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 2005 Forums
 SQL Server Administration (2005)
 Bring Database Online Error

Author  Topic 

learntsql

524 Posts

Posted - 2009-12-07 : 06:20:24
I just created database and i brought it to offline and when i try to bring online it's giving following error.
Database 'Test' cannot be opened because it is offline.
ALTER DATABASE statement failed.
How to bring online.

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-12-07 : 06:24:26
Hi

ALTER DATABASE [Test] SET ONLINE


-------------------------
R...
Go to Top of Page

learntsql

524 Posts

Posted - 2009-12-07 : 06:29:05
Saying as follows...

Msg 942, Level 14, State 4, Line 1
Database 'Test' cannot be opened because it is offline.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-12-07 : 07:05:14
Hi

I think u tried the same database. Try below code

USE master
GO
ALTER DATABASE [Test] SET ONLINE

-------------------------
R...
Go to Top of Page

learntsql

524 Posts

Posted - 2009-12-07 : 07:07:30
Still same error..
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-12-07 : 07:19:30
Hi

USE MASTER;
GO
SP_DBOPTION 'TEST','OFFLINE','FALSE'


-------------------------
R...
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-12-07 : 07:21:34
Hi

Below Query for Database Make offline
USE MASTER;
GO
SP_DBOPTION 'Test','OFFLINE','TRUE'


Make it Online

USE MASTER;
GO
SP_DBOPTION 'Test','OFFLINE','False'



-------------------------
R...
Go to Top of Page

learntsql

524 Posts

Posted - 2009-12-07 : 07:32:08
Thank you for your reply but still giving as

Msg 942, Level 14, State 4, Line 1
Database 'Test' cannot be opened because it is offline.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
sp_dboption command failed.
I am using SQL server 2005 RTM version.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2009-12-07 : 09:24:10
Open the SQL error log, see what errors there are relating to this database. We need to know why it won't come online to help you further

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -