Thursday, February 4, 2010

SQL Server Native Restore Command Vs LiteSpeed Restore Command

If you are taken backup through third party utility like Lite speed then you have to restore using lite speed command. Here you can see a complete list of native and lite speed restore commands.

In Litespeed the most attractive feature for me is table restore from any litespeed backup file, it's not possible with native sql server command.

1. Standard Database Restore
Native Command:
RESTORE DATABASE MyDB 
FROM DISK = 'C:\MSSQL\Backup\MyDB_Backup.BAK'
 
LiteSpeed Command:
 EXEC master.dbo.xp_restore_database 
@database = 'MyDB' , 
@filename= 'C:\MSSQL\Backup\MyDB_Backup.BAK'

2. Restore Database with NoRecovery
Native Command:
 
RESTORE DATABASE MyDB 
FROM DISK = 'C:\MSSQL\Backup\MyDB_Backup.BAK' 
WITH NORECOVERY 

LiteSpeed Command:
 EXEC master.dbo.xp_restore_database 
@database='MyDB' , 
@filename='C:\MSSQL\Backup\MyDB_Backup.BAK' ,
@with='NORECOVERY'

3. Restore Log to Log Mark
Native Command:
 
RESTORE LOG MyDB 
FROM DISK = 'C:\MSSQL\Backup\MyDB_Backup.BAK' 
WITH RECOVERY , 
STOPBEFOREMARK = 'LogMark'

LiteSpeed Command: 
EXEC master.dbo.xp_restore_log @database='MyDB' , @filename = 'C:\MSSQL\Backup\MyDB_Backup.BAK' , @with ='RECOVERY' , @with = 'STOPBEFOREMARK= LogMark' Restore

4. Database with Move 
Native Command: 
RESTORE DATABASE MyDB FROM DISK = 'C:\MSSQL\Backup\MyDB_Backup.BAK' WITH MOVE 'MyDB_Data' TO 'C:\MSSQL\Data\MyDB_Data.MDF' , MOVE 'MyDB_log' TO 'C:\MSSQL\Data\MyDB_Log.LDF'

LiteSpeed Command: 
EXEC master.dbo.xp_restore_database @database='MyDB' , @filename = 'C:\MSSQL\Backup\MyDB_Backup.BAK' , @with = 'MOVE MyDB_Data TO C:\MSSQL\Data\MyDB_Data.MDF' , @with = 'MOVE MyDB_log TO C:\MSSQL\Data\MyDB_Log.LDF'

5. Restore Database from Tape 
Native Command: 
RESTORE DATABASE MyDB 
FROM TAPE = '\\.\TAPE0'

LiteSpeed Command: 
EXEC master.dbo.xp_restore_database 
@database = 'MyDB' , 
@filename='\\.\TAPE0' , @filenumber = 2 , 
@rewind = 1 , 
@unload = 0

6. Restore Log to Point in Time 
Native Command: 
RESTORE LOG MyDB 
FROM DISK = 'C:\MSSQL\Backup\MyDB_Backup.BAK' 
WITH RECOVERY , 
STOPAT= '2003-03-19 11:10:57.000'

LiteSpeed Command: 
EXEC master.dbo.xp_restore_log 
@database='MyDB' , 
@filename = 'C:\MSSQL\Backup\MyDB_Backup.BAK' , 
@with = 'RECOVERY' , 
@with = 'STOPAT = 2003-03-19 11:10:57.000'

7. Restore Verifyonly 
Native Command: 
RESTORE VERIFYONLY FROM 
DISK = 'C:\MSSQL\Backup\MyDB_Backup.BAK'

LiteSpeed Command: 
EXEC master.dbo.xp_restore_verifyonly 
@filename='C:\MSSQL\Backup\MyDB_Backup.BAK'

8. Restore Only Single Table From Backup
Native Command: 
Not Possible!!!
 
LiteSpeed Command: 
EXEC master.dbo.xp_objectrecovery
@FileName = 'C:\MSSQL2005\MSSQL\DB_Name.BAK',
@ObjectName = 'dbo.Source_Tablename',
@DestinationDatabase = 'DB_Name',  

@DestinationTable = 'dbo.Destination_Tablename'
how to to take backup through litespeed. how to take backup through sql script. how to restore database through litespeed. how to restore database through sql query. in sql server 2008 r2. in sql server 2012. in sql server 2005. in sql server 2000. sql server backup script. sql server litespeed backup script. litespeed restore commands. litespeed backup query. litespeed scripts. litespeed backup failure. litespeed restore failure. litespeed issues. lite speed backup. lite speed restore. litespeed benifits. litespeed usefull scripts. litespeed commands. lite speed queries. third party tools for sql server. third party tools for slq server 2012 backup and restore. third party software lite speed utility for sql server 2008. 2005.table restore. single table restore from backup. table backup and restore. how to do table restore from backup file. how to take single table backup. how to restore single table from old backup file.

0 comments:

Post a Comment