Friday, February 24, 2012
attempts to attach db are locking up the server...
I had a similar post before, and got some good
suggestions on this, but so far I'm still unable to
retrieve my database. Unfortunately, I made the mistake
of not detaching my database when I was having some
problems, and it got physically moved instead. I have
tried several different options to get it back, but they
either don't work or end up locking the system.
What would cause something to lock up like that? I've
tried to kill everything, so I don't see anything going
on there.
Any ideas on how I could get this db back, and why it
might be locking up when I try to attach it?
Thanks!
Rick
Hi,
What do you meant by Locking while attach? Are you getting any errors while
attaching ? See the SQL server error log for any errors.
Thanks
Hari
MCDBA
"Rick" <rmemmer@.carolina.rr.com> wrote in message
news:783701c48423$2fd35f80$a601280a@.phx.gbl...
> Hi,
> I had a similar post before, and got some good
> suggestions on this, but so far I'm still unable to
> retrieve my database. Unfortunately, I made the mistake
> of not detaching my database when I was having some
> problems, and it got physically moved instead. I have
> tried several different options to get it back, but they
> either don't work or end up locking the system.
> What would cause something to lock up like that? I've
> tried to kill everything, so I don't see anything going
> on there.
> Any ideas on how I could get this db back, and why it
> might be locking up when I try to attach it?
> Thanks!
>
> Rick
|||Hi,
Thanks for your reply. Actually, I had two different
timing out issues. One was happening due to an update
that needed an index in order to update millions of
rows. It would time out and just sit there racking up
memory resources, but after I put the index on the join
field... it worked just fine. The same thing was
happening to the database I was trying to attach, but it
looks as though there was no way this was ever going to
work. It needed to be repaired first, but I had not
found anything that would work (prior to my post).
Anyway, I found this article that you might be interested
in for future reference:
Search "experts exchange Q_21020424" in Google to get
this article... the link won't bring you directly in, so
that's why you need to search on it. I was able to run a
few procedures and then repair the database (which took
about 40 minutes for a very large file), and after that I
was ready to go.
So, I'm all fine now. Of course, I'm still not sure what
to do in order to kill a process that seemingly doesn't
want to be killed. It would be nice to find that out for
future reference, so that the memory doesn't climb to the
point where you have to shut it down.
Thanks for your help!
Rick
>--Original Message--
>Hi,
>What do you meant by Locking while attach? Are you
getting any errors while[vbcol=seagreen]
>attaching ? See the SQL server error log for any errors.
>Thanks
>Hari
>MCDBA
>"Rick" <rmemmer@.carolina.rr.com> wrote in message
>news:783701c48423$2fd35f80$a601280a@.phx.gbl...
mistake[vbcol=seagreen]
they
>
>.
>
attempts to attach db are locking up the server...
I had a similar post before, and got some good
suggestions on this, but so far I'm still unable to
retrieve my database. Unfortunately, I made the mistake
of not detaching my database when I was having some
problems, and it got physically moved instead. I have
tried several different options to get it back, but they
either don't work or end up locking the system.
What would cause something to lock up like that? I've
tried to kill everything, so I don't see anything going
on there.
Any ideas on how I could get this db back, and why it
might be locking up when I try to attach it?
Thanks!
RickHi,
What do you meant by Locking while attach? Are you getting any errors while
attaching ? See the SQL server error log for any errors.
Thanks
Hari
MCDBA
"Rick" <rmemmer@.carolina.rr.com> wrote in message
news:783701c48423$2fd35f80$a601280a@.phx.gbl...
> Hi,
> I had a similar post before, and got some good
> suggestions on this, but so far I'm still unable to
> retrieve my database. Unfortunately, I made the mistake
> of not detaching my database when I was having some
> problems, and it got physically moved instead. I have
> tried several different options to get it back, but they
> either don't work or end up locking the system.
> What would cause something to lock up like that? I've
> tried to kill everything, so I don't see anything going
> on there.
> Any ideas on how I could get this db back, and why it
> might be locking up when I try to attach it?
> Thanks!
>
> Rick|||Hi,
Thanks for your reply. Actually, I had two different
timing out issues. One was happening due to an update
that needed an index in order to update millions of
rows. It would time out and just sit there racking up
memory resources, but after I put the index on the join
field... it worked just fine. The same thing was
happening to the database I was trying to attach, but it
looks as though there was no way this was ever going to
work. It needed to be repaired first, but I had not
found anything that would work (prior to my post).
Anyway, I found this article that you might be interested
in for future reference:
Search "experts exchange Q_21020424" in Google to get
this article... the link won't bring you directly in, so
that's why you need to search on it. I was able to run a
few procedures and then repair the database (which took
about 40 minutes for a very large file), and after that I
was ready to go.
So, I'm all fine now. Of course, I'm still not sure what
to do in order to kill a process that seemingly doesn't
want to be killed. It would be nice to find that out for
future reference, so that the memory doesn't climb to the
point where you have to shut it down.
Thanks for your help!
Rick
>--Original Message--
>Hi,
>What do you meant by Locking while attach? Are you
getting any errors while
>attaching ? See the SQL server error log for any errors.
>Thanks
>Hari
>MCDBA
>"Rick" <rmemmer@.carolina.rr.com> wrote in message
>news:783701c48423$2fd35f80$a601280a@.phx.gbl...
mistake[vbcol=seagreen]
they[vbcol=seagreen]
>
>.
>
Sunday, February 19, 2012
Attching A Databse To the SQL Server 2000
I am using " Microsoft.SqlServer.Management.Smo". I am trying to attach a database using the AttachDatabse method in it. but it is not working for me.
I am pasting my code as follows...tell me the problem or the right way to do it...
SqlConnection Connection =newSqlConnection("Data Source=SHEBZ; User ID=sa; Password=sa");
Microsoft.SqlServer.Management.Common.ServerConnection con =new Microsoft.SqlServer.Management.Common.ServerConnection(Connection);Server ser =newServer("SHEBZ");ser.ConnectionContext.Connect();
System.Collections.Specialized.StringCollection File =new System.Collections.Specialized.StringCollection();
File.Add(@."D:\Project-Parts\MasterPageOffice\Uploads\Db3");try
{
ser.AttachDatabase("Db3", File);}
catch (Exception ex){
Label1.Text ="ERROR: " + ex.Message.ToString();}
Hi,
What you are using is Server.AttachDatabase method, try to follow the sample below.
Datastr = "C:\Program Files\Microsoft SQL Server"Datastr = datastr + "\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf"Logstr = "C:\Program Files\Microsoft SQL Server"Logstr = datastr + "\MSSQL.1\MSSQL\Data\AdventureWorks_Log.ldf"
StringCollection sc;sc = new StringCollection();sc.Add(datastr);sc.Add(logstr);srv.AttachDatabase("AdventureWorks", sc, owner, AttachOptions.None);Thanks.|||
I know this code...it is for detaching and attaching the databse to a SQL Server 2005 or high..... if you try to use this code for SQL Server 2000 you will get the same exception that this property or method can be used with Sql Server 2005 or high... i want a solution for 2000...
Attaching-detaching Db = Too long
It shouldn't. It's the fastest method.
The file shoud however be on the local machine, not acorss the network..
How big are we talking?|||It could be the database is going into recovery. Anything showing up in the SQL Errorlog?|||when detaching a database sqlserver checks if there are changes suchs as updates and inserts that were processed but has not (yet) actually done. The changes reside in memory of sqlserver but were not written to the disk. So I think it does these first prior detaching.|||Detaching can take a while, because of the need to "flush the log", etc. It seems to me that the GUI provides a checkbox to skip that step, but that is needless risk from my perspective.
I can't think of a reason that attaching a database would take more than a minute or so (basically modify a few system tables, then go through the normal database recovery/startup that happens whenever a database is first opened).
-PatP
Attaching without ldf file
"Error 1813: Could not open new database 'GJIRB'. CREATE DATABASE is aborted
.
Device activation error. The physical file name 'C:\ ...\db_name.LDF' may be
incorrect."
Then:
"Attaching database has failed."
If one has not have ldf file is it possible to use mdf file?Hi
sp_attach_single_file_db may help! Make sure that the LDF does not exist
already and the location that is being used is correct.
John
"Alur" wrote:
> I tried to attach mdf file without ldf file. However:
> "Error 1813: Could not open new database 'GJIRB'. CREATE DATABASE is abort
ed.
> Device activation error. The physical file name 'C:\ ...\db_name.LDF' may
be
> incorrect."
> Then:
> "Attaching database has failed."
> If one has not have ldf file is it possible to use mdf file?|||After sp_attach_single_file_db
the message:
"Server: Msg 911, Level 16, State 1
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not locate entry in
sysdatabses for database 'db_name'.
No entry fount with that name. Make sure that the name is entered correctly.
"
appeared.
"John Bell" wrote:
> Hi
> sp_attach_single_file_db may help! Make sure that the LDF does not exist
> already and the location that is being used is correct.
> John
>
> "Alur" wrote:
>|||You can use exec sp_attach_db and only specify the database name and teh MDB
file path - and leave the remaining parameters blank (i.e., do not specify a
path to the non existant .LDF file).
Your database will get attached and a NEW log file (.ldf) will be created.
-HTH
"Alur" <Alur@.discussions.microsoft.com> wrote in message
news:115A77E2-4DDF-4A4E-8582-7B11A77CF90D@.microsoft.com...
>I tried to attach mdf file without ldf file. However:
> "Error 1813: Could not open new database 'GJIRB'. CREATE DATABASE is
> aborted.
> Device activation error. The physical file name 'C:\ ...\db_name.LDF' may
> be
> incorrect."
> Then:
> "Attaching database has failed."
> If one has not have ldf file is it possible to use mdf file?|||Excuse me
After
sp_attach_single_file_db
@.dbname = 'db_name',
@.physname = 'c:\db_name_Data.MDF'
the message
"Server: Msg 1813, Level 16, State 2, Line 1
Could not open new database 'db_name'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'C:\Program Files\Microsoft
SQL Server\MSSQL\Data\db_name_Log.LDF' may be incorrect."
appeared.
"John Bell" wrote:
> Hi
> sp_attach_single_file_db may help! Make sure that the LDF does not exist
> already and the location that is being used is correct.
> John
>
> "Alur" wrote:
>|||Thank you.
"Jeffrey Todd" wrote:
> You can use exec sp_attach_db and only specify the database name and teh M
DB
> file path - and leave the remaining parameters blank (i.e., do not specify
a
> path to the non existant .LDF file).
> Your database will get attached and a NEW log file (.ldf) will be created.
> -HTH
>
> "Alur" <Alur@.discussions.microsoft.com> wrote in message
> news:115A77E2-4DDF-4A4E-8582-7B11A77CF90D@.microsoft.com...
>
>|||I ran into this very same issue this w
although I was trying toattach the db via vbscript from an msi. Also got the same error when
trying to attach the db from Query Analyser.
Turned out that the mdf had been set to read only because someone had
not checked the shippable copy out of SourceSafe before building the
msi.
As soon as I set the file back to read\write... the problem dissappeared
instantly.
Seems that SQLDMO tries to update the mdf with the new file name and
instead of reporting an access error just continues and uses the ldf
location that is already in the mdf.
Maybe this will provide usefull for others.
Best wishes
Lee Cottrell
Chief Technical Officer
Paymentshield Limited
*** Sent via Developersdex http://www.examnotes.net ***|||Thank you.
"Lee Cottrell" wrote:
> I ran into this very same issue this w
although I was trying to> attach the db via vbscript from an msi. Also got the same error when
> trying to attach the db from Query Analyser.
> Turned out that the mdf had been set to read only because someone had
> not checked the shippable copy out of SourceSafe before building the
> msi.
> As soon as I set the file back to read\write... the problem dissappeared
> instantly.
> Seems that SQLDMO tries to update the mdf with the new file name and
> instead of reporting an access error just continues and uses the ldf
> location that is already in the mdf.
> Maybe this will provide usefull for others.
> Best wishes
> Lee Cottrell
> Chief Technical Officer
> Paymentshield Limited
> *** Sent via Developersdex http://www.examnotes.net ***
>|||And could you tell me is it possible to solve this in SQL Server versions,
which newer than 2000 ?
"Alur" wrote:
> Thank you.
> "Lee Cottrell" wrote:
>|||Hi
I don't think attaching a mdf file that has not been detached properly is
going to work in any version as your database will be in an inconsistent
state. But you may want to post to try posting to the beta news group
http://communities.microsoft.com/ne...lcid=us
to see if anyone has tried this.
John
"Alur" <Alur@.discussions.microsoft.com> wrote in message
news:B22347AC-D039-4842-9595-AF4CBF9D1E57@.microsoft.com...
> And could you tell me is it possible to solve this in SQL Server versions,
> which newer than 2000 ?
> "Alur" wrote:
>
Thursday, February 16, 2012
Attaching the log file and the mdf files of the database.
When I try to attach both the log file and mdf files
I got the following error message.
TITLE: Microsoft SQL Server Management Studio
Attach database failed for Server 'FCIT-GFOX082'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
The header for file 'C:\Documents and Settings\Administrator\My Documents\Microsoft Press\AS2005SBS\Setup\Query\log_attach_databases.txt' is not a valid database file header. The FILE SIZE property is incorrect. (Microsoft SQL Server, Error: 5172)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=08.00.0194&EvtSrc=MSSQLServer&EvtID=5172&LinkId=20476
BUTTONS:
OK
Could someone help me on how to go about this.
Regards,
Ronald
Maybe you need to take a step back and tell us what you were trying to accomplish. SSAS does not use mdf and log files. And the file in the error message you posted is a .txt file.
SSAS either uses a .abf format for back up and restore, or an xmla script to create an empty database.
|||I am trying to attach the SSAS Step by Step database that comes with the book Microsoft SQL SERVER 2005 Analysis SErvices Step by Step.
When I try it out, I get error messages.
Regards,
Ronaldl
attaching SQL Server 2000 database to SQL Server 2005 Express
If someone can help. I just installed SQL Server 2005 Express. I am trying to attach a SQL Server 2000 database so I can work on it. I am getting the following error.
Msg 5118, Level 16, State 1, Line 1
The file "L:\SQL Data\Data\Dougins_Data.mdf" is compressed but does not reside in a read-only database or filegroup. The file must be decompressed.
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'Dougins'. CREATE DATABASE is aborted.
I cannot find instructions in help to decompress the file. Does anyone have any suggestions?
I dont think so there is file compression is related to database. Check with your windows folks since file compression are done at the OS level. Ask them to decompress the files and you should be good to go.Attaching SQL Database in 2005 from CD-ROM
I am trying to attach a database on a CD-ROM using the following command
exec sp_attach_db dbname='dbname',
filename1='d:\dbname.mdf',
filename2='d:\dbname.ldf'
and I am getting the following error
Msg 3415, Level 16, State 1, Line 1
Database 'dbname' cannot be upgraded because it is read-only or has
read-only files. Make the database or files writeable, and rerun recovery.
Any Help would be appreciated.
TIA
-srini
Its working on SQL 2000 Server. I am wondering is there a work-around for
SQL 2005.
-srini
"srini" wrote:
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini
|||SQL needs upgradte the db and the cdrom is read only,upgrade from hard disk
and then save to cdrom
"srini" <srini@.discussions.microsoft.com> escribi en el mensaje
news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini
|||Look at this page from BOL:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/fd717bec-b389-4b1e-936c-a4ccf75dba77.htm
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"srini" <srini@.discussions.microsoft.com> wrote in message
news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini
|||Thanks Geoff for a quick reply.
I read and tried the same it works. Thanks a lot.
Just in case if some one, needs step by step guidelines
Step1:
EXEC sp_create_removable 'exportdb',
'exportdbsys',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdbsys.mdf', 2,
'exportdblog',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdblog.ldf', 2,
'exportdbdata',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdbdata.ndf', 2
Step2:
Exported all objects that I wanted into this db through context menu optoin
"Export "
Step3:
sp_certify_removable exportdb
Step4:
Took the db offline.
Step5:
Copied the files on CD-ROM
Step6:
Deleted exportdb
Step7:
Attached the exportdb as exportdb1 as follows
sp_attach_db @.dbname = 'exportdb1',
@.filename1 = 'd:\exportdbsys.mdf',
@.filename2 = 'd:\exportdbdata.ndf',
@.filename3 = 'd:\exportdblog.ldf'
step8:
Verified the db works with simple select statement.
-srini
"Geoff N. Hiten" wrote:
> Look at this page from BOL:
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/fd717bec-b389-4b1e-936c-a4ccf75dba77.htm
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
> "srini" <srini@.discussions.microsoft.com> wrote in message
> news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
>
|||Thanks Luis Tarzia.
My requirement is to use the database on CD-ROM as read-only database and I
want to be able to attach the db to any SQL 2005 and start using the same.
-srini
"Luis Tarzia" wrote:
> SQL needs upgradte the db and the cdrom is read only,upgrade from hard disk
> and then save to cdrom
> "srini" <srini@.discussions.microsoft.com> escribió en el mensaje
> news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
>
>
Attaching SQL Database in 2005 from CD-ROM
I am trying to attach a database on a CD-ROM using the following command
exec sp_attach_db dbname='dbname',
filename1='d:\dbname.mdf',
filename2='d:\dbname.ldf'
and I am getting the following error
Msg 3415, Level 16, State 1, Line 1
Database 'dbname' cannot be upgraded because it is read-only or has
read-only files. Make the database or files writeable, and rerun recovery.
Any Help would be appreciated.
TIA
-sriniIts working on SQL 2000 Server. I am wondering is there a work-around for
SQL 2005.
-srini
"srini" wrote:
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini|||SQL needs upgradte the db and the cdrom is read only,upgrade from hard disk
and then save to cdrom
"srini" <srini@.discussions.microsoft.com> escribió en el mensaje
news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini|||Look at this page from BOL:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/fd717bec-b389-4b1e-936c-a4ccf75dba77.htm
--
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"srini" <srini@.discussions.microsoft.com> wrote in message
news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini|||Thanks Geoff for a quick reply.
I read and tried the same it works. Thanks a lot.
Just in case if some one, needs step by step guidelines
Step1:
EXEC sp_create_removable 'exportdb',
'exportdbsys',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdbsys.mdf', 2,
'exportdblog',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdblog.ldf', 2,
'exportdbdata',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdbdata.ndf', 2
Step2:
Exported all objects that I wanted into this db through context menu optoin
"Export "
Step3:
sp_certify_removable exportdb
Step4:
Took the db offline.
Step5:
Copied the files on CD-ROM
Step6:
Deleted exportdb
Step7:
Attached the exportdb as exportdb1 as follows
sp_attach_db @.dbname = 'exportdb1',
@.filename1 = 'd:\exportdbsys.mdf',
@.filename2 = 'd:\exportdbdata.ndf',
@.filename3 = 'd:\exportdblog.ldf'
step8:
Verified the db works with simple select statement.
-srini
"Geoff N. Hiten" wrote:
> Look at this page from BOL:
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/fd717bec-b389-4b1e-936c-a4ccf75dba77.htm
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
> "srini" <srini@.discussions.microsoft.com> wrote in message
> news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
> > Hi:
> >
> > I am trying to attach a database on a CD-ROM using the following command
> >
> > exec sp_attach_db dbname='dbname',
> > filename1='d:\dbname.mdf',
> > filename2='d:\dbname.ldf'
> >
> > and I am getting the following error
> >
> > Msg 3415, Level 16, State 1, Line 1
> > Database 'dbname' cannot be upgraded because it is read-only or has
> > read-only files. Make the database or files writeable, and rerun recovery.
> >
> >
> > Any Help would be appreciated.
> >
> > TIA
> > -srini
>|||Thanks Luis Tarzia.
My requirement is to use the database on CD-ROM as read-only database and I
want to be able to attach the db to any SQL 2005 and start using the same.
-srini
"Luis Tarzia" wrote:
> SQL needs upgradte the db and the cdrom is read only,upgrade from hard disk
> and then save to cdrom
> "srini" <srini@.discussions.microsoft.com> escribió en el mensaje
> news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
> > Hi:
> >
> > I am trying to attach a database on a CD-ROM using the following command
> >
> > exec sp_attach_db dbname='dbname',
> > filename1='d:\dbname.mdf',
> > filename2='d:\dbname.ldf'
> >
> > and I am getting the following error
> >
> > Msg 3415, Level 16, State 1, Line 1
> > Database 'dbname' cannot be upgraded because it is read-only or has
> > read-only files. Make the database or files writeable, and rerun recovery.
> >
> >
> > Any Help would be appreciated.
> >
> > TIA
> > -srini
>
>
Attaching SQL Database in 2005 from CD-ROM
I am trying to attach a database on a CD-ROM using the following command
exec sp_attach_db dbname='dbname',
filename1='d:\dbname.mdf',
filename2='d:\dbname.ldf'
and I am getting the following error
Msg 3415, Level 16, State 1, Line 1
Database 'dbname' cannot be upgraded because it is read-only or has
read-only files. Make the database or files writeable, and rerun recovery.
Any Help would be appreciated.
TIA
-sriniIts working on SQL 2000 Server. I am wondering is there a work-around for
SQL 2005.
-srini
"srini" wrote:
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini|||SQL needs upgradte the db and the cdrom is read only,upgrade from hard disk
and then save to cdrom
"srini" <srini@.discussions.microsoft.com> escribi en el mensaje
news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini|||Look at this page from BOL:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/fd717bec-b389-4b1e-936c-a4cc
f75dba77.htm
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"srini" <srini@.discussions.microsoft.com> wrote in message
news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
> Hi:
> I am trying to attach a database on a CD-ROM using the following command
> exec sp_attach_db dbname='dbname',
> filename1='d:\dbname.mdf',
> filename2='d:\dbname.ldf'
> and I am getting the following error
> Msg 3415, Level 16, State 1, Line 1
> Database 'dbname' cannot be upgraded because it is read-only or has
> read-only files. Make the database or files writeable, and rerun recovery.
>
> Any Help would be appreciated.
> TIA
> -srini|||Thanks Geoff for a quick reply.
I read and tried the same it works. Thanks a lot.
Just in case if some one, needs step by step guidelines
Step1:
EXEC sp_create_removable 'exportdb',
'exportdbsys',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdbsys.mdf', 2,
'exportdblog',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdblog.ldf', 2,
'exportdbdata',
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\exportdbdata.ndf', 2
Step2:
Exported all objects that I wanted into this db through context menu optoin
"Export "
Step3:
sp_certify_removable exportdb
Step4:
Took the db offline.
Step5:
Copied the files on CD-ROM
Step6:
Deleted exportdb
Step7:
Attached the exportdb as exportdb1 as follows
sp_attach_db @.dbname = 'exportdb1',
@.filename1 = 'd:\exportdbsys.mdf',
@.filename2 = 'd:\exportdbdata.ndf',
@.filename3 = 'd:\exportdblog.ldf'
step8:
Verified the db works with simple select statement.
-srini
"Geoff N. Hiten" wrote:
> Look at this page from BOL:
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/fd717bec-b389-4b1e-936c-a4
ccf75dba77.htm
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
> "srini" <srini@.discussions.microsoft.com> wrote in message
> news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
>|||Thanks Luis Tarzia.
My requirement is to use the database on CD-ROM as read-only database and I
want to be able to attach the db to any SQL 2005 and start using the same.
-srini
"Luis Tarzia" wrote:
> SQL needs upgradte the db and the cdrom is read only,upgrade from hard dis
k
> and then save to cdrom
> "srini" <srini@.discussions.microsoft.com> escribió en el mensaje
> news:A8B27EC6-2370-4596-8FF2-E505147BB62D@.microsoft.com...
>
>
Attaching SQL 2005 db to a SQL 2000 Server
I have searched but came up empty.I highly doubt it.|||It can happen other way.|||Why do you need to do that?
You can install SQL2K5 Express and attach your SQL2K5 db there. Anything specific forces you to attach it to SQL2K?
Attaching SQL 2000 DB in SQL 2005 and vice versa from CD-ROM
I am trying to attach db created in SQL 2000, detached and written on CD-ROM
in SQL 2005 and vice versa.
If I try to attach on the same SQL Server where it was created, it works fine.
I am using SQL 2000 generated db files as template to create databases
through API, both on SQL 2000 & on SQL 2005 machine.
1. When the database created on SQL 2005 attached in SQL 2000, I get the
following error.
Server: Msg 602, Level 21, State 50, Line 1
Could not find row in sysindexes for database ID 13, object ID 1, index ID
1. Run DBCC CHECKTABLE on sysindexes.
2. When the database created on SQL 2000 is attached in SQL 2005, I get the
following error.
Msg 3415, Level 16, State 1, Line 1
Database 'DB1' cannot be upgraded because it is read-only or has read-only
files. Make the database or files writeable, and rerun recovery.
Is there a workaround for this issue.
Any help would be appreciated.
TIA
-srini
You can't attach a 2005 db to 2000, regardless of read-only media or not.
As for attaching 2000 database to 2005, it is doable, but SQL Server has to be able to upgrade the
file structure. this means that for attach to work, the media cannot be read-only.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"srini" <srini@.discussions.microsoft.com> wrote in message
news:718B30EB-2CDE-4F7A-B995-2254B4B3217C@.microsoft.com...
> Hi all:
> I am trying to attach db created in SQL 2000, detached and written on CD-ROM
> in SQL 2005 and vice versa.
> If I try to attach on the same SQL Server where it was created, it works fine.
> I am using SQL 2000 generated db files as template to create databases
> through API, both on SQL 2000 & on SQL 2005 machine.
>
> 1. When the database created on SQL 2005 attached in SQL 2000, I get the
> following error.
> Server: Msg 602, Level 21, State 50, Line 1
> Could not find row in sysindexes for database ID 13, object ID 1, index ID
> 1. Run DBCC CHECKTABLE on sysindexes.
> 2. When the database created on SQL 2000 is attached in SQL 2005, I get the
> following error.
> Msg 3415, Level 16, State 1, Line 1
> Database 'DB1' cannot be upgraded because it is read-only or has read-only
> files. Make the database or files writeable, and rerun recovery.
> Is there a workaround for this issue.
> Any help would be appreciated.
> TIA
> -srini
|||Thank you Tibor.
"Tibor Karaszi" wrote:
> You can't attach a 2005 db to 2000, regardless of read-only media or not.
> As for attaching 2000 database to 2005, it is doable, but SQL Server has to be able to upgrade the
> file structure. this means that for attach to work, the media cannot be read-only.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "srini" <srini@.discussions.microsoft.com> wrote in message
> news:718B30EB-2CDE-4F7A-B995-2254B4B3217C@.microsoft.com...
>
Attaching SQL 2000 DB in SQL 2005 and vice versa from CD-ROM
I am trying to attach db created in SQL 2000, detached and written on CD-ROM
in SQL 2005 and vice versa.
If I try to attach on the same SQL Server where it was created, it works fin
e.
I am using SQL 2000 generated db files as template to create databases
through API, both on SQL 2000 & on SQL 2005 machine.
1. When the database created on SQL 2005 attached in SQL 2000, I get the
following error.
Server: Msg 602, Level 21, State 50, Line 1
Could not find row in sysindexes for database ID 13, object ID 1, index ID
1. Run DBCC CHECKTABLE on sysindexes.
2. When the database created on SQL 2000 is attached in SQL 2005, I get the
following error.
Msg 3415, Level 16, State 1, Line 1
Database 'DB1' cannot be upgraded because it is read-only or has read-only
files. Make the database or files writeable, and rerun recovery.
Is there a workaround for this issue.
Any help would be appreciated.
TIA
-sriniYou can't attach a 2005 db to 2000, regardless of read-only media or not.
As for attaching 2000 database to 2005, it is doable, but SQL Server has to
be able to upgrade the
file structure. this means that for attach to work, the media cannot be read
-only.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"srini" <srini@.discussions.microsoft.com> wrote in message
news:718B30EB-2CDE-4F7A-B995-2254B4B3217C@.microsoft.com...
> Hi all:
> I am trying to attach db created in SQL 2000, detached and written on CD-R
OM
> in SQL 2005 and vice versa.
> If I try to attach on the same SQL Server where it was created, it works f
ine.
> I am using SQL 2000 generated db files as template to create databases
> through API, both on SQL 2000 & on SQL 2005 machine.
>
> 1. When the database created on SQL 2005 attached in SQL 2000, I get the
> following error.
> Server: Msg 602, Level 21, State 50, Line 1
> Could not find row in sysindexes for database ID 13, object ID 1, index ID
> 1. Run DBCC CHECKTABLE on sysindexes.
> 2. When the database created on SQL 2000 is attached in SQL 2005, I get t
he
> following error.
> Msg 3415, Level 16, State 1, Line 1
> Database 'DB1' cannot be upgraded because it is read-only or has read-only
> files. Make the database or files writeable, and rerun recovery.
> Is there a workaround for this issue.
> Any help would be appreciated.
> TIA
> -srini|||Thank you Tibor.
"Tibor Karaszi" wrote:
> You can't attach a 2005 db to 2000, regardless of read-only media or not.
> As for attaching 2000 database to 2005, it is doable, but SQL Server has t
o be able to upgrade the
> file structure. this means that for attach to work, the media cannot be re
ad-only.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "srini" <srini@.discussions.microsoft.com> wrote in message
> news:718B30EB-2CDE-4F7A-B995-2254B4B3217C@.microsoft.com...
>
Attaching SQL 2000 DB in SQL 2005 and vice versa from CD-ROM
I am trying to attach db created in SQL 2000, detached and written on CD-ROM
in SQL 2005 and vice versa.
If I try to attach on the same SQL Server where it was created, it works fine.
I am using SQL 2000 generated db files as template to create databases
through API, both on SQL 2000 & on SQL 2005 machine.
1. When the database created on SQL 2005 attached in SQL 2000, I get the
following error.
Server: Msg 602, Level 21, State 50, Line 1
Could not find row in sysindexes for database ID 13, object ID 1, index ID
1. Run DBCC CHECKTABLE on sysindexes.
2. When the database created on SQL 2000 is attached in SQL 2005, I get the
following error.
Msg 3415, Level 16, State 1, Line 1
Database 'DB1' cannot be upgraded because it is read-only or has read-only
files. Make the database or files writeable, and rerun recovery.
Is there a workaround for this issue.
Any help would be appreciated.
TIA
-sriniYou can't attach a 2005 db to 2000, regardless of read-only media or not.
As for attaching 2000 database to 2005, it is doable, but SQL Server has to be able to upgrade the
file structure. this means that for attach to work, the media cannot be read-only.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"srini" <srini@.discussions.microsoft.com> wrote in message
news:718B30EB-2CDE-4F7A-B995-2254B4B3217C@.microsoft.com...
> Hi all:
> I am trying to attach db created in SQL 2000, detached and written on CD-ROM
> in SQL 2005 and vice versa.
> If I try to attach on the same SQL Server where it was created, it works fine.
> I am using SQL 2000 generated db files as template to create databases
> through API, both on SQL 2000 & on SQL 2005 machine.
>
> 1. When the database created on SQL 2005 attached in SQL 2000, I get the
> following error.
> Server: Msg 602, Level 21, State 50, Line 1
> Could not find row in sysindexes for database ID 13, object ID 1, index ID
> 1. Run DBCC CHECKTABLE on sysindexes.
> 2. When the database created on SQL 2000 is attached in SQL 2005, I get the
> following error.
> Msg 3415, Level 16, State 1, Line 1
> Database 'DB1' cannot be upgraded because it is read-only or has read-only
> files. Make the database or files writeable, and rerun recovery.
> Is there a workaround for this issue.
> Any help would be appreciated.
> TIA
> -srini|||Thank you Tibor.
"Tibor Karaszi" wrote:
> You can't attach a 2005 db to 2000, regardless of read-only media or not.
> As for attaching 2000 database to 2005, it is doable, but SQL Server has to be able to upgrade the
> file structure. this means that for attach to work, the media cannot be read-only.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "srini" <srini@.discussions.microsoft.com> wrote in message
> news:718B30EB-2CDE-4F7A-B995-2254B4B3217C@.microsoft.com...
> > Hi all:
> >
> > I am trying to attach db created in SQL 2000, detached and written on CD-ROM
> > in SQL 2005 and vice versa.
> >
> > If I try to attach on the same SQL Server where it was created, it works fine.
> >
> > I am using SQL 2000 generated db files as template to create databases
> > through API, both on SQL 2000 & on SQL 2005 machine.
> >
> >
> > 1. When the database created on SQL 2005 attached in SQL 2000, I get the
> > following error.
> > Server: Msg 602, Level 21, State 50, Line 1
> > Could not find row in sysindexes for database ID 13, object ID 1, index ID
> > 1. Run DBCC CHECKTABLE on sysindexes.
> >
> > 2. When the database created on SQL 2000 is attached in SQL 2005, I get the
> > following error.
> > Msg 3415, Level 16, State 1, Line 1
> > Database 'DB1' cannot be upgraded because it is read-only or has read-only
> > files. Make the database or files writeable, and rerun recovery.
> >
> > Is there a workaround for this issue.
> >
> > Any help would be appreciated.
> >
> > TIA
> > -srini
>
Attaching SQL 2000 database (.mdf) with missing (.ldf) file
Hello
Please can anyone help me
I've been given a .mdf file from sql server 2000 which i need to attach but we do not have the .ldf file
I am unable to recover the old .ldf file
I have tried the attach single file command but obvioulsy this still looks for the old .ldf file path which no longer exists
any help would be mostly appriciated
many thanks
Martin
sp_attach_single_file_db only works if the database was appropiatly closed and concistent. If the procedure does not work, you will either need to have the ldf file or a valid backup.Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||
Unfortunatly we do not have the ldf file or a valid backup
we only have the mdf file
is there no way of getting round this or recreating a log so i can access the data of the mdf
regards
Martin
|||Hi, I'm in exactly the same situation where a server failure has lost us the LDF but we still have an MDF..Weve tried the various attach etc but still no luck so if anyone has any advice I'd sure appreciate it as well please...........
regards
PeterSm
|||Unfortunately, the tools mentioned are the only ones.
Jens K. Suessmeyer.
http://www.sqlserver2005.de
Attaching SQL 2000 database (.mdf) with missing (.ldf) file
Hello
Please can anyone help me
I've been given a .mdf file from sql server 2000 which i need to attach but we do not have the .ldf file
I am unable to recover the old .ldf file
I have tried the attach single file command but obvioulsy this still looks for the old .ldf file path which no longer exists
any help would be mostly appriciated
many thanks
Martin
sp_attach_single_file_db only works if the database was appropiatly closed and concistent. If the procedure does not work, you will either need to have the ldf file or a valid backup.Jens K. Suessmeyer.
http://www.sqlserver2005.de|||
Unfortunatly we do not have the ldf file or a valid backup
we only have the mdf file
is there no way of getting round this or recreating a log so i can access the data of the mdf
regards
Martin
|||Hi, I'm in exactly the same situation where a server failure has lost us the LDF but we still have an MDF..Weve tried the various attach etc but still no luck so if anyone has any advice I'd sure appreciate it as well please...........
regards
PeterSm|||Unfortunately, the tools mentioned are the only ones.
Jens K. Suessmeyer.
http://www.sqlserver2005.de
Attaching SQL 2000 database (.mdf) with missing (.ldf) file
Hello
Please can anyone help me
I've been given a .mdf file from sql server 2000 which i need to attach but we do not have the .ldf file
I am unable to recover the old .ldf file
I have tried the attach single file command but obvioulsy this still looks for the old .ldf file path which no longer exists
any help would be mostly appriciated
many thanks
Martin
sp_attach_single_file_db only works if the database was appropiatly closed and concistent. If the procedure does not work, you will either need to have the ldf file or a valid backup.Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||
Unfortunatly we do not have the ldf file or a valid backup
we only have the mdf file
is there no way of getting round this or recreating a log so i can access the data of the mdf
regards
Martin
|||Hi, I'm in exactly the same situation where a server failure has lost us the LDF but we still have an MDF..Weve tried the various attach etc but still no luck so if anyone has any advice I'd sure appreciate it as well please...........
regards
PeterSm
|||Unfortunately, the tools mentioned are the only ones.
Jens K. Suessmeyer.
http://www.sqlserver2005.de
Attaching Northwind (2000) into SQL Server 2005
I am trying to attach to the SQL Server 2000 sample Northwind database using SQL Server 2005. When I do the Database-->Attach using the GUI everything seems alright. I can open the Northwind database and see the usual listing of stuff.
However, when I click on the Database Diagrams, I get an error message stating "Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database support objects."
I have tried repeatedly to get the ALTER AUTHORIZATION statement to work, all to no avail. I have restarted my machine, and the properties of the database is now saying that the owner is the same as the other databases I have, but I keep getting the error message.
What am I doing wrong here? How can I fix this?Any help would be greatly appreciated.
Thank you.Did you already checked the link: http://msdn2.microsoft.com/en-us/library/ms186345.aspx
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de|||
That worked perfectly.
Thank you!
![]()
Attaching MSDB database
before a re-install. It won't allow me to detach MSDB as it says "System
databases cannot be detached". I would like to replace the current MSDB. I
don't have a database backup file.
Thanks.
RonRon,
Provided you really know that this is what you want, you can do the
following:
1 - Backup your existing msdb database.
2 - Shut down your SQL Server.
3 - Move the existing msdb .mdf and .ldf files to somewhere else.
4 - Copy your previous msdb .mdf and .ldf to the same place where the
existing files were.
5 - Restart SQL Server
Then you might create a database named msdbinstall and restore your msdb
backup from step 1 into msdbinstall. Just in case you need to check out a
few things.
RLF
"Ron" <Ron@.discussions.microsoft.com> wrote in message
news:9250F5FE-101A-4605-A849-C94B4C1942C7@.microsoft.com...
> Anyway to attach the MSDB database? I have the .mdf and .ldf files from
> before a re-install. It won't allow me to detach MSDB as it says "System
> databases cannot be detached". I would like to replace the current MSDB.
> I
> don't have a database backup file.
> Thanks.
> Ron|||I think this will work only if the file paths match for all the files. SQL
Servere doesn't like it if the files aren't where sysfiles thiks they are.
--
Thank you,
Daniel Jameson
SQL Server DBA
Children's Oncology Group
www.childrensoncologygroup.org
"Russell Fields" <russellfields@.nomail.com> wrote in message
news:%23X3hsTY9HHA.484@.TK2MSFTNGP06.phx.gbl...
> Ron,
> Provided you really know that this is what you want, you can do the
> following:
> 1 - Backup your existing msdb database.
> 2 - Shut down your SQL Server.
> 3 - Move the existing msdb .mdf and .ldf files to somewhere else.
> 4 - Copy your previous msdb .mdf and .ldf to the same place where the
> existing files were.
> 5 - Restart SQL Server
> Then you might create a database named msdbinstall and restore your msdb
> backup from step 1 into msdbinstall. Just in case you need to check out a
> few things.
> RLF
>
> "Ron" <Ron@.discussions.microsoft.com> wrote in message
> news:9250F5FE-101A-4605-A849-C94B4C1942C7@.microsoft.com...
>> Anyway to attach the MSDB database? I have the .mdf and .ldf files from
>> before a re-install. It won't allow me to detach MSDB as it says "System
>> databases cannot be detached". I would like to replace the current MSDB.
>> I
>> don't have a database backup file.
>> Thanks.
>> Ron
>|||you can refer the below link,
http://deepakinsql.blogspot.com/2007/08/moving-system-databases-in-sql-2005.html
--
Thanxx
Deepak
"Ron" wrote:
> Anyway to attach the MSDB database? I have the .mdf and .ldf files from
> before a re-install. It won't allow me to detach MSDB as it says "System
> databases cannot be detached". I would like to replace the current MSDB. I
> don't have a database backup file.
> Thanks.
> Ron|||Daniel,
You are right, which is why the replacement msdb files must go back to the
exact same place as occupied by the files at installation time. That is
what my step 4 was trying to say.
RLF
"Daniel Jameson" <danjam47@.newsgroup.nospam> wrote in message
news:uelkspZ9HHA.5948@.TK2MSFTNGP04.phx.gbl...
>I think this will work only if the file paths match for all the files. SQL
>Servere doesn't like it if the files aren't where sysfiles thiks they are.
> --
> Thank you,
> Daniel Jameson
> SQL Server DBA
> Children's Oncology Group
> www.childrensoncologygroup.org
>
> "Russell Fields" <russellfields@.nomail.com> wrote in message
> news:%23X3hsTY9HHA.484@.TK2MSFTNGP06.phx.gbl...
>> Ron,
>> Provided you really know that this is what you want, you can do the
>> following:
>> 1 - Backup your existing msdb database.
>> 2 - Shut down your SQL Server.
>> 3 - Move the existing msdb .mdf and .ldf files to somewhere else.
>> 4 - Copy your previous msdb .mdf and .ldf to the same place where the
>> existing files were.
>> 5 - Restart SQL Server
>> Then you might create a database named msdbinstall and restore your msdb
>> backup from step 1 into msdbinstall. Just in case you need to check out
>> a few things.
>> RLF
>>
>> "Ron" <Ron@.discussions.microsoft.com> wrote in message
>> news:9250F5FE-101A-4605-A849-C94B4C1942C7@.microsoft.com...
>> Anyway to attach the MSDB database? I have the .mdf and .ldf files from
>> before a re-install. It won't allow me to detach MSDB as it says
>> "System
>> databases cannot be detached". I would like to replace the current
>> MSDB. I
>> don't have a database backup file.
>> Thanks.
>> Ron
>>
>|||did this few months ago, works!!!
Russell Fields wrote:
> Daniel,
> You are right, which is why the replacement msdb files must go back to the
> exact same place as occupied by the files at installation time. That is
> what my step 4 was trying to say.
> RLF
>
> "Daniel Jameson" <danjam47@.newsgroup.nospam> wrote in message
> news:uelkspZ9HHA.5948@.TK2MSFTNGP04.phx.gbl...
>> I think this will work only if the file paths match for all the files. SQL
>> Servere doesn't like it if the files aren't where sysfiles thiks they are.
>> --
>> Thank you,
>> Daniel Jameson
>> SQL Server DBA
>> Children's Oncology Group
>> www.childrensoncologygroup.org
>>
>> "Russell Fields" <russellfields@.nomail.com> wrote in message
>> news:%23X3hsTY9HHA.484@.TK2MSFTNGP06.phx.gbl...
>> Ron,
>> Provided you really know that this is what you want, you can do the
>> following:
>> 1 - Backup your existing msdb database.
>> 2 - Shut down your SQL Server.
>> 3 - Move the existing msdb .mdf and .ldf files to somewhere else.
>> 4 - Copy your previous msdb .mdf and .ldf to the same place where the
>> existing files were.
>> 5 - Restart SQL Server
>> Then you might create a database named msdbinstall and restore your msdb
>> backup from step 1 into msdbinstall. Just in case you need to check out
>> a few things.
>> RLF
>>
>> "Ron" <Ron@.discussions.microsoft.com> wrote in message
>> news:9250F5FE-101A-4605-A849-C94B4C1942C7@.microsoft.com...
>> Anyway to attach the MSDB database? I have the .mdf and .ldf files from
>> before a re-install. It won't allow me to detach MSDB as it says
>> "System
>> databases cannot be detached". I would like to replace the current
>> MSDB. I
>> don't have a database backup file.
>> Thanks.
>> Ron
>>
>|||Thank you very much - that worked just fine.
"Russell Fields" wrote:
> Ron,
> Provided you really know that this is what you want, you can do the
> following:
> 1 - Backup your existing msdb database.
> 2 - Shut down your SQL Server.
> 3 - Move the existing msdb .mdf and .ldf files to somewhere else.
> 4 - Copy your previous msdb .mdf and .ldf to the same place where the
> existing files were.
> 5 - Restart SQL Server
> Then you might create a database named msdbinstall and restore your msdb
> backup from step 1 into msdbinstall. Just in case you need to check out a
> few things.
> RLF
>
> "Ron" <Ron@.discussions.microsoft.com> wrote in message
> news:9250F5FE-101A-4605-A849-C94B4C1942C7@.microsoft.com...
> > Anyway to attach the MSDB database? I have the .mdf and .ldf files from
> > before a re-install. It won't allow me to detach MSDB as it says "System
> > databases cannot be detached". I would like to replace the current MSDB.
> > I
> > don't have a database backup file.
> >
> > Thanks.
> >
> > Ron
>
>
Attaching MDF with AttachDBFilename?
the connection string, and I have a few questions on the issue.
I am planning on setting this up on a network with both the .mdf and the
instance of SQL Server residing on a server. All the clients will be runnin
g
an app that will have access to the SQL Server instance and the fileshare,
and they will attempt to use a connection string with the "AttachDBFilename"
.
I have successfully connected to the instance of SQL Server and have access
to the .mdf from a client, but I have not been able to get the connection to
attach the .mdf file. If I run the app on the server it works, but on a
client I get an error saying something like "The file '..' is on a network
path that is not supported for database files."
My questions are:
Can this be done using "AttachDBFilename"?
If yes, any suggestion on what I may be missing?
Even if I do get this method to work will it support multiple users?
Thanks,
JimThe database file (mdf) only needs to be attached one time -at the server.
Clients only need to connect to the server and have access to the database.
If SQL Express was installed on each client, and those clients used the
'AttachDBFilename', they would be attempting to attach a database file to
their local copy of SQL Express. Database files cannot be attached from a
unc network path. They would each need a local copy of the database for that
to work. However, it sounds like you want a centrally located database, not
individual copies.
Arnie Rowland
"To be successful, your heart must accompany your knowledge."
"Jim" <Jim@.discussions.microsoft.com> wrote in message
news:5732D62A-EE09-4ED6-8548-FFB7AC58EC2E@.microsoft.com...
>I am attempting to attach an .mdf to SQL Express using "AttachDBFilename"
>in
> the connection string, and I have a few questions on the issue.
> I am planning on setting this up on a network with both the .mdf and the
> instance of SQL Server residing on a server. All the clients will be
> running
> an app that will have access to the SQL Server instance and the fileshare,
> and they will attempt to use a connection string with the
> "AttachDBFilename".
> I have successfully connected to the instance of SQL Server and have
> access
> to the .mdf from a client, but I have not been able to get the connection
> to
> attach the .mdf file. If I run the app on the server it works, but on a
> client I get an error saying something like "The file '..' is on a network
> path that is not supported for database files."
> My questions are:
> Can this be done using "AttachDBFilename"?
> If yes, any suggestion on what I may be missing?
> Even if I do get this method to work will it support multiple users?
> --
> Thanks,
> Jim