查看数据文件的存储路径:
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/umpay/system01.dbf
/home/oracle/app/oracle/oradata/umpay/sysaux01.dbf
/home/oracle/app/oracle/oradata/umpay/undotbs01.dbf
/DataBase/app/oracle/oradata/orcl/users01.dbf
1)修改users表空间存储路径
1. 修改表空间为offline
SQL> alter tablespace users offline;
Tablespace altered.
2. 拷贝数据文件
[oracle@dbhost-33 umpay]$ cp /home/oracle/app/oracle/oradata/umpay/system01.dbf /DataBase/app/oracle/oradata/orcl/
3. 修改路径
SQL> alter tablespace users rename datafile '/home/oracle/app/oracle/oradata/umpay/users01.dbf' to '/DataBase/app/oracle/oradata/orcl/users01.dbf';
Tablespace altered.
4. 修改为online
SQL> alter tablespace users online;
Tablespace altered.
2)修改sysaux表空间路径方式同上
3)修改system表空间路径
1. 关闭数据库
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
2. 拷贝数据文件
[oracle@dbhost-33 orcl]$ cp /home/oracle/app/oracle/oradata/umpay/system01.dbf /DataBase/app/oracle/oradata/orcl/
3. mount方式启动数据库
SQL> startup mount
ORACLE instance started.
Total System Global Area 534462464 bytes
Fixed Size 2254952 bytes
Variable Size 213911448 bytes
Database Buffers 310378496 bytes
Redo Buffers 7917568 bytes
Database mounted.
4. 修改路径
SQL> alter database rename file '/home/oracle/app/oracle/oradata/umpay/system01.dbf' to '/DataBase/app/oracle/oradata/orcl/system01.dbf';
Database altered.
5. 打开数据库
SQL> alter database open;
Database altered.
4)修改UNDO表空间路径方式同上
标签:存储,umpay,app,dbf,数据表,oradata,oracle,SQL,Oracle From: https://www.cnblogs.com/baixisuozai/p/17014170.html