Additional SQL Server features and topics not covered by specific categories
Step 1 - Remove log shipping configuration
On the primary, run:
EXEC sp_delete_log_shipping_primary_secondary
@primary_database = N'YourDB',
@secondary_server = N'SecondaryServerName',
@secondary_database = N'YourDB';
On the secondary:
EXEC sp_delete_log_shipping_secondary_database
@secondary_database = N'YourDB';
Or just use the GUI: right-click the primary DB then Properties then Transaction Log Shipping then uncheck, which cleans up jobs on both sides.
Step 2 - Check the current state
SELECT name, state_desc, recovery_model_desc
FROM sys.databases
WHERE name = 'YourDB';
Step 3 - Bring it online with recovery
If you're done applying logs:
RESTORE DATABASE [YourDB] WITH RECOVERY;
If you still have log backups to apply first, restore each WITH NORECOVERY, then run WITH RECOVERY on the last one:
RESTORE LOG [YourDB] FROM DISK = N'path\to\final.trn' WITH RECOVERY;
This is a one-way step, once recovered, you cannot apply more log backups without restoring from scratch.
Step 4 - Clean up after it's online
Take a fresh full backup to start a new backup chain:
BACKUP DATABASE [YourDB] TO DISK = N'path\to\YourDB_new_full.bak' WITH INIT;
Then handle the leftover files:
The many .trn backup files from log shipping can be archived or deleted now. They're no longer needed once the DB is online and you have a fresh full backup.