Accidents happen and databases disappear...it can be because of a misunderstanding between employees, a disk failure or why not? an alien invasion.
Not sure what happened this time but our friend is screaming again.
JoeyDb is no longer there and we need it alive and kicking as soon as possible.
Luckily enough, we just made a backup of that database in our TSM server which survived the attack.
So let's restore it!
First that all let's select Restore in the home ribbon:
The Restore Wizard opens and we just need to follow it and provide the information needed:
I will give the same name to the database:
LiteSpeed warns us that the database does not exist and if I want to create one with that name. In this case yes, that is exactly what I want!
Since we want to restore from TSM Backup, this is what we select in the Backup Source section
We need to provide the information to log on to the TSM server and LiteSpeed will help us to view and select the appropriate object:
The following screenshots are self explanatory enough so let's just have a look at them:
As always we can see the code LiteSpeed will generate by clicking the Preview Script hyperlink
In this case the code is the one below.
exec master.dbo.xp_restore_database @database = N'JoeyDb' ,
@tsmconfigfile = N'C:\Program Files\Tivoli\TSM\baclient\dsm.opt',
@tsmclientnode = N'ZVILLANO',
@tsmclientownerpwd = N'*****',
@tsmobject = N'test\test\test',
@tsmpointintime = '2017-11-02 09:42:57',
@filenumber = 1,
@with = N'STATS = 10',
@with = N'MOVE N''test'' TO N''C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\JoeyDb.mdf''',
@with = N'MOVE N''test_log'' TO N''C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\JoeyDb_1.ldf''',
@affinity = 0,
@logging = 0
Note: If you copy this script and run it from SQL Management Studio, Toad or any other tool, you will get an error:
As you might have already realized, this is because the Password is masked.
Let's come back to the wizard. LiteSpeed informs us that JoeyDb has been restored. Horray!!
Let's double check...yes! the database is there!
Note: if you cannot see it there, go to the home ribbon and press the Refresh button:
This is just an easy example. For more detailed information about this please see LiteSpeed help (F1) or the LiteSpeed for SQL Server Integration with TSM Guide document.
Hope this helps!