【执行灾难性恢复-1】

执行灾难恢复:

[[email protected] ~]$ 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

[[email protected] ~]$ rm /u01/oracle/oradata/jadl10g/ -rf

[[email protected] ~]$ rm /u01/oracle/admin/jadl10g/ -rf

[[email protected] ~]$ rm /u01/oracle/flash_recovery_area/jadl10g/ -rf

[[email protected] ~]$ 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

[[email protected] ~]$ rm /u01/oracle/10g/dbs/*jadl10g* -rf

***注意该文件不能删除,如果删除了就不能恢复了***

[[email protected] ~]$ ls /u01/oracle/flash_recovery_area/JADL10G/

archivelog  backupset  datafile  onlinelog

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

[[email protected] ~]$ 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.

[[email protected] ~]$ 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‘

[[email protected] ~]$ mkdir /u01/oracle/admin/jadl10g/{a,b,c,u}dump -p

[[email protected] ~]$ mkdir /u01/oracle/oradata/jadl10g

[[email protected] ~]$ mkdir /u01/oracle/flash_recovery_area/jadl10g

[[email protected] ~]$ 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.

[[email protected] ~]$ 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;

时间: 2024-12-18 23:08:00

【执行灾难性恢复-1】的相关文章

Linux系统灾难性恢复

再稳定牛哔的系统也有老牛卸耙的时候...而Linux大部分灾难性崩溃都出在启动阶段. 要快速判断问题原因先简单解下Linux启动顺序: Power→加载MBR→Bootloader(GRUB引导)→加载内核→init设定runlevel→rc.sysinit... 其中关键的位置是位于硬盘上0磁头0柱面1扇区上面的MBR引导记录文件 #MBR共计512字节,446字节bootloader,64字节分区表,2字节结束标识 一.硬盘分区表被破坏 生产环境中的 Linux 服务器可能会因为病毒或者意外

(Les16 执行数据库恢复)-表空间恢复

NOARCHIVELOG模式下丢失了数据文件 数据库处于NOARCHIVELOG模式时,如果丢失任何数据文件,执行以下步骤 1.如果实例尚未关闭,请关闭实例 2.从备份还原整个数据库,包括所有数据文件和控制文件 3.打开数据库 4.让用户重新输入自上次备份以来所做的所有更改 ARCHIVELOG模式下丢失了非关键性数据文件(SYSTEM,UNDO除外) 仅仅恢复当前数据文件不用整库恢复,不需要停机 1.数据文件离线 2.restore数据文件,介质恢复 3.recover事务 4.数据文件联机

exchange灾难性恢复

初级篇: 在原来的环境中,重置以前的exchange服务器计算机账户, 重新部署一台跟原来一样的exchange服务器,并且安装exchange. eseutil /mh "F:\Program Files\Microsoft\Exchange Server\V14\Mailbox\db1\db1.edb" 执行数据库文件与日志文件一致性检查 New-MailboxDatabase -Name db03 -Server exchange2010 -EdbFilePath "c

远程执行命令恢复

监控项 : system.run[cat /etc/zabbix/scripts/sql_lock/lock.txt] 字符串 触发器 : {192.168.8.116:system.run[cat /etc/zabbix/scripts/sql_lock/lock.txt].strlen()}>0 在监控项和触发项做好后,需要对某服务的进程数进行监控,保证服务是否正常启动 在动作这块需要将条件分配好,将操作配置如下: 使用zabbix客户端执行命令时 , 请确保sudo权限在非终端在执行 De

[转]Oracle DB 使用RMAN执行恢复

? 在丢失关键或非关键数据文件后执行完全恢复 ? 使用增量更新的备份进行恢复 ? 切换到映像副本进行快速恢复 ? 将数据库还原到新主机上 ? 使用备份控制文件进行恢复 使用RMAN RESTORE和RECOVER命令 ? RESTORE命令:从备份中还原数据库文件 ? RECOVER命令:通过应用增量备份和重做日志文件中记录的更改来恢复已还原文件 RMAN> SQL 'ALTER TABLESPACE inv_tbs OFFLINE IMMEDIATE'; RMAN> RESTORE TABL

ClientDataSet中撤消与恢复操作及执行细节

利用ClientDataSet的XMLData成员是数据的XML表达,可以非常直观的观察在执行撤消恢复等操作的细节.帮助我们区分几种撤消与恢复操作的不同. 请注意下图中的 CHANGE_LOG的值ROW RowState项和程序标题ChangeCount在执行不同操作时的变化. **************************************************************************************************************

oracle数据库完全恢复和不完全恢复以及执行用户管理辈分恢复

比较完全恢复和不完全恢复: 一.完全恢复:将数据库恢复到当前最新状态,包括直至请求恢复时进行的所有已提交的数据更改 二.不完全恢复:将数据库恢复到请求恢复操作之前指定的过去时间点 一.完全恢复过程 下面的步骤说明了执行完全恢复期间要采取的操作: 1. 通过备份还原损坏或丢失的文件. 2. 根据需要应用增量备份.归档重做日志文件和联机重做日志文件中的更改.将重做日志更改应用于数据文件,直到到达当前联机日志,并且重新输入了最新的事务处理.在整个过程中会生成还原块.这称为前滚或高速缓存恢复. 3. 此

如何用Dummy实例执行数据库的还原和恢复

今天实验了一下,如何在所有文件,包括数据文件,在线日志文件,控制文件都丢失的情况下,利用RMAN备份恢复和还原数据库.该实验的重点是用到了Dummy实例. 具体步骤如下: 备份数据库 [[email protected] ~]$ rman target / Recovery Manager: Release 11.2.0.4.0 - Production on Mon May 25 23:25:51 2015 Copyright (c) 1982, 2011, Oracle and/or its

[转]Oracle DB 执行表空间时间点恢复

• 列出在执行表空间时间点恢复(TSPITR) 时会发生的操作 • 阐释TSPITR 使用的术语的定义 • 确定适合将TSPITR 用作解决方案的情况 • 确定时间点恢复的正确目标时间 • 确定不能使用TSPITR 的情况以及解决方法 • 执行自动TSPITR 表空间时间点恢复(TSPITR):概念 • 通过执行TSPITR 可将一个或多个表空间快速恢复到以前的某个时间. • 执行TSPITR 不会影响数据库中其它表空间或对象的状态. 使用RMAN 自动表空间时间点恢复(TSPITR) 可将Or