Monday, March 26, 2012

RESTORE DATABASE question

Hello,
I ran the script bellow, then the statsales datbase log and data
"logical" file names changed to those of the database
'statsales_staging_victory_full' which I restored from as shown in the
script bellow.
The questions are:
Do I have one chared log file now, for both statsales and
statsales_staging ?
Will this hurt or confuse anything on the server?
How can I change those names back to there original names?
Thanks for any help.
mFH
================================================================== USE master
RESTORE DATABASE statsales
FROM DISK = 'E:\backup\statsales_staging_victory_full'
WITH REPLACE ,
MOVE 'statsales_staging_dat' TO 'G:\statsales\statsales_Data.MDF',
MOVE 'statsales_staging_log' TO 'D:\statsales_Log\statsales.LDF'
GO
==================================================================They don't share a log. I think you are ok. The boundry on the logical
name for database devices (bad memories) is the database.
Christian Smith
"shaab mohagir" <shaab.mohagir@.bonbon.net> wrote in message
news:e1b3da1b.0402121213.3b0d353d@.posting.google.com...
> Hello,
> I ran the script bellow, then the statsales datbase log and data
> "logical" file names changed to those of the database
> 'statsales_staging_victory_full' which I restored from as shown in the
> script bellow.
> The questions are:
> Do I have one chared log file now, for both statsales and
> statsales_staging ?
> Will this hurt or confuse anything on the server?
> How can I change those names back to there original names?
> Thanks for any help.
> mFH
> ==================================================================> USE master
> RESTORE DATABASE statsales
> FROM DISK = 'E:\backup\statsales_staging_victory_full'
> WITH REPLACE ,
> MOVE 'statsales_staging_dat' TO 'G:\statsales\statsales_Data.MDF',
> MOVE 'statsales_staging_log' TO 'D:\statsales_Log\statsales.LDF'
> GO
> ==================================================================|||Correct, Christian.
It might also be worth mentioning that in SQL2K, you can rename the logical
filename using ALTER DATABASE.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Christian Smith" <csmith@.digex.com> wrote in message
news:u9Govfa8DHA.2168@.TK2MSFTNGP12.phx.gbl...
> They don't share a log. I think you are ok. The boundry on the logical
> name for database devices (bad memories) is the database.
> Christian Smith
> "shaab mohagir" <shaab.mohagir@.bonbon.net> wrote in message
> news:e1b3da1b.0402121213.3b0d353d@.posting.google.com...
> > Hello,
> >
> > I ran the script bellow, then the statsales datbase log and data
> > "logical" file names changed to those of the database
> > 'statsales_staging_victory_full' which I restored from as shown in the
> > script bellow.
> >
> > The questions are:
> >
> > Do I have one chared log file now, for both statsales and
> > statsales_staging ?
> > Will this hurt or confuse anything on the server?
> > How can I change those names back to there original names?
> >
> > Thanks for any help.
> >
> > mFH
> >
> > ==================================================================> > USE master
> > RESTORE DATABASE statsales
> > FROM DISK = 'E:\backup\statsales_staging_victory_full'
> > WITH REPLACE ,
> > MOVE 'statsales_staging_dat' TO 'G:\statsales\statsales_Data.MDF',
> > MOVE 'statsales_staging_log' TO 'D:\statsales_Log\statsales.LDF'
> >
> > GO
> > ==================================================================>|||Thanks Christian and Thanks Tibor...
I'll see how can I change the log names using ALTER DATABASE, I hope
it's something I can do.
Thanks again.
mfharraz
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message news:<eQvgLra8DHA.1428@.TK2MSFTNGP12.phx.gbl>...
> Correct, Christian.
> It might also be worth mentioning that in SQL2K, you can rename the logical
> filename using ALTER DATABASE.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
> http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "Christian Smith" <csmith@.digex.com> wrote in message
> news:u9Govfa8DHA.2168@.TK2MSFTNGP12.phx.gbl...
> > They don't share a log. I think you are ok. The boundry on the logical
> > name for database devices (bad memories) is the database.
> >
> > Christian Smith
> >
> > "shaab mohagir" <shaab.mohagir@.bonbon.net> wrote in message
> > news:e1b3da1b.0402121213.3b0d353d@.posting.google.com...
> > > Hello,
> > >
> > > I ran the script bellow, then the statsales datbase log and data
> > > "logical" file names changed to those of the database
> > > 'statsales_staging_victory_full' which I restored from as shown in the
> > > script bellow.
> > >
> > > The questions are:
> > >
> > > Do I have one chared log file now, for both statsales and
> > > statsales_staging ?
> > > Will this hurt or confuse anything on the server?
> > > How can I change those names back to there original names?
> > >
> > > Thanks for any help.
> > >
> > > mFH
> > >
> > > ==================================================================> > > USE master
> > > RESTORE DATABASE statsales
> > > FROM DISK = 'E:\backup\statsales_staging_victory_full'
> > > WITH REPLACE ,
> > > MOVE 'statsales_staging_dat' TO 'G:\statsales\statsales_Data.MDF',
> > > MOVE 'statsales_staging_log' TO 'D:\statsales_Log\statsales.LDF'
> > >
> > > GO
> > > ==================================================================> >
> >

No comments:

Post a Comment