C/C++教程

oracle迁移数据文件

本文主要是介绍oracle迁移数据文件,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

步骤如下:

1.  把数据文件迁移到/u02对应的目录

[oracle@localhost hsbop]$ mv /u01/app/oracle/oradata/orcl/acptdat.dbf  /u02/oradata/hsbop/acptdat.dbf

[oracle@localhost hsbop]$ mv /u01/app/oracle/oradata/orcl/acptidx.dbf /u02/oradata/hsbop/acptidx.dbf

[oracle@localhost hsbop]$ mv /u01/app/oracle/oradata/orcl/archdat.dbf /u02/oradata/hsbop/archdat.dbf

[oracle@localhost hsbop]$ mv /u01/app/oracle/oradata/orcl/archidx.dbf /u02/oradata/hsbop/archidx.dbf

2. 数据库启动到mount状态

SQL> startup mount

ORACLE instance started.

Total System Global Area  536870912 bytes

Fixed Size     1220408 bytes

Variable Size   171966664 bytes

Database Buffers   356515840 bytes

Redo Buffers     7168000 bytes

Database mounted.

3. 进行数据文件的rename

SQL> alter database rename file '/u01/app/oracle/oradata/orcl/acptdat.dbf' to '/u02/oradata/hsbop/acptdat.dbf';

Database altered.

SQL> alter database rename file '/u01/app/oracle/oradata/orcl/acptidx.dbf' to '/u02/oradata/hsbop/acptidx.dbf';

Database altered.

SQL> alter database rename file '/u01/app/oracle/oradata/orcl/archdat.dbf' to '/u02/oradata/hsbop/archdat.dbf';

Database altered.

SQL> alter database rename file '/u01/app/oracle/oradata/orcl/archidx.dbf' to '/u02/oradata/hsbop/archidx.dbf';

Database altered.

4. 打开数据库

SQL> alter database open;

Database altered.

这篇关于oracle迁移数据文件的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!