Unix Technical Forum

SQL server - 'cold' database clone, was this ok?

This is a discussion on SQL server - 'cold' database clone, was this ok? within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi I was in the situation of cloning a SQL server database last night. Today, a dependent application was ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 08:45 AM
andyjgw@gmail.com
 
Posts: n/a
Default SQL server - 'cold' database clone, was this ok?

Hi

I was in the situation of cloning a SQL server database last night.
Today, a dependent application was behaving a little erratically though
most things were fine after sorting out some ntfs permissions. I've
recovered this database from backup exec before from a hot-backup, this
is the first time I've attempted this procedure though.

Could I check with the experts here as to whether what I did was OK?
Been googling to see if it is really the right thing to do, haven't
come up with anything definitive...

Assume server SOURCE and DEST:

install DEST to same specification, OS, SQL patch level as SOURCE. Same
paths where applicable.

shut down SQL server on both

Copy all datafile folder (d:\sqldata) which is the full database
including MASTER etc all over to DEST.

Shut SOURCE down.

Rename DEST to SOURCE, disable SQL server starting, set network
settings to those of SOURCE and reboot.

Wait for things to settle after reboot and name change, bring SQL
database up.

Client application now connects, I can't see any problems, but there
have been some strange anomalies in satellite applications today. All
have been bounced to see if it's just a change they needed to notice,
to no avail.

Was that an OK operation to have done, or is there something just about
to bite me when I'm not looking?

Be grateful for any advice, I spent today pulling a lot of hair out.

Thanks in advance

AW

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 08:46 AM
Erland Sommarskog
 
Posts: n/a
Default Re: SQL server - 'cold' database clone, was this ok?

(andyjgw@gmail.com) writes:
> Client application now connects, I can't see any problems, but there
> have been some strange anomalies in satellite applications today. All
> have been bounced to see if it's just a change they needed to notice,
> to no avail.
>
> Was that an OK operation to have done, or is there something just about
> to bite me when I'm not looking?


This might not really the right way to do it. Then again it sounds
sound to me. Without knowing about the anomalies, it's difficult to
say what might be wrong.

One thing to check though is @@servername. If it's wrong, drop the
name with sp_dropserver. If NULL, add it with sp_addserver with the
"local" parameter. See Books Online for details.

This KB article may be helpful:
http://support.microsoft.com/default...b;EN-US;224071
(although you probably should have seen it earlier!)


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 08:46 AM
andyjgw@gmail.com
 
Posts: n/a
Default Re: SQL server - 'cold' database clone, was this ok?

Thanks for that Erland.

@@servername is fine, though I'd suspect it may be dynamic enough to
query the machine rather than a value stored in the DB somewhere?

I had seen that page, but detaching/re-attaching databases was
something I had decided against as I would have had to follow the
procedures for exporting/recreating all the user accounts (among other
things). With my (ssshhh!) Oracle hat on, this is a perfectly OK
procedure and I must confess that is what drove me to take this
solution.

Things seem a little more stable today, save for one application which
is still odd. I'm in the process of installing it clean to a virtual
server to see if I can isolate the problem.

Thanks for the advice.

AW

Erland Sommarskog wrote:
> (andyjgw@gmail.com) writes:
> > Client application now connects, I can't see any problems, but there
> > have been some strange anomalies in satellite applications today. All
> > have been bounced to see if it's just a change they needed to notice,
> > to no avail.
> >
> > Was that an OK operation to have done, or is there something just about
> > to bite me when I'm not looking?

>
> This might not really the right way to do it. Then again it sounds
> sound to me. Without knowing about the anomalies, it's difficult to
> say what might be wrong.
>
> One thing to check though is @@servername. If it's wrong, drop the
> name with sp_dropserver. If NULL, add it with sp_addserver with the
> "local" parameter. See Books Online for details.
>
> This KB article may be helpful:
> http://support.microsoft.com/default...b;EN-US;224071
> (although you probably should have seen it earlier!)
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
>
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techinf...2000/books.asp


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-29-2008, 08:48 AM
Erland Sommarskog
 
Posts: n/a
Default Re: SQL server - 'cold' database clone, was this ok?

(andyjgw@gmail.com) writes:
> @@servername is fine, though I'd suspect it may be dynamic enough to
> query the machine rather than a value stored in the DB somewhere?


No, I think it digs it out of the registry at startup. It's not
an uncommon problem that @@servername gets messed up, if you rename
the Windows name, or move the installation from one box to another
box with a different name.

Also, reading it from Windows wouldn't do on a cluster, and then you
have named instances where the servername is XXX\INSTANCE_NAME.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:21 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com