I used the following command to take a database offline
alter database dbname set offline with rollback immediate
This appeared to work correctly.
However, I was unaware that the database had been turned into a replicated database since I last visited this server and am now unable to take it back online.
alter database dbname set online
Msg 5120, Level 16, State 101, Line 1
Unable to open the physical file "dbpath.mdf". Operating system error 2: "2(failed to retrieve text for this error. Reason: 15105)".
File activation failure. The physical file name "dbpath_1.ldf" may be incorrect.
Msg 945, Level 14, State 2, Line 1
Database 'NOES' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
As I am now unable to bring the database back online due to the lack of mdf file I am wondering three things:
- what is the correct way to take a replicated database offline?
- What has happened to the mdf file that I would usually take a copy of?
- how do I get the database back?
UPDATE: Both the mdf file and ldf files are not located where sysaltfiles say they should be.