Oracle 修改表空間物理路徑


1、修改表空間為offline

alter tablespace users offline;

2、拷貝表空間文件

cp /oracle/app/oradata/HXDB/users01.dbf /oradata/HXDB/datafile/users01.dbf

3、修改表空間指向地址

alter database rename file '/oracle/app/oradata/HXDB/users01.dbf' to '/oradata/HXDB/datafile/users01.dbf';

4、刪除表空間物理文件

rm /oracle/app/oradata/HXDB/users01.dbf

5、修改表空間為online

alter tablespace users online;

 

--刪除空的表空間,但是不包含物理文件
drop tablespace tablespace_name;
--刪除非空表空間,但是不包含物理文件
drop tablespace tablespace_name including contents;
--刪除空表空間,包含物理文件
drop tablespace tablespace_name including datafiles;
--刪除非空表空間,包含物理文件
drop tablespace tablespace_name including contents and datafiles;
--如果其他表空間中的表有外鍵等約束關聯到了本表空間中的表的字段,就要加上CASCADE CONSTRAINTS
drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;

 


免責聲明!

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



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