SQL> alter tablespace TBS01 offline;
Tablespace altered.
SQL> !cp '/u01/oracle/oradata/orcl/tbs01.dbf' '/u02/oracle/oradata/orcl/tbs01.dbf'
SQL> alter tablespace tbs01 rename datafile '/u01/oracle/oradata/orcl/tbs01.dbf' to '/u02/oracle/oradata/orcl/tbs01.dbf';
Tablespace altered.
SQL> alter tablespace tbs01 online;
Tablespace altered
SQL> SELECT tablespace_name, file_id, file_name, round(bytes / (1024 * 1024), 0) total_space FROM dba_data_files ORDER BY tablespace_name;
TABLESPACE_NAME FILE_ID
------------------------------ ----------
FILE_NAME
--------------------------------------------------------------------------------
TOTAL_SPACE
-----------
RMAN_TS 2
/home/oracle/data/rman_ts1.dbf
2048
SYSAUX 3
/u01/oracle/oradata/orcl/sysaux01.dbf
540
TABLESPACE_NAME FILE_ID
------------------------------ ----------
FILE_NAME
--------------------------------------------------------------------------------
TOTAL_SPACE
-----------
SYSTEM 1
/u01/oracle/oradata/orcl/system01.dbf
820
TBS01 5
/u02/oracle/oradata/orcl/tbs01.dbf
TABLESPACE_NAME FILE_ID
------------------------------ ----------
FILE_NAME
--------------------------------------------------------------------------------
TOTAL_SPACE
-----------
2000
UNDOTBS1 4
/u01/oracle/oradata/orcl/undotbs01.dbf
65
USERS 7
TABLESPACE_NAME FILE_ID
------------------------------ ----------
FILE_NAME
--------------------------------------------------------------------------------
TOTAL_SPACE
-----------
/u01/oracle/oradata/orcl/users01.dbf
5
6 rows selected.
如果要转移system表空间
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 2516582400 bytes
Fixed Size 8623832 bytes
Variable Size 1459620136 bytes
Database Buffers 1040187392 bytes
Redo Buffers 8151040 bytes
Database mounted.
SQL> !cp '/u01/oracle/oradata/orcl/system01.dbf' '/u02/oracle/oradata/orcl/system01.dbf'
SQL> alter database rename file '/u01/oracle/oradata/orcl/system01.dbf' to '/u02/oracle/oradata/orcl/system01.dbf';
Database altered.
SQL> alter database open;
Database altered.
版权声明:本文为博主原创文章,未经博主允许不得转载。
Linux,oracle