본문 바로가기

MSSQL

transaction log for database is full LDF파일의 크기 제한이 걸리거나, 혹은 물리적인 Disk가 full되는 경우 등으로 'Transaction log for database is full' 이라는 Exception이 발생하는 경우가 발생합니다. 개발과정에서 Stress test를 하다가 이러한 과정이 발생했을 때, 간단하게 해결할 수 있는 방법을 정리합니다. 당연, 운용계라면 적절한 Backup 절차에 준하여 대응이 되어야 할 것이며, 아래는 개발과정에 발생하는 이슈를 간단하게 대응하는 방법으로 접근합니다. USE {DBName}; GO -- Truncate the log by changing the database recovery model to SIMPLE. ALTER DATABASE {DBName} SET RECOVERY SIMPL.. 더보기
a connection was successfully established with the server, but then an error occurred during the pre-login handshake MSSQL 접속 후 다음의 에러가 발생하는 경우가 있습니다. 검색해서 보니 대부분은 껏다가 켜라고 하네요. :)저는 다음의 command를 실행하는 것을 시도하는 게 가장 매력적일 것 같습니다.감사합니다. 문제의 원인No configuration for remote connection to SQL serverProtocol issue 해결책command 창에서 다음의 명령을 수행: Netsh winsock resetOr 컴퓨터 재시작 Referenceshttps://msdn.microsoft.com/en-us/library/aa952081.aspxhttps://msdn.microsoft.com/ko-kr/library/aa952081.aspx> BizTalk Server 데이터베이스가 포함된 원격 SQL.. 더보기
Unique index setting #2 (with Criteria) Unique Index 는 중복값의 입력을 방지하는 경우 매우 유용하게 사용할 수 있습니다. 다만, 단일 값이라는 판단은 '조건'을 가지고 판단해야 하는 경우가 있습니다. 예를 들면 특정 상태의 값은 중복이 될 수 없다던지... NULL 값은 중복을 허용한다던지. 이를 위해서 WHERE 절을 사용할 수 있습니다. 예제는 다음과 같습니다. CREATE UNIQUE NONCLUSTERED INDEX [uq_user_email] ON [dbo].[TB_User] ( [Email] ASC ) WHERE [Email] IS NOT NULL WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, D.. 더보기
How to find DB Size Storage 의 사이즈를 확인하기 위해서 아래의 Query 를 사용합니다. USE DBName GO SELECT [size] * 8 , [filename] FROM sysfiles sysfiles 라는 view 는 기본적으로 system 에서 제공하는 것으로써 storage 에 대한 정보를 갖고 있습니다. 이 중 size 컬럼은 그 크기를 8 KB 페이지 단위로 나타내고 있기 때문에, 실제의 용량을 확인하기 위해서는 8 을 곱하면 됩니다. 출처: http://stackoverflow.com/questions/176379/determine-sql-server-database-size 더보기
SQL Server DateTime Formatting SQL Server DateTime FormattingUsually the formatting of a DateTime value into a more readable date and time is dealt with by the client application. However, there are some situations were it is useful to convert a DateTime into a formatted character string within a SQL statement. Converting a DateTime to a VarCharThe Transact-SQL (T-SQL) Convert command can be used to convert data between diffe.. 더보기