Showing posts with label upwith. Show all posts
Showing posts with label upwith. Show all posts

Tuesday, March 20, 2012

back upwith out any machine specific data

How can i take back up of a data base
with out having any machine/system specific
data in the .bak file?

What exactly do you mean by machine specific data?

When you take a backup your database is backed up, nothing more, nothing less.

If you are talking about the file location this can be changed in the RESTORE statement.

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||

Data or information? What issues are you trying to prevent with this? If you do a restore headeronly, you will see the server name that backed up the file. Is that the kind of thing you are concerned about?

Otherwise, as WesleyB said, you can backup on one server and restore to another.

-Sue

|||i cant restore a db ,in another system

i am getting error like

System.Data.SqlClient.SqlError: Directory lookup for the file "D:\Microsoft SQL Server 2005\mydatabase.mdf" failed with the operating system error 2(The system cannot find the file specified.). (Microsoft.SqlServer.Smo)

i am trying to restore from a .bak file

i have sql servrer in D:
but on another system it in c:
|||

That's where the MOVE statement is for.

From BOL:

RESTORE DATABASE TestDB
FROM AdventureWorksBackups
WITH MOVE 'AdventureWorks_Data' TO 'C:\MySQLServer\testdb.mdf',
MOVE 'AdventureWorks_Log' TO 'C:\MySQLServer\testdb.ldf';

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

back upwith out any machine specific data

How can i take back up of a data basewith out having any machine/system specific data in the .bak file?

What are you trying to accomplish? You can obviously move a database backup file from one machine to another.

|||

then why i cant restore a db ,in another system

i am getting error like

System.Data.SqlClient.SqlError:Directory lookup for the file "D:\Microsoft SQL Server2005\mydatabase.mdf" failed with the operating system error 2(Thesystem cannot find the file specified.). (Microsoft.SqlServer.Smo)

i am trying to restore from a .bak file

where d:is the place where sql server is installed in my system

and and in another system it is in c:

|||

Yes, the path to the data and log files is stored with the backup. This is for convenience when you are restoring a backup to the same machine from which it was taken. Unfortunately it is inconvenient when moving to another machine. It the restore database dialog, you have to find the options for where to store the data and transaction log files. Modify these settings to fit the local machine. If you need more specific details, please indicate which version of Sql Server you are using.

Hope this helps,

Matt

|||

i am using sql server 2005

|||

in the restore window, after adding the backup file, go to the "options" page and change the two paths for .mdf and and .ldf files