ORACLE 中RMAN执行数据库全库恢复
2014-04-17 15:36
429 查看
1.备份数据库
2.关闭数据库
3.模拟数据丢失
删除控制文件、数据文件、日志文件、参数文件、密码文件
4.启动数据库到nomount状态
此时需要用到参数文件:
启动数据库到nomount状态:
4.使用RMAN恢复数据库参数文件
然后关闭数据库启动到nomount状态呢:
5.使用RMAN恢复数据库控制文件
6.启动数据库至mount状态
7.恢复数据库
接下来执行recover database,出现错误,链接如下:
/article/7325749.html
8.创建密码文件
本文出自 “DBA成长日记” 博客,请务必保留此出处http://dayong2015.blog.51cto.com/7185873/1397257
RMAN> backup database format '/u01/app/RMANBK/bk_dir/%u'; |
SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. |
删除控制文件、数据文件、日志文件、参数文件、密码文件
[oracle@localhost myorcl]$ pwd /u01/app/oradata/myorcl [oracle@localhost myorcl]$ rm -rf * [oracle@localhost dbs]$ ls hc_myorcl.datinit.oraorapwmyorclspfilemyorcl.ora initdw.oralkMYORCLsnapcf_myorcl.f [oracle@localhost dbs]$ pwd /u01/app/oracle/dbs [oracle@localhost dbs]$ rm -rf spfilemyorcl.ora [oracle@localhost dbs]$ rm -rf orapwmyorcl |
此时需要用到参数文件:
[oracle@localhost pfile]$ ls init.ora.226201419515 [oracle@localhost pfile]$ pwd /u01/app/admin/myorcl/pfile [oracle@localhost pfile]$ mv init.ora.226201419515 init.ora [oracle@localhost pfile]$ ls init.ora |
[oracle@localhost ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Thu Mar 27 22:11:17 2014 Copyright (c) 1982, 2005, Oracle.All rights reserved. Connected to an idle instance. SQL> startup nomount pfile='/u01/app/admin/myorcl/pfile/init.ora'; ORACLE instance started. Total System Global Area281018368 bytes Fixed Size2020160 bytes Variable Size88083648 bytes Database Buffers184549376 bytes Redo Buffers6365184 bytes SQL> |
[oracle@localhost ~]$ rman target / Recovery Manager: Release 10.2.0.1.0 - Production on Thu Mar 27 22:13:59 2014 Copyright (c) 1982, 2005, Oracle.All rights reserved. connected to target database: myorcl (not mounted) RMAN> restore spfile from autobackup; |
SQL> shutdown immediate; ORACLE instance shut down. SQL> startup nomount; ORACLE instance started. Total System Global Area281018368 bytes Fixed Size2020160 bytes Variable Size113249472 bytes Database Buffers159383552 bytes Redo Buffers6365184 bytes |
RMAN> restore controlfile from autobackup; Starting restore at 27-MAR-14 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=155 devtype=DISK recovery area destination: /u01/app/flash_recovery_area database name (or database unique name) used for search: MYORCL channel ORA_DISK_1: autobackup found in the recovery area channel ORA_DISK_1: autobackup found: /u01/app/flash_recovery_area/MYORCL/autobackup/2014_03_27/o1_mf_s_843343359_9m8cw0g0_.bkp channel ORA_DISK_1: control file restore from autobackup complete output filename=/u01/app/oradata/myorcl/control01.ctl output filename=/u01/app/oradata/myorcl/control02.ctl output filename=/u01/app/oradata/myorcl/control03.ctl Finished restore at 27-MAR-14 |
SQL> alter database mount; Database altered. |
RMAN> restore database; |
/article/7325749.html
8.创建密码文件
[oracle@localhost ~]$ orapwd file=$ORACLE_HOME/dbs/orapwmyorcl password=oracle; |
相关文章推荐
- (RMAN)使用恢复目录数据库执行RMAN
- oracle备份之rman_全库备份恢复
- (RMAN)使用恢复目录数据库执行RMAN步骤 推荐
- Oracle DB 执行数据库恢复
- [转]Oracle DB 使用RMAN执行恢复
- ORACLE数据库误操作执行了DELETE,该如何恢复数据?
- [转]Oracle DB 执行数据库恢复
- ORACLE 11G 中采用rman备份异机恢复数据库详细过程
- ORACLE 11G 中采用rman备份异机恢复数据库详细过程
- ORACLE 数据库RMAN备份恢复
- (RMAN)使用恢复目录数据库执行RMAN步骤
- ORACLE 11G 中没有参数文件和控制文件如何通过rman恢复数据库
- 使用Rman将Windows Oracle 11gR2 32位中数据库恢复至Windows Oracle 11gR2 64位 与 centos 6.5 Oracle 11gR2 32位
- Oracle学习(11)---使用rman备份进行数据库的恢复
- Oracle DB 使用RMAN执行恢复
- Oracle rman备份和还原恢复数据库
- 在oracle下我们如何正确的执行数据库恢复
- oracle-dba- RMAN备份与恢复数据库
- ORACLE 11G rman恢复数据库实战纪实
- 在oracle下我们如何正确的执行数据库恢复