oracle 12c R1 可以線上對資料檔案重新命名或者移動資料檔案位置

paulyibinyi發表於2015-11-10
SQL> CREATE TABLESPACE test DATAFILE '/bugmnt17/em/celclnx14/SR3.5377673271/app/oracle/oradata/T12cB3/test.dbf' SIZE 50M
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO;  2    3

Tablespace created.

SQL> select file_name, status, online_status from dba_data_files;

FILE_NAME
----------------------------------------------------------------------------------------------------
STATUS    ONLINE_
--------- -------
/bugmnt17/em/celclnx14/SR3.5377673271/app/oracle/oradata/T12cB3/system01.dbf
AVAILABLE SYSTEM

/bugmnt17/em/celclnx14/SR3.5377673271/app/oracle/oradata/T12cB3/sysaux01.dbf
AVAILABLE ONLINE

/bugmnt17/em/celclnx14/SR3.5377673271/app/oracle/oradata/T12cB3/undotbs01.dbf
AVAILABLE ONLINE

/bugmnt17/em/celclnx14/SR3.5377673271/app/oracle/oradata/T12cB3/users01.dbf
AVAILABLE ONLINE

/bugmnt17/em/celclnx14/SR3.5377673271/app/oracle/oradata/T12cB3/test.dbf
AVAILABLE ONLINE

SQL> ALTER DATABASE MOVE DATAFILE '/bugmnt17/em/celclnx14/SR3.5377673271/app/oracle/oradata/T12cB3/test.dbf'
TO '/bugmnt17/em/celclnx14/SR3.5377673271/app/oracle/oradata/T12cB3/test_renamed.dbf';

Database altered.

SQL> select file_name, status, online_status from dba_data_files where file_name='/bugmnt17/em/celclnx14/SR3.5377673271/app/oracle/oradata/T12cB3/test_renamed.dbf';

FILE_NAME
----------------------------------------------------------------------------------------------------
STATUS    ONLINE_
--------- -------
/bugmnt17/em/celclnx14/SR3.5377673271/app/oracle/oradata/T12cB3/test_renamed.dbf
AVAILABLE ONLINE

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-1827421/,如需轉載,請註明出處,否則將追究法律責任。

相關文章