Reputation: 6462
I have added Log Shippig to SQL Server:
SQL server1\source_database->SQL server2\target_database
As I see from SSMs Report it works ok. But the target database always in "Restoring" state. I want to change it to have a read access to the target db and made all as described here
But the target database still in Restoring mode. What I did wrong? How to change the state and have a read access ?
Upvotes: 0
Views: 2504
Reputation: 9159
There are two ways of doing:
I very much prefer method #2, because it's god slow to restore every backup to standby mode if you have a lot of action in the database.
To manually use restore mode add a step in the SQL Agent Job after the restoring and run something like:
if exists(
select 1 from sys.databases where name = 'YOUR DATABASE NAME' and state_desc = 'RESTORING'
)
begin
restore database YOUR_DB_NAME with standby = 'D:\PATH_TO_STANDBY_FILE\YOUR_DB_NAME_standby.tuf'
end
With this method, you get faster restores and your db will be accessible as soon as the restore job is finished.
Upvotes: 1