【執行災難性恢複-1】,執行災難-1

來源:互聯網
上載者:User

【執行災難性恢複-1】,執行災難-1
執行災難恢複:
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Nov 6 20:23:30 2014
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine
and Real Application Testing options

SQL> shutdown abort
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine
and 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.f
alert_jadl10g.log  initd10g.ora    lk+ASM     orapwd10g     spfile+ASM.ora
hc_+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 2014
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
connected to target database (not started)

RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/oracle/10g/dbs/initjadl10g.ora'
starting Oracle instance without parameter file for retrival of spfile
Oracle instance started
Total System Global Area     159383552 bytes
Fixed Size                     2094736 bytes
Variable Size                 67111280 bytes
Database Buffers              83886080 bytes
Redo Buffers                   6291456 bytes

RMAN> restore spfile from '/u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_ncsnf_TAG20141106T202102_b5psyngf_.bkp';
Starting restore at 06-NOV-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK
channel ORA_DISK_1: autobackup found: /u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_ncsnf_TAG20141106T202102_b5psyngf_.bkp
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 06-NOV-14

RMAN> shutdown abort;
Oracle instance shut down

RMAN> exit
Recovery Manager complete.
[oracle@oracle ~]$ strings $ORACLE_HOME/dbs/spfilejadl10g.ora
jadl10g.__db_cache_size=427819008
jadl10g.__java_pool_size=4194304
jadl10g.__large_pool_size=4194304
jadl10g.__shared_pool_size=155189248
jadl10g.__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 2014
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
connected to target database (not started)
RMAN>  startup nomount
connected to target database (not started)
Oracle instance started
Total System Global Area     599785472 bytes
Fixed Size                     2098112 bytes
Variable Size                163580992 bytes
Database Buffers             427819008 bytes
Redo Buffers                   6287360 bytes

RMAN> restore controlfile from '/u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_ncsnf_TAG20141106T202102_b5psyngf_.bkp';
Starting restore at 06-NOV-14
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output filename=/u01/oracle/oradata/jadl10g/control01.ctl
output filename=/u01/oracle/flash_recovery_area/jadl10g/control02.ctl
Finished restore at 06-NOV-14

RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1

RMAN> restore database;
Starting restore at 06-NOV-14
Starting implicit crosscheck backup at 06-NOV-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 06-NOV-14
Starting implicit crosscheck copy at 06-NOV-14
using channel ORA_DISK_1
Crosschecked 1 objects
Finished implicit crosscheck copy at 06-NOV-14
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_ncsnf_TAG20141106T202102_b5psyngf_.bkp
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/oracle/oradata/jadl10g/system01.dbf
restoring datafile 00002 to /u01/oracle/oradata/jadl10g/undotbs01.dbf
restoring datafile 00003 to /u01/oracle/oradata/jadl10g/sysaux01.dbf
restoring datafile 00004 to /u01/oracle/oradata/jadl10g/users01.dbf
restoring datafile 00005 to /u01/oracle/oradata/jadl10g/example01.dbf
channel ORA_DISK_1: reading from backup piece /u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T202102_b5psxhko_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T202102_b5psxhko_.bkp tag=TAG20141106T202102
channel ORA_DISK_1: restore complete, elapsed time: 00:00:35
Finished restore at 06-NOV-14

RMAN> recover database;
Starting recover at 06-NOV-14
using channel ORA_DISK_1
starting media recovery
unable to find archive log
archive log thread=1 sequence=1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 11/06/2014 20:39:55
RMAN-06054: media recovery requesting unknown log: thread 1 seq 1 lowscn 485958

RMAN> recover database until scn 485958;
Starting recover at 06-NOV-14
using channel ORA_DISK_1
starting media recovery
unable to find archive log
archive log thread=1 sequence=1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 11/06/2014 20:40:17
RMAN-06054: media recovery requesting unknown log: thread 1 seq 1 lowscn 485958

RMAN> recover database noredo;
Starting recover at 06-NOV-14
using channel ORA_DISK_1
Finished recover at 06-NOV-14

RMAN> alter database open resetlogs;
database opened

RMAN> exit
Recovery Manager complete.
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Nov 6 20:47:03 2014
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine
and Real Application Testing options

SQL> 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;

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.