oracle 修改表空間存儲路徑


[root@yoon ~]# more /etc/oracle-release
Oracle Linux Server release 5.7

 

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

 

1.查看數據文件的存儲路徑:

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/yoon/system01.dbf
/u01/oracle/oradata/yoon/sysaux01.dbf
/u01/oracle/oradata/yoon/undotbs01.dbf
/u01/oracle/oradata/yoon/users01.dbf

 

2.修改表空間為offline:

SQL> alter tablespace users offline;

Tablespace altered.

 

3.拷貝數據文件

[oracle@yoon yoon]$ cp users01.dbf /u01/oracle/oradata/yoondata/

 

4.修改表空間存儲路徑

SQL> alter tablespace users rename datafile '/u01/oracle/oradata/yoon/users01.dbf' to '/u01/oracle/oradata/yoondata/users01.dbf';

Tablespace altered.

 

5.修改表空間為online

SQL> alter tablespace users online;

Tablespace altered.

 

6.重新查看數據文件路徑

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/yoon/system01.dbf
/u01/oracle/oradata/yoon/sysaux01.dbf
/u01/oracle/oradata/yoon/undotbs01.dbf
/u01/oracle/oradata/yoondata/users01.dbf


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM