I am in the process of configuring a new laptop. It has two hard drives and
I want to restore several of my large databases to files on both hard
drives, even though the original dbs on my old laptop are single-file.
Anyone know a secret that will allow you to restore a single-file database
to spread it's data over two files during the restore'
--
TheSQLGuru
President
Indicium Resources, Inc.Hi
I'm affraid you cannot do that. As SQL Server needs to restore/attach the
same number of files as you created db.
"TheSQLGuru" <kgboles@.earthlink.net> wrote in message
news:%23mNKpyH9HHA.4180@.TK2MSFTNGP05.phx.gbl...
>I am in the process of configuring a new laptop. It has two hard drives
>and I want to restore several of my large databases to files on both hard
>drives, even though the original dbs on my old laptop are single-file.
>Anyone know a secret that will allow you to restore a single-file database
>to spread it's data over two files during the restore'
> --
> TheSQLGuru
> President
> Indicium Resources, Inc.
>
>|||I didn't think it could be done either, but I have found quite a number of
things that fall into that category on this forum so I thought I would ask
anyway!! :-)
--
TheSQLGuru
President
Indicium Resources, Inc.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uqQ5U8H9HHA.1484@.TK2MSFTNGP06.phx.gbl...
> Hi
> I'm affraid you cannot do that. As SQL Server needs to restore/attach the
> same number of files as you created db.
> "TheSQLGuru" <kgboles@.earthlink.net> wrote in message
> news:%23mNKpyH9HHA.4180@.TK2MSFTNGP05.phx.gbl...
>>I am in the process of configuring a new laptop. It has two hard drives
>>and I want to restore several of my large databases to files on both hard
>>drives, even though the original dbs on my old laptop are single-file.
>>Anyone know a secret that will allow you to restore a single-file database
>>to spread it's data over two files during the restore'
>> --
>> TheSQLGuru
>> President
>> Indicium Resources, Inc.
>>
>|||You are probably better off placing the log files on one drive and the data
on the other.
--
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"TheSQLGuru" <kgboles@.earthlink.net> wrote in message
news:%23mNKpyH9HHA.4180@.TK2MSFTNGP05.phx.gbl...
>I am in the process of configuring a new laptop. It has two hard drives
>and I want to restore several of my large databases to files on both hard
>drives, even though the original dbs on my old laptop are single-file.
>Anyone know a secret that will allow you to restore a single-file database
>to spread it's data over two files during the restore'
> --
> TheSQLGuru
> President
> Indicium Resources, Inc.
>
>|||That will be done for my 'standard' databases. I have a few very large ones
I use for analyzing trace files and also one large test db for a client and
for those the read-throughput is key to optimal perforance thus the desire
to spread the data across both drives.
--
TheSQLGuru
President
Indicium Resources, Inc.
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:uTTCReJ9HHA.5456@.TK2MSFTNGP05.phx.gbl...
> You are probably better off placing the log files on one drive and the
> data on the other.
> --
> Andrew J. Kelly SQL MVP
> Solid Quality Mentors
>
> "TheSQLGuru" <kgboles@.earthlink.net> wrote in message
> news:%23mNKpyH9HHA.4180@.TK2MSFTNGP05.phx.gbl...
>>I am in the process of configuring a new laptop. It has two hard drives
>>and I want to restore several of my large databases to files on both hard
>>drives, even though the original dbs on my old laptop are single-file.
>>Anyone know a secret that will allow you to restore a single-file database
>>to spread it's data over two files during the restore'
>> --
>> TheSQLGuru
>> President
>> Indicium Resources, Inc.
>>
>sql
Showing posts with label multiple. Show all posts
Showing posts with label multiple. Show all posts
Monday, March 26, 2012
Wednesday, March 7, 2012
restore multiple databases (Transact SQL?)
Does anyone have a good method for quickly restored multiple SQL
Server 2000 databases'
I'm hoping to execute a Transact SQL script that will restore a bunch
of databases all in one step.
Any ideas/comments?
ThankyouAndrew wrote:
> Does anyone have a good method for quickly restored multiple SQL
> Server 2000 databases'
RESTORE DATABASE [myDB]
FROM DISK = 'd:\Databases\backup\myDb.BAK'
WITH
MOVE 'myDB_Data' TO 'F:\Databases\myDB_Data.mdf',
MOVE 'myDB_Log' TO 'F:\Databases\myDB_Log.ldf',
RECOVERY
rinse, repeat
As you can see this is very scriptable.
Aaron Weiker
http://aaronweiker.com/
http://www.sqlprogrammer.org/|||In Addition to Aaron's response
You can detach a 'source' database. Copy mdf and ldf files and rename them.
Attach these databases with different names.
For more details please refer to BOL
sp_detach_db
sp_attach_db
Note: After remaining the mdf and ldf files you have to issue sp_detach_db
'new name database' in order to attach it successfuly.
"Aaron Weiker" <aaron@.sqlprogrammer.org> wrote in message
news:u5zATcmDFHA.1836@.tk2msftngp13.phx.gbl...
> Andrew wrote:
>
> RESTORE DATABASE [myDB]
> FROM DISK = 'd:\Databases\backup\myDb.BAK'
> WITH
> MOVE 'myDB_Data' TO 'F:\Databases\myDB_Data.mdf',
> MOVE 'myDB_Log' TO 'F:\Databases\myDB_Log.ldf',
> RECOVERY
>
> rinse, repeat
> As you can see this is very scriptable.
> --
> Aaron Weiker
> http://aaronweiker.com/
> http://www.sqlprogrammer.org/
Server 2000 databases'
I'm hoping to execute a Transact SQL script that will restore a bunch
of databases all in one step.
Any ideas/comments?
ThankyouAndrew wrote:
> Does anyone have a good method for quickly restored multiple SQL
> Server 2000 databases'
RESTORE DATABASE [myDB]
FROM DISK = 'd:\Databases\backup\myDb.BAK'
WITH
MOVE 'myDB_Data' TO 'F:\Databases\myDB_Data.mdf',
MOVE 'myDB_Log' TO 'F:\Databases\myDB_Log.ldf',
RECOVERY
rinse, repeat
As you can see this is very scriptable.
Aaron Weiker
http://aaronweiker.com/
http://www.sqlprogrammer.org/|||In Addition to Aaron's response
You can detach a 'source' database. Copy mdf and ldf files and rename them.
Attach these databases with different names.
For more details please refer to BOL
sp_detach_db
sp_attach_db
Note: After remaining the mdf and ldf files you have to issue sp_detach_db
'new name database' in order to attach it successfuly.
"Aaron Weiker" <aaron@.sqlprogrammer.org> wrote in message
news:u5zATcmDFHA.1836@.tk2msftngp13.phx.gbl...
> Andrew wrote:
>
> RESTORE DATABASE [myDB]
> FROM DISK = 'd:\Databases\backup\myDb.BAK'
> WITH
> MOVE 'myDB_Data' TO 'F:\Databases\myDB_Data.mdf',
> MOVE 'myDB_Log' TO 'F:\Databases\myDB_Log.ldf',
> RECOVERY
>
> rinse, repeat
> As you can see this is very scriptable.
> --
> Aaron Weiker
> http://aaronweiker.com/
> http://www.sqlprogrammer.org/
Subscribe to:
Posts (Atom)