Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Change DBID

Author  Topic 

CanadaDBA

583 Posts

Posted - 2005-11-17 : 06:33:08
I want to order DBIDs in my Dev server same as my production. For example if dbid for DBOne in Production is 7, then it has the 7 in Dev server, too.

I can detach the databases in my Dev server and reattach in order. Is there easier way? Can I just update the sysdatabases?

Canada DBA

Kristen
Test

22859 Posts

Posted - 2005-11-17 : 07:07:02
Sounds a bit scary to me that you are needing to rely on DBIDs - but no doubt you've got a good reason! Might help to know what it is?

Kristen
Go to Top of Page

CanadaDBA

583 Posts

Posted - 2005-11-17 : 09:11:35
I am going to replay a production's trace on my Test server. Please refer to the following link.

[url]http://www.databasejournal.com/features/mssql/article.php/10894_1479971_3[/url]
...After capturing the trace file we can now replay that trace file in our Development environment. There are several "gotchas" that you will want to keep in mind when replaying a trace on another server. Most of these are mentioned in bol (books online) but they bear repeating here:
...
Gotcha 3: The dbid of the database in Development must match the dbid of the database in Production. You can determine the dbid of your database with the following query:
...

Thanks,

Canada DBA
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-11-17 : 09:12:36
"but no doubt you've got a good reason!"

That qualifies!

Kristen
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-11-17 : 21:18:00
It would be a lot safer to detach the databases from your test server and re-attach them in the order that will set their DBID's equal to the other server's.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-11-17 : 22:08:54
Wouldn't it be simpler to undate the DBIDs in the trace file to match the development server?







CODO ERGO SUM
Go to Top of Page
   

- Advertisement -