Oracle转移user表空间位置

时间:2022-02-24 03:30:12

1:登录sqlplus

      sqlplus /nolog

      conn sys/bcc@gis as sysdba

2:修改表空间位offline

      alter tablespace users offline;

3:拷贝表空间文件

4:修改oracle表空间指向地址

     alter database rename file '/user/oracle/data/user01.dbf' to '/home/oracle/data/user01.dbf';

5:修改表空间为online

     alter tablespace users online;

6:查看数据库表空间存放位置

     select file_name from sys.dba_data_files;

7:查看空闲表空间

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