Thursday, February 16, 2012

Attaching SQL Database in 2005 from CD-ROM

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
-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
>
>

No comments:

Post a Comment