How Oracle database files are transferred to another machine

Source: Internet
Author: User
Tags oracle database sqlplus

How to transfer an Oracle database tutorial file to another machine

Because restoring video data causes insufficient space to terminate, you need to transfer some data files to another hard drive. In the reference section

Network data, combined with their own practice, summed up the Oracle data file transfer method.

1 manual copy of the data data file to be transferred ' D:ORACLEDATAGWTABLE42.DBF ' to the new bit

Place ' e:oracledatagwtable42.dbf '.

2 The data file belongs to the table space offline, in the Sqlplus run the following command:

Sqlplus>alter tablespace gwtable offline;

3 Modify the table space file path ALTER DATABASE rename file ' old file path ' to ' New document path ';

Sqlplus>alter DATABASE RENAME FILE ' d:oracledatagwtable42.dbf ' to

' E:ORACLEDATAGWTABLE42.DBF ';

4 When the rename command is executed, Oracle considers the database file corrupt and prompts: "Restore media required"

Sqlplus>shutdown immediate;--shut down the database

Sqlplus>startup mount;--Start the database in archive mode without opening the database

sqlplus> recover datafile ' e:oracledatagwtable42.dbf '; --Media recovery

Sqlplus>alter database open;

5 The table space online, so you can

Sqlplus>alter tablespace gwtable Online;

6 View data file and table space and status

Sqlplus> select File_name,tablespace_name,status from Dba_data_files;

Refer to a different method

Oracle database in use process, with the increase of data database files also gradually increased, after reaching a certain size

May cause a lack of hard disk space; Then we can move the database file to another large hard disk partition.

Now I'm going to use Oracle for Windows to move the C-disk database files to D disk for an example

Methods and steps for file movement.
1. In Sqlplus, connect to the Oracle database where you want to move the file, and then execute the following SQL statement to view Oracle

Database File Location:

Sql> select file_name from Sys.dba_data_files;

file_name
--------------------------------------------------------------
E:oracleoradataoradbsystem01. Dbf
E:oracleoradataoradbundotbs01. Dbf
E:oracleoradataoradbcwmlite01. Dbf
E:oracleoradataoradbdrsys01. Dbf
E:oracleoradataoradbexample01. Dbf
e:oracleoradataoradbindx01. Dbf
E:oracleoradataoradbodm01. Dbf
E:oracleoradataoradbtools01. Dbf
E:oracleoradataoradbusers01. Dbf
E:oracleoradataoradbxdb01. Dbf

Query to 10 records.

Record the location and name of the file you want to move.

2. Below we take the document "E:oracleoradataoradbusers01". DBF "Move to

"D:oradatausers01. DBF "For example, to move other files, greet the same method (according to the actual situation

Modify the file path and name) operation.

<1> first let all users stop connecting to the database and close the database. In the Command Line window, enter:

C:SVRMGRL (carriage return)
Svrmgr>connect Internal (carriage return)
Svrmgr>shutdown Immediate (carriage return)
#等待数据库提示关闭
Svrmgr>exit

<2> Locate the file "USERS01" from the "e:oracleoradataoradb" directory. DBF ", and then copy

Below the directory "D:oradata". Repeat this step if you are moving multiple files.

<3> Enter the command window as follows:
C:SVRMGRL (carriage return)
Svrmgr>connect Internal (carriage return)
Svrmgr>startup Mount (carriage return)
#等待数据库提示装载成功
Svrmgr>alter database Rename file ' E:oracleoradataoradbusers01. DBF ' to

' D:oradatausers01. DBF ';
#提示语句已处理后, if you want to move multiple files, modify the file path and name and repeat the above statement. Finish

Cheng Open the database.
Svrmgr>alter database open;
Svrmgr>exit

The database file was moved successfully.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.