Shrink MsSql DB Logs

1. Open query analyser. Do not open Enterprise Manager.
2. Let the database be selected as “Master”
3. Fire the command

BACKUP LOG “DATABASE_NAME” WITH TRUNCATE_ONLY

BACKUP LOG “db0098″ WITH TRUNCATE_ONLY

This should show you a success message

4. Now change the database seclected in query analyser to “DATABASE_NAME” where DATABASE_NAME is the name of the database which needs modified
5. Fire the command as below:

DBCC SHRINKFILE ('DATABASE_NAME_Log', 1);
DBCC SHRINKFILE ('db0098Log', 1);

where database-name_Log is the name of the log file of the db concerned. Such as test_Log. And the valuew ’1′ indicates the size that the log file needs to be shrunk to. This can be any value depending on the size of the log file of the db. This value is considered in MB’s.

PS: if you copy and paste the above command in QA, it will throw a syntax error message. You should rather key it in or if you do copy and paste the query, then delet the D at the start of the query and key it in again and do the same for the training bracket. The query will run without trouble then.

  • 1 משתמשים שמצאו מאמר זה מועיל
?האם התשובה שקיבלתם הייתה מועילה

מאמרים קשורים

Manage Database Roles

Solution Database roles are conceptually completely separate from operating system users....

Manage Tablespaces

Tablespaces in PostgreSQL allow database administrators to define locations in the file system...

ColdFusion DSN parameters are not updated

SYMPTOMS New CF DSN records are created.  Even the set of parameters is tried to be updated...

Finding what packages are installed on a Linux system

For distributions that use RPM format packages, use the command: $ rpm -qa You may want to pipe...

What platforms does Linux support?

Linux runs on almost every general-purpose computer made in the last 10 years. It runs on systems...