Hello there
Afrer i replicate my database, the tables that i replicated have been
created with the owner of the user i've accessed to the subscriber database,
instead of updating the data on my original tables that has dbo owner.
Is there a way to use replication to update the dbo tables?
' 03-5611606
' 050-7709399
: roy@.atidsm.co.il
Right click on your publication, select properties, click on the articles
tab. Click on the browse button to the right of each of your tables, and in
the general tab, enter dbo for destination table owner.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Roy Goldhammer" <roy@.hotmail.com> wrote in message
news:ezEA$uCHGHA.2460@.TK2MSFTNGP10.phx.gbl...
> Hello there
> Afrer i replicate my database, the tables that i replicated have been
> created with the owner of the user i've accessed to the subscriber
> database, instead of updating the data on my original tables that has dbo
> owner.
> Is there a way to use replication to update the dbo tables?
> --
>
> ' 03-5611606
> ' 050-7709399
> : roy@.atidsm.co.il
>
Showing posts with label ive. Show all posts
Showing posts with label ive. Show all posts
Wednesday, March 7, 2012
changing owner of the subscriber
Labels:
accessed,
beencreated,
changing,
database,
ive,
microsoft,
mysql,
oracle,
owner,
replicate,
replicated,
server,
sql,
subscriber,
tables,
thereafrer,
user
Thursday, February 16, 2012
changing file's filegroup
Hi, I have a database with two data files, both belonging
to the PRIMARY filegroup. I've emptied one of the files
and would like to modify that file's filegroup to
SECONDARY so that I can remove it from my database.
Using the alter database modify filegroup would impact my
entire database and not to a specific file.
Any suggestions. Thanks.
Why not just remove it using ALTER DATABASE... REMOVE FILE...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rob" <anonymous@.discussions.microsoft.com> wrote in message news:974b01c48618$64d38f60$a601280a@.phx.gbl...
> Hi, I have a database with two data files, both belonging
> to the PRIMARY filegroup. I've emptied one of the files
> and would like to modify that file's filegroup to
> SECONDARY so that I can remove it from my database.
> Using the alter database modify filegroup would impact my
> entire database and not to a specific file.
> Any suggestions. Thanks.
|||That doesn't work because it already belongs to in the
PRIMARY filegroup and get the following msg when attempted
to do so:
The primary data or log file cannot be removed from a
database.
Thanks.
>--Original Message--
>Why not just remove it using ALTER DATABASE... REMOVE
FILE...
>--
>Tibor Karaszi, SQL Server MVP
>http://www.karaszi.com/sqlserver/default.asp
>http://www.solidqualitylearning.com/
>
>"Rob" <anonymous@.discussions.microsoft.com> wrote in
message news:974b01c48618$64d38f60$a601280a@.phx.gbl...[vbcol=seagreen]
belonging[vbcol=seagreen]
my
>
>.
>
|||The filegroup named "PRIMARY" is not the same thing as the primary file (which generally has .mdf as
extension).
The error message states that you cannot remove the primary file. You can, however remove secondary file
(.ndf) from the primary filegroup (as well as other filegroups).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rob" <anonymous@.discussions.microsoft.com> wrote in message news:926801c48621$4c39ddc0$a501280a@.phx.gbl...[vbcol=seagreen]
> That doesn't work because it already belongs to in the
> PRIMARY filegroup and get the following msg when attempted
> to do so:
> The primary data or log file cannot be removed from a
> database.
> Thanks.
> FILE...
> message news:974b01c48618$64d38f60$a601280a@.phx.gbl...
> belonging
> my
|||Both these files have the .mdf extension. I wonder if
detaching the db, renaming the .mdf file in question
to .ndf, re-attaching the db, and then attempt to remove
this file again would work.
Thanks again.
>--Original Message--
>The filegroup named "PRIMARY" is not the same thing as
the primary file (which generally has .mdf as
>extension).
>The error message states that you cannot remove the
primary file. You can, however remove secondary file
>(.ndf) from the primary filegroup (as well as other
filegroups).
>--
>Tibor Karaszi, SQL Server MVP
>http://www.karaszi.com/sqlserver/default.asp
>http://www.solidqualitylearning.com/
>
>"Rob" <anonymous@.discussions.microsoft.com> wrote in
message news:926801c48621$4c39ddc0$a501280a@.phx.gbl...[vbcol=seagreen]
attempted[vbcol=seagreen]
files[vbcol=seagreen]
impact
>
>.
>
|||Nope that didn't work... still get the same error message
after I had detached, renamed, and re-attached the db.
Any other thoughts? Thanks.
>--Original Message--
>Both these files have the .mdf extension. I wonder if
>detaching the db, renaming the .mdf file in question
>to .ndf, re-attaching the db, and then attempt to remove
>this file again would work.
>Thanks again.
>the primary file (which generally has .mdf as
>primary file. You can, however remove secondary file
>filegroups).
>message news:926801c48621$4c39ddc0$a501280a@.phx.gbl...
>attempted
>files
>impact
>.
>
|||You can name the files anything you want, that doesn't affect whether a file is a primary or secondary
database file. I.e., seems like someone didn't follow the naming conventions when creating your database.
(There can be only one primary file for each database.)
You can try sp_helpfile. I have a feeling that the one with fileid 1 is the primary. OTOH, you already know
which is the primary, the one you tried to remove. Empty the other file (the one which isn't the primary) and
then you can remove that. You cannot remove the primary database file.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rob" <anonymous@.discussions.microsoft.com> wrote in message news:92c001c48624$027652b0$a501280a@.phx.gbl...[vbcol=seagreen]
> Both these files have the .mdf extension. I wonder if
> detaching the db, renaming the .mdf file in question
> to .ndf, re-attaching the db, and then attempt to remove
> this file again would work.
> Thanks again.
> the primary file (which generally has .mdf as
> primary file. You can, however remove secondary file
> filegroups).
> message news:926801c48621$4c39ddc0$a501280a@.phx.gbl...
> attempted
> files
> impact
to the PRIMARY filegroup. I've emptied one of the files
and would like to modify that file's filegroup to
SECONDARY so that I can remove it from my database.
Using the alter database modify filegroup would impact my
entire database and not to a specific file.
Any suggestions. Thanks.
Why not just remove it using ALTER DATABASE... REMOVE FILE...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rob" <anonymous@.discussions.microsoft.com> wrote in message news:974b01c48618$64d38f60$a601280a@.phx.gbl...
> Hi, I have a database with two data files, both belonging
> to the PRIMARY filegroup. I've emptied one of the files
> and would like to modify that file's filegroup to
> SECONDARY so that I can remove it from my database.
> Using the alter database modify filegroup would impact my
> entire database and not to a specific file.
> Any suggestions. Thanks.
|||That doesn't work because it already belongs to in the
PRIMARY filegroup and get the following msg when attempted
to do so:
The primary data or log file cannot be removed from a
database.
Thanks.
>--Original Message--
>Why not just remove it using ALTER DATABASE... REMOVE
FILE...
>--
>Tibor Karaszi, SQL Server MVP
>http://www.karaszi.com/sqlserver/default.asp
>http://www.solidqualitylearning.com/
>
>"Rob" <anonymous@.discussions.microsoft.com> wrote in
message news:974b01c48618$64d38f60$a601280a@.phx.gbl...[vbcol=seagreen]
belonging[vbcol=seagreen]
my
>
>.
>
|||The filegroup named "PRIMARY" is not the same thing as the primary file (which generally has .mdf as
extension).
The error message states that you cannot remove the primary file. You can, however remove secondary file
(.ndf) from the primary filegroup (as well as other filegroups).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rob" <anonymous@.discussions.microsoft.com> wrote in message news:926801c48621$4c39ddc0$a501280a@.phx.gbl...[vbcol=seagreen]
> That doesn't work because it already belongs to in the
> PRIMARY filegroup and get the following msg when attempted
> to do so:
> The primary data or log file cannot be removed from a
> database.
> Thanks.
> FILE...
> message news:974b01c48618$64d38f60$a601280a@.phx.gbl...
> belonging
> my
|||Both these files have the .mdf extension. I wonder if
detaching the db, renaming the .mdf file in question
to .ndf, re-attaching the db, and then attempt to remove
this file again would work.
Thanks again.
>--Original Message--
>The filegroup named "PRIMARY" is not the same thing as
the primary file (which generally has .mdf as
>extension).
>The error message states that you cannot remove the
primary file. You can, however remove secondary file
>(.ndf) from the primary filegroup (as well as other
filegroups).
>--
>Tibor Karaszi, SQL Server MVP
>http://www.karaszi.com/sqlserver/default.asp
>http://www.solidqualitylearning.com/
>
>"Rob" <anonymous@.discussions.microsoft.com> wrote in
message news:926801c48621$4c39ddc0$a501280a@.phx.gbl...[vbcol=seagreen]
attempted[vbcol=seagreen]
files[vbcol=seagreen]
impact
>
>.
>
|||Nope that didn't work... still get the same error message
after I had detached, renamed, and re-attached the db.
Any other thoughts? Thanks.
>--Original Message--
>Both these files have the .mdf extension. I wonder if
>detaching the db, renaming the .mdf file in question
>to .ndf, re-attaching the db, and then attempt to remove
>this file again would work.
>Thanks again.
>the primary file (which generally has .mdf as
>primary file. You can, however remove secondary file
>filegroups).
>message news:926801c48621$4c39ddc0$a501280a@.phx.gbl...
>attempted
>files
>impact
>.
>
|||You can name the files anything you want, that doesn't affect whether a file is a primary or secondary
database file. I.e., seems like someone didn't follow the naming conventions when creating your database.
(There can be only one primary file for each database.)
You can try sp_helpfile. I have a feeling that the one with fileid 1 is the primary. OTOH, you already know
which is the primary, the one you tried to remove. Empty the other file (the one which isn't the primary) and
then you can remove that. You cannot remove the primary database file.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rob" <anonymous@.discussions.microsoft.com> wrote in message news:92c001c48624$027652b0$a501280a@.phx.gbl...[vbcol=seagreen]
> Both these files have the .mdf extension. I wonder if
> detaching the db, renaming the .mdf file in question
> to .ndf, re-attaching the db, and then attempt to remove
> this file again would work.
> Thanks again.
> the primary file (which generally has .mdf as
> primary file. You can, however remove secondary file
> filegroups).
> message news:926801c48621$4c39ddc0$a501280a@.phx.gbl...
> attempted
> files
> impact
Sunday, February 12, 2012
Changing database status from Read Only
Ive attached a database from 2 MDF files I copied from a production
database. The attach works fine, except it always attaches in Read Only
mode.
I notice when attaching that, despite me specifying sa as the database
owner, it always makes my domain account the database owner. When I try to
make the owner sa using sp_changedbowner, I get error messages about the
database read only.
How can I make the database turn back to normal status?
Thanks
Elliot,
try ALTER DATABASE dbname SET READ_WRITE
HTH,
Paul Ibison
|||Paul:
Thanks for the reply.
Running this command returns the following errors:
Server: Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name
'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
There are 2 primary files, along with a single log file. Ive confirmed their
locations and all hae their read/write attributes set properly. The only
other thing I can think of is permissions, which should happen because I am
logged into QA and EM as sa.
Any other thoughts?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
> Elliot,
> try ALTER DATABASE dbname SET READ_WRITE
> HTH,
> Paul Ibison
>
|||Your files are probably in 'Read Only' mode before you
even restore the database (Usually if it was taken out of
the CD). Change the file properties first by checking OFF
the 'read-only' option before restoring the
database......
'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
error is stating that the server you are restoring it to
does not have that path (It is the old server's path).
Change that in the 'Options'--> 'Restore AS' part.
>--Original Message--
>Paul:
>Thanks for the reply.
>Running this command returns the following errors:
>Server: Msg 5105, Level 16, State 4, Line 1
>Device activation error. The physical file name
>'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>There are 2 primary files, along with a single log file.
Ive confirmed their
>locations and all hae their read/write attributes set
properly. The only
>other thing I can think of is permissions, which should
happen because I am
>logged into QA and EM as sa.
>Any other thoughts?
>
>
>"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
>news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
>
>.
>
|||Jack:
I'm doing an attach from the MDF, NDF, and LDF files. I'm not restoring from
a backup.
"Jack" <anonymous@.discussions.microsoft.com> wrote in message
news:16aec01c44812$477d4620$a501280a@.phx.gbl...[vbcol=seagreen]
> Your files are probably in 'Read Only' mode before you
> even restore the database (Usually if it was taken out of
> the CD). Change the file properties first by checking OFF
> the 'read-only' option before restoring the
> database......
> 'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
> error is stating that the server you are restoring it to
> does not have that path (It is the old server's path).
> Change that in the 'Options'--> 'Restore AS' part.
>
> Ive confirmed their
> properly. The only
> happen because I am
|||Check those MDF, NDF and LDF files by right clicking on
them and choosing Properties -- General tab. See if
the 'Read Only' attribute is checked ON. If it is, check
it OFF , then restore the database........
>--Original Message--
>Jack:
>I'm doing an attach from the MDF, NDF, and LDF files. I'm
not restoring from
>a backup.
>
>"Jack" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:16aec01c44812$477d4620$a501280a@.phx.gbl...
of[vbcol=seagreen]
OFF[vbcol=seagreen]
file.[vbcol=seagreen]
message
>
>.
>
|||I see what you mean now.....
Maybe the database was in a 'Read Only' status at the time
it was detached ?
>--Original Message--
>Jack:
>I'm doing an attach from the MDF, NDF, and LDF files. I'm
not restoring from
>a backup.
>
>"Jack" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:16aec01c44812$477d4620$a501280a@.phx.gbl...
of[vbcol=seagreen]
OFF[vbcol=seagreen]
file.[vbcol=seagreen]
message
>
>.
>
database. The attach works fine, except it always attaches in Read Only
mode.
I notice when attaching that, despite me specifying sa as the database
owner, it always makes my domain account the database owner. When I try to
make the owner sa using sp_changedbowner, I get error messages about the
database read only.
How can I make the database turn back to normal status?
Thanks
Elliot,
try ALTER DATABASE dbname SET READ_WRITE
HTH,
Paul Ibison
|||Paul:
Thanks for the reply.
Running this command returns the following errors:
Server: Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name
'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
There are 2 primary files, along with a single log file. Ive confirmed their
locations and all hae their read/write attributes set properly. The only
other thing I can think of is permissions, which should happen because I am
logged into QA and EM as sa.
Any other thoughts?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
> Elliot,
> try ALTER DATABASE dbname SET READ_WRITE
> HTH,
> Paul Ibison
>
|||Your files are probably in 'Read Only' mode before you
even restore the database (Usually if it was taken out of
the CD). Change the file properties first by checking OFF
the 'read-only' option before restoring the
database......
'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
error is stating that the server you are restoring it to
does not have that path (It is the old server's path).
Change that in the 'Options'--> 'Restore AS' part.
>--Original Message--
>Paul:
>Thanks for the reply.
>Running this command returns the following errors:
>Server: Msg 5105, Level 16, State 4, Line 1
>Device activation error. The physical file name
>'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>There are 2 primary files, along with a single log file.
Ive confirmed their
>locations and all hae their read/write attributes set
properly. The only
>other thing I can think of is permissions, which should
happen because I am
>logged into QA and EM as sa.
>Any other thoughts?
>
>
>"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
>news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
>
>.
>
|||Jack:
I'm doing an attach from the MDF, NDF, and LDF files. I'm not restoring from
a backup.
"Jack" <anonymous@.discussions.microsoft.com> wrote in message
news:16aec01c44812$477d4620$a501280a@.phx.gbl...[vbcol=seagreen]
> Your files are probably in 'Read Only' mode before you
> even restore the database (Usually if it was taken out of
> the CD). Change the file properties first by checking OFF
> the 'read-only' option before restoring the
> database......
> 'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
> error is stating that the server you are restoring it to
> does not have that path (It is the old server's path).
> Change that in the 'Options'--> 'Restore AS' part.
>
> Ive confirmed their
> properly. The only
> happen because I am
|||Check those MDF, NDF and LDF files by right clicking on
them and choosing Properties -- General tab. See if
the 'Read Only' attribute is checked ON. If it is, check
it OFF , then restore the database........
>--Original Message--
>Jack:
>I'm doing an attach from the MDF, NDF, and LDF files. I'm
not restoring from
>a backup.
>
>"Jack" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:16aec01c44812$477d4620$a501280a@.phx.gbl...
of[vbcol=seagreen]
OFF[vbcol=seagreen]
file.[vbcol=seagreen]
message
>
>.
>
|||I see what you mean now.....
Maybe the database was in a 'Read Only' status at the time
it was detached ?
>--Original Message--
>Jack:
>I'm doing an attach from the MDF, NDF, and LDF files. I'm
not restoring from
>a backup.
>
>"Jack" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:16aec01c44812$477d4620$a501280a@.phx.gbl...
of[vbcol=seagreen]
OFF[vbcol=seagreen]
file.[vbcol=seagreen]
message
>
>.
>
Changing database status from Read Only
Ive attached a database from 2 MDF files I copied from a production
database. The attach works fine, except it always attaches in Read Only
mode.
I notice when attaching that, despite me specifying sa as the database
owner, it always makes my domain account the database owner. When I try to
make the owner sa using sp_changedbowner, I get error messages about the
database read only.
How can I make the database turn back to normal status?
ThanksElliot,
try ALTER DATABASE dbname SET READ_WRITE
HTH,
Paul Ibison|||Paul:
Thanks for the reply.
Running this command returns the following errors:
Server: Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name
'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
There are 2 primary files, along with a single log file. Ive confirmed their
locations and all hae their read/write attributes set properly. The only
other thing I can think of is permissions, which should happen because I am
logged into QA and EM as sa.
Any other thoughts?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
> Elliot,
> try ALTER DATABASE dbname SET READ_WRITE
> HTH,
> Paul Ibison
>|||Your files are probably in 'Read Only' mode before you
even restore the database (Usually if it was taken out of
the CD). Change the file properties first by checking OFF
the 'read-only' option before restoring the
database......
'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
error is stating that the server you are restoring it to
does not have that path (It is the old server's path).
Change that in the 'Options'--> 'Restore AS' part.
>--Original Message--
>Paul:
>Thanks for the reply.
>Running this command returns the following errors:
>Server: Msg 5105, Level 16, State 4, Line 1
>Device activation error. The physical file name
>'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>There are 2 primary files, along with a single log file.
Ive confirmed their
>locations and all hae their read/write attributes set
properly. The only
>other thing I can think of is permissions, which should
happen because I am
>logged into QA and EM as sa.
>Any other thoughts?
>
>
>"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
>news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
>
>.
>|||Jack:
I'm doing an attach from the MDF, NDF, and LDF files. I'm not restoring from
a backup.
"Jack" <anonymous@.discussions.microsoft.com> wrote in message
news:16aec01c44812$477d4620$a501280a@.phx
.gbl...[vbcol=seagreen]
> Your files are probably in 'Read Only' mode before you
> even restore the database (Usually if it was taken out of
> the CD). Change the file properties first by checking OFF
> the 'read-only' option before restoring the
> database......
> 'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
> error is stating that the server you are restoring it to
> does not have that path (It is the old server's path).
> Change that in the 'Options'--> 'Restore AS' part.
>
>
> Ive confirmed their
> properly. The only
> happen because I am|||Check those MDF, NDF and LDF files by right clicking on
them and choosing Properties -- General tab. See if
the 'Read Only' attribute is checked ON. If it is, check
it OFF , then restore the database........
>--Original Message--
>Jack:
>I'm doing an attach from the MDF, NDF, and LDF files. I'm
not restoring from
>a backup.
>
>"Jack" <anonymous@.discussions.microsoft.com> wrote in
message
> news:16aec01c44812$477d4620$a501280a@.phx
.gbl...
of[vbcol=seagreen]
OFF[vbcol=seagreen]
file.[vbcol=seagreen]
message[vbcol=seagreen]
>
>.
>|||I see what you mean now.....
Maybe the database was in a 'Read Only' status at the time
it was detached ?
>--Original Message--
>Jack:
>I'm doing an attach from the MDF, NDF, and LDF files. I'm
not restoring from
>a backup.
>
>"Jack" <anonymous@.discussions.microsoft.com> wrote in
message
> news:16aec01c44812$477d4620$a501280a@.phx
.gbl...
of[vbcol=seagreen]
OFF[vbcol=seagreen]
file.[vbcol=seagreen]
message[vbcol=seagreen]
>
>.
>
database. The attach works fine, except it always attaches in Read Only
mode.
I notice when attaching that, despite me specifying sa as the database
owner, it always makes my domain account the database owner. When I try to
make the owner sa using sp_changedbowner, I get error messages about the
database read only.
How can I make the database turn back to normal status?
ThanksElliot,
try ALTER DATABASE dbname SET READ_WRITE
HTH,
Paul Ibison|||Paul:
Thanks for the reply.
Running this command returns the following errors:
Server: Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name
'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
There are 2 primary files, along with a single log file. Ive confirmed their
locations and all hae their read/write attributes set properly. The only
other thing I can think of is permissions, which should happen because I am
logged into QA and EM as sa.
Any other thoughts?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
> Elliot,
> try ALTER DATABASE dbname SET READ_WRITE
> HTH,
> Paul Ibison
>|||Your files are probably in 'Read Only' mode before you
even restore the database (Usually if it was taken out of
the CD). Change the file properties first by checking OFF
the 'read-only' option before restoring the
database......
'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
error is stating that the server you are restoring it to
does not have that path (It is the old server's path).
Change that in the 'Options'--> 'Restore AS' part.
>--Original Message--
>Paul:
>Thanks for the reply.
>Running this command returns the following errors:
>Server: Msg 5105, Level 16, State 4, Line 1
>Device activation error. The physical file name
>'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>There are 2 primary files, along with a single log file.
Ive confirmed their
>locations and all hae their read/write attributes set
properly. The only
>other thing I can think of is permissions, which should
happen because I am
>logged into QA and EM as sa.
>Any other thoughts?
>
>
>"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
>news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
>
>.
>|||Jack:
I'm doing an attach from the MDF, NDF, and LDF files. I'm not restoring from
a backup.
"Jack" <anonymous@.discussions.microsoft.com> wrote in message
news:16aec01c44812$477d4620$a501280a@.phx
.gbl...[vbcol=seagreen]
> Your files are probably in 'Read Only' mode before you
> even restore the database (Usually if it was taken out of
> the CD). Change the file properties first by checking OFF
> the 'read-only' option before restoring the
> database......
> 'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
> error is stating that the server you are restoring it to
> does not have that path (It is the old server's path).
> Change that in the 'Options'--> 'Restore AS' part.
>
>
> Ive confirmed their
> properly. The only
> happen because I am|||Check those MDF, NDF and LDF files by right clicking on
them and choosing Properties -- General tab. See if
the 'Read Only' attribute is checked ON. If it is, check
it OFF , then restore the database........
>--Original Message--
>Jack:
>I'm doing an attach from the MDF, NDF, and LDF files. I'm
not restoring from
>a backup.
>
>"Jack" <anonymous@.discussions.microsoft.com> wrote in
message
> news:16aec01c44812$477d4620$a501280a@.phx
.gbl...
of[vbcol=seagreen]
OFF[vbcol=seagreen]
file.[vbcol=seagreen]
message[vbcol=seagreen]
>
>.
>|||I see what you mean now.....
Maybe the database was in a 'Read Only' status at the time
it was detached ?
>--Original Message--
>Jack:
>I'm doing an attach from the MDF, NDF, and LDF files. I'm
not restoring from
>a backup.
>
>"Jack" <anonymous@.discussions.microsoft.com> wrote in
message
> news:16aec01c44812$477d4620$a501280a@.phx
.gbl...
of[vbcol=seagreen]
OFF[vbcol=seagreen]
file.[vbcol=seagreen]
message[vbcol=seagreen]
>
>.
>
Changing database status from Read Only
Ive attached a database from 2 MDF files I copied from a production
database. The attach works fine, except it always attaches in Read Only
mode.
I notice when attaching that, despite me specifying sa as the database
owner, it always makes my domain account the database owner. When I try to
make the owner sa using sp_changedbowner, I get error messages about the
database read only.
How can I make the database turn back to normal status?
ThanksElliot,
try ALTER DATABASE dbname SET READ_WRITE
HTH,
Paul Ibison|||Paul:
Thanks for the reply.
Running this command returns the following errors:
Server: Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name
'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
There are 2 primary files, along with a single log file. Ive confirmed their
locations and all hae their read/write attributes set properly. The only
other thing I can think of is permissions, which should happen because I am
logged into QA and EM as sa.
Any other thoughts?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
> Elliot,
> try ALTER DATABASE dbname SET READ_WRITE
> HTH,
> Paul Ibison
>|||Your files are probably in 'Read Only' mode before you
even restore the database (Usually if it was taken out of
the CD). Change the file properties first by checking OFF
the 'read-only' option before restoring the
database......
'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
error is stating that the server you are restoring it to
does not have that path (It is the old server's path).
Change that in the 'Options'--> 'Restore AS' part.
>--Original Message--
>Paul:
>Thanks for the reply.
>Running this command returns the following errors:
>Server: Msg 5105, Level 16, State 4, Line 1
>Device activation error. The physical file name
>'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>There are 2 primary files, along with a single log file.
Ive confirmed their
>locations and all hae their read/write attributes set
properly. The only
>other thing I can think of is permissions, which should
happen because I am
>logged into QA and EM as sa.
>Any other thoughts?
>
>
>"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
>news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
>> Elliot,
>> try ALTER DATABASE dbname SET READ_WRITE
>> HTH,
>> Paul Ibison
>>
>
>.
>|||Jack:
I'm doing an attach from the MDF, NDF, and LDF files. I'm not restoring from
a backup.
"Jack" <anonymous@.discussions.microsoft.com> wrote in message
news:16aec01c44812$477d4620$a501280a@.phx.gbl...
> Your files are probably in 'Read Only' mode before you
> even restore the database (Usually if it was taken out of
> the CD). Change the file properties first by checking OFF
> the 'read-only' option before restoring the
> database......
> 'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
> error is stating that the server you are restoring it to
> does not have that path (It is the old server's path).
> Change that in the 'Options'--> 'Restore AS' part.
>
> >--Original Message--
> >Paul:
> >
> >Thanks for the reply.
> >
> >Running this command returns the following errors:
> >Server: Msg 5105, Level 16, State 4, Line 1
> >Device activation error. The physical file name
> >'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
> >
> >There are 2 primary files, along with a single log file.
> Ive confirmed their
> >locations and all hae their read/write attributes set
> properly. The only
> >other thing I can think of is permissions, which should
> happen because I am
> >logged into QA and EM as sa.
> >
> >Any other thoughts?
> >
> >
> >
> >
> >"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
> >news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
> >> Elliot,
> >> try ALTER DATABASE dbname SET READ_WRITE
> >> HTH,
> >> Paul Ibison
> >>
> >>
> >
> >
> >.
> >|||Check those MDF, NDF and LDF files by right clicking on
them and choosing Properties -- General tab. See if
the 'Read Only' attribute is checked ON. If it is, check
it OFF , then restore the database........
>--Original Message--
>Jack:
>I'm doing an attach from the MDF, NDF, and LDF files. I'm
not restoring from
>a backup.
>
>"Jack" <anonymous@.discussions.microsoft.com> wrote in
message
>news:16aec01c44812$477d4620$a501280a@.phx.gbl...
>> Your files are probably in 'Read Only' mode before you
>> even restore the database (Usually if it was taken out
of
>> the CD). Change the file properties first by checking
OFF
>> the 'read-only' option before restoring the
>> database......
>> 'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>> error is stating that the server you are restoring it to
>> does not have that path (It is the old server's path).
>> Change that in the 'Options'--> 'Restore AS' part.
>>
>> >--Original Message--
>> >Paul:
>> >
>> >Thanks for the reply.
>> >
>> >Running this command returns the following errors:
>> >Server: Msg 5105, Level 16, State 4, Line 1
>> >Device activation error. The physical file name
>> >'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>> >
>> >There are 2 primary files, along with a single log
file.
>> Ive confirmed their
>> >locations and all hae their read/write attributes set
>> properly. The only
>> >other thing I can think of is permissions, which should
>> happen because I am
>> >logged into QA and EM as sa.
>> >
>> >Any other thoughts?
>> >
>> >
>> >
>> >
>> >"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in
message
>> >news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
>> >> Elliot,
>> >> try ALTER DATABASE dbname SET READ_WRITE
>> >> HTH,
>> >> Paul Ibison
>> >>
>> >>
>> >
>> >
>> >.
>> >
>
>.
>|||I see what you mean now.....
Maybe the database was in a 'Read Only' status at the time
it was detached ?
>--Original Message--
>Jack:
>I'm doing an attach from the MDF, NDF, and LDF files. I'm
not restoring from
>a backup.
>
>"Jack" <anonymous@.discussions.microsoft.com> wrote in
message
>news:16aec01c44812$477d4620$a501280a@.phx.gbl...
>> Your files are probably in 'Read Only' mode before you
>> even restore the database (Usually if it was taken out
of
>> the CD). Change the file properties first by checking
OFF
>> the 'read-only' option before restoring the
>> database......
>> 'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>> error is stating that the server you are restoring it to
>> does not have that path (It is the old server's path).
>> Change that in the 'Options'--> 'Restore AS' part.
>>
>> >--Original Message--
>> >Paul:
>> >
>> >Thanks for the reply.
>> >
>> >Running this command returns the following errors:
>> >Server: Msg 5105, Level 16, State 4, Line 1
>> >Device activation error. The physical file name
>> >'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>> >
>> >There are 2 primary files, along with a single log
file.
>> Ive confirmed their
>> >locations and all hae their read/write attributes set
>> properly. The only
>> >other thing I can think of is permissions, which should
>> happen because I am
>> >logged into QA and EM as sa.
>> >
>> >Any other thoughts?
>> >
>> >
>> >
>> >
>> >"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in
message
>> >news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
>> >> Elliot,
>> >> try ALTER DATABASE dbname SET READ_WRITE
>> >> HTH,
>> >> Paul Ibison
>> >>
>> >>
>> >
>> >
>> >.
>> >
>
>.
>
database. The attach works fine, except it always attaches in Read Only
mode.
I notice when attaching that, despite me specifying sa as the database
owner, it always makes my domain account the database owner. When I try to
make the owner sa using sp_changedbowner, I get error messages about the
database read only.
How can I make the database turn back to normal status?
ThanksElliot,
try ALTER DATABASE dbname SET READ_WRITE
HTH,
Paul Ibison|||Paul:
Thanks for the reply.
Running this command returns the following errors:
Server: Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name
'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
There are 2 primary files, along with a single log file. Ive confirmed their
locations and all hae their read/write attributes set properly. The only
other thing I can think of is permissions, which should happen because I am
logged into QA and EM as sa.
Any other thoughts?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
> Elliot,
> try ALTER DATABASE dbname SET READ_WRITE
> HTH,
> Paul Ibison
>|||Your files are probably in 'Read Only' mode before you
even restore the database (Usually if it was taken out of
the CD). Change the file properties first by checking OFF
the 'read-only' option before restoring the
database......
'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
error is stating that the server you are restoring it to
does not have that path (It is the old server's path).
Change that in the 'Options'--> 'Restore AS' part.
>--Original Message--
>Paul:
>Thanks for the reply.
>Running this command returns the following errors:
>Server: Msg 5105, Level 16, State 4, Line 1
>Device activation error. The physical file name
>'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>There are 2 primary files, along with a single log file.
Ive confirmed their
>locations and all hae their read/write attributes set
properly. The only
>other thing I can think of is permissions, which should
happen because I am
>logged into QA and EM as sa.
>Any other thoughts?
>
>
>"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
>news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
>> Elliot,
>> try ALTER DATABASE dbname SET READ_WRITE
>> HTH,
>> Paul Ibison
>>
>
>.
>|||Jack:
I'm doing an attach from the MDF, NDF, and LDF files. I'm not restoring from
a backup.
"Jack" <anonymous@.discussions.microsoft.com> wrote in message
news:16aec01c44812$477d4620$a501280a@.phx.gbl...
> Your files are probably in 'Read Only' mode before you
> even restore the database (Usually if it was taken out of
> the CD). Change the file properties first by checking OFF
> the 'read-only' option before restoring the
> database......
> 'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
> error is stating that the server you are restoring it to
> does not have that path (It is the old server's path).
> Change that in the 'Options'--> 'Restore AS' part.
>
> >--Original Message--
> >Paul:
> >
> >Thanks for the reply.
> >
> >Running this command returns the following errors:
> >Server: Msg 5105, Level 16, State 4, Line 1
> >Device activation error. The physical file name
> >'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
> >
> >There are 2 primary files, along with a single log file.
> Ive confirmed their
> >locations and all hae their read/write attributes set
> properly. The only
> >other thing I can think of is permissions, which should
> happen because I am
> >logged into QA and EM as sa.
> >
> >Any other thoughts?
> >
> >
> >
> >
> >"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
> >news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
> >> Elliot,
> >> try ALTER DATABASE dbname SET READ_WRITE
> >> HTH,
> >> Paul Ibison
> >>
> >>
> >
> >
> >.
> >|||Check those MDF, NDF and LDF files by right clicking on
them and choosing Properties -- General tab. See if
the 'Read Only' attribute is checked ON. If it is, check
it OFF , then restore the database........
>--Original Message--
>Jack:
>I'm doing an attach from the MDF, NDF, and LDF files. I'm
not restoring from
>a backup.
>
>"Jack" <anonymous@.discussions.microsoft.com> wrote in
message
>news:16aec01c44812$477d4620$a501280a@.phx.gbl...
>> Your files are probably in 'Read Only' mode before you
>> even restore the database (Usually if it was taken out
of
>> the CD). Change the file properties first by checking
OFF
>> the 'read-only' option before restoring the
>> database......
>> 'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>> error is stating that the server you are restoring it to
>> does not have that path (It is the old server's path).
>> Change that in the 'Options'--> 'Restore AS' part.
>>
>> >--Original Message--
>> >Paul:
>> >
>> >Thanks for the reply.
>> >
>> >Running this command returns the following errors:
>> >Server: Msg 5105, Level 16, State 4, Line 1
>> >Device activation error. The physical file name
>> >'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>> >
>> >There are 2 primary files, along with a single log
file.
>> Ive confirmed their
>> >locations and all hae their read/write attributes set
>> properly. The only
>> >other thing I can think of is permissions, which should
>> happen because I am
>> >logged into QA and EM as sa.
>> >
>> >Any other thoughts?
>> >
>> >
>> >
>> >
>> >"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in
message
>> >news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
>> >> Elliot,
>> >> try ALTER DATABASE dbname SET READ_WRITE
>> >> HTH,
>> >> Paul Ibison
>> >>
>> >>
>> >
>> >
>> >.
>> >
>
>.
>|||I see what you mean now.....
Maybe the database was in a 'Read Only' status at the time
it was detached ?
>--Original Message--
>Jack:
>I'm doing an attach from the MDF, NDF, and LDF files. I'm
not restoring from
>a backup.
>
>"Jack" <anonymous@.discussions.microsoft.com> wrote in
message
>news:16aec01c44812$477d4620$a501280a@.phx.gbl...
>> Your files are probably in 'Read Only' mode before you
>> even restore the database (Usually if it was taken out
of
>> the CD). Change the file properties first by checking
OFF
>> the 'read-only' option before restoring the
>> database......
>> 'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>> error is stating that the server you are restoring it to
>> does not have that path (It is the old server's path).
>> Change that in the 'Options'--> 'Restore AS' part.
>>
>> >--Original Message--
>> >Paul:
>> >
>> >Thanks for the reply.
>> >
>> >Running this command returns the following errors:
>> >Server: Msg 5105, Level 16, State 4, Line 1
>> >Device activation error. The physical file name
>> >'F:\sqldata\DOCUMENTS_Data.MDF' may be incorrect.
>> >
>> >There are 2 primary files, along with a single log
file.
>> Ive confirmed their
>> >locations and all hae their read/write attributes set
>> properly. The only
>> >other thing I can think of is permissions, which should
>> happen because I am
>> >logged into QA and EM as sa.
>> >
>> >Any other thoughts?
>> >
>> >
>> >
>> >
>> >"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in
message
>> >news:%23tRADqASEHA.3016@.tk2msftngp13.phx.gbl...
>> >> Elliot,
>> >> try ALTER DATABASE dbname SET READ_WRITE
>> >> HTH,
>> >> Paul Ibison
>> >>
>> >>
>> >
>> >
>> >.
>> >
>
>.
>
Subscribe to:
Posts (Atom)