Oracle database File Move

Source: Internet
Author: User
Tags exit command line connect oracle database
oracle| Data | database Oracle Database in the use of the process, as the data increase in the database files are gradually increased, after reaching a certain size may cause hard disk space; Then we can move the database file to another large hard disk partition. Here's how and how to move the Oracle database files to the D disk in the Oracle for Windows version.

1. In Sqlplus, connect to the Oracle database where you want to move the file, and then execute the following SQL statement to view the location of the Oracle database file:

Sql> select file_name from Sys.dba_data_files;

file_name
--------------------------------------------------------------
C:\ORA8\ORADATA\ORACLE\USERS01. Dbf
C:\ORA8\ORADATA\ORACLE\DR01. Dbf
C:\ORA8\ORADATA\ORACLE\TOOLS01. Dbf
C:\ORA8\ORADATA\ORACLE\INDX01. Dbf
C:\ORA8\ORADATA\ORACLE\RBS01. Dbf
C:\ORA8\ORADATA\ORACLE\TEMP01. Dbf
C:\ORA8\ORADATA\ORACLE\SYSTEM01. Dbf

Query to 7 records.

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

2. Below we take the document "C:\ORA8\ORADATA\ORACLE\USERS01". DBF "moves to" D:\ORADATA\USERS01. DBF "For example, to move other files, greet the same method (according to the actual situation to modify the file path and name) operation can be.

<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 "C:\ORA8\ORADATA\ORACLE\" directory. DBF, and then copy to the directory "D:\ORADATA\" below. 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 ' C:\ORA8\ORADATA\ORACLE\USERS01. DBF ' to ' D:\ORADATA\USERS01. DBF ';
#提示语句已处理后, if you want to move multiple files, modify the file path and name and repeat the above statement. Open the database when you are finished.
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.