重庆思庄Oracle、Redhat认证学习论坛

标题: oracle11g修改数据文件路径 [打印本页]

作者: jiawang    时间: 2020-9-3 09:38
标题: oracle11g修改数据文件路径
本帖最后由 jiawang 于 2020-9-3 09:39 编辑

有时候我们想把数据文件移动到其他的目录下,可以按照如下操作:

SQL>  select file_name from sys.dba_data_files;
FILE_NAME--------------------------------------------------------------------------------
/home/app/oracle/oradata/sztech/users01.dbf
/home/app/oracle/oradata/sztech/undotbs01.dbf
/home/app/oracle/oradata/sztech/sysaux01.dbf
/home/app/oracle/oradata/sztech/system01.dbf


  2.关机并启动到mount状态
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.
Total System Global Area 2.1379E+10 bytes
Fixed Size                    2262656 bytes
Variable Size                 1677724032 bytes
Database Buffers         1.9663E+10 bytes
Redo Buffers                   36073472 bytes
Database mounted.

3.执行修改
SQL> alter database rename file   '/home/app/oracle/oradata/sztech/users01.dbf'   to   '/u01/app/oradata/sztech/users01.dbf';
Database altered.
SQL> alter database rename file   '/home/app/oracle/oradata/sztech/undotbs01.dbf'   to   '/u01/app/oradata/sztech/undotbs01.dbf';
Database altered.
SQL> alter database rename file   '/home/app/oracle/oradata/sztech/sysaux01.dbf'   to   '/u01/app/oradata/sztech/sysaux01.dbf';
Database altered.
SQL> alter database rename file   '/home/app/oracle/oradata/sztech/system01.dbf'   to   '/u01/app/oradata/sztech/system01.dbf';
Database altered.

4.启动数据库
SQL> alter database open;
Database altered.

作者: jiawang    时间: 2020-9-3 09:40
12C在线修改数据文件名字:http://bbs.cqsztech.com/forum.ph ... D%BE%DD%CE%C4%BC%FE




欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2