People,
I need some direction on how to duplicate a database (name: Fod) to another
database on the same server named FodTrain that not only has Fods data but
also the sprocs and ect. This needs to take place on a weekly basis.
Hi Joseph
If can afford any downtime of the Fod database, use sp_detach_db, copy the
files, and use sp_attach_db command specifying new filenames. Please see BOL
for details. If you can't afford downtime, backup the database, and restore
to a new name using the MOVE option. Again, see BOL for full syntax details.
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"Joseph" <Joseph@.discussions.microsoft.com> wrote in message
news:A011179E-4B25-46CC-AF57-E8686DBA56C4@.microsoft.com...
> People,
> I need some direction on how to duplicate a database (name: Fod) to
> another
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>
|||One method is with backup/restore. For example:
BACKUP DATABASE Fod
TO DISK = 'C;\Backups\Fod.bak'
WITH
INIT,
STATS=10
GO
RESTORE DATABASE CopyOfFod
FROM DISK = 'C;\Backups\Fod.bak'
WITH
MOVE 'Fod' TO 'E:\DataFiles\CopyOfMyDatabase.mdf'',
MOVE 'Fod_Log' TO 'F:\LogFiles\CopyOfFod_Log.ldf'',
STATS=10
GO
Note that you may need to change the logical file names ('Fod' and
'Fod_Log') in the RESTORE command to match the actual logical file names of
the source database. After the restore, you can change the logical file
names with ALTER DATABASE to be tidy:
ALTER DATABASE CopyOfFod
MODIFY FILE(NAME='Fod', NEWNAME='CopyOfFod')
ALTER DATABASE CopyOfFod
MODIFY FILE(NAME='Fod_Log', NEWNAME='CopyOfFod_Log')
Hope this helps.
Dan Guzman
SQL Server MVP
"Joseph" <Joseph@.discussions.microsoft.com> wrote in message
news:A011179E-4B25-46CC-AF57-E8686DBA56C4@.microsoft.com...
> People,
> I need some direction on how to duplicate a database (name: Fod) to
> another
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>
|||You can also use DTS to copy objects.
"Joseph" wrote:
> People,
> I need some direction on how to duplicate a database (name: Fod) to another
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>
Showing posts with label direction. Show all posts
Showing posts with label direction. Show all posts
Monday, March 19, 2012
Database duplication
Database duplication
People,
I need some direction on how to duplicate a database (name: Fod) to another
database on the same server named FodTrain that not only has Fods data but
also the sprocs and ect. This needs to take place on a weekly basis.Hi Joseph
If can afford any downtime of the Fod database, use sp_detach_db, copy the
files, and use sp_attach_db command specifying new filenames. Please see BOL
for details. If you can't afford downtime, backup the database, and restore
to a new name using the MOVE option. Again, see BOL for full syntax details.
--
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"Joseph" <Joseph@.discussions.microsoft.com> wrote in message
news:A011179E-4B25-46CC-AF57-E8686DBA56C4@.microsoft.com...
> People,
> I need some direction on how to duplicate a database (name: Fod) to
> another
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>|||One method is with backup/restore. For example:
BACKUP DATABASE Fod
TO DISK = 'C;\Backups\Fod.bak'
WITH
INIT,
STATS=10
GO
RESTORE DATABASE CopyOfFod
FROM DISK = 'C;\Backups\Fod.bak'
WITH
MOVE 'Fod' TO 'E:\DataFiles\CopyOfMyDatabase.mdf'',
MOVE 'Fod_Log' TO 'F:\LogFiles\CopyOfFod_Log.ldf'',
STATS=10
GO
Note that you may need to change the logical file names ('Fod' and
'Fod_Log') in the RESTORE command to match the actual logical file names of
the source database. After the restore, you can change the logical file
names with ALTER DATABASE to be tidy:
ALTER DATABASE CopyOfFod
MODIFY FILE(NAME='Fod', NEWNAME='CopyOfFod')
ALTER DATABASE CopyOfFod
MODIFY FILE(NAME='Fod_Log', NEWNAME='CopyOfFod_Log')
Hope this helps.
Dan Guzman
SQL Server MVP
"Joseph" <Joseph@.discussions.microsoft.com> wrote in message
news:A011179E-4B25-46CC-AF57-E8686DBA56C4@.microsoft.com...
> People,
> I need some direction on how to duplicate a database (name: Fod) to
> another
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>|||You can also use DTS to copy objects.
"Joseph" wrote:
> People,
> I need some direction on how to duplicate a database (name: Fod) to anothe
r
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>
I need some direction on how to duplicate a database (name: Fod) to another
database on the same server named FodTrain that not only has Fods data but
also the sprocs and ect. This needs to take place on a weekly basis.Hi Joseph
If can afford any downtime of the Fod database, use sp_detach_db, copy the
files, and use sp_attach_db command specifying new filenames. Please see BOL
for details. If you can't afford downtime, backup the database, and restore
to a new name using the MOVE option. Again, see BOL for full syntax details.
--
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"Joseph" <Joseph@.discussions.microsoft.com> wrote in message
news:A011179E-4B25-46CC-AF57-E8686DBA56C4@.microsoft.com...
> People,
> I need some direction on how to duplicate a database (name: Fod) to
> another
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>|||One method is with backup/restore. For example:
BACKUP DATABASE Fod
TO DISK = 'C;\Backups\Fod.bak'
WITH
INIT,
STATS=10
GO
RESTORE DATABASE CopyOfFod
FROM DISK = 'C;\Backups\Fod.bak'
WITH
MOVE 'Fod' TO 'E:\DataFiles\CopyOfMyDatabase.mdf'',
MOVE 'Fod_Log' TO 'F:\LogFiles\CopyOfFod_Log.ldf'',
STATS=10
GO
Note that you may need to change the logical file names ('Fod' and
'Fod_Log') in the RESTORE command to match the actual logical file names of
the source database. After the restore, you can change the logical file
names with ALTER DATABASE to be tidy:
ALTER DATABASE CopyOfFod
MODIFY FILE(NAME='Fod', NEWNAME='CopyOfFod')
ALTER DATABASE CopyOfFod
MODIFY FILE(NAME='Fod_Log', NEWNAME='CopyOfFod_Log')
Hope this helps.
Dan Guzman
SQL Server MVP
"Joseph" <Joseph@.discussions.microsoft.com> wrote in message
news:A011179E-4B25-46CC-AF57-E8686DBA56C4@.microsoft.com...
> People,
> I need some direction on how to duplicate a database (name: Fod) to
> another
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>|||You can also use DTS to copy objects.
"Joseph" wrote:
> People,
> I need some direction on how to duplicate a database (name: Fod) to anothe
r
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>
Database duplication
People,
I need some direction on how to duplicate a database (name: Fod) to another
database on the same server named FodTrain that not only has Fods data but
also the sprocs and ect. This needs to take place on a weekly basis.Hi Joseph
If can afford any downtime of the Fod database, use sp_detach_db, copy the
files, and use sp_attach_db command specifying new filenames. Please see BOL
for details. If you can't afford downtime, backup the database, and restore
to a new name using the MOVE option. Again, see BOL for full syntax details.
--
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"Joseph" <Joseph@.discussions.microsoft.com> wrote in message
news:A011179E-4B25-46CC-AF57-E8686DBA56C4@.microsoft.com...
> People,
> I need some direction on how to duplicate a database (name: Fod) to
> another
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>|||One method is with backup/restore. For example:
BACKUP DATABASE Fod
TO DISK = 'C;\Backups\Fod.bak'
WITH
INIT,
STATS=10
GO
RESTORE DATABASE CopyOfFod
FROM DISK = 'C;\Backups\Fod.bak'
WITH
MOVE 'Fod' TO 'E:\DataFiles\CopyOfMyDatabase.mdf'',
MOVE 'Fod_Log' TO 'F:\LogFiles\CopyOfFod_Log.ldf'',
STATS=10
GO
Note that you may need to change the logical file names ('Fod' and
'Fod_Log') in the RESTORE command to match the actual logical file names of
the source database. After the restore, you can change the logical file
names with ALTER DATABASE to be tidy:
ALTER DATABASE CopyOfFod
MODIFY FILE(NAME='Fod', NEWNAME='CopyOfFod')
ALTER DATABASE CopyOfFod
MODIFY FILE(NAME='Fod_Log', NEWNAME='CopyOfFod_Log')
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Joseph" <Joseph@.discussions.microsoft.com> wrote in message
news:A011179E-4B25-46CC-AF57-E8686DBA56C4@.microsoft.com...
> People,
> I need some direction on how to duplicate a database (name: Fod) to
> another
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>|||You can also use DTS to copy objects.
"Joseph" wrote:
> People,
> I need some direction on how to duplicate a database (name: Fod) to another
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>
I need some direction on how to duplicate a database (name: Fod) to another
database on the same server named FodTrain that not only has Fods data but
also the sprocs and ect. This needs to take place on a weekly basis.Hi Joseph
If can afford any downtime of the Fod database, use sp_detach_db, copy the
files, and use sp_attach_db command specifying new filenames. Please see BOL
for details. If you can't afford downtime, backup the database, and restore
to a new name using the MOVE option. Again, see BOL for full syntax details.
--
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"Joseph" <Joseph@.discussions.microsoft.com> wrote in message
news:A011179E-4B25-46CC-AF57-E8686DBA56C4@.microsoft.com...
> People,
> I need some direction on how to duplicate a database (name: Fod) to
> another
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>|||One method is with backup/restore. For example:
BACKUP DATABASE Fod
TO DISK = 'C;\Backups\Fod.bak'
WITH
INIT,
STATS=10
GO
RESTORE DATABASE CopyOfFod
FROM DISK = 'C;\Backups\Fod.bak'
WITH
MOVE 'Fod' TO 'E:\DataFiles\CopyOfMyDatabase.mdf'',
MOVE 'Fod_Log' TO 'F:\LogFiles\CopyOfFod_Log.ldf'',
STATS=10
GO
Note that you may need to change the logical file names ('Fod' and
'Fod_Log') in the RESTORE command to match the actual logical file names of
the source database. After the restore, you can change the logical file
names with ALTER DATABASE to be tidy:
ALTER DATABASE CopyOfFod
MODIFY FILE(NAME='Fod', NEWNAME='CopyOfFod')
ALTER DATABASE CopyOfFod
MODIFY FILE(NAME='Fod_Log', NEWNAME='CopyOfFod_Log')
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Joseph" <Joseph@.discussions.microsoft.com> wrote in message
news:A011179E-4B25-46CC-AF57-E8686DBA56C4@.microsoft.com...
> People,
> I need some direction on how to duplicate a database (name: Fod) to
> another
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>|||You can also use DTS to copy objects.
"Joseph" wrote:
> People,
> I need some direction on how to duplicate a database (name: Fod) to another
> database on the same server named FodTrain that not only has Fods data but
> also the sprocs and ect. This needs to take place on a weekly basis.
>
Friday, February 24, 2012
Database design and development Best Pratice
Can anybody point me in the right direction on any resoures that may help us
towards drawing up a Best Practice document that developers can work towards
when develpoing DB's and subsequent applications.
See the below links:-
http://www.extremeexperts.com/sql/ar...Practices.aspx
http://www.sql-server-performance.co..._practices.asp
Thanks
Hari
SQl Server MVP
"simlr" <simlr@.discussions.microsoft.com> wrote in message
news:219CCD01-B653-4246-B20C-78D536BF4D3C@.microsoft.com...
> Can anybody point me in the right direction on any resoures that may help
> us
> towards drawing up a Best Practice document that developers can work
> towards
> when develpoing DB's and subsequent applications.
towards drawing up a Best Practice document that developers can work towards
when develpoing DB's and subsequent applications.
See the below links:-
http://www.extremeexperts.com/sql/ar...Practices.aspx
http://www.sql-server-performance.co..._practices.asp
Thanks
Hari
SQl Server MVP
"simlr" <simlr@.discussions.microsoft.com> wrote in message
news:219CCD01-B653-4246-B20C-78D536BF4D3C@.microsoft.com...
> Can anybody point me in the right direction on any resoures that may help
> us
> towards drawing up a Best Practice document that developers can work
> towards
> when develpoing DB's and subsequent applications.
Database design and development Best Pratice
Can anybody point me in the right direction on any resoures that may help us
towards drawing up a Best Practice document that developers can work towards
when develpoing DB's and subsequent applications.See the below links:-
http://www.extremeexperts.com/sql/a...tPractices.aspx
http://www.sql-server-performance.c...t_practices.asp
Thanks
Hari
SQl Server MVP
"simlr" <simlr@.discussions.microsoft.com> wrote in message
news:219CCD01-B653-4246-B20C-78D536BF4D3C@.microsoft.com...
> Can anybody point me in the right direction on any resoures that may help
> us
> towards drawing up a Best Practice document that developers can work
> towards
> when develpoing DB's and subsequent applications.
towards drawing up a Best Practice document that developers can work towards
when develpoing DB's and subsequent applications.See the below links:-
http://www.extremeexperts.com/sql/a...tPractices.aspx
http://www.sql-server-performance.c...t_practices.asp
Thanks
Hari
SQl Server MVP
"simlr" <simlr@.discussions.microsoft.com> wrote in message
news:219CCD01-B653-4246-B20C-78D536BF4D3C@.microsoft.com...
> Can anybody point me in the right direction on any resoures that may help
> us
> towards drawing up a Best Practice document that developers can work
> towards
> when develpoing DB's and subsequent applications.
Database design and development Best Pratice
Can anybody point me in the right direction on any resoures that may help us
towards drawing up a Best Practice document that developers can work towards
when develpoing DB's and subsequent applications.See the below links:-
http://www.extremeexperts.com/sql/articles/BestPractices.aspx
http://www.sql-server-performance.com/vk_sql_best_practices.asp
Thanks
Hari
SQl Server MVP
"simlr" <simlr@.discussions.microsoft.com> wrote in message
news:219CCD01-B653-4246-B20C-78D536BF4D3C@.microsoft.com...
> Can anybody point me in the right direction on any resoures that may help
> us
> towards drawing up a Best Practice document that developers can work
> towards
> when develpoing DB's and subsequent applications.
towards drawing up a Best Practice document that developers can work towards
when develpoing DB's and subsequent applications.See the below links:-
http://www.extremeexperts.com/sql/articles/BestPractices.aspx
http://www.sql-server-performance.com/vk_sql_best_practices.asp
Thanks
Hari
SQl Server MVP
"simlr" <simlr@.discussions.microsoft.com> wrote in message
news:219CCD01-B653-4246-B20C-78D536BF4D3C@.microsoft.com...
> Can anybody point me in the right direction on any resoures that may help
> us
> towards drawing up a Best Practice document that developers can work
> towards
> when develpoing DB's and subsequent applications.
Subscribe to:
Posts (Atom)