Syndicate
Home arrow Sun Documentation arrow System Administration arrow Creating Sun Database Backups
Creating Sun Database Backups PDF Print E-mail
User Rating: / 2
PoorBest 
Sun Documentation - System Administration
Article Index
Creating Sun Database Backups
Page 2

Detaching and attaching a database.
Another useful Microsoft SQL Server feature is an ability to detach and attach a database. If you need to move a database, or database file to another server or disk, and you do not want to backup the database, copy the backup on another server, and then re-create the database from the backup, you can use database detach/attach. Detaching and attaching databases can be used when you want to move the database files to a different physical disk or installation of the SQL Server. To move a database using detach and attach, you should make the following steps:
 1. Detach the database.
 2. Move the database file(s) to the desired location on another server or disk.
 3. Attach the database specifying the new location of the moved file(s).
After detaching, the database will be removed from SQL Server but will be intact within the data and transaction log files that compose the database. You can use these data and transaction log files to attach the database to any instance of SQL Server, including the server from which the database was detached. After attaching, the database will be available in exactly the same state it was in when it was detached.
Detaching a Database
1. Right-click the database, and then select All Tasks/Detach Database.

2. In the Detach Database dialog box, check the status of the database.
To successfully detach a database, STATUS should be: The database is ready to be detached. Optionally, you can select to update statistics prior to the detach operation.
3. Click OK. The database node for the detached database is removed from the Database folder.
How to attach a database
1.
Right-click Databases, and select All Tasks/Attach Database.


2. Enter the name of the MDF (master data file) of the database to attach. If you are not sure where the file is located, click browse (...) to search.

3. To ensure that the specified MDF file is correct, click Verify. The Original File Name(s) column lists all the files in the database (data files and log files). The Current File(s) Location column lists the file names and paths. If Microsoft SQL Server cannot find the files in the specified locations, the attach operation fails. The Current File(s) Location column can be edited, and the current location of the file must be in this column for the attach operation to work. For example, if you have changed the default location of the file before you detached it, you must specify the current location for the attach operation to be successful.
4. In the Attach as box, enter the name of the database. The database name must not match any existing database names.
5. Specify the database owner.
6. Click OK. A database node for the newly attached database is created in the Database folder.

Comments
Very useful !
Written by Guest on 2007-03-13 21:01:41
Excellent article and great site. Keep up this good job.
Munyendo
Written by Guest on 2007-03-16 21:13:17
Very useful sun admin function

Only registered users can write comments.
Please login or register.



Latest News
Forum Topics
Latest Articles
 
 
Popular Articles
Poll
Apart from Sun do you use other Infor products?
Yes, we use these Infor products: