Restore SQL Server Database From Snapshot Backup
I am attempting some experiments related to restoring a database from a snapshot backup.
I backup metadata by T-SQL (BACKUP DATABASE with METADATA_ONLY) , and database mdf, ldf file by snapshot which involve SQL Server VSS Writer.
In the begining, i insert 10 data into database, and process first backup (backup 1).
When first backup finish, i insert 20 data into database, and process second backup (backup2)
After second backup finish, i insert 20 data into database, and backup transaction log
|----- (10 data)----[backup 1]-----(20 data)----[backup 2] ----(20 data)-----[transaction log backup]----|
I restore the database using metadata files and MDF/LDF files from different points in time.
Restore database with backup 1 metadata file and backup 2 mdf, ldf -> success, 30 data
Restore database with backup 2 metadata file and backup 1 mdf, ldf -> failed
Is it safe to restore the database using earlier metadata files with later MDF/LDF files from different points in time, or could this approach cause potential data leaks or restore failures in certain scenarios?