Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Restroing DB to multiple files Expand / Collapse
Author
Message
Posted Tuesday, June 18, 2013 9:05 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, April 29, 2014 3:57 AM
Points: 646, Visits: 213
Is it possible to restore a database's logical path to multiple physical files?

The following produces an expected file or id error message.

RESTORE DATABASE TestDB
FROM DISK = 'Z:\SQLServerBackups\AdventureWorks2012.bak'
WITH MOVE 'AdventureWorks2012_Data' TO 'C:\MySQLServer\testdb.mdf', 'C:\MySQLServer\testdb2.ndf',
MOVE 'AdventureWorks2012_Log' TO 'C:\MySQLServer\testdb.ldf';
GO
Post #1464718
Posted Tuesday, June 18, 2013 9:17 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 4:05 PM
Points: 5,989, Visits: 12,915
nope, logical and physical names are a one to one relationship

---------------------------------------------------------------------

Post #1464726
Posted Tuesday, June 18, 2013 9:17 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:14 PM
Points: 42,747, Visits: 35,835
Not possible. A restore recreates the DB as it was at the time of backup. If the database that was backed up had one data file then the restored database has one data file.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1464727
Posted Tuesday, June 18, 2013 10:27 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, April 29, 2014 3:57 AM
Points: 646, Visits: 213
If it is not possible to restore to multiple files, is it possible to automate moving the data to multiple ndf files after the restore?
Post #1464778
Posted Tuesday, June 18, 2013 10:41 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 4:05 PM
Points: 5,989, Visits: 12,915
only by scripting up exactly what you want to do.

---------------------------------------------------------------------

Post #1464784
Posted Tuesday, June 18, 2013 10:45 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:14 PM
Points: 42,747, Visits: 35,835
marks_262 (6/18/2013)
If it is not possible to restore to multiple files, is it possible to automate moving the data to multiple ndf files after the restore?


Depends what you want to do specifically (and why)

There's no ALTER DATABASE SPREAD DATA ACROSS FILES command.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1464787
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse