日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ORACLE利用STANDBY端RMAN备份进行数据恢复

發布時間:2023/12/4 编程问答 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ORACLE利用STANDBY端RMAN备份进行数据恢复 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
這里記錄一下流程,有我和同事問心進行測試

dataguard主庫和物理備庫主要是controlfile文件有區別,用restore可以查看含有primary,standby關鍵字
RMAN> restore ;


RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "archivelog, channel, check, controlfile, database, datafile, device, force, from, high, preview, primary, skip readonly, spfile, standby, tablespace, to restore point, until restore point, until, validate, ("
RMAN-01007: at line 1 column 9 file: standard input




RMAN> restore primary;


RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "controlfile"
RMAN-01007: at line 1 column 16 file: standard input






利用物理備庫rman備份文件恢復過程:


SQL> startup nomount;
ORACLE instance started.


Total System Global Area 1043886080 bytes
Fixed Size ? ? ? ? ? ? ? ? ?2259840 bytes
Variable Size ? ? ? ? ? ? 775947392 bytes
Database Buffers ? ? ? ? ?260046848 bytes
Redo Buffers ? ? ? ? ? ? ? ?5632000 bytes


[oracle@std]$ rman target/


Recovery Manager: Release 11.2.0.4.0 - Production on Mon Sep 26 15:09:14 2016


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


connected to target database: DG (not mounted)


RMAN> restore primary controlfile from '/u01/app/oracle/product/11.2.0/dbhome1/dbs/c-1832575162-20160926-01';


Starting restore at 26-SEP-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK


channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/dg/control01.ctl
output file name=/u01/app/oracle/oradata/dg/control02.ctl
Finished restore at 26-SEP-16


RMAN> sql 'alter database mount';


sql statement: alter database mount
released channel: ORA_DISK_1


SQL> select open_mode,database_role from v$database;


OPEN_MODE ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DATABASE_ROLE
------------------------------------------------------------ ------------------------------------------------
MOUNTED ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PRIMARY




RMAN> restore database;


Starting restore at 26-SEP-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 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 /u01/app/oracle/oradata/dg/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/dg/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/dg/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/dg/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/dg/example01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/dg/lieb01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/dbhome1/dbs/19rgpgsu_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/dbhome1/dbs/19rgpgsu_1_1 tag=TAG20160926T145629
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:56
Finished restore at 26-SEP-16




RMAN> recover database;


Starting recover at 26-SEP-16
using channel ORA_DISK_1


starting media recovery


archived log for thread 1 with sequence 0 is already on disk as file /u01/app/oracle/oradata/dg/redo03.log
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=19
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/dbhome1/dbs/18rgpgss_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/dbhome1/dbs/18rgpgss_1_1 tag=TAG20160926T145628
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/home/oracle/archivelog/DG/1_19_922121441.dbf thread=1 sequence=19
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=20
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/dbhome1/dbs/1argph09_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/dbhome1/dbs/1argph09_1_1 tag=TAG20160926T145817
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/home/oracle/archivelog/DG/1_20_922121441.dbf thread=1 sequence=20
unable to find archived log
archived log thread=1 sequence=21
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/26/2016 15:20:49
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 21 and starting SCN of 1402274








SQL> alter database open resetlogs;


Database altered.


SQL> select open_mode,database_role from v$database;


OPEN_MODE ? ? ? ? ? ?DATABASE_ROLE
-------------------- ----------------
READ WRITE ? ? ? ? ? PRIMARY

作者微信:

? ? ? ? ? ? ? ?

總結

以上是生活随笔為你收集整理的ORACLE利用STANDBY端RMAN备份进行数据恢复的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。