cancel
Showing results for 
Search instead for 
Did you mean: 

Sql Database Backup

O-a
Level 4
Hallo,

i'm backing up Sql Database using MS-SQL-Server Policy(through the master server ).

does the default backup type is full?
why it does'nt backup allso the transaction log and truncate(i saw today that the transaction log hes recahed more then 20 Gb and i allways thought my backup is include the translaction log).
i know i can use the  NetBackup MS SQL client to back up truncate the transaction log but i want to do it through the master server(it is possible?).

thanks for your help
1 ACCEPTED SOLUTION

Accepted Solutions

rj_nbu
Level 6
Employee Accredited Certified
Hi,

When you perform a full backup on a database, it also backs up the transaction log. Your log file size has grown to 20 Gb, becasue you have not shrinked it:


Netbackup will not shrink the transaction log after taking a backup with truncate option. It will only logically truncate the log file . You need to run DBCC SHRINKDATABASE or DBCC SHRINKFILE command in Query Analyzer (SQL Server) to reduce the PHYSICAL size of the log file.
 

 

Here is a MSFT article explaining the process:

 

http://msdn.microsoft.com/en-us/library/aa174524(SQL.80).aspx

 

http://support.microsoft.com/kb/272318/

 

 

Relevant snippet from the MSFT Article 873235: http://support.microsoft.com/kb/873235/

 

 

Shrink the transaction log file

 

The backup operation or the Truncate method does not reduce the log file size. To reduce the size of the transaction log file, you must shrink the transaction log file. To shrink a transaction log file to the requested size and to remove the unused pages, you must use the DBCC SHRINKFILE operation. The DBCC SHRINKFILE Transact-SQL statement can only shrink the inactive part inside the log file.

 

You need to run DBCC SHRINKDATABASE or DBCC SHRINKFILE command in Query Analyzer (SQL Server) to reduce the PHYSICAL size of the log file.

 
Netbackup backs up and truncates ONLY the logical part of the transaction log file, but the Actual shrinking part has to be done on the database itself.



View solution in original post

4 REPLIES 4

Marianne
Level 6
Partner    VIP    Accredited Certified
What is the recovery mode of your SQL database?
Extract from NBU for SQL manual (Chapter 4 - Backup and recovery concepts):
Transaction logs can be backed up in SQL Server 2000 or SQL Server 2005 for databases which are set in either full or bulk-logged mode.

O-a
Level 4
hi marianne,

the backup mode is full backup.
is it mean the transaction log are backed up with the db?
if so why the the transaction logs are not truncated after the bakup?

do i need to configure another think? 


thanks for your help,

rj_nbu
Level 6
Employee Accredited Certified
Hi,

When you perform a full backup on a database, it also backs up the transaction log. Your log file size has grown to 20 Gb, becasue you have not shrinked it:


Netbackup will not shrink the transaction log after taking a backup with truncate option. It will only logically truncate the log file . You need to run DBCC SHRINKDATABASE or DBCC SHRINKFILE command in Query Analyzer (SQL Server) to reduce the PHYSICAL size of the log file.
 

 

Here is a MSFT article explaining the process:

 

http://msdn.microsoft.com/en-us/library/aa174524(SQL.80).aspx

 

http://support.microsoft.com/kb/272318/

 

 

Relevant snippet from the MSFT Article 873235: http://support.microsoft.com/kb/873235/

 

 

Shrink the transaction log file

 

The backup operation or the Truncate method does not reduce the log file size. To reduce the size of the transaction log file, you must shrink the transaction log file. To shrink a transaction log file to the requested size and to remove the unused pages, you must use the DBCC SHRINKFILE operation. The DBCC SHRINKFILE Transact-SQL statement can only shrink the inactive part inside the log file.

 

You need to run DBCC SHRINKDATABASE or DBCC SHRINKFILE command in Query Analyzer (SQL Server) to reduce the PHYSICAL size of the log file.

 
Netbackup backs up and truncates ONLY the logical part of the transaction log file, but the Actual shrinking part has to be done on the database itself.



Claudio_Veronez
Level 6
Partner Accredited

I would like to run the shrink right after the end of the LOG backup?


over Oracle and Solaris I'm Running a script ever 15 minutes... as a df -k  if the partitioin is over than 50% the LOG/ARCH backup runs and truncate it up.


over mssql I trying but.. Windows isn't helpping me..


Is there some way of running a script right after the backup ends status 0  ??


Thanks


:wq!