SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Could not find database ID
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gongxia649
So Suave

Azores
344 Posts

Posted - 09/21/2007 :  22:19:39  Show Profile  Visit gongxia649's Homepage  Reply with Quote
I dropped a DB and restored it from last nights backup.
Now getting a job failure that has this msg. Any ideas?

Msg 913, Sev 16: Could not find database ID 7. Database may not be activated yet or may be in transition. [SQLSTATE 42000]

Zoroaster
Aged Yak Warrior

USA
702 Posts

Posted - 09/21/2007 :  23:27:50  Show Profile  Reply with Quote
Sounds like the ID changed, run sp_helpdb and see what ID is associated with the database.



Future guru in the making.

Edited by - Zoroaster on 09/21/2007 23:28:06
Go to Top of Page

gongxia649
So Suave

Azores
344 Posts

Posted - 09/21/2007 :  23:56:47  Show Profile  Visit gongxia649's Homepage  Reply with Quote
now it has id 6.
how do i change it back.?
is there any impact if i change it back?
Go to Top of Page

Zoroaster
Aged Yak Warrior

USA
702 Posts

Posted - 09/22/2007 :  00:30:33  Show Profile  Reply with Quote
quote:
Originally posted by gongxia649

now it has id 6.
how do i change it back.?
is there any impact if i change it back?



If you change it back you also have to change all related tables, and I am sure it is unsupported. When you restored the DB did you restore or attach? Did you recently remove a database that occupied DBID 6?



Future guru in the making.
Go to Top of Page

gongxia649
So Suave

Azores
344 Posts

Posted - 09/22/2007 :  00:39:12  Show Profile  Visit gongxia649's Homepage  Reply with Quote
i did restore on Query analyzer.
no i didnt removed any database that occupied dbid 6. cause all the databases are still there.
Go to Top of Page

Zoroaster
Aged Yak Warrior

USA
702 Posts

Posted - 09/22/2007 :  00:39:24  Show Profile  Reply with Quote
Ok, I did some research. Your jobs have cached the DB_ID from before, all you should need to do is either restart or run DBCC FREEPROCCACHE to clear the procedure cache.





Future guru in the making.
Go to Top of Page

rmiao
Flowing Fount of Yak Knowledge

USA
7266 Posts

Posted - 09/22/2007 :  22:09:15  Show Profile  Reply with Quote
What kind of job? Restore db statement will not cache db id.
Go to Top of Page

Zoroaster
Aged Yak Warrior

USA
702 Posts

Posted - 09/22/2007 :  22:56:51  Show Profile  Reply with Quote
quote:
Originally posted by rmiao

What kind of job? Restore db statement will not cache db id.



I assume from the OP's original remarks about job failures that he was talking about some existing jobs.



Future guru in the making.

Edited by - Zoroaster on 09/23/2007 00:29:53
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000