Log Shipping
Log Shipping
Log Shipping
Page 1 of 5
Share
More
Next Blog
Create Blog
Sign In
Welcome This blog is a diary, which helps me as well as others while surfing about SQL Server. Some articles are written by me some were taken as reference from others websites.
A tail-log backup captures the log records that have not been backed up since the recent last log backup to current point in time before restore. Generally we generate a tail log to make database into NoRecovery mode (Inaccessible). The tail log backup can be generated from FULL / BULK-LOGGED Recovery model databases. Unlike other log backups, this tail log backup can be generated even if database is damaged. The tail log backup is also generated using backup log command only with two options a) NoRecovery and b) continue_after_error
Blog Archive
NoRecovery We need to use this option when database is online, After issuing this command it ensures Database is not changed after tail-log backup, it makes database in restoring state, if database is in restoring state, users requests will not processed. Backup log database_name to disk =path of tlog file with norecovery No_Truncate / Continue_after_error Using one of this options we can generate a tail-log backup on a damaged database. a) Create a database and table in it b) Insert few records into the table c) Offline the database and rename data file d) Try to bring the database online, it wont allow because, it wont find the data file At that time we can use the below command to generate tail log file from a damaged database. Backup log damaged_dbname to disk=path of tlog file with no_truncate Using No_Truncate option, the current active transaction log can be backedup when the data files are inaccessible or damaged or missing and log file is undamaged. Backup log damaged_dbname to disk=path of tlog file with continue_after_error Posted by Kalyan Akula at 5/30/2012 09:02:00 AM
Recommend this on Google
2010 (34) 2012 (170) March (17) April (29) May (25) Moving System Databases What is SQL Azure? Xlib: connect to ":0.0" refused by server not able... Installating 32bit SQL Server on Windows 64bit Mac... SQL Server 2012 Startup Parameters Contained Databases - SQL Server 2012 Backup / Restore Progress Paging Option in SQL Server 2012 Fix - The login is from an untrusted domain and ca... Attach Adventure Works Sample Databases SQL 2008, ... Saving Changes is not permitted, the changed you h... SQL Server 2012 : Choose Function, IIF Function SQL Server 2012 : Format, Concat Function HEAP Table / Clustered Table Msg 3723, Level 16, State 5, Line 1 An explicit DR...
No comments:
What is Server Core Moving Tables Between File Groups FileStream In SQL Server 2008 Script to display indexes
Logshipping Tables
The below are few tables provides the essential information about the logshipping databases. For more information Browse BOL for "Log Shipping Tables and Stored Procedures" All these tables are stored in MSDB database. log_shipping_primary_databases -- Displays configuration information for primary databases on the server.
Logshipping Tables BCP Examples Memory Management Full Text Index in SQL Server
log_shipping_primary_secondaries -- Displays mapping information between primary databases to secondary databases. log_shipping_secondary -- Displays secondary server database details along with Primary server database information. log_shipping_secondary_databases -- Displays configuration information for secondary databases on the server.(Run command from Logshipping Secondary Server)
Tail Log Backups in SQL Server SQLCMD Mode in Query Editor (!! for SQL CMD) June (19) July (16) August (15)
http://calyansql.blogspot.in/search/label/Logshipping
3/23/2013
Page 2 of 5
Using the above logshipping tables we can get the last restored log file, last backup file, last copied file, backup source directory, backup destination directory etc., Posted by Kalyan Kumar at 5/26/2012 09:02:00 AM
Recommend this on Google
September (7) October (20) November (11) December (11) 2013 (20)
No comments:
Labels
Tuesday, April 24, 2012
Excel VBA (8) Interview Questions (4) Logshipping (4) Misc (3) MySQL (1) Oracle (2)
Adding File To Logshipping Database -- Error: Could not apply log backup file
Sometimes due to disk space issue or with some other issue, we may need to add additional file to logshipping primary database, in that case the logshipping will fail from that point onwards. We will receive the below error message.
* Error: Could not apply log backup file 'C:\Temp\PrimaryDBLogs\PrimaryDB_20120419115948.trn' to secondary database 'SecondaryDB'.(Microsoft.SqlServer.Management.LogShipping) ***
Error: The file 'C:\Appl\MSSQL\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\Secondary_File.ndf' cannot be overwritten. It is being used by database 'PrimaryDB'. File 'Secondary_File' cannot be restored to 'C:\Appl\MSSQL\MSSQL10_50 .MSSQLSERVER\MSSQL\DATA\Secondary_File.ndf'. Use WITH MOVE to identify a valid location for the file. Steps 1) I created two databases called PrimaryDB and Secondary DB 2) Configured Logshipping between primarydb and secondarydb (Secondary in Readonly Mode) 3) Ensure Logshipping is configured and running smooth between the servers 4) Stop the logshipping and disable logshipping jobs 5) Add data file (ndf) to primaryDB 6) Run the LSBackup manually 7) Run the copy job manually (ensure the file copied to target server) 8) Run the below command to verify whether this trn file consists additional data file or not Restore filelistonly from disk='C:\temp\PrimaryDBLogs\PrimaryDB_20120419115948.trn' 9) Run the below restore command to add the data file to secondaryDb on target server Use Master RESTORE log [SecondaryDB] FROM Disk='C:\temp\PrimaryDBLogs\PrimaryDB_20120419115948.trn' WITH MOVE 'Secondary_File' TO 'C:\Appl\MSSQL\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\Secondary_File2.ndf', STANDBY = N'C:\Appl\MSSQL\MSSQL10_50 .MSSQLSERVER\MSSQL\Backup\ROLLBACK_UNDO_SecondaryDB.BAK' 10) Verify file added or not using the below command select * from secondaryDb..sysfiles 11) Enable the backup, copy and restore jobs.
SQL Express (2) SQL Queries (15) SQL Security (4) SQLServer 2012 (9) SSIS (5) TempDB (1) Triggers (4)
Live Feed
Followers
No comments:
Disclaimer
Translate
Select Language
Powered by
This is my personal blog, the views and opinions are published here are my own. All data and information provided on this site is for informational purposes only. The views and opinions expressed here are of my
Translate
http://calyansql.blogspot.in/search/label/Logshipping
3/23/2013
Page 3 of 5
2. Ensure the transaction log backup happend on the primary server. If the t-log backup fails then also above error will occur. 3. You may set incorrect value for the backup alert. 4. The date and time of monitor server is different from the date and time of primary server. 5. The logshipping copy job is run on the primary server and may not update the entry in the msdb database at monitor server in the log_shipping_primaries table. 14421 Error : The log shipping secondary database %s.%s has restore threshold of %d minutes and is out of sync. No restore was performed for %d minutes. Restored latency is %d minutes. Check agent log and logshipping monitor information. The message doesn't necessarly indicate a problm with logshipping. 1. This may occur restore job on the secondary server is failing. 2. You may set out of sync alert is wrong. Posted by Kalyan Akula at 6/01/2010 10:22:00 PM
Recommend this on Google
own and not those of the people or organizations that I may or may not be related with. The code / scripts or any kind of stuff published in this blog are not permitted or certified by my employer or Microsoft SQL Server. While following any advices from blog if you encountered any issues, author is not responsible for that.
We can shrink the tempdb data file without restarting the SQL Server using the following steps. First verify the space usage information... SQLCMD - Examples sqlcmd Switches -S >> ServerName -D >> DatabaseName -U >> UserName -P >> Password Q >> Query -o >>... Cannot alter the user 'dbo'. (Microsoft SQL Server, Error: 15150) Some times we may get the below error while updating the login from dbo to some other login from user mapping window. 1. I have database ... Insert Images into database using T-SQL The following are the rowset functions available with us to query values from different types of sources. 1. OPENQUERY 2. OPENROWSET 3....
No comments:
Home
Older Posts
Total Pageviews
Powered by Blogger.
http://calyansql.blogspot.in/search/label/Logshipping
3/23/2013
Page 4 of 5
http://calyansql.blogspot.in/search/label/Logshipping
3/23/2013
Page 5 of 5
http://calyansql.blogspot.in/search/label/Logshipping
3/23/2013