美文网首页linux redhat & Oracle
非归档模式下增量备份后的恢复

非归档模式下增量备份后的恢复

作者: 重庆思庄 | 来源:发表于2019-04-12 16:36 被阅读0次

非归档模式下增量备份后的恢复

已经使用增量备份对数据库进行备份后,数据库出现问题,某些文件不存在了,那么这时只能恢复到上次备份的时刻

1.关闭数据库

SQL> connect / as sysdba

Connected.

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

2.删除数据文件

[oracle@dbserver sztech1]$ ls -ltr /oracle/app/oracle/oradata/sztech1/*.dbf

-rw-r----- 1 oracle dba  52436992 Aug 20 18:34 /oracle/app/oracle/oradata/sztech1/temp02.dbf

-rw-r----- 1 oracle dba  13115392 Aug 20 19:09 /oracle/app/oracle/oradata/sztech1/users01.dbf

-rw-r----- 1 oracle dba 110108672 Aug 20 19:09 /oracle/app/oracle/oradata/sztech1/undotbs01.dbf

-rw-r----- 1 oracle dba 922755072 Aug 20 19:09 /oracle/app/oracle/oradata/sztech1/system01.dbf

-rw-r----- 1 oracle dba 692068352 Aug 20 19:09 /oracle/app/oracle/oradata/sztech1/sysaux01.dbf

-rw-r----- 1 oracle dba  20979712 Aug 20 19:09 /oracle/app/oracle/oradata/sztech1/idx01.dbf

-rw-r----- 1 oracle dba 471867392 Aug 20 19:09 /oracle/app/oracle/oradata/sztech1/example01.dbf

[oracle@dbserver sztech1]$ rm -fr system01.dbf

[oracle@dbserver sztech1]$ rm -fr undotbs01.dbf

[oracle@dbserver sztech1]$ ls -ltr

total 1335532

-rw-r----- 1 oracle dba  52436992 Aug 20 18:34 temp02.dbf

-rw-r----- 1 oracle dba  52429312 Aug 20 19:04 redo03.log

-rw-r----- 1 oracle dba  52429312 Aug 20 19:04 redo02.log

-rw-r----- 1 oracle dba  13115392 Aug 20 19:09 users01.dbf

-rw-r----- 1 oracle dba 692068352 Aug 20 19:09 sysaux01.dbf

-rw-r----- 1 oracle dba  52429312 Aug 20 19:09 redo01.log

-rw-r----- 1 oracle dba  20979712 Aug 20 19:09 idx01.dbf

-rw-r----- 1 oracle dba 471867392 Aug 20 19:09 example01.dbf

-rw-r----- 1 oracle dba   9748480 Aug 20 19:09 control01.ctl

[oracle@dbserver sztech1]$

3.启动到mount

oracle@dbserver sztech1]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Mon Aug 20 19:11:43 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

SQL> connect / as sysdba

Connected to an idle instance.

SQL> startup mount;

ORACLE instance started.

Total System Global Area  619360256 bytes

Fixed Size                  1346700 bytes

Variable Size             411042676 bytes

Database Buffers          201326592 bytes

Redo Buffers                5644288 bytes

Database mounted.

4.使用rman 登陆到数据库

oracle@dbserver sztech1]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Aug 20 19:13:09 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: SZTECH1 (DBID=3206860853, not open)

RMAN>

5.还原数据库

RMAN> restore database;

Starting restore at 20-AUG-12

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=133 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_DISK_1: restoring datafile 00001 to /oracle/app/oracle/oradata/sztech1/system01.dbf

channel ORA_DISK_1: restoring datafile 00002 to /oracle/app/oracle/oradata/sztech1/sysaux01.dbf

channel ORA_DISK_1: restoring datafile 00003 to /oracle/app/oracle/oradata/sztech1/undotbs01.dbf

channel ORA_DISK_1: restoring datafile 00004 to /oracle/app/oracle/oradata/sztech1/users01.dbf

channel ORA_DISK_1: restoring datafile 00005 to /oracle/app/oracle/oradata/sztech1/example01.dbf

channel ORA_DISK_1: restoring datafile 00006 to /oracle/app/oracle/oradata/sztech1/idx01.dbf

channel ORA_DISK_1: reading from backup piece /oracle/app/oracle/fast_recovery_area/SZTECH1/backupset/2012_08_20/o1_mf_nnnd0_TAG20120820T185705_834601rt_.bkp

channel ORA_DISK_1: piece handle=/oracle/app/oracle/fast_recovery_area/SZTECH1/backupset/2012_08_20/o1_mf_nnnd0_TAG20120820T185705_834601rt_.bkp tag=TAG20120820T185705

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:01:15

Finished restore at 20-AUG-12

6.进行介质恢复

RMAN> recover database;

Starting recover at 20-AUG-12

using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 1 is already on disk as file /oracle/app/oracle/oradata/sztech1/redo01.log

archived log file name=/oracle/app/oracle/oradata/sztech1/redo01.log thread=1 sequence=1

media recovery complete, elapsed time: 00:00:02

Finished recover at 20-AUG-12

7.打开数据库

RMAN> alter database open resetlogs;

database opened

必须使用resetlogs方式打开数据库.

相关文章

  • 非归档模式下增量备份后的恢复

    非归档模式下增量备份后的恢复 已经使用增量备份对数据库进行备份后,数据库出现问题,某些文件不存在了,那么这时只能恢...

  • rman备份

    一、数据库备份与RMAN备份的概念 1.数据库完全备份:按归档模式分为归档和非归档 归档模式 ...

  • PostgreSQL使用PG_Rman进行物理备份

    背景 在Oracle下我们可以使用rman进行物理备份,支持数据库的全量、增量、归档的备份模式而PostgreSQ...

  • 【MySQL】xtrabackup实战版

    备份脚本 全量备份脚本 增量备份脚本 全量恢复 增量恢复 全量备份脚本 增量备份脚本 目录结构 其中mysql_d...

  • Oracle rman 迁移(同版本)

    1.执行rman备份 rman备份包括全备,增量备份(可选),归档或归档备份,控制文件备份(可以用全备之后的控制文...

  • Mysql备份恢复

    备份恢复 例如 例如 例如: xtrabackup 例如 例如 增量备份

  • 备份恢复

    备份恢复 在备份恢复需要做哪些工作 设计备份策略 备份周期 天,周,月 备份方式 全备,增量.... 备份什么? ...

  • MySql备份·增量备份percona

    一、增量备份定义: 增量备份是备份上次备份后新产生的数据,所以在执行增量备份之前 必须要先有一次备份,否则无法得知...

  • 2019-04-15-MySQL备份恢复

    运维的备份恢复相关的职责1.1 设计备份策略全备 、增量、时间、自动 1.2 日常备份检查备份存在性备份空间够用...

  • MySQL第二章备份恢复

    1. 运维的备份恢复相关的职责 1.1 设计备份策略 全备 、增量、时间、自动 1.2 日常备份检查 备份存在性...

网友评论

    本文标题:非归档模式下增量备份后的恢复

    本文链接:https://www.haomeiwen.com/subject/dkzcwqtx.html