• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

【执行灾难性恢复-1】

mysql 搞代码 4年前 (2022-01-09) 25次浏览 已收录 0个评论

执行灾难恢复: [oracle@oracle ~]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.5.0 – Production on Thu Nov 6 20:23:30 2014Copyright (c) 1982, 2010, Oracle. All Rights Reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.

执行灾难恢复:

[oracle@oracle ~]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.5.0 - Production on Thu Nov 6 20:23:30 2014Copyright (c) 1982, 2010, Oracle. All Rights Reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit ProductionWith the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engineand Real Application Testing optionsSQL> shutdown abortORACLE instance shut down.SQL> exitDisconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit ProductionWith the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engineand Real Application Testing options[oracle@oracle ~]$ rm /u01/oracle/oradata/jadl10g/ -rf[oracle@oracle ~]$ rm /u01/oracle/admin/jadl10g/ -rf[oracle@oracle ~]$ rm /u01/oracle/flash_recovery_area/jadl10g/ -rf[oracle@oracle ~]$ ls /u01/oracle/10g/dbs/ab_+ASM.dat hc_jadl10g.dat init.ora orapw+ASM snapcf_jadl10g.falert_jadl10g.log initd10g.ora lk+ASM orapwd10g spfile+ASM.orahc_+ASM.dat initdw.ora lkJADL10G orapwjadl10g spfilejadl10g.ora[oracle@oracle ~]$ rm /u01/oracle/10g/dbs/*jadl10g* -rf***注意该文件不能删除,如果删除了就不能恢复了***[oracle@oracle ~]$ ls /u01/oracle/flash_recovery_area/JADL10G/archivelog backupset datafile onlinelog

故障模拟完毕:开始执行恢复操作;

[oracle@oracle ~]$ rman target /Recovery Manager: Release 10.2.0.5.0 - Production on Thu Nov 6 20:30:19 2014Copyright (c) 1982, 2007, Oracle. All rights reserved.connected to target database (not started)RMAN> startup nomountstartup failed: ORA-01078: failure in processing system parametersLRM-00109: could not open parameter file '/u01/oracle/10g/dbs/initjadl10g.ora'starting Oracle instance without parameter file for retrival of spfileOracle instance startedTotal System Global Area 159383552 bytesFixed Size 2094736 bytesVariable Size 67111280 bytesDatabase Buffers 83886080 bytesRedo Buffers 6291456 bytesRMAN> restore spfile from '/u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_ncsnf_TAG20141106T202102_b5psyngf_.bkp';Starting restore at 06-NOV-14using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=36 devtype=DISKchannel ORA_DISK_1: autobackup found: /u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_ncsnf_TAG20141106T202102_b5psyngf_.bkpchannel ORA_DISK_1: SPFILE restore from autobackup completeFinished restore at 06-NOV-14RMAN> shutdown abort;Oracle instance shut downRMAN> exitRecovery Manager complete.[oracle@oracle ~]$ strings $ORACLE_HOME/dbs/spfilejadl10g.orajadl10g.__db_cache_size=427819008jadl10g.__java_pool_size=4194304jadl10g.__large_pool_size=4194304jadl10g.__shared_pool_size=155189248jadl10g.__streams_pool_size=0*.audit_file_dest='/u01/oracle/admin/jadl10g/adump'*.background_dump_dest='/u01/oracle/admin/jadl10g/bdump'*.compatible='10.2.0.5.0'*.control_files='/u01/oracle/oradata/jadl10g/control01.ctl','/u01/oracle/flash_recovery_area/jadl10g/control02.ctl'#Restore Controlfile*.core_dump_dest='/u01/oracle/admin/jadl10g/cdump'*.db_block_size=8192*.db_domain=''*.db_file_multiblock_read_count=16*.db_name='jadl10g'*.db_recovery_file_dest='/u01/oracle/flash_recovery_area'*.db_recovery_file_dest_size=2147483648*.dispatchers='(PROTOCOL=TCP) (SERVICE=jadl10gXDB)'*.job_queue_processes=10*.log_archive_format='%t_%s_%r.dbf'*.open_cursors=300*.pga_aggregate_target=199229440*.processes=150*.remote_login_passwordfile='EXCLUSIVE'*.sga_target=597688320*.undo_management='AUTO'*.undo_tablespace='UNDOTBS1'*.user_dump_dest='/u01/oracle/admin/jadl10g/udump'[oracle@oracle ~]$ mkdir /u01/oracle/admin/jadl10g/{a,b,c,u}dump -p[oracle@oracle ~]$ mkdir /u01/oracle/oradata/jadl10g[oracle@oracle ~]$ mkdir /u01/oracle/flash_recovery_area/jadl10g[oracle@oracle ~]$ rman target /Recovery Manager: Release 10.2.0.5.0 - Production on Thu Nov 6 20:35:03 2014Copyright (c) 1982, 2007, Oracle. All rights reserved.connected to target database (not started)RMAN> startup nomountconnected to target database (not started)Oracle instance startedTotal System Global Area 599785472 bytesFixed Size 2098112 bytesVariable Size 163580992 bytesDatabase Buffers 427819008 bytesRedo Buffers 6287360 bytesRMAN> restore controlfile from '/u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_ncsnf_TAG20141106T202102_b5psyngf_.bkp';Starting restore at 06-NOV-14using channel ORA_DISK_1channel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:03output filename=/u01/oracle/oradata/jadl10g/control01.ctloutput filename=/u01/oracle/flash_recovery_area/jadl10g/control02.ctlFinished restore at 06-NOV-14RMAN> alter database mount;database mountedreleased channel: ORA_DISK_1RMAN> restore database;Starting restore at 06-NOV-14Starting implicit crosscheck backup at 06-NOV-14allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=156 devtype=DISKCrosschecked 1 objectsFinished implicit crosscheck backup at 06-NOV-14Starting implicit crosscheck copy at 06-NOV-14using channel ORA_DISK_1Crosschecked 1 objectsFinished implicit crosscheck copy at 06-NOV-14searching for all files in the recovery areacataloging files...cataloging doneList of Cataloged Files=======================File Name: /u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_ncsnf_TAG20141106T202102_b5psyngf_.bkpusing channel ORA_DISK_1channel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00001 to /u01/oracle/oradata/jadl10g/system01.dbfrestoring datafile 00002 to /u01/oracle/oradata/jadl10g/undotbs01.dbfrestoring datafile 00003 to /u01/oracle/oradata/jadl10g/sysaux01.dbfrestoring datafile 00004 to /u01/oracle/oradata/jadl10g/users01.dbfrestoring datafile 00005 to /u01/oracle/oradata/jadl10g/example01.dbfchannel ORA_DISK_1: reading from backup piece /u01/or<strong style="color:transparent">来源gaodai#ma#com搞@代~码$网</strong>acle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T202102_b5psxhko_.bkpchannel ORA_DISK_1: restored backup piece 1piece handle=/u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T202102_b5psxhko_.bkp tag=TAG20141106T202102channel ORA_DISK_1: restore complete, elapsed time: 00:00:35Finished restore at 06-NOV-14RMAN> recover database;Starting recover at 06-NOV-14using channel ORA_DISK_1starting media recoveryunable to find archive logarchive log thread=1 sequence=1RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of recover command at 11/06/2014 20:39:55RMAN-06054: media recovery requesting unknown log: thread 1 seq 1 lowscn 485958RMAN> recover database until scn 485958;Starting recover at 06-NOV-14using channel ORA_DISK_1starting media recoveryunable to find archive logarchive log thre【本文来自鸿网互联 (http://www.68idc.cn)】ad=1 sequence=1RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of recover command at 11/06/2014 20:40:17RMAN-06054: media recovery requesting unknown log: thread 1 seq 1 lowscn 485958RMAN> recover database noredo;Starting recover at 06-NOV-14using channel ORA_DISK_1Finished recover at 06-NOV-14RMAN> alter database open resetlogs;database openedRMAN> exitRecovery Manager complete.[oracle@oracle ~]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.5.0 - Production on Thu Nov 6 20:47:03 2014Copyright (c) 1982, 2010, Oracle. All Rights Reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit ProductionWith the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engineand Real Application Testing optionsSQL> select name from v$datafile;NAME--------------------------------------------------------------------------------/u01/oracle/oradata/jadl10g/system01.dbf/u01/oracle/oradata/jadl10g/undotbs01.dbf/u01/oracle/oradata/jadl10g/sysaux01.dbf/u01/oracle/oradata/jadl10g/users01.dbf/u01/oracle/oradata/jadl10g/example01.dbf

备份文件 不用删除 在备份设备上保留冗余备份
归档日志 不要删除 在备份设备上保留归档日志
日志文件一定要分开放,不要造成日志文件组成员全部丢失
数据文件丢失有故障,是可以恢复的
使用重建控制文件,备份控制文件恢复,resetlogs打开数据库都需要重新备份backup database;


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:【执行灾难性恢复-1】
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址