You are on page 1of 62

Recrear Data Guard IMAGENOR

***********************

1.Sacar un Respaldo a Disco de la BD "NODO" via RMAN


****************************************************
--Script 1: rman_backup_full_disk_NODO.sh
#!/bin/ksh
set -x
/home/oracle/DRP/scripts/rman_backup_full_disk_NODO1.sh
mail -s "LOG RESPALDO DRP NODO1" mgomezj@abccapital.com.mx -c
gsantana@abccapital.com.mx < /backupabanks/DRP/NODO/rman_backup_full_disk_NODO.log

export DATE=`date '+%y%m%d%H%M'`


mv /backupabanks/DRP/NODO/rman_backup_full_disk_NODO.log
/backupabanks/DRP/NODO/rman_backup_full_disk_NODO_$DATE.log

/usr/bin/find /backupabanks/DRP/NODO/*.log -atime +31 -exec rm {} \;

--Script 2: /home/oracle/DRP/scripts/rman_backup_full_disk_NODO1.sh
#!/bin/ksh
set -x
export DATE=`date '+%y%m%d%H%M'`
export ORACLE_SID=nodo1
export ORACLE_HOME=/u01/app/product/11.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
rman target / catalog rman/rman@dbrman msglog
/backupabanks/DRP/NODO/rman_backup_full_disk_NODO.log
cmdfile=/home/oracle/DRP/scripts/rman_backup_full_disk_NODO1.rcv

--Script 3: /home/oracle/DRP/scripts/rman_backup_full_disk_NODO1.rcv
run {
allocate CHANNEL ch1 DEVICE TYPE DISK FORMAT '/backupabanks/DRP/NODO/%d_%s_%T';
allocate CHANNEL ch2 DEVICE TYPE DISK FORMAT '/backupabanks/DRP/NODO/%d_%s_%T';
allocate CHANNEL ch3 DEVICE TYPE DISK FORMAT '/backupabanks/DRP/NODO/%d_%s_%T';
allocate CHANNEL ch4 DEVICE TYPE DISK FORMAT '/backupabanks/DRP/NODO/%d_%s_%T';
allocate CHANNEL ch5 DEVICE TYPE DISK FORMAT '/backupabanks/DRP/NODO/%d_%s_%T';
allocate CHANNEL ch6 DEVICE TYPE DISK FORMAT '/backupabanks/DRP/NODO/%d_%s_%T';
allocate CHANNEL ch7 DEVICE TYPE DISK FORMAT '/backupabanks/DRP/NODO/%d_%s_%T';
allocate CHANNEL ch8 DEVICE TYPE DISK FORMAT '/backupabanks/DRP/NODO/%d_%s_%T';
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO
'/backupabanks/DRP/NODO/CTRL_AUTO_%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
SQL 'alter system archive log current';
crosscheck backup;
crosscheck archivelog all;
backup database plus archivelog;
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
release channel ch5;
release channel ch6;
release channel ch7;
release channel ch8;
}
exit;

1.Pasar el Respaldo al 10.99.40.160


***********************************
--Subir el respaldo al 10.100.300.200 pendiente no nos dice Mart�n que onda

--Bajar el log del Respaldo

RESP_NODO_NODO_16449_20170124
RESP_NODO_NODO_16450_20170124
RESP_NODO_NODO_16455_20170124
RESP_NODO_NODO_16456_20170124
RESP_NODO_NODO_16457_20170124
RESP_NODO_NODO_16453_20170124
RESP_NODO_NODO_16454_20170124
RESP_NODO_NODO_16451_20170124
RESP_NODO_NODO_16452_20170124
RESP_NODO_NODO_16463_20170124
RESP_NODO_NODO_16465_20170124
RESP_NODO_NODO_16461_20170124
RESP_NODO_NODO_16464_20170124
RESP_NODO_NODO_16462_20170124
RESP_NODO_NODO_16459_20170124
RESP_NODO_NODO_16460_20170124
RESP_NODO_NODO_16458_20170124
RESP_NODO_NODO_16470_20170124
RESP_NODO_NODO_16466_20170124
RESP_NODO_NODO_16467_20170124
RESP_NODO_NODO_16468_20170124
RESP_NODO_NODO_16469_20170124
ls -lrt CTRL_AUTO_c-1457517586-20170124-00

2.Respaldar initSID.ora de NODO


*******************************
cd $ORACLE_HOME/dbs
ls -lrt initnodo.ora
cat initnodo1.ora
$ cat initnodo1.ora
SPFILE='+DG_NODO/NODO/PARAMETERFILE/spfile.388.928392763'

CREATE PFILE='/u01/app/product/11.2.0/db_1/dbs/initnodo1.ora.bkp.26Feb19_1105' FROM


SPFILE;

ls /u01/app/product/11.2.0/db_1/dbs/initnodo1.ora.bkp.26Feb19_1105

Evidencia:
----------
ls -lrt initnodo*
-rw-r--r-- 1 oracle oinstall 81 Feb 05 2017 initnodo1.ora
-rw-r--r-- 1 oracle asmadmin 4024 Feb 26 11:08
initnodo1.ora.bkp.26Feb19_1105

3.Validar espacio en las Instancias ASM


***************************************
Disk Group Size Primary-Standby
---------- --------------------
DG_NODO 3,932,160 | 3,932,160 --> OK
FRA_NODO 184,320 | 122,880 --> OK Tiene 1 Disco menos

3.Validamos el status de los Redos Online y Los Redos en


Standby

****************************************************************

--Validar Online Redos en la Base de Datos Primaria


set linesize 200
col (bytes) for a5
col status for a20
SELECT group#, sequence#, members,SUM(bytes)/1024/1024 MB, status FROM v$log
GROUP BY group#, sequence#, members, status
ORDER BY group#;

set linesize 200


set pagesize 200
col group# for 999
col member for a80
SELECT a.group#, b.member, a.status, SUM(a.bytes)/1024/1024 MB
FROM v$log a, v$logfile b
WHERE a.group#=b.group#
GROUP BY a.group#, b.member, a.status
ORDER BY a.group#;

Evidencia:
----------

--Primary
GROUP# SEQUENCE# MEMBERS MB STATUS
---------- ---------- ---------- ---------- --------------------
1 7 2 100 INACTIVE
2 8 2 100 CURRENT
3 6 2 100 INACTIVE
4 7 2 100 CURRENT
5 5 2 100 INACTIVE
6 6 2 100 INACTIVE

6 rows selected.

SQL> set linesize 200


set pagesize 200
col group# for 999
col member for a80
SELECT a.group#, b.member, a.status, SUM(a.bytes)/1024/1024 MB
FROM v$log a, v$logfile b
WHERE a.group#=b.group#
GROUP BY a.group#, b.member, a.status
ORDER BY a.group#;SQL> SQL> SQL> SQL> 2 3 4 5

GROUP# MEMBER
STATUS MB
------
--------------------------------------------------------------------------------
-------------------- ----------
1 +DG_IMAG/imagenor/onlinelog/redo01_01.log
INACTIVE 100
1 +FRA_IMAG/imagenor/onlinelog/redo01_02.log
INACTIVE 100
2 +DG_IMAG/imagenor/onlinelog/redo02_01.log
CURRENT 100
2 +FRA_IMAG/imagenor/onlinelog/redo02_02.log
CURRENT 100
3 +DG_IMAG/imagenor/onlinelog/redo03_01.log
INACTIVE 100
3 +FRA_IMAG/imagenor/onlinelog/redo03_02.log
INACTIVE 100
4 +DG_IMAG/imagenor/onlinelog/group_4.377.1062257815
CURRENT 100
4 +DG_IMAG/imagenor/onlinelog/group_4.378.1062257815
CURRENT 100
5 +DG_IMAG/imagenor/onlinelog/group_5.375.1062257817
INACTIVE 100
5 +DG_IMAG/imagenor/onlinelog/group_5.376.1062257817
INACTIVE 100
6 +DG_IMAG/imagenor/onlinelog/group_6.372.1062257817
INACTIVE 100
6 +DG_IMAG/imagenor/onlinelog/group_6.374.1062257817
INACTIVE 100

12 rows selected.

--Validar Online Redos en Standby en la Base de Datos


Primaria
set linesize 300 pagesize 100
col member for a80
SELECT group#, type, member FROM v$logfile
WHERE type = 'STANDBY';

SELECT group#, dbid, thread#, sequence#, status


FROM v$standby_log;

Evidencia:
----------
GROUP# TYPE MEMBER
------ -------
--------------------------------------------------------------------------------
7 STANDBY +DG_IMAG/imagenor/onlinelog/stby_redo01_01.log
7 STANDBY +FRA_IMAG/imagenor/onlinelog/stby_redo01_02.log
8 STANDBY +DG_IMAG/imagenor/onlinelog/stby_redo02_01.log
8 STANDBY +FRA_IMAG/imagenor/onlinelog/stby_redo02_02.log
9 STANDBY +DG_IMAG/imagenor/onlinelog/stby_redo03_01.log
9 STANDBY +FRA_IMAG/imagenor/onlinelog/stby_redo03_02.log
10 STANDBY +DG_IMAG/imagenor/onlinelog/stby_redo04_01.log
10 STANDBY +FRA_IMAG/imagenor/onlinelog/stby_redo04_02.log
11 STANDBY +DG_IMAG/imagenor/onlinelog/stby_redo05_01.log
11 STANDBY +FRA_IMAG/imagenor/onlinelog/stby_redo05_02.log
12 STANDBY +DG_IMAG/imagenor/onlinelog/stby_redo06_01.log
12 STANDBY +FRA_IMAG/imagenor/onlinelog/stby_redo06_02.log
13 STANDBY +DG_IMAG/imagenor/onlinelog/stby_redo07_01.log
13 STANDBY +FRA_IMAG/imagenor/onlinelog/stby_redo07_02.log
14 STANDBY +DG_IMAG/imagenor/onlinelog/stby_redo08_01.log
14 STANDBY +FRA_IMAG/imagenor/onlinelog/stby_redo08_02.log

16 rows selected.

GROUP# DBID THREAD# SEQUENCE# STATUS


------ ---------------------------------------- ---------- ----------
--------------------
7 UNASSIGNED 1 10611 ACTIVE
8 UNASSIGNED 1 0 UNASSIGNED
9 UNASSIGNED 1 0 UNASSIGNED
10 UNASSIGNED 1 0 UNASSIGNED
11 UNASSIGNED 2 9571 ACTIVE
12 UNASSIGNED 2 0 UNASSIGNED
13 UNASSIGNED 2 0 UNASSIGNED
14 UNASSIGNED 2 0 UNASSIGNED

8 rows selected.

Conclusi�n:
-----------
1-6 RLSs Online
7-14 RLS Standby

4. Validar el Status del Data Guard


***********************************
select b.instance_name,b.status,a.database_role,a.protection_mode from v$database
a,v$instance b;
select max(sequence#) from v$archived_log;

PRIMARY
*******

STATUS INSTANCE_NAME DATABASE_ROLE PROTECTION_MODE


------------ ---------------- ---------------- --------------------
OPEN nodo1 PRIMARY MAXIMUM PERFORMANCE

MAX(SEQUENCE#)
--------------
70217

STANDBY
*******
STATUS INSTANCE_NAME DATABASE_ROLE PROTECTION_MODE
------------ ---------------- ---------------- --------------------
nodo MOUNTED PHYSICAL STANDBY MAXIMUM PERFORMANCE

MAX(SEQUENCE#)
--------------
29550
5.Borramos la Base de Datos NODO
********************************
--Respaldar el init
CREATE
PFILE='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initnodo.ora.bkp.26Feb19_1209'
FROM SPFILE;

startup force mount exclusive restrict;

set linesize 300


col host_name for a20
SELECT host_name, instance_name, status, TO_CHAR(startup_time, 'dd-mm-yy
hh24:mi:ss') STARTUP_TIME, shutdown_pending, logins FROM v$instance;

drop database;

Evidencia:
----------
abcabanksdrp:/u01/app/oracle/product/11.2.0/dbhome_1/dbs:nodo$ls -lrt initnodo*
-rw-r--r-- 1 oracle oinstall 72 Oct 16 2016 initnododesa.ora
-rw-r--r-- 1 oracle oinstall 63 Jan 28 2017 initnodo.ora
-rw-r--r-- 1 oracle oinstall 64 May 03 2017 initnododev.ora
-rw-r--r-- 1 oracle asmadmin 3097 Feb 26 12:09
initnodo.ora.bkp.26Feb19_1209
-rw-r--r-- 1 oracle oinstall 63 Feb 26 12:11
initnodo.ora.bkp.26Feb19_1211_SPFILE
abcabanksdrp:/u01/app/oracle/product/11.2.0/dbhome_1/dbs:nodo$

SQL> startup force mount exclusive restrict;


ORACLE instance started.

Total System Global Area 3.2870E+10 bytes


Fixed Size 2237808 bytes
Variable Size 2.2347E+10 bytes
Database Buffers 1.0469E+10 bytes
Redo Buffers 51675136 bytes
Database mounted.
SQL> SELECT dbid,name, open_mode, log_mode,flashback_on,force_logging FROM
v$database;

DBID NAME OPEN_MODE LOG_MODE FLASHBACK_ON FOR


---------- --------- -------------------- ------------ ------------------ ---
1457517586 NODO MOUNTED ARCHIVELOG NO YES

SQL> set linesize 300


col host_name for a20
SELECT host_name, instance_name, status, TO_CHAR(startup_time, 'dd-mm-yy
hh24:mi:ss') STARTUP_TIME, shutdown_pending, logins FROM v$instance;SQL> SQL>

HOST_NAME INSTANCE_NAME STATUS STARTUP_TIME SHU LOGINS


-------------------- ---------------- ------------ ----------------- --- ----------
abcabanksdrp nodo MOUNTED 26-02-19 12:16:12 NO RESTRICTED

SQL> drop database;


Database dropped.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit
Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
SQL> SQL>

--Depurar el ASM
-Control Files
-Redologs Online
-Archivelogs

--Evidencia
ASMCMD> ls
DATAGUARDCONFIG/
DGB/
ONLINELOG/
ASMCMD>

6.Levantar la Instancia en NOMOUNT


**********************************

. ./nodo.env
cd $ORACLE_HOME/dbs
cp initnodo.ora initnodo.ora.bkp.26Ene17_1710
startup nomount;

Evidencia:
----------
abcabanksdrp /u01/app/oracle/product/11.2.0/dbhome_1/dbs>cp
initnodo.ora.bkp.26Ene17_1710 initnodo.ora
abcabanksdrp /u01/app/oracle/product/11.2.0/dbhome_1/dbs>echo $ORACLE_SID
nodo
abcabanksdrp /u01/app/oracle/product/11.2.0/dbhome_1/dbs>sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.3.0 Production on Sat Mar 9 13:58:53 2019

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

Connected to an idle instance.

SQL> startup nomount;


ORACLE instance started.

Total System Global Area 3.2870E+10 bytes


Fixed Size 2237808 bytes
Variable Size 2.2347E+10 bytes
Database Buffers 1.0469E+10 bytes
Redo Buffers 51675136 bytes

7.Restaurar Control File


************************
rman target /
set dbid=1457517586
restore controlfile from '/backup/imagenor/CTRL_AUTO_c-3732027390-20200924-00';

shu immediate;
startup mount;

--Evidencia
racmig1:/home/oracle/dba/scripts/admon:imagenor1$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Tue Jan 19 12:52:47 2021

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

connected to target database: IMAGENOR (not mounted)

RMAN> restore controlfile from '/backup/imagenor/CTRL_AUTO_c-3732027390-20200924-


00';

Starting restore at 19-JAN-21


using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=148 instance=imagenor1 device type=DISK

channel ORA_DISK_1: restoring control file


RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 01/19/2021 12:53:53
ORA-19870: error while restoring backup piece /backup/imagenor/CTRL_AUTO_c-
3732027390-20200924-00
ORA-19504: failed to create file "+DG_IMAG"
ORA-17502: ksfdcre:4 Failed to create file +DG_IMAG
ORA-15001: diskgroup "DG_IMAG" does not exist or is not mounted
ORA-15204: database version 11.2.0.0.0 is incompatible with diskgroup DG_IMAG

RMAN> exit

racmig1:/u01/app/product/11.2.0/db_1/dbs:imagenor1$ cat initimagenor1.ora


*.archive_lag_target=0
*.compatible='11.2.0.3.0'

racmig1:/u01/app/product/11.2.0/db_1/dbs:imagenor1$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jan 21 17:41:24 2021

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

connected to target database: IMAGENOR (not mounted)

RMAN> restore controlfile from '/backup/imagenor/CTRL_AUTO_c-3732027390-20200924-


00';

Starting restore at 21-JAN-21


using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=148 instance=imagenor1 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:06
output file name=+DG_IMAG/imagenor/controlfile/current.337.1062438231.
output file name=+FRA_IMAG/imagenor/controlfile/current.287.1062441565
Finished restore at 21-JAN-21

Finished restore at 21-JAN-21

RMAN>

SQL> shu immediate


ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SQL> alt
SQL>
SQL> startup mount;
ORACLE instance started.

Total System Global Area 2137886720 bytes


Fixed Size 2223208 bytes
Variable Size 1811940248 bytes
Database Buffers 318767104 bytes
Redo Buffers 4956160 bytes
Database mounted.
SQL>

8. Montar la Base de Datos


**************************
sqlplus / as sysdba
alter database mount;
SELECT dbid,name, open_mode, log_mode,flashback_on,force_logging FROM v$database;

Evidencia:
----------
SQL> alter database mount;

Database altered.

SQL> SELECT dbid,name, open_mode, log_mode,flashback_on,force_logging FROM


v$database;

DBID NAME OPEN_MODE LOG_MODE FLASHBACK_ON FOR


---------- --------- -------------------- ------------ ------------------ ---
1457517586 NODO MOUNTED ARCHIVELOG NO YES

SQL>

8.Restaurar la Base de Datos:


*****************************
--Script 1: RESTAURA_NODO_GDL.sh
#!/bin/ksh
export DATE=`date '+%y%m%d%H%M'`
export ORACLE_SID=nodo
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH:.
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
rman target / msglog /home/oracle/CZM/LOGS/DISK/NODO/RESTORE_NODO_$DATE.log
cmdfile=/home/oracle/CZM/SCRIPTS/RESTORE_NODO_DISK.rcv

--Script 2: /home/oracle/CZM/SCRIPTS/RESTORE_NODO_DISK.rcv
run {
catalog start with '/ora_depaso/RMAN/NODO_STBY' noprompt;
allocate CHANNEL ch1 DEVICE TYPE DISK;
allocate CHANNEL ch2 DEVICE TYPE DISK;
allocate CHANNEL ch3 DEVICE TYPE DISK;
allocate CHANNEL ch4 DEVICE TYPE DISK;
allocate CHANNEL ch5 DEVICE TYPE DISK;
allocate CHANNEL ch6 DEVICE TYPE DISK;
allocate CHANNEL ch7 DEVICE TYPE DISK;
allocate CHANNEL ch8 DEVICE TYPE DISK;
allocate CHANNEL ch9 DEVICE TYPE DISK;
allocate CHANNEL ch10 DEVICE TYPE DISK;
restore database;
switch datafile all;
recover database;
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
release channel ch5;
release channel ch6;
release channel ch7;
release channel ch8;
release channel ch9;
release channel ch10;
}
exit

cd /home/oracle/CZM/SCRIPTS
nohup ./RESTAURA_NODO_GDL.sh > RESTAURA_NODO_GDL.log &

abcabanksdrp:/home/oracle/CZM/SCRIPTS:nodo$ nohup ./RESTAURA_NODO_GDL.sh >


RESTAURA_NODO_GDL.log &
[1] 12386426
abcabanksdrp:/home/oracle/CZM/SCRIPTS:nodo$
abcabanksdrp:/home/oracle/CZM/SCRIPTS:nodo$ jobs
[1] + Running nohup ./RESTAURA_NODO_GDL.sh > RESTAURA_NODO_GDL.log
&
abcabanksdrp:/home/oracle/CZM/SCRIPTS:nodo$

Script 2
--------
vi restore_disk_rman_imagenor.sh
--------------------------------
#!/bin/ksh
export DATE=`date '+%y%m%d%H%M'`
export ORACLE_SID=imagenor1
export ORACLE_HOME=/u01/app/product/11.2.0/db_1
export PATH=$PATH1:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

rman target / msglog /home/oracle/dba/shells/restore/imagenor/imagenor_$DATE.log


cmdfile=/home/oracle/dba/shells/restore/imagenor/restore.rcv

vi restore.rcv
--------------
run {
catalog start with '/backup/imagenor' noprompt;
allocate CHANNEL c1 DEVICE TYPE DISK;
allocate CHANNEL c2 DEVICE TYPE DISK;
allocate CHANNEL c3 DEVICE TYPE DISK;
allocate CHANNEL c4 DEVICE TYPE DISK;
allocate CHANNEL c5 DEVICE TYPE DISK;
allocate CHANNEL c6 DEVICE TYPE DISK;
allocate CHANNEL c7 DEVICE TYPE DISK;
allocate CHANNEL c8 DEVICE TYPE DISK;
allocate CHANNEL c9 DEVICE TYPE DISK;
allocate CHANNEL c10 DEVICE TYPE DISK;
allocate CHANNEL c11 DEVICE TYPE DISK;
allocate CHANNEL c12 DEVICE TYPE DISK;
allocate CHANNEL c13 DEVICE TYPE DISK;
allocate CHANNEL c14 DEVICE TYPE DISK;
allocate CHANNEL c15 DEVICE TYPE DISK;
SET NEWNAME FOR DATABASE TO '+DG_IMAG';
SET NEWNAME FOR tempfile 1 TO '+DG_IMAG';
restore database;
switch datafile all;
switch tempfile all;
recover database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
release channel c9;
release channel c10;
release channel c11;
release channel c12;
release channel c13;
release channel c14;
release channel c15;
}
EXIT

cd /home/oracle/dba/shells/restore/imagenor
nohup ./restore_disk_rman_imagenor.sh &

--Log
RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21> 22>
23> 24> 25> 26> 27> 28> 29> 30> 31> 32> 33> 34> 35> 36> 37> 38> 39> 40>
racmig1:/home/oracle/dba/shells/restore/imagenor:nodo1$ tail -500f
imagenor_2101191323.log

Recovery Manager: Release 11.2.0.3.0 - Production on Tue Jan 19 13:23:27 2021

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

connected to target database: IMAGENOR (DBID=3732027390, not open)

RMAN> run {
2> catalog start with '/backup/imagenor' noprompt;
3> allocate CHANNEL c1 DEVICE TYPE DISK;
4> allocate CHANNEL c2 DEVICE TYPE DISK;
5> allocate CHANNEL c3 DEVICE TYPE DISK;
6> allocate CHANNEL c4 DEVICE TYPE DISK;
7> allocate CHANNEL c5 DEVICE TYPE DISK;
8> allocate CHANNEL c6 DEVICE TYPE DISK;
9> allocate CHANNEL c7 DEVICE TYPE DISK;
10> allocate CHANNEL c8 DEVICE TYPE DISK;
11> allocate CHANNEL c9 DEVICE TYPE DISK;
12> allocate CHANNEL c10 DEVICE TYPE DISK;
13> allocate CHANNEL c11 DEVICE TYPE DISK;
14> allocate CHANNEL c12 DEVICE TYPE DISK;
15> allocate CHANNEL c13 DEVICE TYPE DISK;
16> allocate CHANNEL c14 DEVICE TYPE DISK;
17> allocate CHANNEL c15 DEVICE TYPE DISK;
18> SET NEWNAME FOR DATABASE TO '+DG_IMAG';
19> SET NEWNAME FOR tempfile 1 TO '+DG_IMAG';
20> restore database;
21> switch datafile all;
22> switch tempfile all;
23> recover database;
24> release channel c1;
25> release channel c2;
26> release channel c3;
27> release channel c4;
28> release channel c5;
29> release channel c6;
30> release channel c7;
31> release channel c8;
32> release channel c9;
33> release channel c10;
34> release channel c11;
35> release channel c12;
36> release channel c13;
37> release channel c14;
38> release channel c15;
39> }
40> EXIT
using target database control file instead of recovery catalog
searching for all files that match the pattern /backup/imagenor

List of Files Unknown to the Database


=====================================
File Name: /backup/imagenor/CTRL_AUTO_c-3732027390-20200924-00
File Name: /backup/imagenor/RESP_IMAGENOR_760_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_761_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_762_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_763_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_764_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_765_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_766_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_767_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_768_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_769_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_770_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_771_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_772_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_773_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_774_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_775_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_776_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_777_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_778_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_779_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_780_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_781_20200924
File Name: /backup/imagenor/full_daily_imagenor_2409201134.log
File Name: /backup/imagenor/snapcf_imagenor.f
cataloging files...
cataloging done

List of Cataloged Files


=======================
File Name: /backup/imagenor/CTRL_AUTO_c-3732027390-20200924-00
File Name: /backup/imagenor/RESP_IMAGENOR_760_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_761_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_762_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_763_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_764_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_765_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_766_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_767_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_768_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_769_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_770_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_771_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_772_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_773_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_774_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_775_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_776_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_777_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_778_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_779_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_780_20200924
File Name: /backup/imagenor/RESP_IMAGENOR_781_20200924
File Name: /backup/imagenor/snapcf_imagenor.f

List of Files Which Where Not Cataloged


=======================================
File Name: /backup/imagenor/full_daily_imagenor_2409201134.log
RMAN-07517: Reason: The file header is corrupted

allocated channel: c1
channel c1: SID=248 instance=imagenor1 device type=DISK

allocated channel: c2
channel c2: SID=297 instance=imagenor1 device type=DISK
allocated channel: c3
channel c3: SID=346 instance=imagenor1 device type=DISK

allocated channel: c4
channel c4: SID=395 instance=imagenor1 device type=DISK

allocated channel: c5
channel c5: SID=444 instance=imagenor1 device type=DISK

allocated channel: c6
channel c6: SID=494 instance=imagenor1 device type=DISK

allocated channel: c7
channel c7: SID=542 instance=imagenor1 device type=DISK

allocated channel: c8
channel c8: SID=592 instance=imagenor1 device type=DISK

allocated channel: c9
channel c9: SID=641 instance=imagenor1 device type=DISK

allocated channel: c10


channel c10: SID=690 instance=imagenor1 device type=DISK

allocated channel: c11


channel c11: SID=738 instance=imagenor1 device type=DISK

allocated channel: c12


channel c12: SID=3 instance=imagenor1 device type=DISK

allocated channel: c13


channel c13: SID=52 instance=imagenor1 device type=DISK

allocated channel: c14


channel c14: SID=102 instance=imagenor1 device type=DISK

allocated channel: c15


channel c15: SID=151 instance=imagenor1 device type=DISK

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 19-JAN-21

channel c1: starting datafile backup set restore


channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00005 to +DG_IMAG
channel c1: restoring datafile 00011 to +DG_IMAG
channel c1: restoring datafile 00021 to +DG_IMAG
channel c1: reading from backup piece
/oradepaso2/rman/imagenor/RESP_IMAGENOR_780_20200924
channel c2: starting datafile backup set restore
channel c2: specifying datafile(s) to restore from backup set
channel c2: restoring datafile 00009 to +DG_IMAG
channel c2: restoring datafile 00019 to +DG_IMAG
channel c2: restoring datafile 00027 to +DG_IMAG
channel c2: reading from backup piece
/oradepaso2/rman/imagenor/RESP_IMAGENOR_778_20200924
channel c3: starting datafile backup set restore
channel c3: specifying datafile(s) to restore from backup set
channel c3: restoring datafile 00003 to +DG_IMAG
channel c3: restoring datafile 00010 to +DG_IMAG
channel c3: restoring datafile 00020 to +DG_IMAG
channel c3: reading from backup piece
/oradepaso2/rman/imagenor/RESP_IMAGENOR_779_20200924
channel c4: starting datafile backup set restore
channel c4: specifying datafile(s) to restore from backup set
channel c4: restoring datafile 00015 to +DG_IMAG
channel c4: restoring datafile 00024 to +DG_IMAG
channel c4: restoring datafile 00025 to +DG_IMAG
channel c4: reading from backup piece
/oradepaso2/rman/imagenor/RESP_IMAGENOR_774_20200924
channel c5: starting datafile backup set restore
channel c5: specifying datafile(s) to restore from backup set
channel c5: restoring datafile 00004 to +DG_IMAG
channel c5: restoring datafile 00013 to +DG_IMAG
channel c5: restoring datafile 00022 to +DG_IMAG
channel c5: reading from backup piece
/oradepaso2/rman/imagenor/RESP_IMAGENOR_781_20200924
channel c6: starting datafile backup set restore
channel c6: specifying datafile(s) to restore from backup set
channel c6: restoring datafile 00012 to +DG_IMAG
channel c6: restoring datafile 00014 to +DG_IMAG
channel c6: restoring datafile 00023 to +DG_IMAG
channel c6: reading from backup piece
/oradepaso2/rman/imagenor/RESP_IMAGENOR_773_20200924
channel c7: starting datafile backup set restore
channel c7: specifying datafile(s) to restore from backup set
channel c7: restoring datafile 00001 to +DG_IMAG
channel c7: restoring datafile 00008 to +DG_IMAG
channel c7: restoring datafile 00018 to +DG_IMAG
channel c7: reading from backup piece
/oradepaso2/rman/imagenor/RESP_IMAGENOR_777_20200924
channel c8: starting datafile backup set restore
channel c8: specifying datafile(s) to restore from backup set
channel c8: restoring datafile 00007 to +DG_IMAG
channel c8: restoring datafile 00017 to +DG_IMAG
channel c8: restoring datafile 00026 to +DG_IMAG
channel c8: reading from backup piece
/oradepaso2/rman/imagenor/RESP_IMAGENOR_776_20200924
channel c9: starting datafile backup set restore
channel c9: specifying datafile(s) to restore from backup set
channel c9: restoring datafile 00002 to +DG_IMAG
channel c9: restoring datafile 00006 to +DG_IMAG
channel c9: restoring datafile 00016 to +DG_IMAG
channel c9: reading from backup piece
/oradepaso2/rman/imagenor/RESP_IMAGENOR_775_20200924
channel c5: errors found reading piece
handle=/oradepaso2/rman/imagenor/RESP_IMAGENOR_781_20200924
channel c5: failover to piece handle=/backup/imagenor/RESP_IMAGENOR_781_20200924
tag=TAG20200924T113502
channel c5: restored backup piece 1
channel c5: restore complete, elapsed time: 01:11:41
channel c3: errors found reading piece
handle=/oradepaso2/rman/imagenor/RESP_IMAGENOR_779_20200924
channel c3: failover to piece handle=/backup/imagenor/RESP_IMAGENOR_779_20200924
tag=TAG20200924T113502
channel c3: restored backup piece 1
channel c3: restore complete, elapsed time: 01:20:31
channel c1: errors found reading piece
handle=/oradepaso2/rman/imagenor/RESP_IMAGENOR_780_20200924
channel c1: failover to piece handle=/backup/imagenor/RESP_IMAGENOR_780_20200924
tag=TAG20200924T113502
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 01:20:41
channel c2: errors found reading piece
handle=/oradepaso2/rman/imagenor/RESP_IMAGENOR_778_20200924
channel c2: failover to piece handle=/backup/imagenor/RESP_IMAGENOR_778_20200924
tag=TAG20200924T113502
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 01:21:11
channel c4: errors found reading piece
handle=/oradepaso2/rman/imagenor/RESP_IMAGENOR_774_20200924
channel c4: failover to piece handle=/backup/imagenor/RESP_IMAGENOR_774_20200924
tag=TAG20200924T113502
channel c4: restored backup piece 1
channel c4: restore complete, elapsed time: 01:21:31
channel c9: errors found reading piece
handle=/oradepaso2/rman/imagenor/RESP_IMAGENOR_775_20200924
channel c9: failover to piece handle=/backup/imagenor/RESP_IMAGENOR_775_20200924
tag=TAG20200924T113502
channel c9: restored backup piece 1
channel c9: restore complete, elapsed time: 01:46:11
channel c6: errors found reading piece
handle=/oradepaso2/rman/imagenor/RESP_IMAGENOR_773_20200924
channel c6: failover to piece handle=/backup/imagenor/RESP_IMAGENOR_773_20200924
tag=TAG20200924T113502
channel c6: restored backup piece 1
channel c6: restore complete, elapsed time: 01:50:32
channel c7: errors found reading piece
handle=/oradepaso2/rman/imagenor/RESP_IMAGENOR_777_20200924
channel c7: failover to piece handle=/backup/imagenor/RESP_IMAGENOR_777_20200924
tag=TAG20200924T113502
channel c7: restored backup piece 1
channel c7: restore complete, elapsed time: 01:52:01
channel c8: errors found reading piece
handle=/oradepaso2/rman/imagenor/RESP_IMAGENOR_776_20200924
channel c8: failover to piece handle=/backup/imagenor/RESP_IMAGENOR_776_20200924
tag=TAG20200924T113502
channel c8: restored backup piece 1
channel c8: restore complete, elapsed time: 01:52:31
Finished restore at 19-JAN-21

datafile 1 switched to datafile copy


input datafile copy RECID=31 STAMP=1062256586 file
name=+DG_IMAG/imagenor/datafile/system.339.1062249839
datafile 2 switched to datafile copy
input datafile copy RECID=32 STAMP=1062256586 file
name=+DG_IMAG/imagenor/datafile/undotbs1.329.1062249839
datafile 3 switched to datafile copy
input datafile copy RECID=33 STAMP=1062256586 file
name=+DG_IMAG/imagenor/datafile/indx.343.1062249837
datafile 4 switched to datafile copy
input datafile copy RECID=34 STAMP=1062256586 file
name=+DG_IMAG/imagenor/datafile/tools.342.1062249837
datafile 5 switched to datafile copy
input datafile copy RECID=35 STAMP=1062256586 file
name=+DG_IMAG/imagenor/datafile/users.355.1062249835
datafile 6 switched to datafile copy
input datafile copy RECID=36 STAMP=1062256586 file
name=+DG_IMAG/imagenor/datafile/digital.347.1062249837
datafile 7 switched to datafile copy
input datafile copy RECID=37 STAMP=1062256586 file
name=+DG_IMAG/imagenor/datafile/digital.351.1062249837
datafile 8 switched to datafile copy
input datafile copy RECID=38 STAMP=1062256586 file
name=+DG_IMAG/imagenor/datafile/digital.352.1062249837
datafile 9 switched to datafile copy
input datafile copy RECID=39 STAMP=1062256586 file
name=+DG_IMAG/imagenor/datafile/digital.362.1062249833
datafile 10 switched to datafile copy
input datafile copy RECID=40 STAMP=1062256586 file
name=+DG_IMAG/imagenor/datafile/digital.357.1062249835
datafile 11 switched to datafile copy
input datafile copy RECID=41 STAMP=1062256586 file
name=+DG_IMAG/imagenor/datafile/digital.363.1062249833
datafile 12 switched to datafile copy
input datafile copy RECID=42 STAMP=1062256586 file
name=+DG_IMAG/imagenor/datafile/digital.345.1062249837
datafile 13 switched to datafile copy
input datafile copy RECID=43 STAMP=1062256586 file
name=+DG_IMAG/imagenor/datafile/digital.356.1062249835
datafile 14 switched to datafile copy
input datafile copy RECID=44 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/digital.358.1062249835
datafile 15 switched to datafile copy
input datafile copy RECID=45 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/digital.359.1062249835
datafile 16 switched to datafile copy
input datafile copy RECID=46 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/digital.340.1062249837
datafile 17 switched to datafile copy
input datafile copy RECID=47 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/digital.341.1062249837
datafile 18 switched to datafile copy
input datafile copy RECID=48 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/digital.344.1062249837
datafile 19 switched to datafile copy
input datafile copy RECID=49 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/digital.360.1062249835
datafile 20 switched to datafile copy
input datafile copy RECID=50 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/digital.350.1062249837
datafile 21 switched to datafile copy
input datafile copy RECID=51 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/digital.361.1062249835
datafile 22 switched to datafile copy
input datafile copy RECID=52 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/digital.348.1062249837
datafile 23 switched to datafile copy
input datafile copy RECID=53 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/digital.349.1062249837
datafile 24 switched to datafile copy
input datafile copy RECID=54 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/digital.353.1062249835
datafile 25 switched to datafile copy
input datafile copy RECID=55 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/sysaux.346.1062249837
datafile 26 switched to datafile copy
input datafile copy RECID=56 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/undotbs2.338.1062249839
datafile 27 switched to datafile copy
input datafile copy RECID=57 STAMP=1062256587 file
name=+DG_IMAG/imagenor/datafile/db_crecimiento.354.1062249835

renamed tempfile 1 to +DG_IMAG in control file

Starting recover at 19-JAN-21

starting media recovery

channel c1: starting archived log restore to default destination


channel c1: restoring archived log
archived log thread=2 sequence=9567
channel c1: reading from backup piece
/oradepaso2/rman/imagenor/RESP_IMAGENOR_770_20200924
channel c2: starting archived log restore to default destination
channel c2: restoring archived log
archived log thread=1 sequence=10609
channel c2: restoring archived log
archived log thread=2 sequence=9568
channel c2: reading from backup piece
/oradepaso2/rman/imagenor/RESP_IMAGENOR_771_20200924
channel c3: starting archived log restore to default destination
channel c3: restoring archived log
archived log thread=2 sequence=9569
channel c3: restoring archived log
archived log thread=1 sequence=10610
channel c3: restoring archived log
archived log thread=2 sequence=9570
channel c3: reading from backup piece
/oradepaso2/rman/imagenor/RESP_IMAGENOR_772_20200924
channel c1: errors found reading piece
handle=/oradepaso2/rman/imagenor/RESP_IMAGENOR_770_20200924
channel c1: failover to piece handle=/backup/imagenor/RESP_IMAGENOR_770_20200924
tag=TAG20200924T113451
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:03
channel c3: errors found reading piece
handle=/oradepaso2/rman/imagenor/RESP_IMAGENOR_772_20200924
channel c3: failover to piece handle=/backup/imagenor/RESP_IMAGENOR_772_20200924
tag=TAG20200924T113451
channel c3: restored backup piece 1
channel c3: restore complete, elapsed time: 00:00:03
channel c2: errors found reading piece
handle=/oradepaso2/rman/imagenor/RESP_IMAGENOR_771_20200924
channel c2: failover to piece handle=/backup/imagenor/RESP_IMAGENOR_771_20200924
tag=TAG20200924T113451
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 00:00:15
archived log file
name=+FRA_IMAG/imagenor/archivelog/2021_01_19/thread_1_seq_10609.288.1062256597
thread=1 sequence=10609
archived log file
name=+FRA_IMAG/imagenor/archivelog/2021_01_19/thread_2_seq_9567.292.1062256595
thread=2 sequence=9567
archived log file
name=+FRA_IMAG/imagenor/archivelog/2021_01_19/thread_2_seq_9568.289.1062256597
thread=2 sequence=9568
archived log file
name=+FRA_IMAG/imagenor/archivelog/2021_01_19/thread_2_seq_9569.293.1062256595
thread=2 sequence=9569
archived log file
name=+FRA_IMAG/imagenor/archivelog/2021_01_19/thread_1_seq_10610.291.1062256595
thread=1 sequence=10610
archived log file
name=+FRA_IMAG/imagenor/archivelog/2021_01_19/thread_2_seq_9570.290.1062256595
thread=2 sequence=9570
unable to find archived log
archived log thread=1 sequence=10611
released channel: c1
released channel: c2
released channel: c3
released channel: c4
released channel: c5
released channel: c6
released channel: c7
released channel: c8
released channel: c9
released channel: c10
released channel: c11
released channel: c12
released channel: c13
released channel: c14
released channel: c15
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/19/2021 15:16:54
RMAN-06054: media recovery requesting unknown archived log for thread 1 with
sequence 10611 and starting SCN of 10199303848076

Recovery Manager complete.

Evidencia:
----------
--Validar Espacio en la FRA de NODO: --> Se borraron todos los archivos
de la BD en el ASM
--Ver log para mas detalle.

archived log file


name=+FRA_NODO/nodo_stby/archivelog/2019_03_10/thread_2_seq_188046.1642.1002511753
thread=2 sequence=188046
archived log file
name=+FRA_NODO/nodo_stby/archivelog/2019_03_10/thread_1_seq_175035.1230.1002511795
thread=1 sequence=175035
archived log file
name=+FRA_NODO/nodo_stby/archivelog/2019_03_10/thread_2_seq_188047.2420.1002511801
thread=2 sequence=188047
archived log file
name=+FRA_NODO/nodo_stby/archivelog/2019_03_10/thread_1_seq_175036.928.1002511801
thread=1 sequence=175036
archived log file
name=+FRA_NODO/nodo_stby/archivelog/2019_03_10/thread_2_seq_188048.2289.1002511801
thread=2 sequence=188048
archived log file
name=+FRA_NODO/nodo_stby/archivelog/2019_03_10/thread_1_seq_175037.2415.1002511803
thread=1 sequence=175037
archived log file
name=+FRA_NODO/nodo_stby/archivelog/2019_03_10/thread_2_seq_188049.2532.1002511821
thread=2 sequence=188049
unable to find archived log
archived log thread=2 sequence=188050
released channel: ch1
released channel: ch2
released channel: ch3
released channel: ch4
released channel: ch5
released channel: ch6
released channel: ch7
released channel: ch8
released channel: ch9
released channel: ch10
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/10/2019 03:36:17
RMAN-06054: media recovery requesting unknown archived log for thread 2 with
sequence 188050 and starting SCN of 10188403598628

Recovery Manager complete.

9.Abrir la Base de Datos


************************
SELECT name, open_mode, log_mode,flashback_on,force_logging FROM v$database;

alter database open resetlogs;

--Log
racmig1:/home/oracle/dba/shells/restore/imagenor:nodo1$ imagenor

SQL*Plus: Release 11.2.0.3.0 Production on Tue Jan 19 15:35:03 2021

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management,
OLAP,
Data Mining and Real Application Testing options

NAME OPEN_MODE LOG_MODE FLASHBACK_ON FOR


------------------------- -------------------- ------------ ------------------ ---
IMAGENOR MOUNTED ARCHIVELOG NO YES

HOST_NAME INSTANCE_NAME STATUS STARTUP_TIME SHU


LOGINS
------------------------- ---------------- ------------ ----------------- ---
----------
racmig1 imagenor1 MOUNTED 19-01-21 13:18:50 NO
ALLOWED

FILE_NAME
--------------------------------------------------------------------------------
+DG_IMAG/imagenor/datafile/users.355.1062249835
+DG_IMAG/imagenor/datafile/undotbs1.329.1062249839
+DG_IMAG/imagenor/datafile/tools.342.1062249837
+DG_IMAG/imagenor/datafile/system.339.1062249839
+DG_IMAG/imagenor/datafile/sysaux.346.1062249837
+DG_IMAG/imagenor/datafile/indx.343.1062249837
+DG_IMAG/imagenor/datafile/digital.360.1062249835
+DG_IMAG/imagenor/datafile/digital.353.1062249835
+DG_IMAG/imagenor/datafile/digital.349.1062249837
+DG_IMAG/imagenor/datafile/digital.348.1062249837
+DG_IMAG/imagenor/datafile/digital.361.1062249835
+DG_IMAG/imagenor/datafile/digital.350.1062249837
+DG_IMAG/imagenor/datafile/digital.344.1062249837
+DG_IMAG/imagenor/datafile/digital.341.1062249837
+DG_IMAG/imagenor/datafile/digital.340.1062249837
+DG_IMAG/imagenor/datafile/digital.359.1062249835
+DG_IMAG/imagenor/datafile/digital.358.1062249835
+DG_IMAG/imagenor/datafile/digital.356.1062249835
+DG_IMAG/imagenor/datafile/digital.345.1062249837
+DG_IMAG/imagenor/datafile/digital.363.1062249833
+DG_IMAG/imagenor/datafile/digital.357.1062249835
+DG_IMAG/imagenor/datafile/digital.362.1062249833
+DG_IMAG/imagenor/datafile/digital.352.1062249837
+DG_IMAG/imagenor/datafile/digital.351.1062249837
+DG_IMAG/imagenor/datafile/digital.347.1062249837
+DG_IMAG/imagenor/datafile/undotbs2.338.1062249839
+DG_IMAG/imagenor/datafile/db_crecimiento.354.1062249835
+DG_IMAG/imagenor/tempfile/temp.371.1062257821
+DG_IMAG/imagenor/onlinelog/redo03_01.log
+FRA_IMAG/imagenor/onlinelog/redo03_02.log
+DG_IMAG/imagenor/onlinelog/redo02_01.log
+FRA_IMAG/imagenor/onlinelog/redo02_02.log
+DG_IMAG/imagenor/onlinelog/redo01_01.log
+FRA_IMAG/imagenor/onlinelog/redo01_02.log
+DG_IMAG/imagenor/onlinelog/group_4.378.1062257815
+DG_IMAG/imagenor/onlinelog/group_4.377.1062257815
+DG_IMAG/imagenor/onlinelog/group_5.376.1062257817
+DG_IMAG/imagenor/onlinelog/group_5.375.1062257817
+DG_IMAG/imagenor/onlinelog/group_6.374.1062257817
+DG_IMAG/imagenor/onlinelog/group_6.372.1062257817
+DG_IMAG/imagenor/onlinelog/stby_redo01_01.log
+FRA_IMAG/imagenor/onlinelog/stby_redo01_02.log
+DG_IMAG/imagenor/onlinelog/stby_redo02_01.log
+FRA_IMAG/imagenor/onlinelog/stby_redo02_02.log
+DG_IMAG/imagenor/onlinelog/stby_redo03_01.log
+FRA_IMAG/imagenor/onlinelog/stby_redo03_02.log
+DG_IMAG/imagenor/onlinelog/stby_redo04_01.log
+FRA_IMAG/imagenor/onlinelog/stby_redo04_02.log
+DG_IMAG/imagenor/onlinelog/stby_redo05_01.log
+FRA_IMAG/imagenor/onlinelog/stby_redo05_02.log
+DG_IMAG/imagenor/onlinelog/stby_redo06_01.log
+FRA_IMAG/imagenor/onlinelog/stby_redo06_02.log
+DG_IMAG/imagenor/onlinelog/stby_redo07_01.log
+FRA_IMAG/imagenor/onlinelog/stby_redo07_02.log
+DG_IMAG/imagenor/onlinelog/stby_redo08_01.log
+FRA_IMAG/imagenor/onlinelog/stby_redo08_02.log
+DG_IMAG/imagenor/controlfile/current.337.1062248615, +FRA_IMAG/imagenor/control
file/current.287.1062248615

57 rows selected.

Modificar el SPFILE
-------------------
srvctl status database -d imagenor
srvctl config db -d imagenor
srvctl modify db -d imagenor -p
+DG_IMAG/IMAGENOR/PARAMETERFILE/spfile.364.1063022205
srvctl start database -d imagenor
srvctl status database -d imagenor

--Log
racmig2:/u01/app/product/11.2.0/db_1/dbs:imagenor2$ srvctl modify db -d imagenor -p
+DG_IMAG/IMAGENOR/PARAMETERFILE/spfile.364.1062258305
racmig2:/u01/app/product/11.2.0/db_1/dbs:imagenor2$ srvctl config db -d imagenor
Database unique name: imagenor
Database name:
Oracle home: /u01/app/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DG_IMAG/IMAGENOR/PARAMETERFILE/spfile.364.1062258305
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: imagenor
Database instances: imagenor1,imagenor2
Disk Groups: DG_IMAG,FRA_IMAG
Mount point paths:
Services:
Type: RAC
Database is administrator managed
racmig2:/u01/app/product/11.2.0/db_1/dbs:imagenor2$ srvctl status database -d
imagenor
Instance imagenor1 is not running on node racmig1
Instance imagenor2 is not running on node racmig2
racmig2:/u01/app/product/11.2.0/db_1/dbs:imagenor2$ srvctl start database -d
imagenor
racmig2:/u01/app/product/11.2.0/db_1/dbs:imagenor2$ srvctl status database -d
imagenor
Instance imagenor1 is running on node racmig1
Instance imagenor2 is running on node racmig2
racmig2:/u01/app/product/11.2.0/db_1/dbs:imagenor2$ srvctl stop database -d
imagenor
racmig2:/u01/app/product/11.2.0/db_1/dbs:imagenor2$ srvctl start database -d
imagenor
racmig2:/u01/app/product/11.2.0/db_1/dbs:imagenor2$ srvctl status database -d
imagenor
Instance imagenor1 is running on node racmig1
Instance imagenor2 is running on node racmig2
racmig2:/u01/app/product/11.2.0/db_1/dbs:imagenor2$

9.Abrir la Base de Datos en Modo Lectura


****************************************
. ./nodo.env
SELECT name, open_mode, log_mode,flashback_on,force_logging FROM v$database;
alter database open read only;

--Validar la ubicaci�n de los archivos de la Base de Datos


SELECT name, open_mode, log_mode,flashback_on,force_logging FROM v$database;

set linesize 300 pagesize 900


col file_name for a80
SELECT file_name FROM dba_data_files
UNION ALL
SELECT file_name FROM dba_temp_files
UNION ALL
SELECT member FROM v$logfile
UNION ALL
SELECT value FROM v$parameter WHERE name = 'control_files';

show parameter control_files

--Status del Data Guard


SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY;

PROCESS STATUS
--------- ------------
ARCH CLOSING
ARCH CLOSING
ARCH CONNECTED
ARCH CLOSING
RFS IDLE
RFS IDLE
RFS IDLE
RFS RECEIVING
RFS RECEIVING
RFS RECEIVING

10 rows selected.

10.Validar y Modificar el parametro


control_files en congruencia con el ASM

***************************************************************************
--Bajar la Base de Datos
shu immediate;
cd $ORACLE_HOME/dbs
vi initnodo.ora
*.control_files

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
control_files string
+DG_NODO/nodo_stby/controlfile/current.352.934377343,

+FRA_NODO/nodo_stby/controlfile/current.538.933251583

*.control_files='+DG_NODO/nodo_stby/controlfile/current.352.934377343','+FRA_NODO/n
odo_stby/controlfile/current.538.933251583'

shu immediate;
startup mount;
show parameter control_files

--Dejar la BD Levantada con el SPFILE


create spfile='+DG_NODO' from pfile;
create spfile='+DG_IMAG' from
pfile='/u01/app/product/11.2.0/db_1/dbs/initimagenor1.ora';

shu immediate;
startup mount;

ASMCMD> pwd
+DG_NODO/NODO_STBY
ASMCMD> ls
CONTROLFILE/
DATAFILE/
DATAGUARDCONFIG/
DGB/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
ASMCMD> cd PARAMETERFILE/
ASMCMD> pwd
+DG_NODO/NODO_STBY/PARAMETERFILE
ASMCMD> ls
spfile.423.934484283

cat /u01/app/oracle/product/11.2.0/dbhome_1/dbs/initnodo.ora
SPFILE='+DG_IMAG/IMAGENOR/PARAMETERFILE/spfile.364.1062258305'

show parameter pfile

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
spfile string +DG_NODO/nodo_stby/parameterfi
le/spfile.423.934484283

--Recrear el SPFILE
SQL> create spfile='+DG_IMAG' from
pfile='/u01/app/product/11.2.0/db_1/dbs/initimagenor1.ora';

File created.

SQL> shu immediate;


Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 2137886720 bytes
Fixed Size 2223208 bytes
Variable Size 1811940248 bytes
Database Buffers 318767104 bytes
Redo Buffers 4956160 bytes
Database mounted.
Database opened.
SQL>

11.Recrear el archivo de password Nota:


*********************************
Ojo: En caso de que el Data Guard de la BD ya existe, NO tocar el archivo de
password.

Troubleshooting: En la Standby
---------------
-Soluci�n Aplicada:
Copiar/P�gar el Archivo de Password del Servidor Productivo Nodo 1.

sftp oracle@10.99.40.160
cd $ORACLEHOME/dbs
put orapwnodo1

mv orapwnodo1 orapwnodo

shu immediate
startup mount;

-Soluci�n 1.
orapwd file=$ORACLE_HOME/dbs/orapwnodo password=nmpHP123 entries=3

orapwd file=$ORACLE_HOME/dbs/orapwnodo password=sysabril15 entries=3 ignorecase=y

. Create a new password file on primary using ignorecase=Y option and copy the new
password file to the standby database.

$ORAPWD FILE=filename [ENTRIES=numusers] [FORCE={Y|N}] IGNORECASE=Y


[NOSYSDBA={Y|N}
sqlplus sys/sysabril15@nodo as sysdba
sqlplus sys/sysabril15@nodo_stby as sysdba

--IMAGENOR
orapwd file=$ORACLE_HOME/dbs/orapwnodo password=nmpHP123 entries=3

ALTER USER SYS IDENTIFIED BY nmpHP123;


ALTER USER SYSTEM IDENTIFIED BY nmpHP123;

12.Validar la Replicaci�n en la Standby


***************************************

--1.Activar la Aplicacion de Redo: (Redo Apply)


alter database recover managed standby database disconnect from session;
alter database recover managed standby database using current logfile disconnect
from session;

--2.Desactivar la Aplicacion de Redo: (Redo Apply)


alter database recover managed standby database cancel;

--Validar archiveds aplicados


@validadg.sql

set linesize 300


col completion_time for a20
col standby_dest for a20
select al.thrd "Thread", almax "Last Seq Received", lhmax "Last Seq Applied",
(almax-lhmax) "Difference"
from (select thread# thrd, max(sequence#) almax
from v$archived_log
where resetlogs_change#=(select resetlogs_change# from v$database)
group by thread#) al,
(select thread# thrd, max(sequence#) lhmax
from v$log_history
where resetlogs_change#=(select resetlogs_change# from v$database)
group by thread#) lh
where al.thrd = lh.thrd;

--3.Administraci�n del Data Guard


Troubleshooting Data Guard (Doc ID 237213.1)
11.2 Data Guard Physical Standby Switchover Best Practices using SQL*Plus (Doc ID
1304939.1)

Troubleshooting Data Guard (Doc ID


237213.1)

********************************************

1.Identicar s� la Transferencia de Archiveds funciona


correctamente
-----------------------------------------------------------------
---

--Primary
alter system switch logfile;
SELECT dest_id,status,error FROM v$archive_dest where target='STANDBY';

*VALID ---> OK Proceder al paso 2.

*ERROR ---> NO OK Proceder al "Troubleshooting Log Transport Services"

2.Determinar s� la Standby es una Physical/Logical Standby:


----------------------------------------------------------
--Standby
select database_role from v$database;

*Si es Physical Standby --> Proceder al "Troubleshooting Redo Apply".


*S� es una Logical Standby --> Proceder al "Troubleshooting Logical Apply".
Troubleshooting Log transport services: Identificar si no se
est�n pasando los archiveds correctamente.
**************************************

1) Verificar que la Primary est� en Modo Archivelog y tiene


Activado el Archivado Autom�tico
-----------------------------------------------------------------
----------------------------
--Primary
select log_mode from v$database;
archive log list;
select inst_id,status,database_status,instance_role from gv$instance;

2) Verificar que se tiene espacio suficiente en todos destinos de los


archiveds:
a) Locales
b) Obligatorios
-----------------------------------------------------------------
-------------
--Primary
a).En la Primary
set linesize 300
col destination for a20
select dest_id,destination from v$archive_dest
where schedule='ACTIVE'
and (binding='MANDATORY' or target='PRIMARY');

b).Validar espacio en el ASM

3) Determinar s� el �ltimo "log switch" para cualquier "remote


destinations" resulta en un error.

-----------------------------------------------------------------------------
--------------------
--Primary
alter system switch logfile;
select target,dest_id,status,error from v$archive_dest where target='STANDBY';

SELECT target,thread#, dest_id, gvad.status, error


FROM gv$archive_dest gvad, gv$instance gvi
WHERE gvad.inst_id = gvi.inst_id
AND destination is NOT NULL
ORDER BY thread#, dest_id;

*Si se muestra algun error, realizar un switcheo y reejecutar el query para


determinar si el issue ha sido resuelto
*S� la Columna error est�n en blanco y la Columna status muestra VALID, entonces el
Archivado termino correctamente.
--

4) Determinar s� se tiene algun error consultando


v$dataguard_status (vista disponible de 9.2.0 en adelante):
-----------------------------------------------------------------
----------------------------------------------
--Primary
a) En la BD
set linesize 300 pagesize 100
col message for a80
select message, to_char(timestamp,'DD-MM-YYYY HH:MI:SS') timestamp
from v$dataguard_status
where severity in ('Error','Fatal')
order by timestamp;

column message format a80


SELECT to_char(timestamp,'DD-MM-YYYY HH:MI:SS') timestamp,
gvi.thread#, message
FROM gv$dataguard_status gvds, gv$instance gvi
WHERE gvds.inst_id = gvi.inst_id
AND severity in ('Error','Fatal')
ORDER BY timestamp, thread#;

b) En el alert de la BD
tail -90000f
/u01/app/oracle/diag/rdbms/nodo/nodo/diag/diag/rdbms/nodo/nodo1/trace/alert_nodo1.l
og | awk '/TNS-/ { print NR $0 };/ARC/ { print NR $0 };/ORA-/ { print NR
$0 };/WARNING/ { print NR $0 };/Feb 02/ { print NR $0 }'
tail -90000f
/u01/app/oracle/diag/rdbms/nodo/nodo/diag/diag/rdbms/nodo/nodo2/trace/alert_nodo2.l
og | awk '/TNS-/ { print NR $0 };/ARC/ { print NR $0 };/ORA-/ { print NR
$0 };/WARNING/ { print NR $0 };/Feb 02/ { print NR $0 }'

5) Obtener informaci�n acerca de como los Destinos Remotos est�n


realizando el Archivado:
-----------------------------------------------------------------
-----------------------
--Primary
set linesize 300
col transmit_mode for a13
col affirm for a6
select dest_id,archiver,transmit_mode,affirm,net_timeout,delay_mins,async_blocks
from v$archive_dest where target='STANDBY';

DEST_ID ARCHIVER TRANSMIT_MODE AFFIRM NET_TIMEOUT DELAY_MINS ASYNC_BLOCKS


---------- ---------- ------------- ------ ----------- ---------- ------------
2 LGWR ASYNCHRONOUS NO 30 0 61440

5.1. Validar Status de los Destinos: Debe de ser VALID


-----------------------------------
--Primary
set linesize 300
col type for a10
col destination for a40
col dest_name for a20
col error for a40
SELECT database_mode,recovery_mode,dest_id,dest_name,destination,status,type,error
FROM v$archive_dest_status WHERE status = 'VALID';

SELECT dest_id,dest_name,target,destination,status,type,error FROM v$archive_dest


WHERE status = 'VALID';
6) Determinar si hay "lags" o retrasos en la Transferencia de los
Archiveds
-----------------------------------------------------------------
-----------
--Standby
col value for a20
SELECT * FROM v$dataguard_stats;
SELECT * FROM v$dataguard_stats WHERE name LIKE '%lag%'; ---> Esto s�lo
aplica cuando el LGWR(archiver) y el Real Time Apply (recovery_mode) est� en uso.
SELECT * FROM v$dataguard_stats WHERE name = 'transport lag';

La columna "value" nos indica si hay un retraso en la Transferencia de los


Archiveds hacia la Standby.

6.1.Identificar con que frecuencia y en que medidad son los lags


----------------------------------------------------------------
SELECT name, time, unit, count,
TO_DATE(last_time_updated, 'DD-MM-YYYY HH24:MI:SS')
FROM v$standby_event_histogram
ORDER BY unit DESC, time;

7) Determinar:
--------------
-La Secuencia Actual,
-La �ltima Secuencia Archivada, y
-La �ltima Secuencia Aplicada en la Standby:
-------------------------------------------
--Primary
select ads.dest_id,
max(sequence#) "Current Sequence",
max(log_sequence) "Last Archived",
max(applied_seq#) "Last Sequence Applied"
from v$archived_log al, v$archive_dest ad, v$archive_dest_status ads
where ad.dest_id=al.dest_id
and al.dest_id=ads.dest_id
group by ads.dest_id;

*S� estas archivando remotamente usando el Proceso LWGR, entonces la


Secuencia Archivada debe ser m�s grande que la Secuencia Actual.

DEST_ID Current Sequence Last Archived Last Sequence Applied


---------- ---------------- ------------- ---------------------
1 74660 74660 0
2 74659 74660 74635

*S� estas archivando remotamente usando el Proceso ARCH, entonces la


Secuencia Archivada debe ser igual a la Secuencia Actual.
La Informaci�n de la Secuencia Aplicada es actualizada al momento del log
switch.

8) Identificar el Status de los Procesos involucrados en la


Transportaci�n del Redo a la Standby
-----------------------------------------------------------------
-------------------------------
--Primary
set linesize 300
SELECT thread#,
process,
pid,
status,
client_process,
client_pid,
sequence#,
block#,
active_agents,
known_agents
FROM gv$managed_standby ORDER BY thread#, process;

--Standby: Ver cuales Secuencias est�n siendo Transferidas a la Standby


select process, status, thread#, sequence#,block#, blocks
from v$managed_standby
--where status != 'APPLYING_LOG'
where thread# != 0
order by thread#,process;

PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS


------- -------------------- -------- --------- -------- --------
RFS IDLE 0 0 0 0
RFS IDLE 0 0 0 0
RFS IDLE 0 0 0 0
RFS RECEIVING 0 0 0 0
RFS IDLE 0 0 0 0
RFS IDLE 0 0 0 0
ARCH CONNECTED 0 0 0 0
RFS IDLE 1 74670 86761 3
ARCH CLOSING 1 74668 167936 738
MRP0 APPLYING_LOG 1 74670 86760 204800 ---> Aplicando
Redo en la Standby (MRPO)
ARCH CLOSING 1 74669 165888 541

PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS


------- -------------------- -------- --------- -------- --------
ARCH CLOSING 1 74666 55296 1575
RFS IDLE 2 73852 154809 1

PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS


------- -------------------- -------- --------- -------- --------
ARCH CLOSING 1 74666 55296 1575
ARCH CLOSING 1 74669 165888 541
MRP0 APPLYING_LOG 1 74670 87044 204800 ---> Aplicando
Redo en la Standby (MRPO)
RFS IDLE 1 74670 87046 1
ARCH CLOSING 1 74668 167936 738
RFS IDLE 2 73852 155038 1

6 rows selected.

Cual proceso transporta los archivos??


Troubleshooting Redo Apply services:
Identificar si no se est�n Aplicando los Archiveds correctamente.
***********************************

1. Verificar la �ltima Secuencia Recibida y la �ltima Secuencia


Aplicada en la Standby

-----------------------------------------------------------------------------
---------
--Primary y Standby
*1
SELECT max(al.sequence#) "Last Seq Received",
max(lh.sequence#) "Last Seq Applied"
FROM v$archived_log al, v$log_history lh;

*2
SELECT al.thrd "Thread",
almax "Last Seq Received",
lhmax "Last Seq Applied"
FROM (select thread# thrd,
MAX(sequence#) almax
FROM v$archived_log
WHERE resetlogs_change#=(SELECT resetlogs_change#
FROM v$database) GROUP BY thread#) al,
(SELECT thread# thrd,
MAX(sequence#) lhmax
FROM v$log_history
WHERE resetlogs_change#=(SELECT resetlogs_change#
FROM v$database);
GROUP BY thread#) lh
WHERE al.thrd = lh.thrd;

*S� los 2 N�meros son iguales --->


entonces la Standby ha aplicado todos los Redos enviados desde la Primary.
*S� los 2 N�meros son diferentes mas de 1 ---> entonces se tiene un problema
y pasar al paso 2.

2.Verificar que la Stanby tenga el Status de Montada


----------------------------------------------------
--Standby
select open_mode from v$database;

3.Determinar s� hay un "archive gap"(archiveds faltantes) en la


Physical Standby,
consultando la vista V$ARCHIVE_GAP:
------------------------------------------------------------

--Standby
set linesize 300
col thread# for a20
col LOW_SEQUENCE# for a20
col HIGH_SEQUENCE# for a20
select * from v$archive_gap;

3.1.Determinar si hay "lags" o retrasos en la Aplicaci�n de Redo


----------------------------------------------------------------
col value for a20
SELECT * FROM v$dataguard_stats;
SELECT * FROM v$dataguard_stats WHERE name = 'apply lag';

La columna value nos indica si hay un retraso en la Aplicaci�n de los Archiveds en


la Standby

Nota: La vista fija V$ARCHIVE_GAP en una Physical Standby Database s�lo regresa
el "gap" que
est� actualmente bloqueando la "Aplicacion del Redo".

Despu�s de resolver el gap identificado e iniciar el "Redo Apply", consulta


nuevamente la
vista V$ARCHIVE_GAP en la Standby, para determinar la siguiente Secuencia,
si es que la
hay.

Repite el proceso hasta que no halla gaps.

4.Verificar que el "Managed Recovery Process" est� corriendo:


---> Proceso MRP
----------------------------------------------------

--Standby
a).Si est� corriendo se observa el Proceso MRP, responsable del Redo Apply.

-En la BD
select thread#,sequence#,process,client_process,status,block#,blocks from
v$managed_standby where thread# in (1,2)order by thread#;
select thread#,sequence#,process,status from v$managed_standby where process LIKE
'MRP%' order by thread#;

set linesize 300


col start_time for a20
col type for a16
col units for a10
col comments for a50
select to_char(start_time,'DD-MM-YYYY HH:MI:SS')
start_time,type,item,units,sofar,total,
to_char(timestamp,'DD-MM-YYYY HH:MI:SS') timestamp,comments
from v$recovery_progress;

-En el SO
ps -ef|grep mrp|grep nodo

b).S� no se observa, entonces iniciar el Managed Recovery, para iniciar el


"Redo Apply"

recover managed standby database disconnect;


Posibles stados del Proceso MRP:

ERROR - Significa que el proceso fallo.Ver el alert log or


v$dataguard_status para m�s detalle.

WAIT_FOR_LOG - El Proceso MRP est� esperando para que el "archived del redo
log" (archivado) sea terminado/completado.
Switchea un "archive log" en la Primary y consulta la vista
v$managed_standby para ver s� el status cambia a APPLYING_LOG.
Con lo cual lo correcto es que diga APPLYNG_LOG.

WAIT_FOR_GAP - El Proceso est� esperando para que el "archive gap"


(intervalo/desfase/desajuste) sea resuelto.
Revisa el alert log para ver si el
"FAL_SERVER" ha sido cancelado para resolver el desfase en las secuencias.

APPLYING_LOG - El Proceso est� aplicando el Redo Log Archivado(Archiveds) en


la Standby Database y est� funcionando bien la Aplicaci�n de Redo.
Faltaria ver la velocidad o el tiempo que toma para est�
actividad???

Script to Collect Data Guard Physical Standby Diagnostic Information for Version 9i
(Doc ID 241438.1)
SELECT THREAD#,MAX(SEQUENCE#) FROM V$ARCHIVED_LOG GROUP BY THREAD#;
SELECT THREAD#,MAX(SEQUENCE#) FROM V$ARCHIVED_LOG WHERE APPLIED='YES' GROUP BY
THREAD#;
SELECT THREAD#,SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY THREAD#,SEQUENCE#;
SELECT THREAD#,SEQUENCE#,PROCESS,CLIENT_PROCESS,STATUS,BLOCK#,BLOCKS FROM
V$MANAGED_STANDBY;
SELECT name, value, time_computed FROM V$DATAGUARD_STATS;

13.Configurar el Data Broker: en la Primary y Standby


*****************************************************

--Desactivar el Data Broker: en la Primary y Standby


select b.instance_name,b.status,a.database_role,a.protection_mode from v$database
a,v$instance b;
show parameter dg_broker_start
alter system set dg_broker_start=false;

Evidencia:
----------

PRIMARY: Nodo Primario


*******
INSTANCE_NAME STATUS DATABASE_ROLE PROTECTION_MODE
---------------- ------------ ---------------- --------------------
nodo1 OPEN PRIMARY MAXIMUM PERFORMANCE

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_start boolean FALSE
PRIMARY: Nodo Secundario
*******
INSTANCE_NAME STATUS DATABASE_ROLE PROTECTION_MODE
---------------- ------------ ---------------- --------------------
nodo2 OPEN PRIMARY MAXIMUM PERFORMANCE

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_start boolean FALSE

STANDBY
*******
INSTANCE_NAME STATUS DATABASE_ROLE PROTECTION_MODE
---------------- ------------ ---------------- --------------------
nodo MOUNTED PHYSICAL STANDBY MAXIMUM PERFORMANCE

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_start boolean FALSE

14.Recrear los Archivos del Data Guard Broker en la


Standby y en la Primary

***************************************************************************

--Borrar los Archivos del Data Guard Broker


set linesize 200
col name for a25
col value for a60
SELECT name, value FROM v$parameter WHERE name LIKE '%dg_broker_config_file%';

--Se conecta uno al ASM y se borran los archivos del Data Guard Broker en la
Primary y la Standby

Evidencia:
----------
PRIMARY: Nodo Primario
*******
SELECT name, value FROM v$parameter WHERE name LIKE '%dg_broker_config_file%';

NAME VALUE
-------------------------
------------------------------------------------------------
dg_broker_config_file1 +FRA_NODO/nodo/dgb/dgb_nodo_config01.ora
dg_broker_config_file2 +DG_NODO/nodo/dgb/dgb_nodo_config02.ora

ASMCMD> cd +FRA_NODO/nodo/dgb
ASMCMD> ls
dgb_nodo_config01.ora
ASMCMD> rm dgb_nodo_config01.ora
ASMCMD> pwd
+FRA_NODO/nodo/dgb
ASMCMD> cd +DG_NODO/nodo/dgb/
ASMCMD> ls
dgb_nodo_config02.ora
ASMCMD> rm dgb_nodo_config02.ora
ASMCMD>

PRIMARY: Nodo Secundario, solo se valida.


*******
SELECT name, value FROM v$parameter WHERE name LIKE '%dg_broker_config_file%';

NAME VALUE
-------------------------
------------------------------------------------------------
dg_broker_config_file1 +FRA_NODO/nodo_stby/dgb/dgb_nodo_stby_config01.ora
dg_broker_config_file2 +DG_NODO/nodo_stby/dgb/dgb_nodo_stby_config02.ora

STANDBY
*******
SELECT name, value FROM v$parameter WHERE name LIKE '%dg_broker_config_file%';

NAME VALUE
-------------------------
------------------------------------------------------------
dg_broker_config_file1 +FRA_NODO/nodo_stby/dgb/dgb_nodo_stby_config01.ora
dg_broker_config_file2 +DG_NODO/nodo_stby/dgb/dgb_nodo_stby_config02.ora

---
Esas lineas son en caso
alter system set
dg_broker_config_file1='+FRA_NODO/NODO_STBY/dgb/dgb_abccapit_config01.ora'
scope=both sid='*';
alter system set
dg_broker_config_file2='+DG_NODO/nodo_stby/dgb/dgb_nodo_stby_config02.ora'
scope=both sid='*';

15.Activar el Data Guard Broker en la Primary y


Standaby

********************************************************
select b.instance_name,b.status,a.database_role,a.protection_mode from v$database
a,v$instance b;
show parameter dg_broker_start
alter system set dg_broker_start=true;

Status:
----------
PRIMARY: Nodo Primario
*******
INSTANCE_NAME STATUS DATABASE_ROLE PROTECTION_MODE
---------------- ------------ ---------------- --------------------
nodo1 OPEN PRIMARY MAXIMUM PERFORMANCE

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_start boolean FALSE

PRIMARY: Nodo Secundario


*******
INSTANCE_NAME STATUS DATABASE_ROLE PROTECTION_MODE
---------------- ------------ ---------------- --------------------
nodo2 OPEN PRIMARY MAXIMUM PERFORMANCE

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_start boolean FALSE

STANDBY
*******
INSTANCE_NAME STATUS DATABASE_ROLE PROTECTION_MODE
---------------- ------------ ---------------- --------------------
nodo MOUNTED PHYSICAL STANDBY MAXIMUM PERFORMANCE

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_start boolean FALSE

--Resultado en la Primary y en la Standby

--Primary
show parameter broker

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string +FRA_NODO/nodo/dgb/dgb_nodo_co
nfig01.ora
dg_broker_config_file2 string +DG_NODO/nodo/dgb/dgb_nodo_con
fig02.ora
dg_broker_start boolean TRUE

--Standby
SQL> show parameter broker

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string +FRA_NODO/nodo_stby/dgb/dgb_no
do_stby_config01.ora
dg_broker_config_file2 string +DG_NODO/nodo_stby/dgb/dgb_nod
o_stby_config02.ora
dg_broker_start boolean TRUE

--Nota: Se pone en FALSE el parametro dg_broker_start para borrar los archivos del
Broker en el ASM,
y posteriormente se activa.
16.Configurar el Data Broker desde la Primary
*********************************************
--Configurar la BD NODO en el Data Guard Broker
dgmgrl /
connect sys/sysabril15@NODO;
remove configuration;
create configuration NODO_DGB as primary database is NODO connect identifier is
NODO;

add database NODO_STBY as connect identifier is NODO_STBY;



add database NODO_STBY as connect identifier is NODO_STBY MAINTAINED AS PHYSICAL;

enable configuration;
show configuration;

--Ver configuraci�n de la BD PRIMARY


show database verbose NODO

--Ver configuraci�n de la BD STANDBY


show database verbose NODO_STBY

Evidencia:
----------
PRIMARY: Nodo Primario
*******

DGMGRL> CREATE CONFIGURATION 'DGB_NODO' AS PRIMARY DATABASE IS 'nodo' CONNECT


IDENTIFIER IS nodo;
Configuration "DGB_NODO" created with primary database "nodo"
DGMGRL> ADD DATABASE 'nodo_stby' AS CONNECT IDENTIFIER IS nodo_stby MAINTAINED AS
PHYSICAL;
Database "nodo_stby" added
DGMGRL> ENABLE CONFIGURATION;
Enabled.
DGMGRL> show configuration;

Configuration - DGB_NODO

Protection Mode: MaxPerformance


Databases:
nodo - Primary database
nodo_stby - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

--Referencia
dgmgrl /
DGMGRL> remove configuration;
Removed configuration
DGMGRL> connect sys/sysabril15@NODO;
Connected.
DGMGRL> create configuration NODO_DGB as primary database is NODO connect
identifier is NODO;
Configuration "nodo_dgb" created with primary database "nodo"
DGMGRL> add database NODO_STBY as connect identifier is NODO_STBY;
Database "nodo_stby" added
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;

Configuration - nodo_dgb

Protection Mode: MaxPerformance


Databases:
crecardp - Primary database
crecardp_stby - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL>

17.Prueba de Switchover(Se omiti� en este caso)


***********************
switchover to nodo_stby;
SELECT dbid,name, open_mode, log_mode,flashback_on,force_logging FROM v$database;
shu immediate;
startup mount;

DGMGRL> switchover to rac11g1_stby;


Performing switchover NOW, please wait...
New primary database "rac11g1_stby" is opening...
Operation requires shutdown of instance "RAC11G11" on database "rac11g1"
Shutting down instance "RAC11G11"...
ORACLE instance shut down.
Operation requires startup of instance "RAC11G11" on database "rac11g1"
Starting instance "RAC11G11"...
Unable to connect to database
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

Failed.
Warning: You are no longer connected to ORACLE.

Please complete the following steps to finish switchover:


start up and mount instance "RAC11G11" of database "rac11g1"

De regreso a la Primary (Se omitio en este caso)


************************
switchover to nodo_stby;
SELECT dbid,name, open_mode, log_mode,flashback_on,force_logging FROM v$database;
shu immediate;
startup mount;
DGMGRL> switchover to nodo;
Performing switchover NOW, please wait...
New primary database "rac11g1" is opening...
Operation requires shutdown of instance "RAC11G1" on database "rac11g1_stby"
Shutting down instance "RAC11G1"...
ORA-01031: insufficient privileges

Warning: You are no longer connected to ORACLE.

Please complete the following steps to finish switchover:


shut down instance "RAC11G1" of database "rac11g1_stby"
start up and mount instance "RAC11G1" of database "rac11g1_stby"

DGMGRL>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%

lData Guard SPEIWEB


********************
SETEAR PARAMETROS PARA LAS BASES DEL RAC(PRIMARIAS) Y LA BASE EN STANDBY

-------------------------------------------------------------------

PARA LA BASE DE DATOS PRIMARIA DEL 10.100.40.160

SQL> select name,open_mode from v$database;

NAME OPEN_MODE
--------- --------------------
SPEIWEB READ WRITE

1- Revisamos el status del broker y las rutas de archivos de configuracion

SQL> show parameter dg_broker

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/product/11.2.0/db_1/d
bs/dr1speiweb.dat
dg_broker_config_file2 string /u01/app/product/11.2.0/db_1/d
bs/dr2speiweb.dat
dg_broker_start boolean FALSE

alter system set


dg_broker_config_file1='+DG_SPEIWEB/SPEIWEB/DGB/dgb_speiweb_config01.ora'
scope=both sid='*';
alter system set
dg_broker_config_file2='+FRA_SPEIWEB/SPEIWEB/DGB/dgb_speiweb_config02.ora'
scope=both sid='*';
alter system set dg_broker_start = true scope=both sid='*';

SQL> alter system set


dg_broker_config_file1='+DG_SPEIWEB/SPEIWEB/DGB/dgb_speiweb_config01.ora'
scope=both sid='*';

System altered.

SQL> alter system set


dg_broker_config_file2='+FRA_SPEIWEB/SPEIWEB/DGB/dgb_speiweb_config02.ora'
scope=both sid='*';

System altered.

SQL> alter system set dg_broker_start = true scope=both sid='*';

System altered.

SQL> show parameter dg_broker

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string +DG_SPEIWEB/SPEIWEB/dgb/d
gb_speiweb_config01.ora
dg_broker_config_file2 string +FRA_SPEIWEB/SPEIWEB/dgb/dg
b_speiweb_config02.ora
dg_broker_start boolean TRUE

PARA LA BASE DE DATOS STANDBY DEL 10.99.40.160 hacemos lo mismo

SQL> select name,open_mode from v$database;

NAME OPEN_MODE
--------- --------------------
SPEIWEB MOUNTED

SQL> show parameter dg_broker

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/11.2.0
/dbhome_1/dbs/dr1speiweb_stby.
dat
dg_broker_config_file2 string /u01/app/oracle/product/11.2.0
/dbhome_1/dbs/dr2speiweb_stby.
dat
dg_broker_start boolean FALSE
SQL>

2- Seteamos los parametros para esta base en sus respectivos diskgroups

alter system set


dg_broker_config_file1='+DG_SPEIWEB/SPEIWEB_STBY/DGB/dgb_speiweb_config01.ora'
scope=both sid='*';
alter system set
dg_broker_config_file2='+FRA_SPEIWEB/SPEIWEB_STBY/DGB/dgb_speiweb_config02.ora'
scope=both sid='*';
alter system set dg_broker_start = true scope=both sid='*';

SQL> show parameter dg_broker

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string +DG_SPEIWEB/SPEIWEB_STBY/dgb/d
gb_speiweb_config01.ora
dg_broker_config_file2 string +FRA_SPEIWEB/SPEIWEB_STBY/dgb/dg
b_speiweb_config02.ora
dg_broker_start boolean TRUE

3- Ahora configuramos la parte de los listeners

Con grid: 10.100.40.160

Deben estar las siguientes lineas ES POSIBLE QUE YA EXISTAN

(SID_DESC=(SID_NAME=speiweb1)(SERVICE_NAME=SPEIWEB)(GLOBAL_DBNAME=SPEIWEB_DGMGRL)
(ORACLE_HOME=/u01/app/product/11.2.0/db_1))
(SID_DESC=(SID_NAME=speiweb1)(SERVICE_NAME=SPEIWEB)(GLOBAL_DBNAME=SPEIWEB_DGB)
(ORACLE_HOME=/u01/app/product/11.2.0/db_1)))

Con grid: 10.100.40.170

Agregamos la siguiente linea ES POSIBLE QUE YA EXISTAN

(SID_DESC=(SID_NAME=speiweb2)(SERVICE_NAME=SPEIWEB)(GLOBAL_DBNAME=SPEIWEB_DGMGRL)
(ORACLE_HOME=/u01/app/product/11.2.0/db_1))
(SID_DESC=(SID_NAME=speiweb2)(SERVICE_NAME=SPEIWEB)(GLOBAL_DBNAME=SPEIWEB_DGB)
(ORACLE_HOME=/u01/app/product/11.2.0/db_1)))

Con grid: 10.99.40.160 PARA LA BASE EN STANDBY (ES POSIBLE QUE YA EXISTAN)
Agregamos la siguiente linea

(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(GLOBAL_DBNAME = SPEIWEB_STBY_DGB)
(SID_NAME = speiweb)
(SERVICE_NAME = SPEIWEB_STBY)
)
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(GLOBAL_DBNAME = SPEIWEB_STBY_DMGRL)
(SID_NAME = speiweb)
(SERVICE_NAME = SPEIWEB_STBY)
)

4- por ultimo se configura el DGB en la base de datos primaria 10.100.40.160

dgmgrl /
create configuration SPEIWEB_DGB as primary database is speiweb connect identifier
is speiweb;
add database speiweb_stby as connect identifier is speiweb_stby;
enable configuration;

QUEDANDO DE LA SIGUIENTE MANERA:

DGMGRL> show configuration

Configuration - dgb_speiweb

Protection Mode: MaxPerformance


Databases:
speiweb - Primary database
speiweb_stby - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> show database verbose speiweb

Database - speiweb

Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
..........................
..........................
.........................

Database Status:
SUCCESS

DGMGRL> show database verbose speiweb

Database - speiweb

Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
speiweb1
speiweb2

Properties:
DGConnectIdentifier = 'speiweb'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'MANUAL'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '4'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '+DG_SPEIWEB/SPEIWEB_STBY/DATAFILE,
+DG_SPEIWEB/SPEIWEB/DATAFILE'
LogFileNameConvert = '+DG_SPEIWEB/SPEIWEB_STBY/ONLINELOG,
+DG_SPEIWEB/SPEIWEB/ONLINELOG, +FRA_SPEIWEB/SPEIWEB_STBY/ONLINELOG,
+FRA_SPEIWEB/SPEIWEB/ONLINELOG'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName(*)
StaticConnectIdentifier(*)
StandbyArchiveLocation(*)
AlternateLocation(*)
LogArchiveTrace(*)
LogArchiveFormat(*)
TopWaitEvents(*)
(*) - Please check specific instance for the property value

Database Status:
SUCCESS
DGMGRL> show database verbose speiweb_stby

Database - speiweb_stby

Role: PHYSICAL STANDBY


Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: OFF
Instance(s):
speiweb

Properties:
DGConnectIdentifier = 'speiweb_stby'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'MANUAL'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '10'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '+DG_SPEIWEB/SPEIWEB_STBY/DATAFILE,
+DG_SPEIWEB/SPEIWEB/DATAFILE'
LogFileNameConvert = '+DG_SPEIWEB/SPEIWEB/ONLINELOG,
+DG_SPEIWEB/SPEIWEB_STBY/ONLINELOG, +FRA_SPEIWEB/SPEIWEB/ONLINELOG,
+FRA_SPEIWEB/SPEIWEB_STBY/ONLINELOG'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'speiweb'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)
(HOST=abcabanksdrp)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=speiweb_stby_DGMGRL)
(INSTANCE_NAME=speiweb)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '+FRA_SPEIWEB/speiweb_stby/archivelog'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = 'speiweb_%t_%s_%r.arc'
TopWaitEvents = '(monitor)'

Database Status:
SUCCESS

DGMGRL>
Validar en el Servidor de la Standby
***********************************

abcabanksdrp /home/oracle>. ./speiweb.env

SQL*Plus: Release 11.2.0.3.0 Production on Thu Oct 27 11:33:38 2016

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> SELECT name, open_mode, log_mode,flashback_on,force_logging FROM v$database;

NAME OPEN_MODE LOG_MODE FLASHBACK_ON FOR


--------- -------------------- ------------ ------------------ ---
SPEIWEB MOUNTED ARCHIVELOG NO YES

SQL> alter system set


dg_broker_config_file1='DG_SPEIWEB/SPEIWEB_STBY/DGB/dgb_speiweb_config01.ora'
scope=both sid='*';
SQL>
SQL> show parameter dg_broker

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/11.2.0
/dbhome_1/dbs/dr1speiweb_stby.
dat
dg_broker_config_file2 string /u01/app/oracle/product/11.2.0
/dbhome_1/dbs/dr2speiweb_stby.
dat
dg_broker_start boolean FALSE
SQL> alter system set
dg_broker_config_file1='DG_SPEIWEB/SPEIWEB_STBY/DGB/dgb_speiweb_config01.ora'
scope=both sid='*';

System altered.

SQL> alter system set


dg_broker_config_file2='+FRA_SPEIWEB/SPEIWEB_STBY/DGB/dgb_speiweb_config02.ora'
scope=both sid='*';

System altered.

SQL> alter system set dg_broker_start = true scope=both sid='*';

System altered.

SQL> show parameter dg_broker

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string DG_SPEIWEB/SPEIWEB_STBY/DGB/dg
b_speiweb_config01.ora
dg_broker_config_file2 string +FRA_SPEIWEB/SPEIWEB_STBY/DGB/
dgb_speiweb_config02.ora
dg_broker_start boolean TRUE
SQL> !date
Thu Oct 27 11:37:48 CDT 2016

SQL> alter system set


dg_broker_config_file1='+DG_SPEIWEB/SPEIWEB_STBY/DGB/dgb_speiweb_config01.ora'
scope=both sid='*';
alter system set
dg_broker_config_file1='+DG_SPEIWEB/SPEIWEB_STBY/DGB/dgb_speiweb_config01.ora'
scope=both sid='*'
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16573: attempt to change or access configuration file for an enabled broker
configuration

SQL> alter system set dg_broker_start = false scope=both sid='*';

System altered.

SQL> alter system set


dg_broker_config_file1='+DG_SPEIWEB/SPEIWEB_STBY/DGB/dgb_speiweb_config01.ora'
scope=both sid='*';

System altered.

SQL> alter system set


dg_broker_config_file2='+FRA_SPEIWEB/SPEIWEB_STBY/DGB/dgb_speiweb_config02.ora'
scope=both sid='*';

System altered.

SQL> alter system set dg_broker_start = true scope=both sid='*';

System altered.

SQL> show parameter dg_broker

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string +DG_SPEIWEB/SPEIWEB_STBY/DGB/d
gb_speiweb_config01.ora
dg_broker_config_file2 string +FRA_SPEIWEB/SPEIWEB_STBY/DGB/
dgb_speiweb_config02.ora
dg_broker_start boolean TRUE
SQL> !date
Thu Oct 27 11:40:43 CDT 2016

SQL> show parameter dg_broker

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string +DG_SPEIWEB/SPEIWEB_STBY/DGB/d
gb_speiweb_config01.ora
dg_broker_config_file2 string +FRA_SPEIWEB/SPEIWEB_STBY/DGB/
dgb_speiweb_config02.ora
dg_broker_start boolean TRUE
SQL> shu immediate;
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 1068937216 bytes


Fixed Size 2228344 bytes
Variable Size 696258440 bytes
Database Buffers 364904448 bytes
Redo Buffers 5545984 bytes
Database mounted.
SQL> show parameter dg_broker

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string +DG_SPEIWEB/speiweb_stby/dgb/d
gb_speiweb_config01.ora
dg_broker_config_file2 string +FRA_SPEIWEB/speiweb_stby/dgb/
dgb_speiweb_config02.ora
dg_broker_start boolean TRUE
SQL> SELECT host_name, instance_name, status, TO_CHAR(startup_time, 'dd-mm-yy
hh24:mi:ss') STARTUP_TIME, shutdown_pending, logins FROM v$instance;

HOST_NAME
----------------------------------------------------------------
INSTANCE_NAME STATUS STARTUP_TIME SHU LOGINS
---------------- ------------ ----------------- --- ----------
abcabanksdrp
speiweb MOUNTED 27-10-16 12:00:27 NO ALLOWED

SQL> SELECT name, open_mode, log_mode,flashback_on,force_logging FROM v$database;

NAME OPEN_MODE LOG_MODE FLASHBACK_ON FOR


--------- -------------------- ------------ ------------------ ---
SPEIWEB MOUNTED ARCHIVELOG NO YES

SQL> !
$ dgmgrl /
DGMGRL for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - 64bit Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.


Connected.
DGMGRL> show configuration

Configuration - speiweb_dgb

Protection Mode: MaxPerformance


Databases:
speiweb - Primary database
speiweb_stby - Physical standby database

Fast-Start Failover: DISABLED


Configuration Status:
SUCCESS

DGMGRL> show database verbose speiweb

Database - speiweb

Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
speiweb1
speiweb2

Properties:
DGConnectIdentifier = 'speiweb'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'MANUAL'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '4'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '+DG_SPEIWEB/SPEIWEB_STBY/DATAFILE,
+DG_SPEIWEB/SPEIWEB/DATAFILE'
LogFileNameConvert = '+DG_SPEIWEB/SPEIWEB_STBY/ONLINELOG,
+DG_SPEIWEB/SPEIWEB/ONLINELOG, +FRA_SPEIWEB/SPEIWEB_STBY/ONLINELOG,
+FRA_SPEIWEB/SPEIWEB/ONLINELOG'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName(*)
StaticConnectIdentifier(*)
StandbyArchiveLocation(*)
AlternateLocation(*)
LogArchiveTrace(*)
LogArchiveFormat(*)
TopWaitEvents(*)
(*) - Please check specific instance for the property value

Database Status:
SUCCESS

DGMGRL> show database verbose speiweb_stby

Database - speiweb_stby
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: OFF
Instance(s):
speiweb

Properties:
DGConnectIdentifier = 'speiweb_stby'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'MANUAL'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '10'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '+DG_SPEIWEB/SPEIWEB_STBY/DATAFILE,
+DG_SPEIWEB/SPEIWEB/DATAFILE'
LogFileNameConvert = '+DG_SPEIWEB/SPEIWEB/ONLINELOG,
+DG_SPEIWEB/SPEIWEB_STBY/ONLINELOG, +FRA_SPEIWEB/SPEIWEB/ONLINELOG,
+FRA_SPEIWEB/SPEIWEB_STBY/ONLINELOG'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'speiweb'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)
(HOST=abcabanksdrp)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=speiweb_stby_DGMGRL)
(INSTANCE_NAME=speiweb)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '+FRA_SPEIWEB/speiweb_stby/archivelog'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = 'speiweb_%t_%s_%r.arc'
TopWaitEvents = '(monitor)'

Database Status:
SUCCESS

DGMGRL>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Referencias %%%%%%%%%%%%%%%%%%%%%%%

0.Sacar un Respaldo a Disco RMAN


********************************

run {
allocate CHANNEL ch1 DEVICE TYPE DISK FORMAT '/backupabanks/CRECARDP_DATAGUARD/%d_
%s_%T';
set controlfile autobackup format for device type disk to
'/backupabanks/CRECARDP_DATAGUARD/%F';
backup database;
SQL 'alter system archive log current';
backup archivelog all;
release channel ch1;
}
EXIT;

1.Borrar la Base de Datos CRECARDP


**********************************

connect sys/oracle as sysdba;


startup mount exclusive;
alter system enable restricted session;
drop database;

2.Levantar la Instancia en NOMOUNT


**********************************

. ./CRECARDP.env

SQL> startup nomount;


ORACLE instance started.

Total System Global Area 2137886720 bytes


Fixed Size 2223208 bytes
Variable Size 520094616 bytes
Database Buffers 1610612736 bytes
Redo Buffers 4956160 bytes

3.Restaurar Control File


************************

restore standby controlfile from '/ora_depaso/CRECARDP_RMAN/c-1275226990-20150616-


01';

RMAN> restore standby controlfile from '/ora_depaso/CRECARDP_RMAN/c-1275226990-


20150616-01';

Starting restore at 17-JUN-15


using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=639 device type=DISK

channel ORA_DISK_1: restoring control file


channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=+DG_CREC/crecardp_stby/controlfile/current.269.882613859
output file name=+FRA_CREC/crecardp_stby/controlfile/current.258.882613859
Finished restore at 17-JUN-15
RMAN>

4. Montar la Base de Datos


**************************

alter database mount;

5.Restaurar la Base de Datos:


*****************************

run {
catalog start with '/ora_depaso/CRECARDP_RMAN' noprompt;
allocate CHANNEL ch1 DEVICE TYPE DISK;
allocate CHANNEL ch2 DEVICE TYPE DISK;
allocate CHANNEL ch3 DEVICE TYPE DISK;
allocate CHANNEL ch4 DEVICE TYPE DISK;
allocate CHANNEL ch5 DEVICE TYPE DISK;
allocate CHANNEL ch6 DEVICE TYPE DISK;
allocate CHANNEL ch7 DEVICE TYPE DISK;
allocate CHANNEL ch8 DEVICE TYPE DISK;
restore database;
switch datafile all;
recover database;
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
release channel ch5;
release channel ch6;
release channel ch7;
release channel ch8;
}
EXIT

*Resumen:

Finished restore at 17-JUN-15

Starting recover at 17-JUN-15

starting media recovery

channel ch2: restore complete, elapsed time: 00:00:03


archived log file
name=+FRA_CREC/crecardp_stby/archivelog/2015_06_17/thread_1_seq_4083.516.882614281
thread=1 sequence=4083
archived log file
name=+FRA_CREC/crecardp_stby/archivelog/2015_06_17/thread_2_seq_3668.517.882614281
thread=2 sequence=3668
archived log file
name=+FRA_CREC/crecardp_stby/archivelog/2015_06_17/thread_1_seq_4084.518.882614281
thread=1 sequence=4084
archived log file
name=+FRA_CREC/crecardp_stby/archivelog/2015_06_17/thread_2_seq_3669.519.882614281
thread=2 sequence=3669
unable to find archived log
archived log thread=2 sequence=3670
released channel: ch1
released channel: ch2
released channel: ch3
released channel: ch4
released channel: ch5
released channel: ch6
released channel: ch7
released channel: ch8
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 06/17/2015 10:38:05
RMAN-06054: media recovery requesting unknown archived log for thread 2 with
sequence 3670 and starting SCN of 10161545552838

RMAN>

SQL> SELECT name, open_mode, log_mode FROM v$database;

NAME OPEN_MODE LOG_MODE


--------- -------------------- ------------
CRECARDP MOUNTED ARCHIVELOG

SQL>

5� Activar la Replicaci�n en la Standby


****************************************

*1
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

*2
---Validar archiveds aplicados
set linesize 300
col completion_time for a20
col standby_dest for a20
SELECT arch.THREAD# "Thread", arch.SEQUENCE# "Last Sequence Received",
appl.SEQUENCE# "Last Sequence Applied",
(arch.SEQUENCE# - appl.SEQUENCE#) "Difference"
FROM (SELECT THREAD#, SEQUENCE# FROM v$archived_log
WHERE (THREAD#, first_time) IN (SELECT THREAD#, MAX (first_time)
FROM v$archived_log GROUP BY THREAD#)) arch,
(SELECT THREAD#, SEQUENCE#
FROM v$log_history
WHERE (THREAD#, first_time) IN (SELECT THREAD#, MAX (first_time)
FROM v$log_history
GROUP BY THREAD#)) appl
WHERE arch.THREAD# = appl.THREAD#;

Thread Last Sequence Received Last Sequence Applied Difference


------- ---------------------- --------------------- ----------
1 4097 121 3976
2 3683 12 3671
*3
set linesize 300 pagesize 30
col completion_time for a20
col standby_dest for a20
SELECT THREAD#,
SEQUENCE#,
APPLIED,
to_char(FIRST_TIME,'dd-mm-yy hh24:mi:ss'),
to_char(NEXT_TIME,'dd-mm-yy hh24:mi:ss'),
COMPLETION_TIME,
STANDBY_DEST
FROM V$ARCHIVED_LOG
ORDER BY THREAD#,SEQUENCE#;

THREAD# SEQUENCE# APPLIED TO_CHAR(FIRST_TIM TO_CHAR(NEXT_TIME COMPLETION_TIME


STANDBY_DEST
---------- ---------- --------- ----------------- -----------------
-------------------- --------------------
1 4083 YES 16-06-15 21:24:11 16-06-15 21:32:08 17-JUN-15
NO
1 4083 YES 16-06-15 21:24:11 16-06-15 21:32:08 17-JUN-15
NO
1 4084 YES 16-06-15 21:32:08 16-06-15 21:32:16 17-JUN-15
NO
1 4085 YES 16-06-15 21:32:16 16-06-15 21:32:49 17-JUN-15
NO
1 4086 YES 16-06-15 21:32:49 17-06-15 08:05:15 17-JUN-15
NO
1 4087 YES 17-06-15 08:05:15 17-06-15 10:23:15 17-JUN-15
NO
1 4088 YES 17-06-15 10:23:15 17-06-15 10:23:47 17-JUN-15
NO
1 4089 YES 17-06-15 10:23:47 17-06-15 10:24:03 17-JUN-15
NO
1 4090 YES 17-06-15 10:24:03 17-06-15 10:32:03 17-JUN-15
NO
1 4091 YES 17-06-15 10:32:03 17-06-15 11:11:21 17-JUN-15
NO
1 4092 YES 17-06-15 11:11:21 17-06-15 12:55:16 17-JUN-15
NO
1 4093 YES 17-06-15 12:55:16 17-06-15 12:55:19 17-JUN-15
NO
1 4094 YES 17-06-15 12:55:19 17-06-15 12:56:08 17-JUN-15
NO
1 4095 YES 17-06-15 12:56:08 17-06-15 12:59:17 17-JUN-15
NO
1 4096 YES 17-06-15 12:59:17 17-06-15 13:03:05 17-JUN-15
NO
1 4097 YES 17-06-15 13:03:05 17-06-15 13:18:26 17-JUN-15
NO
1 4098 YES 17-06-15 13:18:26 17-06-15 13:26:59 17-JUN-15
NO
1 4099 YES 17-06-15 13:26:59 17-06-15 13:30:07 17-JUN-15
NO
1 4100 YES 17-06-15 13:30:07 17-06-15 13:30:10 17-JUN-15
NO
2 3668 YES 16-06-15 20:38:22 16-06-15 21:32:11 17-JUN-15
NO
2 3669 YES 16-06-15 21:32:11 16-06-15 21:32:14 17-JUN-15
NO
2 3670 YES 16-06-15 21:32:14 16-06-15 21:32:47 17-JUN-15
NO
2 3671 YES 16-06-15 21:32:47 17-06-15 10:00:22 17-JUN-15
NO
2 3672 YES 17-06-15 10:00:22 17-06-15 10:23:13 17-JUN-15
NO
2 3673 YES 17-06-15 10:23:13 17-06-15 10:23:49 17-JUN-15
NO
2 3674 YES 17-06-15 10:23:49 17-06-15 10:23:58 17-JUN-15
NO
2 3675 YES 17-06-15 10:23:58 17-06-15 10:32:01 17-JUN-15
NO

THREAD# SEQUENCE# APPLIED TO_CHAR(FIRST_TIM TO_CHAR(NEXT_TIME COMPLETION_TIME


STANDBY_DEST
---------- ---------- --------- ----------------- -----------------
-------------------- --------------------
2 3676 YES 17-06-15 10:32:01 17-06-15 11:11:20 17-JUN-15
NO
2 3677 YES 17-06-15 11:11:20 17-06-15 12:50:47 17-JUN-15
NO
2 3678 YES 17-06-15 12:50:47 17-06-15 12:51:17 17-JUN-15
NO
2 3679 YES 17-06-15 12:56:03 17-06-15 12:56:03 17-JUN-15
NO
2 3680 YES 17-06-15 12:56:03 17-06-15 12:56:04 17-JUN-15
NO
2 3681 YES 17-06-15 12:56:04 17-06-15 12:59:16 17-JUN-15
NO
2 3682 YES 17-06-15 12:59:16 17-06-15 13:03:04 17-JUN-15
NO
2 3683 YES 17-06-15 13:03:04 17-06-15 13:18:28 17-JUN-15
NO
2 3684 YES 17-06-15 13:18:28 17-06-15 13:26:53 17-JUN-15
NO
2 3685 YES 17-06-15 13:26:53 17-06-15 13:26:56 17-JUN-15
NO
2 3686 YES 17-06-15 13:26:56 17-06-15 13:26:56 17-JUN-15
NO
2 3687 YES 17-06-15 13:26:56 17-06-15 13:26:57 17-JUN-15
NO
2 3688 NO 17-06-15 13:26:57 17-06-15 13:30:13 17-JUN-15
NO

40 rows selected.

---Validar los archivelogs aplicados en el Thread 1 y 2 de la Base de Datos


set linesize 300 pagesize 30
col completion_time for a20
col standby_dest for a20
SELECT THREAD#,SEQUENCE#, APPLIED,
to_char(FIRST_TIME,'dd-mm-yy hh24:mi:ss'),
to_char(NEXT_TIME,'dd-mm-yy hh24:mi:ss'),
COMPLETION_TIME,
STANDBY_DEST
FROM V$ARCHIVED_LOG
WHERE FIRST_TIME LIKE '16-JUN-15'
AND THREAD# = 2
AND APPLIED='YES'
ORDER BY SEQUENCE#;

6� Validar Online Redos en Standby en la Base de Datos


Primaria

***************************************************************

--Identificar el Tama�o de los Redos

set linesize 200


col (bytes) for a5
col status for a20
SELECT group#, sequence#, members,SUM(bytes)/1024/1024 MB, status FROM v$log
GROUP BY group#, sequence#, members, status
ORDER BY group#;

GROUP# SEQUENCE# MEMBERS MB STATUS


---------- ---------- ---------- ---------- --------------------
1 482 2 300 INACTIVE
2 483 2 300 INACTIVE
3 400 2 300 INACTIVE
4 401 2 300 INACTIVE
5 484 2 300 CURRENT
6 402 2 300 INACTIVE

6 rows selected.

set linesize 200


set pagesize 200
col group# for 999
col member for a80
SELECT a.group#, b.member, a.status, SUM(a.bytes)/1024/1024 MB
FROM v$log a, v$logfile b
WHERE a.group#=b.group#
GROUP BY a.group#, b.member, a.status
ORDER BY a.group#;

GROUP# MEMBER
STATUS MB
------
--------------------------------------------------------------------------------
-------------------- ----------
1 +DG_CREC/crecardp/onlinelog/redo1_01.log
INACTIVE 50
1 +FRA_CREC/crecardp/onlinelog/redo1_02.log
INACTIVE 50
2 +DG_CREC/crecardp/onlinelog/redo2_01.log
INACTIVE 50
2 +FRA_CREC/crecardp/onlinelog/redo2_02.log
INACTIVE 50
3 +DG_CREC/crecardp/onlinelog/redo3_01.log
CURRENT 50
3 +FRA_CREC/crecardp/onlinelog/redo3_02.log
CURRENT 50
4 +DG_CREC/crecardp/onlinelog/group_4.274.829877401
CURRENT 50
4 +DG_CREC/crecardp/onlinelog/group_4.275.829877401
CURRENT 50
5 +DG_CREC/crecardp/onlinelog/group_5.276.829877403
INACTIVE 50
5 +DG_CREC/crecardp/onlinelog/group_5.277.829877403
INACTIVE 50
6 +DG_CREC/crecardp/onlinelog/group_6.278.829877403
INACTIVE 50
6 +DG_CREC/crecardp/onlinelog/group_6.279.829877403
INACTIVE 50

12 rows selected.

SQL>

-Tienen el mismo tama�o


-Son 6 Grupos con 2 miembros de 300 MB

SELECT THREAD#,GROUP#,MEMBERS,BYTES/1024/1024 "MB" FROM V$LOG ORDER BY 2;

THREAD# GROUP# MEMBERS MB


---------- ------ ---------- ----------
1 1 2 50
1 2 2 50
1 3 2 50
2 4 2 50
2 5 2 50
2 6 2 50

7� Validar el Status del Data Guard


***********************************

PRIMARY
*******

select status,instance_name,database_role,protection_mode from


v$database,v$instance;
select max(sequence#) from v$archived_log;

STATUS INSTANCE_NAME DATABASE_ROLE PROTECTION_MODE


------------ ---------------- ---------------- --------------------
OPEN nodo1 PRIMARY MAXIMUM PERFORMANCE

MAX(SEQUENCE#)
--------------
29550

STANDBY
*******

STATUS INSTANCE_NAME DATABASE_ROLE PROTECTION_MODE


------------ ---------------- ---------------- --------------------
MOUNTED nodo PHYSICAL STANDBY MAXIMUM PERFORMANCE

MAX(SEQUENCE#)
--------------
29550

8� Configurar el Data Broker desde la Primary


*********************************************

DGMGRL> remove configuration;


Removed configuration
DGMGRL> connect sys/syscrecardp@CRECARDP;
Connected.
DGMGRL> create configuration CRECARDP_DGB as primary database is CRECARDP connect
identifier is CRECARDP;
Configuration "crecardp_dgb" created with primary database "crecardp"
DGMGRL> add database CRECARDP_STBY as connect identifier is CRECARDP_STBY;
Database "crecardp_stby" added
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;

Configuration - crecardp_dgb

Protection Mode: MaxPerformance


Databases:
crecardp - Primary database
crecardp_stby - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL>

--Ver configuraci�n de la BD PRIMARY


show database verbose CRECARDP

--Ver configuraci�n de la BD STANDBY


show database verbose CRECARDP_STBY

Prueba de Switchover
********************

DGMGRL> swichtover to rac11g1_stby;


Unrecognized command "swichtover", try "help"
DGMGRL> switchover to rac11g1_stby;
Performing switchover NOW, please wait...
New primary database "rac11g1_stby" is opening...
Operation requires shutdown of instance "RAC11G11" on database "rac11g1"
Shutting down instance "RAC11G11"...
ORACLE instance shut down.
Operation requires startup of instance "RAC11G11" on database "rac11g1"
Starting instance "RAC11G11"...
Unable to connect to database
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

Failed.
Warning: You are no longer connected to ORACLE.

Please complete the following steps to finish switchover:


start up and mount instance "RAC11G11" of database "rac11g1"

* De regreso a la Primary*
**************************

switchover to rac11g1;

DGMGRL> switchover to rac11g1;


Performing switchover NOW, please wait...
New primary database "rac11g1" is opening...
Operation requires shutdown of instance "RAC11G1" on database "rac11g1_stby"
Shutting down instance "RAC11G1"...
ORA-01031: insufficient privileges

Warning: You are no longer connected to ORACLE.

Please complete the following steps to finish switchover:


shut down instance "RAC11G1" of database "rac11g1_stby"
start up and mount instance "RAC11G1" of database "rac11g1_stby"

DGMGRL>

http://deepakguptadba.blogspot.mx/2010/04/managing-archive-gaps-manually-on.html

Managing Archive Gaps Manually on Standby Database Setup

To determine if there is an archive gap on your physical standby database

SQL> SELECT * FROM V$ARCHIVE_GAP;

THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#


---------- ------------- --------------
1 6999 7037

In this case, Standby database is waiting for archive log 6999

SQL> select process,sequence#,status from v$managed_standby;

PROCESS SEQUENCE# STATUS


--------- ---------- ------------
ARCH 0 CONNECTED
RFS 7029 RECEIVING
RFS 7028 RECEIVING
ARCH 0 CONNECTED
ARCH 7140 CLOSING
ARCH 0 CONNECTED
RFS 7030 RECEIVING
RFS 7141 IDLE
MRP0 6999 WAIT_FOR_GAP

9 rows selected.

But if you check, archives have been either shipped already or even if you copy
these on to Standby server (MRP is still waiting for 12499)

[oracle@xxxdb2 ~]$ cd /oracle/backups/xxx2/stby_archive


[oracle@xxxdb2 stby_archive]$ ll -l 1_12499*
-rw-r----- 1 oracle oinstall 85923328 Apr 23 19:01 1_12499_704597469.arc
[oracle@xxxdb2 stby_archive]$ ll -l 1_1250* head -5
-rw-r----- 1 oracle oinstall 85897728 Apr 23 19:38 1_12500_704597469.arc
-rw-r----- 1 oracle oinstall 83760640 Apr 23 19:39 1_12501_704597469.arc
-rw-r----- 1 oracle oinstall 1121792 Apr 23 19:39 1_12502_704597469.arc
-rw-r----- 1 oracle oinstall 21140480 Apr 23 19:39 1_12503_704597469.arc
-rw-r----- 1 oracle oinstall 246272 Apr 23 19:31 1_12504_704597469.arc
[oracle@xxxdb2 stby_archive]$

Below SQL is also confirmed for same:

SQL> column dest format a20


SQL> select substr(DEST_NAME,1,20) dest
,archived_thread#,archived_seq#,applied_thread#,applied_seq# from
v$archive_dest_status;

DEST ARCHIVED_THREAD# ARCHIVED_SEQ# APPLIED_THREAD# APPLIED_SEQ#


-------------------- ---------------- ------------- --------------- ------------
LOG_ARCHIVE_DEST_1 1 7140 0 0
LOG_ARCHIVE_DEST_2 0 0 0 0
LOG_ARCHIVE_DEST_3 0 0 0 0
LOG_ARCHIVE_DEST_4 0 0 0 0
LOG_ARCHIVE_DEST_5 0 0 0 0
LOG_ARCHIVE_DEST_6 0 0 0 0
LOG_ARCHIVE_DEST_7 0 0 0 0
LOG_ARCHIVE_DEST_8 0 0 0 0
LOG_ARCHIVE_DEST_9 0 0 0 0
LOG_ARCHIVE_DEST_10 0 0 0 0
LOG_ARCHIVE_DEST_11 0 0 0 0

DEST ARCHIVED_THREAD# ARCHIVED_SEQ# APPLIED_THREAD# APPLIED_SEQ#


-------------------- ---------------- ------------- --------------- ------------
LOG_ARCHIVE_DEST_12 0 0 0 0
LOG_ARCHIVE_DEST_13 0 0 0 0
LOG_ARCHIVE_DEST_14 0 0 0 0
LOG_ARCHIVE_DEST_15 0 0 0 0
LOG_ARCHIVE_DEST_16 0 0 0 0
LOG_ARCHIVE_DEST_17 0 0 0 0
LOG_ARCHIVE_DEST_18 0 0 0 0
LOG_ARCHIVE_DEST_19 0 0 0 0
LOG_ARCHIVE_DEST_20 0 0 0 0
LOG_ARCHIVE_DEST_21 0 0 0 0
LOG_ARCHIVE_DEST_22 0 0 0 0

DEST ARCHIVED_THREAD# ARCHIVED_SEQ# APPLIED_THREAD# APPLIED_SEQ#


-------------------- ---------------- ------------- --------------- ------------
LOG_ARCHIVE_DEST_23 0 0 0 0
LOG_ARCHIVE_DEST_24 0 0 0 0
LOG_ARCHIVE_DEST_25 0 0 0 0
LOG_ARCHIVE_DEST_26 0 0 0 0
LOG_ARCHIVE_DEST_27 0 0 0 0
LOG_ARCHIVE_DEST_28 0 0 0 0
LOG_ARCHIVE_DEST_29 0 0 0 0
LOG_ARCHIVE_DEST_30 0 0 0 0
LOG_ARCHIVE_DEST_31 0 0 0 0
STANDBY_ARCHIVE_DEST 1 7082 1 6998

32 rows selected.

You may find similar entry or error in standby database's alert log file:

Tue Feb 21 23:37:48 2017


Managed Standby Recovery starting Real Time Apply
Parallel Media Recovery started with 16 slaves
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Media Recovery Waiting for thread 1 sequence 6999
Fetching gap sequence in thread 1, gap sequence 6999-7037

Some time, due to the cancelation of Recovery Process at standby causes a partial
apply of archive log. To fix this problem

To find out archive log at Primary database Server:

set linesize 200


col name for a80
SELECT NAME FROM V$ARCHIVED_LOG WHERE THREAD#=1 AND DEST_ID=1 AND SEQUENCE# between
6999 and 7037;

NAME
--------------------------------------------------------------------------------
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_6999_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7000_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7001_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7002_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7003_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7004_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7005_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7006_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7007_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7008_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7009_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7010_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7011_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7012_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7013_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7014_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7015_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7016_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7017_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7018_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7019_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7020_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7021_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7022_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7023_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7024_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7025_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7026_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7027_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7028_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7029_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7030_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7031_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7032_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7033_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7034_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7035_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7036_838951420.arc
+FRA_ABCCAPITAL/abccapit/archivelog/abccapit_1_7037_838951420.arc

39 rows selected.

Copy the missing archives to Standby Server (optional).

Register them using the ALTER DATABASE REGISTER LOGFILE sQL on your physical
standby database (to re-appy them):

SQL> ALTER DATABASE REGISTER LOGFILE


'/oracle/backups/xxx2/stby_archive/1_12499_704597469.arc';
Database altered.

SQL> ALTER DATABASE REGISTER LOGFILE


'/oracle/backups/xxx2/stby_archive/1_12500_704597469.arc';
Database altered.

SQL> ALTER DATABASE REGISTER LOGFILE


'/oracle/backups/xxx2/stby_archive/1_12501_704597469.arc';
Database altered.

SQL> ALTER DATABASE REGISTER LOGFILE


'/oracle/backups/xxx2/stby_archive/1_12502_704597469.arc';
Database altered.

SQL> ALTER DATABASE REGISTER LOGFILE


'/oracle/backups/xxx2/stby_archive/1_12503_704597469.arc';
Database altered.

MRP automatically start and apply the archive one by one.


SQL> select sequence#,client_process,process,status from v$managed_standby;

SEQUENCE# CLIENT_P PROCESS STATUS


---------- -------- --------- ------------
0 ARCH ARCH CONNECTED
7029 UNKNOWN RFS RECEIVING
6999 UNKNOWN RFS RECEIVING
0 ARCH ARCH CONNECTED
7140 ARCH ARCH CLOSING
0 ARCH ARCH CONNECTED
7030 UNKNOWN RFS RECEIVING
7141 LGWR RFS IDLE
6999 N/A MRP0 WAIT_FOR_GAP

9 rows selected.

Wed Feb 22 00:26:19 2017


Archived Log entry 777 added for thread 1 sequence 7028 rlc 838951420 ID 0x4d2d764
dest 2:
Wed Feb 22 00:26:19 2017
Fetching gap sequence in thread 1, gap sequence 6999-7027
Wed Feb 22 00:26:22 2017
RFS[6]: Assigned to RFS process 16581178
RFS[6]: Opened log for thread 1 sequence 6999 dbid -8537991 branch 838951420
Wed Feb 22 00:29:52 2017
Archived Log entry 778 added for thread 1 sequence 7030 rlc 838951420 ID 0x4d2d764
dest 2:

Borramos/Subio/Bajo la BD

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO


'/ora_depaso/RMAN/NODO_STBY/CTRL_AUTO_%F';

# Alert ASM Instance


00 * * * * /home/grid/dba/shells/monitoreo/mon_alert_asm.sh -d +ASM2

You might also like