Shrinking the log file script for SQL server database This script mainly for a DBA’s, because most of the time the log file grow again and again and eats up all the disk space and finally an application goes down. Errors from SQL server error log: Error: 9002, Severity: 17, State: 2. The transaction log for database ‘test’ is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases If you got an error “Error: 9002, Severity: 17, State: 2.” like this go and check the log_reuse_wait_desc column in sys.databases by running below command and see what value it returns. SELECT name,…
-
-
Difference between truncating and shrinking the transaction log file
Difference between truncating and shrinking the transaction log file I have noticed in many forum the frequently asked question is “Truncating and shrinking the log file both are same” The answer is obviously NO. These both are totally different. Before going into discussion, let’s read the transaction log file architecture. Truncating the transaction log: Truncating a log file will change one or more VLF file’s status from active to inactive and mark the space for reuse. SQL server will change the VLF from active to inactive and reuses it automatically (Just like a circular). When does it truncate and reuse it automatically? It depends upon your setting: recovery…
-
How to get the SQL server critical errors via mail using native T-SQL Script
T-SQL Tuesday #015: Automation: I am very much interested to participate in the T-SQL Tuesday event party. I have seen the T-SQL Tuesday logo and article in one of my favorite SQL server blog Gail Shaw. I found the Adam Machanic ( Blog | Twitter ) via Google but, I did not find the required information so, I wrote an email to him and he has sent me the link to topic http://sqlasylum.wordpress.com/2011/02/01/invitation-to-t-sql-tuesday-15-automation-in-sql-server. Thanks to Adam Machanicfor doing this wonderful job. This is my first T-SQL Tuesday post. I have referred some of T-SQL Tuesday blog post. This month Pat Wright is hosting and has given us the…
-
Setup the Database mail in SQL server using Gmail account
How to setup the DB mail using Gmail account In this article I am going to show the database mail setup steps with screen shots. When I tried to test one of my automation procedure in my friend’s laptop I got number of errors.Then I Goggled and found the solution. Here I am going to share my experience. Database mail is introduced in SQL server 2005 onwards. It is the replacement of the SQLMail with new features. Step by Step DB Mail setup Screen shot After click the send test e-mail go and checks your mail box. While i was testing in SQL server 2005 (9.0.1399) version i got…
-
SQLskills Master Immersion Events 2011 competition
SQLskills Master Immersion Events 2011 competition I have completed engineering and my native is M.Uthamasolagan (village near chidambaram ). I have started my career as SQL server DBA with my brother’s Rajakrishnan Rajadurai support. To be frank I am not good in English and so I feared to work during the initial time. My senior DBA Roshan Joe Joseph helped and encouraged me a lot. Now I love to work with SQL server because of SQL community helpers. I have started a blog three months back and now my interest in writing blogs has increased tremendously because, I got a good local SQL server team. When I write…