ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle之system表空间热备恢复

oracle之system表空间热备恢复

原创 Linux操作系统 作者:atx2418 时间:2012-07-12 21:14:12 0 删除 编辑

-----------------------------------------oracle之system表空间热备恢复---------------------------------------------
SQL> select status,name from v$datafile; -----查看所有表空间的状态

STATUS NAME
------- ------------------------------------------------------------------------
SYSTEM /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_7zwwzx6l_.dbf
ONLINE /u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_7zwwzxd7_.dbf
ONLINE /u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_7zwwzx72_.dbf
ONLINE /u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_7zwwzxdw_.dbf
ONLINE /u01/app/oracle/oradata/ORCL/datafile/o1_mf_example_7zwx380j_.dbf

SQL> alter tablespace system begin backup; ----开始备份system表空间

Tablespace altered.

SQL> ! cp -rp /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_7zwwzx6l_.dbf /u01/orcl_backup/ ---拷贝表空间文件

SQL> ! ls -l /u01/orcl_backup/ ---查看拷贝到表空间文件
total 492012
-rw-r----- 1 oracle oinstall 503324672 Jul 12 20:10 o1_mf_system_7zwwzx6l_.dbf

SQL> alter tablespace system end backup; ----结束system表空间备份

Tablespace altered.


SQL> !rm -rf /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_7zwwzx6l_.dbf ----删除原有的system表空间文件

[oracle@oracle datafile]$ cp -rp /u01/orcl_backup/o1_mf_system_7zwwzx6l_.dbf ./ ----拷贝备份的system表空间文件到datafile目录下


SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 96470632 bytes
Database Buffers 180355072 bytes
Redo Buffers 7168000 bytes
Database mounted.
ORA-01113: file 1 needs media recovery ----提示system需要恢复
ORA-01110: data file 1:
'/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_7zwwzx6l_.dbf'

SQL> recover datafile 1; ----提示system表空间文件恢复成功
Media recovery complete.


SQL> alter database open;

Database altered.

-----------------------------------------oracle之system表空间热备恢复---------------------------------------------

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13453302/viewspace-735337/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-07-12

  • 博文量
    9
  • 访问量
    3552