如何轉移表空間存儲位置?

Oracle安裝到了C盤,表空間也創建到了C盤,目前發現C盤的空間不夠用了,現在將表空間的文件轉移到一個容量大的盤下邊,操作方法:

1. 先登錄sqlplus:
sqlplus /nolog
conn user1/passwd@test
2.修改表空間爲Offline
alter tablespace users offline;
3.拷貝表空間文件
拷貝C:oracleproduct10.2.0oradataorcladoUSERS01.DBF 到 D:oracledata
4.修改oracle表空間指向地址
SQL> alter database rename file 'C:oracleproduct10.2.0oradataorcladoUSERS01.DBF' to 'D:oracledataUSERS01.DBF';
5.修改表空間爲Online
SQL> alter tablespace users online;

查看數據庫的表空間文件存放位置:
select file_name from sys.dba_data_files;

查看空閒表空間:

SQL>select tablespace_name ,sum(bytes)/1024/1024||'M' as freespaces from dba_data_files group by tablespace_name;



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章