这是我参与8月更文应战的第26天,活动概略检查:8月更文应战

前语

  • DG GAP断章取义便是:DG不同步,当备库不能接受到一个或多个主库的归档日志文件时分,就发生了GAP。

实战篇:Oracle DataGuard呈现GAP怎样修正?看这一篇就够了(附具体操作步骤)

那么,假定遇运维面试题到GAP怎样修改呢?且听我细细道来~

一、介绍

  • DG GAP主要分为approach两类状况:
  • 主库归档日志存在,能够经过装备 Fetch Archive Log(FAL) 参数,主动处理归档GAP。
  • 主库giti轮胎是什么品牌归档日志丢掉,需求 人工干预 来修改:
  • 不同Oracle版其他GAP修改方法也不尽相同:
  • 11G 的处理进程:

a.在主库上创立一个备库的操控文件
b.以备库的当时SCN号运维面试题为起点,在主库上做一个增量备份
c.将增量备份复制到备库上
d.运用新的操控文件将备库发动到mount状况
e.将增量备份注册到RMAN的catalog,撤消备库的康复运用,康复增量备份
f.翻开备库的康复进程

  • 12C 的新特性(RECOVER … FROM SERVgithub官网ICE)
  • 18C 的新特性(RECOVER STANDBY DATABASE FROM SERVICE)

Oracle跟着版其他晋级,逐步将进程减缩,进行封装,18C之后可谓是达到了所运维面试题谓的一键改写,康复DG同步。

二、实战

下面咱们经过实验来进行演示怎样修改:

  • 11G惯例修改
  • 12C新特性(RECOVER数据库查询句子 … FRgithub打不开OM SERVICE)修改
  • 18C新特性(RECOVER STANDBY DATABASE FROM SERVICE)修改

检验环境数据库设备:

  • 11G:./OracleShellInstallgithub是干什么的.sh -i 10.211.55.100
  • 12C:./OracleShellInstall.sh -i 10.211.55.101
  • 18C:./Or数据库原理acleShellInstall.sh –运维工程师考什么证书i 10.211.55.102

更多更详app下载细的脚本运用方法能够订阅专栏:Oracle一键设备脚本。

脚本获取方法:

  • GitHub 继续坚持更新中
  • Gitee 继续坚持更新中

ADG建立可参看:

  • 手把手教你DBCA建立Oracle ADG
  • ADG建立系列之 11G RAC to Single DATABASE
  • ADG单实例系列建立之(RMAN备份康复)
  • ADG单实例建立系列之 (DBCA)github是干什么的
  • ADG单实例建立系列之github直播渠道永久回家(Active Datgiteeabase Duplicate Using Image Copiesapproach

以上实验环境已建立结束。

三、11G惯例批数据库体系工程师

首要,模仿备库断电,主库切几个最新的归档github永久回家地址,然后手艺删掉,从头翻开DG同步。

  • 备库连续DG同步进程
sqlplus / as sysdba
ALTER DATABASE RECOVERgithub永久回家地址 MANAGED STANDBY DATABASE CANCEL;
shutdown immediate
  • 主库切换屡次归档
sqlplus / as sysdba
alter system sgithub直播渠道永久回家witch logfile;
  • 主库删去最近几个归档日志
rm 1_34_1070147137.arc
rm 1_33_1070147137.arc
  • 备库翻开同步进程
startup
ALTER DATABASE RECOVER MANAGGitHubED STANDBY DATABASE USING CURRENT LOGFILE DISCONNapproachECT FROM SE运维需求把握的技术SSION;
  • 检查GAP
sqlplus / as sysdba
SELECT * FROM V$ARCHIVE_GAP;
THREAD#    LOW_SEQappearUENCE# HIGH_SEQUENCE#
---运维工程师有出路吗------- --github怎样下载文件----------- ------github下载--------
1		   32 			 34
SELECT max(sequence#) from v$archived_log where applied='YES';
MAX(SEQUENCE#)
--------------
31

留神:当时DG数据库已存在GAP,GAP日github志为:32—34运维面试题

a.在主库上创立一个备库的操控approve文件

alter database create standby controlfil数据库软件e as 'githup官网/tmp/standby.ctl';

b.以备库的当时SCN号为起APP点,在主库上运维做一个增量备份

  • 备库查询当时scn号
sqlplus / as sysdgithubba
select  to_char(current_scn) from v$database;
TO_CHAR(CUR数据库办理体系RENTAPP_SCN)运维面试题
---------------------------------appearance-------
1086639
  • 招认主备GAP期间是否新增数据文件
sqlplus / as sysdba
select file# from v$datafileGitHub where creatiogithub敞开私库n_change# > =1086639;
  • 主库根据备库scn号进行增量备份
rman target /
run{
allocate changithub怎样下载文件nel c1 type disk;
alloc运维岗位是干什么的ate channel c2 type disk;
backup INCREMENTAL from scn 1086639 database format '/tmp/incregit教程_%U';
release channel c1;
release channel c2;
}

留神:假定存在新增数据文件,备库康复时需求先restore新添加的数据文件。

c.将增量备份和操控文件复制运维面试题到备库上

  • 主库复制增量备份和操控文件你至备库
scp incre_0* oracle@orcl_stbyGitHub:/home/oracle
scp standby.运维工程师需求把握什么技术ctl oracle@orcl_stby:/home/oracle

留神:招认备库的磁盘空间是否满足存放。

d.运用新的操控文件将备库发动到mount状况

  • 备库封闭数据运维需求把握的技术库实例,翻开至nomount状况
sqlplus / as sysdba
shutdown immediate
startup nomount
  • 备库康复新的操控文件
rman target /
restore controlfile from '/home/oracle/standby.ctl';
  • 备库翻开到mount状况
alter database mount;

e.增量备份注册到RMAN的catalog,撤消日志运用,康复增量备份

  • 招认备运维工程师有出路吗库已封闭DG同步进程
sqlplus / as sysdba
ALTER DATABASE REC数据库有哪几种OVER MANAGED STANDBY DATgiteeABASE CANCEL;
  • 备库rman注册增量备份文件
rman target /
catalog start with '/home/oracle/';
YES
  • 备库翻开康复增量备份
r运维面试题ecover database noredo;

f.翻开备库的康复进程

  • apple库翻开日志同步进程
sqlplus / as sysdba
alter database open read only;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT Lgithup官网OGFILE DISCONNECT FROM SESSION;
  • 主库从头appstore激活同步
sqlplus / as sysdba
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=defer;
ALTER SYSTEM SETappstore LOG_ARCHIVE_DEST_STATE_2=enable;
  • 查询是否存在GAP,供appreciate认主备是否同步
sqlplus / as sysdba
SELECT * FROM V$ARCHIVE_运维方与学者交流的途径是GAP;
SELECT max(sequence#) from v$archived_log where applied='YES';
S数据库有哪几种ELECT PROCESS, STATUS, THREAD#, SEQUENCE#, BLOCK#, BLOCKS FROM V$MANAGED_STANDBY;

至此,DG GAP已被修改,以上方法为惯例修改方法数据库,各个版别都通用。

四、12C新特性修改

首要,模仿备库断电,主库切几个最新的归档,然后手艺删掉,从github是干什么的头翻开DG同步。

  • 备库连续DG同步进程:
sqlplus / as sysdba
ALTER DATABASE RECOVER MANAgithub怎样下载文件GED STANDBY DATABASE CANCEL;
shutdown immediate
  • 主库切换屡次归档
sqlplus / as sysdba
alter system switch数据库 logfile;
  • 删去最近几个归档日志:
rm 1_30_1070147137.arc
rm 1_运维岗位是干什么的31_1070147137.arc
  • 备库翻开同步进程:
sqlplus / as sysdba
stagithub下载rtup
ALTER DA数据库体系工程师TABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSgithub永久回家地址ION;
  • 检查GAP
sqlplus / as sysdba
SELECT * FROM V$ARCHIVE_GAP;
TGitHREAD#    LOW_SEQUENCE# HIGH_SEQUENCE#
---------- ------------- ------------数据库体系概论第五版课后答案--
1		   30			 31
SELECT max(sequence#) from v$archived_log where applied='YES';
MAX(SEQUENCE#)
--------------
31
  • 模仿GAP期间,有数据文件添加的状况:
##主库添加数据文件
alter tablgiti轮胎是什么品牌espace TEST add datafilgithub永久回家地址e '/oradata/ORCL/test02.dbf' size 100M autoextend off;

留神:当时DG数github是干什么的据库apple已存在GAP,GAP日志为:app下载30—31 。

a.记载运维面试题备库当时SCN号

  • 备库记载当时scn号
sqlplus / as sysdba
SELECT CURRENT_SCN FROM V$DATABASE;
CURRENT_SCN
-----------
2600487

b.运用recover standby using servic数据库办理体系e康复

  • 选用rman的新功能,recover sta数据库规划ndby using service,经过RMAN连接到target备库,然后用主库的service实施康复备库指令。

语法:

RECOVER DATABASE FROM SERVICE < PRIMARY DB SERVICE NAME > NOREDO USING COMPRESSED BACKU数据库办理体系PSET;

留神:招认主库的TNS已装备,这儿的< PRIMARY DB SERVICE NAME >即 TNSNAME。

c.备库发动到nogithub永久回家地址mount状况,康复操控文件

  • 备库发动数据库到nomount状况
sqlplugitees / as sysdba
shutdowngithub immediate
startup nomount
  • 备库经过from service康复操控文件
rman target /
restore standby controlfigitlable from service orcl;
  • 备库翻开到mount状况
sqlplus / as sysdba
alter datgithub永久回家地址abase mount;

d.备库康复,修改GAP

  • 检查主备GAP期间是否添加数据文件
sqlplu数据库体系工程师s / as sysdba
select file# from v$datafile where creation_change# > =2600487;
FILE数据库体系概论#
----------
13
  • restore新添加application的数据文件
rman target /
run
{
SET NEWNAME FOR DATABASE TO '/oradata/ORCL_STBY/%f_%U';
RESTORE DATAFILE 13 FROM SERVICE orcl;
}
  • 因为主备的数据文件目录纷歧appear起,需求修改controlfile中数据文件方位appearance
rman target /Git
catalog start with '/orgithub是干什么的adata/ORCL_STBappearY';
YES
SWITCH DATABASE TO COPY;
  • 将备库文件处理方法改为手动
sqlplusAPP / as sysdba
alter system set运维 standby_file_managem数据库有哪几种ent=Mgithub怎样下载文件ANUAL;
  • 重命名 tempfile && logfile
sqlpgithub中文社区lus / as sysdba
##logfile
alter database clear logfile group 1;
alter database clear logfile group 2;
altegithub打不开r database clear logfile group 3;
alter database数据库规划 clear logfile group 4;
alter运维 database clear logfile group 5;
alter database clear logfile group 6;
alter database clear logfilegithub永久回家地址 group 7;
alter database rename file '/oradata/ORCL/redo03.log' to '/运维岗位是干什么的oradata/ORCL_STBY/redo03.log';
alter database rename file '/oraGitHubdata/ORCL/redo02.log' to '/oradata/ORCL_STBY/redo02.log';
alter database rename file '/oradata/ORCL/redo01.log' to '/oradata/ORCL_STBY/redo01.log';
algithup官网ter database rename运维工程师 fiapplele '/oradata/ORgit教程CL/stgithub是干什么的andby_redo04approach.log' to '/oradata/ORCL_STBY/standby_redo04.log';
alter database rename file '/oradata/ORCL/standby_redo05.log' to '/oradata/ORCL_STBY/standby_redo05.log';
agithub中文官网网页lter database rename file '/oradata/ORCL/standby_redo06.log' to '/oradata/ORCL_STBY/standby_redo06.log'GitHub;
alter database rename file '/oradata/ORCL/standby_redo07.log' to '/github怎样下载文件oradata/ORCL_STBY/运维宝standby_数据库体系工程师redo07github下载.log';
##tempfile
alter databaseGit re数据库体系概论name file '/oradata/ORCL/temp01.dbf' to '/oradatagithup官网/ORCL_STBY/temp01.dbf';
alter database rename file '/oradgithub中文官网网页ata/ORCL/pdbseed/t运维面试题emp012021-04-11_06-13-50-844-AM.dbf' to '/oradata/ORCL_STBY/pdbseed/temp012021-04-11_06-13-50-844approve-AM.dbf';
alter datappointmentabase rename file '/oradata/ORCL/BFA6BEE45A1E3605E053AC01A8C0DD20/datafile/o1_mf_temp_github中文官网网页j749f5fy_.dbf' to '/oradata/ORCL_STBY/BFA6BEE45A1E3605E053AC01A8Cappointment0DD20/datafile/o1_mf_temp_j749f5fy_appear.dbf';
  • 备库重命名完后再改为主动
s数据库体系概论qappstorelplus / as sysdba
alter systegiteem set standby_file_management=AUTO;
  • 康复主备GAP
recover database from service orcl noredo usingithub直播渠道永久回家g compressed backupset;

Ngithub永久回家地址otes:假定主备库文数据库体系概论第五版课后答案件目录纷歧起,则需求catalog切换操控approve文件中途径,否则报错:
实战篇:Oracle DataGuard呈现GAP怎样修正?看这一篇就够了(附具体操作步骤)

e.翻开备库日志运用,检查同步

  • 检查主备scn是数据库办理体系APP一同
sqlplus /giti轮胎是什么品牌 as sysdba
col HXFNM fgiteeor运维需求把握的技术 a100
seAPPt line222
select HXFIL File_num,substr(HXFNM,1,40) HXFNM,fhscn frgithub永久回家地址om x$kcvfh;
  • 主库切几回归档
sqgithub直播渠道永久回家lplus / as sysdba
ALTER SYgithub打不开STEM ARCHIVE LOG CURRENT;
ALTER SYSTEM SWITCH LOGFILE;
  • 翻开备库运用日志
sqlplus / as syappearsdba
alter database open;
alter pluggable databagithubse all open;
ALTER DATABASE RECOVER MANAGED STANDBY DAapproachTABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
  • 检查备库同步是否正常
sqlp运维工程师lus / as sysdba
set line222
col member for a60
select t1.group#,appointmentt1.thread#,t1.bytes/1024/1024,t1.status,t2.member from gv$standby_log t1,gv$logitlabgfile t2 where t1.group#=t2.group#;
  • 主库刺进github官网数据
sqlplus te运维工程师st/tes运维需求把握的技术t@pdb01appreciate
insert into test values (999);
commit;
  • 备库查询是否实github下载时同步
alter session set container=pdb01;
select * frgitlabom test.test;
ID
--------数据库有哪几种--
1
2
999

至此,appleGAP已修改完结,能够发现,12C这个新特性,将一些进程进行了省掉和封装,进一步减少了咱们的操作进程,可是内部的原理仍然是一同的。

五、18C新运维特性康复

  • 18C新特性是在12C的基础上,将RECOVER STANDBY DATABASE指令与FROM SERVICE子句一同运用,以经过对主数approve据库进行的更改来改写物理备用数据库;备库能够直接在翻开状况进行改写。

语法:

RECOVER STANDBY DATABASE FROM SERVICE primary_db;

首要,模仿备库断电,主库切几个最新的归档,然后手艺删掉,从头翻开DG同步。

  • 备库连续DG同步进程
sqlplus / as sysdba
ALTER DATABASE RECO运维面试题VER MANAGED STANDBgithub官网Y DATABASE CANCEL;
shutdo数据库办理体系wn immediate
  • 主库切换屡次归档
sqlplus / as sysappearancedba
alter system switch logfile;
  • 删去最近appearance几个归档日志
rm 1_github是干什么的69_1070147137.arc
rm 1_70_1070147137.arc
  • 备库翻开同步进程
startup
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DIgithub中文社区SCONNECT FROM SESSIgithub是干什么的ON;
  • 检查GAP
sqlplus / as sAPPysdba
SELECT * FROM V$ARCHIVE_GAP;
THREAD#    LOW_SEQUENCE# HIGH_SEQUENCE#
---------数据库有哪几种- ------------- --------------
1		   70			 70
SELECT max(sequence#) from v$archived_log where appligithub下载ed='YES';
MAX(SEQapproachUENCE#)
--------------
69
  • 模仿GAP期间,有数据文件添加的状况
##主库添加数据文件
alter tablespace TEST add datafile '/oradata/ORCL/test02.dbf' size 100M autoextend off;

留神:当时DG数据库已存在GAP,GAP日志为:69—70 。

a、实施RECOVER STANDBY DATA数据库有哪几种BASE FROMgithub下载 SERVICE改写Git备库

下面演示一下,怎样运运维工程师有出路吗用一行指令在线修改DG GAP:

  • 备库撤消日志运用:
sqlplus / as sysdba
ALTER DATABASE RECOVER MANAGED STANDBY DATABapproachASE CANCEL;
  • 备库实施修改指令,开端在线改写备库:
rman target /
RMAN> RECOVER STANDBY数据库有哪几种 DATABASE FROM SERVICE orcl;
Starting recover at 19-APR-21
using target databagithub下载se control file instead of recGitovery catalog
Oracle instance started
Total System Global Ar运维是做什么的ea3355441944 bytesappearance
Fixed Size 9141016 bytes
Variable Size671088640 bytes
Database Buffers2667577344 bytes
Redo Buffers   7634944 bytes
contents of Memory Script:
{
rest数据库原理ore standbgithub官网y controlfile from service  'orcl';
alter database mount standby database;
}
executing Memory Script
Starting restore at 19-APR-21
allocated channel: ORA_DISK_1
channeGitl ORA运维需求把握的技术_DISK_1: SID=appear502 device typeappearance=DISK
channel OapplicationRA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service orcl
channel ORA_DISK_1: restoring controgithub中文官网网页l file
channel ORA_DISK_1: res运维岗位是干什么的tore complete, elapsed time: 00:00:02
output file name=/oradata/ORCL_STBY/control01.ctl
output file name=/oradata/giteeORCgithub中文社区L_STBY/control02.ctl
Finished restore at 19-APR-21
rel运维工程师有出路吗eased channel: ORA_DISK_1
Statement processed
Executing: alter system set standby_file_management=manual
contents of Memory Script:
{
set newname for tempfile  1 to
"/oradata/ORCL_STBY/temp01.dbf";
set newname for tempfile  2 to
"/oradat数据库办理体系a/ORCL运维工程师考什么证书_STBY/pdbseed/temp012021-04-11_06-13-50-844-AM.dbf";
set newname for tempfile  3 to
"/oradata/ORCL_STBY/BFA6BEE4github怎样下载文件5A1E3605E053AC01A8C0DD20/datafile/o1_mf_temp_j749f5fy_.dbf";
switch tempfile all;
set newname forgit教程 datafile  1 to
"/oradata/Ogithub是干什么的RCgithub中文官网网页L_STBY/giti轮胎是什么品牌system01.dbf";
set newname for datafile  3 to
"/oradata/ORCL_STBY/sysaux01.dbf";
set数据库原理 negithubwname for datafile  4 to
"/oradata/ORCL_STBY/undotbs01.dbf";
set newgithub怎样下载文件name for datafiappstorele  5 to
"/oradata/ORCL_STBY/pdbseed/运维工程师system01approach.dbf";
set newname for datafile  6 to
"/oradata/ORCL_STBY/运维工程师需求把握什么技术pdbseed/sysaux01.dbf";
set newname for datafile  7 to
"/oradat运维需求把握的技术a/ORCL_STBY/users01.dbf";
set newname for datafile  8 to
"/oradata/ORCL_STBY/pdbseed/undotbs01.dbf";
segithub中文社区t newnagithubme for datafile  9 to
"/oradata/ORCL_SappreciateTBY/PDB01/o1_mf_system_j749f5d5_.dbf";
set newname for datafile  10 to
"/oradat运维需求把握的技术a/ORCL_STBY/PD运维B01/o1_mf_sysaux_j749f5fw_.dbf";
set newname for datafile  11 to
"/oradata/ORCL运维工程师_STBY/PDB01/o1_mf_undotb运维方与学者交流的途径是s1_j749fappearance5fx_.dbfgithub下载";
set newname for datafil运维宝e  12 to
"/oradata/ORCL_STBY/test01.dbf";
set newname for datafiAPPle  14 to
"/oradata/ORCL/test02.dbf";
restore from service  'orcl' d运维工程师需求把握什么技术atafile
14;
catalog datgiti轮胎是什么品牌afilecopy  "/oradata/ORCL_STBY/system01.dbf",
"/oradata/ORCL_STBY/sysaux01.dbf",
"/oradata/ORCL_STBY/undotbs01.dbf",
"/orada运维工程师有出路吗ta/ORCL_STBY/pdbseed/system01approach.dbf",
"/oradata/ORCL_STBY/pdbseed/sysaux01.dbf",
"/oradata/ORCL_STBY/users01.dbf",
"/oradata/ORCL_STBgithub是干什么的Y/pdbseed/undotbs01.dbf",
"/oradata/ORCL_STBY/P运维DB01/o1_mf_system_j749f5d5_.githup官网dbf",运维需求把握的技术
"/oapp下载radata/ORCL_STBY/PDB01/o1_mf_github是干什么的sysaux_j749f5fw_.dbf",github怎样下载文件
"/oradata/ORCL_STBY/PDB01/o1_mf_undotbs1_j749f5fx_.dbf数据库体系概论",
"/ogithub永久回家地址radata/ORCL_STBY/test01.dbf",
"/oradata/ORCL/test02.dbf";
switch datafile all;
}
executing Memory Script
executing command: SET NEWNAME
executing command:运维 SET NEWNAME
executing command: SET NEWNAME
renamed tempfile 1 to /oradata/ORCL_STBY/temp01.dbf in control file
renamed tempfile 2 to /oradata/ORCL_STBY/pdbseed/运维工程师temp012021-04-11_06-13-50-844-AM.dbf in control file
renamed tgitiempfile 3 to /oradata/ORCL_STBY/BFA6BEEgithub是干什么的45A1E3605E053AC01A8C0DD20/datafile/o1_mf_temp_j749f5fyapproach_.dbf in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME数据库体系的中心是
executing commanapproved: SET NEWNAME
executing command: SET NEWNAME
executi运维需求把握的技术ng command: SET NEWNAME
executing command:数据库体系概论 SET NEWNAME
executing command: SET NEWNAME
executing command:数据库体系概论第五版课后答案 SET NEWNAME
executing command: SET NEWNAME运维方与学者交流的途径是
Starting restore at 19-APR-21
agithubllocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=504 device type=DISK
channel ORA_DISK_1: starting datafile backup set restogiteere
channel ORA_DISK_1: using network backup set from service orcl
channel ORA_DISK_1:github官网 specifying datafile(s) to restore from backup set
channel ORA_DapproveISK_1: restoring datafile 00014 to /oradata/ORCL/test02.dbf
channel ORA_DISK_1github是干什么的: restore complete, elapsed tigithub中文官网网页me: 00:00:03
Finished restore at 19-APR-21
catalo运维工程师有出路吗ged datafile copy
datafile copy file name=/oradata/ORCL_STBY/system01.dbf RECID=4 STAMgithub永久回家地址P=数据库办理体系1070263316
cataloged运维方与学者交流的途径是 datafile copy
datafile copy file naappleme=/oradata/ORCL_STBgithub中文社区Y/sysaux01.dbf RECID=5 STAMP=1070263317
cataloged datafile capproachopy
datafile copy file na数据库体系概论第五版课后答案me=/oradata/ORCL_STBY/ugiti轮胎是什么品牌ndotbs01.dbf RECID=6 STAMP=1070263317
cataloged datafile copy
datafile cappreciateopy fgitlabile name=/oradata/ORCL_STBY/pdbseed/system01.dbf RECID=7 STAMP=1070263317
cataloged datafile copy
da数据库原理tafile copy file name=/oradata/ORCL_STBY/pdbseed/sysaux01.dbf RECID=8 STAMP=1070263318
cataloged dat运维方与学者交流的途径是afile copy
datafile copy file name=/oradatagithub下载/ORCL_STBYgithub/users01.dbf RECID=9 STAMP=1070263318
cataloged da数据库体系概论tafi数据库办理体系le copy
datafile copgiti轮胎是什么品牌y fi运维宝le name=/oradata/ORCL_STBY/pdbseed/undotbs01.dbf RECID=10 STAMP=1070263318
cataloged datafile copy
datafile copgithub中文官网网页y file name=/oradata/ORCL_STBY/PDB01/o1_mf_system_j749f5d5_.dbf RECID=11 STAMP=1070263318
cataloged datafile copy
datafile copy f数据库体系概论ile name=/oradata/ORCL_STBY/PDB01/o1_mf_sysaux_j749f5fw_.dbf REC运维ID=12 STAMP=1070263318
cataloged datafile copy
datafile copy file name=/oradata/giteeORCL_STBY/PDB01/o1_mf_undotbs1_j749f5fx_.dbf RECID=13 STAMP=1070263318
cataloged datafile copy
datafile copy file name=/oradata/ORCL_STBY/test01.dbf RECID=14 ST运维需求把握的技术AMP=1070263318
cataloged datafilgithub下载e copy
datafile copy file name=/oradata/ORCL/test02.dbf RECID=15 STAMP=1运维工程师有出路吗070263318
da运维工程师有出路吗tafile 14 switched to datafile copy
input datafile copy RECID=15 STAMP=1070263318 fiapplele name=/oradata/ORCL运维工程师考什么证书/test02.dbf
datafile 1 swit数据库体系工程师ched to datafile copy
input datafile copy RECID=4 STAMP=1070263316 file name=/oradata/ORCL_STBgit教程Y/sys数据库体系概论tem01.dbf
datafile 3 switched to datafile copy
input d数据库ata运维岗位是干什么的file c运维面试题opy RECID=5github中文社区 STAMP=1070263317 file name=/oradata/ORCL_ST运维BY/sysaux01.dbf
datafile 4 switched to dataf运维工程师有出路吗ile copy
inpuappointmentt datafile copy RECID=6 STAMP=1070263317 file name=/oradata/ORCL_STBY/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=107appear0263317 file name=/oapproachrada运维工程师有出路吗ta/ORCL_STBY/pdbseed/system01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=8 STAMP=1070263318 file name=/oradata/ORCL_STBY运维方与学者交流的途径是/pdbseed/sysgithub下载aux01.dbf
daGittafile 7 swit运维需求把握的技术ched to datafigithub永久回家地址le copy
input datafile copy RECID=9 STAMP=1070263318 file name=/oradata/ORCL_STBY/users01.dbf
datafilgithub永久回家地址e 8 switched to datafile copy
input dataAPPfile copy RECID=10 STAMP数据库原理=git教程1070263318 file name=/oradata/ORCL_STBY/pdbseed/undotbs01.dbf
datafile 9 switched to datafile copy
input datafile copy RECIDapproach=11 STAMP=1070263318 file name=/oradatgithub下载a/ORCL_STBY/PDB01/o1_mf_system_j749f5d5_.dbf
datafile 10 switched to datafile copy
input dat运维工程师afile copy RECID=12 STAMP=1070263318 file name=/oradata/ORCL_STBY/PDB01/o1_mf_sysaux_j749f5fw_.dbf
datafilappeare 11 switched to datafile运维工程师需求把握什么技术 copy
input datafile copy RECI数据库体系的中心是D=13 STAMP=1070263318 file name=/oradata/ORCL_STBY/PDB01/o1_mf_u运维需求把握的技术ndotbs1_j7giti49f5fx_.gitlabdbf
datafile 12 switched to datafile copy
input datafile copygithub是干什么的 RECID=14 STAMP=1数据库查询句子070263318 file name=运维宝/oradatagithub打不开/ORCL_STBY/test01.dbf
Executing: alter database rename file '/oradata/ORCL数据库原理/redo01.loapproachg' to '/oradata/ORCL_STBY/redo01.log'
Executing: alter database rename file '/oradata/ORCL/redo02.log' to '/oradata/ORCL数据库查询句子_STBY/redo02.log'
Executing: alter database rename file '/oradata/ORCL/redo03.log' to '/oradata/ORCL_STBY/redo03.log'app下载
contents of Memory Script:
{
rec数据库办理体系over database from service  'orcl';
}
executing Memory Scri运维是做什么的pt
Starting recover at 19-APR-21
using channel ORA_DISK_1
skipping datafile 5; already restored to SCN 2155383
skipping datafile 6; already restored to SCN 2155383
skipping datafilapprovee 8; alreadyapple restored to SCN 2155383
skipping datafile 14; agithub永久回家地址lready restored to SCN 2658548
chanappearancenel ORA运维_DISK_gitlab1: starting incremental datafile backup set restore
channel ORA_DISK_1: using networkgithub中文官网网页 backup set frogit教程m service orcl
destination for restore of datappearanceafile 00001: /oradata/ORCL_STBY/system01.dbf
channeappstorel ORA_DISK数据库查询句子_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental dagithub是干什么的tafigitlable backup set restore
channel ORA_DISK_1: u数据库办理体系sing network运维 backup set from service orcl
destination for restore of datafile 00003: /oradata/ORCL_STBY/sysaux01.dbf
channel ORA_DISK_1: rest数据库办理体系ore complete, elapsed time:github中文官网网页 00:00:01
channel ORA_DISK_1: starting in运维工程师有出路吗crgithup官网emental datafile backup set restore
channel ORA_DISK_1: using network backup set from segithup官网rvice orcl
destination for restore of dataf运维工程师需求把握什么技术ile 00004: /oradata/ORCL_STBY/undotbs01.dbf
channel ORA_DISK_1: restore complete, elapsed tim运维工程师考什么证书e: 00:00:01
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service orcl
destination for restore of datafile 00007: /oradata/数据库体系概论第五版课后答案ORCL_STBY/users01.dbf
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafileapp下载 backup set restore
channel ORA_DISK_1: using network backup set from service orcl
desgithub永久回家地址tina运维宝tion for restore of datafile 00009: /oragiti轮胎是什么品牌data/ORCL_运维工程师需求把握什么技术STBY/PDB01/o1_mf_system数据库软件_j749f5d5github中文官网网页_.dbf
channel ORA_DISK_1: restore complete, elapsed tigithub直播渠道永久回家meappstore: 00:00:01
channel OappearRA_DISK_1数据库软件: start数据库体系的中心是ing incremental d运维工程师考什么证书atafile backup set restore
chanappreciatenel ORA_DISK_1: using network backup set fapproachrom service orcl
destappleination for restore of datafile 00010: /oradata/ORCL_STBY/PDB01/o1_mf_sysaux_j749f5fw_.dbf
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: start数据库原理ing incremental datafile bac数据库体系概论kup set restore
c运维工程师hannel ORA_DISK_1: using network backup set from service orcl
destination for restore of da运维是做什么的tafile 00011: /oradata/ORCL_STBY/PDB01/o1_mf_undotbs1_j749f5fx_.dbgithub打不开f
channel ORA_DISK_1: restore com运维工程师需求把握什么技术plete, elapsed time: 00:00:02
channel ORA_DISapproachK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set froappointmentm service orcl
destination for restoreapplication of datafile 00012: /oradata/ORCL_STBY/test01.dbf
channel ORA_运维工程师需求把握什么技术DISK_1: restore complete, elapsed timeappreciate: 00:00:01
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recogit教程ver at 19-AGitHubPR-21
Executing: alter system set standby_数据库体系概论第五版课后答案file_management运维工程师考什么证书=git教程auto
Finished recover运维工程师 at 19-APR-21

便当咱们检查,所以记载恢githup官网复全进程,经过以上实施进运维工程师考什么证书程,能够看到:

  • REappearCOVER STANDBY DATABASE指appearance令从头发动备用实例。
  • 从主数据库改写操控文件,并主动重命名数据文件,临时文件和联机日志。
  • 它能够康复添加到主数据库中的新数据文件,并康复到当时时刻的备用数据库。

b.备库修改standby log途径

发现改写往后,备库redo log途径已修改,standby log途径未修改,因此手动修改。

  • 查询备库的日志文件途径
sqlpGitHublus / as sysdba
SQL> select member from v$logfile;
MEMBER
----------------------------------github中文官网网页------------------------------------------git教程----
/oradata/ORCL_STBY/redo03.log
/oradata/ORCL_STBY/redo02.log
/oradatapprovea/ORCL_STBY/redo01.log
/oradgithup官网atgithub中文社区a/ORCLgiti/standby_red运维工程师需求把握什么技术o04.log
/oradata/ORCL/standby_re数据库体系概论do05.log
/oradata/ORCL/standby_redo06.log
/oradata/ORCL/standby_redo07.log
  • 封闭备库文件主动处理
sqlplus / as sysdba
alter system set standgithub中文官网网页by_file_management=MANUAL;
  • 清理standby log
sq运维面试题lplus / as sysdba
alter datagithub中文官网网页base clear logfile group 4;
alter datGitabase clear logfile grogithub中文官网网页up 5;
alter database clear logfile group运维是做什么的 6;
alter databapplease clear logfile group 7;
  • 修改standby log途径
sqlplus / as sysdba
alter database rename file '/oradata/ORCL/standby_redo04.log' to '/oradata/ORCL_STBY/standby_redogiti轮胎是什么品牌04.log';
alter database renamgiteee file '/oradata/ORCL/standby_redo05.log' to '/oradata/ORCL_STBY/standby_redo05.log';
a运维岗位是干什么的lter database rename file '/oradata/ORCL/standby_redo06.log' togitee '/ora运维面试题data/ORCL_STBgiteeY/standby_redo06.log';
alter datGitabase ren运维岗位是干什么的ame file '/oradata/ORCL/standby_r数据库体系概论第五版课后答案edo07.log' to '/oradata/ORCL_STBYapplication/standby_redo07.log';
  • 修改完后翻开备库文件appstore主动处理
sqlplus / as sysdba
alter system set standby_file_management=AUTO;

c.主库切日志,备库翻开日志运用

  • 检查主备scn是否一同
sqlplus / as sysdba
col HXFNM for a100
set line222
select HXgithub下载FIappreciateL Fi运维工程师le_nGitHubum,substr(HXFNM,1,40) HXFNM,fhscn from x$kcvfh;
  • 主库切几回归档
sqlplus / as sysdba
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER Sgithup官网YSTEM SWITCH LO数据库有哪几种GFILE;
  • 翻开备库运用日志
sqlplus / as sysdba
alter database open;
alter pgithub永久回家地址luggable database all open;
ALTER DATABASE RECOgitlabVER MANAGED STANDBY数据库规划 DATABASE USING CURRENT LOGFILE DISCONNECT FROMgithub SESSION;
  • 检查备库同步是否正常
sqlplus / as sysdba
set line222
col member for运维是做什么的 a60
select t1.group#,t1.thread#,t1.bytes/1024/1024,t1.status,t2.member from gv$standb数据库办理体系y_log t1,gv$logfile t2 where t1.group#=t2.group#;
  • 主库刺进数据
sqlplus test/test运维工程师考什么证书@pappstoredb01
insert into test values (999);
commit;
  • 备库查询是否实时github敞开私库同步
sqlplus / as sysdba
alter session set container=pdb01;
select * from test.test;
ID
----------
1
2
9giti轮胎是什么品牌99

至此,18C的GAP也已修改,能够看到Oracle跟着版别晋级,越来越主动化的操作,意味着appearance运维appreciate动化的未来。

参看文档:

  • RESTORE/Recover from Service
  • Restoring and Recovering Files Over the Network(DG)
  • Restoring and Recovering Files Over the Network(RapproachMAN)
  • Rolling Forward a Standby With数据库原理 One Command 18C

本次同享到此结束啦~

假定觉得文章对你有帮助,点赞、保藏、注重、议论,一键四连支撑,你的支撑便是我发明最大的动力。