August 7, 2009 at 5:05 am
I am doing a "full" backup of the db in SQL Express, but it doesnt maintain my indexes??! I have googled and havent found anything to say yup its this!
Can some one point me in the right direction!? What am I doing wrong?!
Cheers
August 7, 2009 at 5:31 am
When a backup is restored it always recreates the database exactly as it was at the time of the backup. If there are no indexes after the restore it means that there were no indexes when the DB was backed up.
Check the DB before you run the backup, make sure that no one's 'accidentally' dropped indexes.
How are you doing database backups?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 7, 2009 at 6:37 am
If you're using the command "backup database" then you're getting a bit-by-bit copy. Nothing should be lost, data, structure, procedures... nothing.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
August 7, 2009 at 5:04 pm
How are you doing database backups?
in sql management studio, right click on the database, tasks -> backup
thanks
August 7, 2009 at 8:17 pm
it sounds like this was your order of operations, and explains why when you restore, you lose your keys:
1. created the database.
2. create the table
3. backed up the database
4. added pk's and indexes
5. restored the database, which reverted to the pre-step 4 savepoint.
Lowell
August 8, 2009 at 5:13 am
Well, it's possible, if you're backing up to the same place every time, that your backups are aggregating within a single file. If so, when you run a restore, you might be seeing an older backup. You can open the file and see all the backups within it by checking the contents when you're in the file selection window. Be sure you're using the right backup. Nothing in the backup process can change your data or your structure, but it is possible to restore the wrong backup, which will look like data was lost or structure was changed.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
August 8, 2009 at 4:22 pm
... always the indian, never the arrow 😉
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply