Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

We're in the proces of preparing our migration to our new servers aswell as SQL 2012 and everything is looking fine and dandy and i'm testing some of the scripts we will be using.

One of these scripts grabs all the full backups in a specfic folder and restores the databases. It looks at the Database name specified in the HEADER information of the specific backup files.

Now we've got atleast one database which some genius deceided to somehow copy from an old database, and then rename or something. (Don't ask me exactly what he/she did) When the script get's to this database it attempts to restore it with the old name. As the old database is still in use and already restored the script fails here and goes to the next database which is fine.

How ever before our migration i'd like to actually change the name of this database so it's reflected in the HEADER information so that this script works on it's own. (Yes, I know I can make the code skip this database and simply restore this one manually later).

Is there any way to check the headerinformation of a live database and change it?

share|improve this question
    
Which specific database platform do you run? I am assuming SQL Server 2012? Please specify in your post as well as with your tag. –  Chris Aldrich Jul 17 '13 at 12:21
    
Appologies, SQL Server 2005 is where the DB is running currently, it'll change to 2012 after the migration. –  F.B. ten Kate Jul 17 '13 at 12:56
    
Can you try to create a new copy-only backup of that database and see if that header still holds the wrong name? –  Sebastian Meine Jul 19 '13 at 9:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.