Oracle mobile data file (installation)

Source: Internet
Author: User

(From http://space.itpub.net/12361284/viewspace-588)

I. Move data files:
-- You can use alter database or alter tablespace to move data files.
1. Alter database method;
-- This method can be used to move data files in any tablespace.
Step 1. BottomDatabase:
$ Sqlplus/nolog
SQL> connect internal;
SQL> shutdown;
SQL> exit;
Step 2. Use the operating system command to move the data file:
-- Move the data file 'test. ora 'from the/ora/Oracle/data1 directory to the/ora/Oracle/data2 directory:
$ MV/ora/Oracle/data1/test. ora/Oracle/data2
Step 3. Mount the database and use the alter database command to rename the data file:
$ Sqlplus/nolog
SQL> connect internal;
SQL> startup Mount;
SQL> alter database rename File '/ora/Oracle/data1/test. ora' to '/ora/Oracle/data2/test. ora ';
Step 4. Open the database :.
SQL> alter database open;
SQL> select name, status from V $ datafile;
2. Alter tablespace method:
-- This method requires that the data file neither belong to the system tablespace nor to the tablespace containing the active rollback segment or temporary segment.
Step1. set the tablespace of the data file to offline:
$ Sqlplus/nolog
SQL> connect internal;
SQL> alter tablespaceTestOffline;
SQL> exit;
Step2. use the operating system command to move the data file:
Import the data file 'test. ora 'from/ora/Oracle/
Move the data1 directory to the/ora/Oracle/data2 directory:
$ MV/ora/Oracle/data1/test. ora/Oracle/data2
Step3. use the alter tablespace command to change the data file name:
$ Sqlplus/nolog
SQL> connect internal;
SQL> alter tablespace test rename datafile '/ora/Oracle/data1/test. ora' to '/ora/Oracle/data2/test. ora ';
Step 4. Set the tablespace where the data file is located to online:
SQL> alter tablespace test online;
SQL> select name, status from V $ datafile;
Ii. Mobile control file:
-- The control file is specified in the init. ora file. Mobile control files are relatively simple,
-- Edit init. ora, move the control file, and restart the database.
Step 1. database:
$ Sqlplus/nolog
SQL> connect internal;
SQL> shutdown;
SQL> exit;
Step 2. Use the operating system command to move the control file:
-- Move the control file 'ctl3orcl. ora 'from the/ora/Oracle/data1 directory to the/ora/Oracle/data2 directory:
$ MV/ora/Oracle/data1/ctrlorcl3.ora/ora/Oracle/data2
Step 3. Edit the init. ora file:
The init. ora file is in the $ ORACLE_HOME/DBS directory,
Modify the parameter "control_files", and specify the moved control file:
Control_files = (/ora/Oracle/data1/ctrlorcl1.ora,/ora/Oracle/data1/ctrlorcl2.ora,/ora/Oracle/data2/ctrlorcl3.ora)
Step 4. Restart the database:
$ Sqlplus/nolog
SQL> connect internal;
SQL> startup;
SQL> select name from V $ controlfile;
SQL> exit;
3. move online log files:
Step 1. Stop the database:
$ Sqlplus/nolog
SQL> connect internal;
SQL> shutdown;
SQL> exit;
Step 2. Use the operating system command to move the online log file:
-- Move the online Log File 'redolog1. ora 'from the/ora/Oracle/data1 directory to the/ora/Oracle/data2 directory:
$ MV/ora/Oracle/data1/redolog1.ora/ora/Oracle/data2
Step 3. Mount the database and use the alter database command to change the online Log File Name :.
$ Sqlplus/nolog
SQL> connect internal;
SQL> startup Mount;
SQL> alter database rename File '/ora/Oracle/data1/redolog1.ora' to '/ora/Oracle/data2/redolog1.ora ';
Step 4. Restart the database :.
SQL> alter database open;
SQL> select Member from V $ logfile;

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.