The code below shrinks the transaction log file to target size specified.
Use AdventureWorks
GO
DBCC Shrinkfile(filename, target_size)
filename is the logical name of the file to shrink
traget_size is the size of the transaction log file in megabytes to be shrunk. For example
Use AdventureWorks
GO
DBCC Shrinkfile(AdventureWorks_Log, 10)
The above code shrinks down the transaction log file named AdventureWorks_Log to 10MB
Showing posts with label SQL Backup and Restore. Show all posts
Showing posts with label SQL Backup and Restore. Show all posts
Wednesday, October 15, 2008
Monday, October 6, 2008
Copy-Only Backup
Copy-only backup are new feature in SQL 2005. It allows a backup of any type to be taken without affecting any other backups. Copy-only backup doesn’t affect the restore chain. It cannot be used as a restored base in the event of failure. They are useful in a situation where you want to get a copy of the database for testing purposes or when you want to refresh the staging, development and testing databases.
Copy-only backups are not supported via SQL Server Management Studio(SSMS). It must be performed using T-SQL Backup command.
Backup Database MYDATABASE
TO DISK = 'Drive\Folder\filename.bak'
WITH COPY-ONLY
Copy-only backups are not supported via SQL Server Management Studio(SSMS). It must be performed using T-SQL Backup command.
Backup Database MYDATABASE
TO DISK = 'Drive\Folder\filename.bak'
WITH COPY-ONLY
Subscribe to:
Posts (Atom)