楼主: hadba

[参考文档] RMAN Recipes for Oracle Database 12c A Problem-Solution Approach 2nd Edition

[复制链接]
招聘 : 数据库管理员
论坛徽章:
0
11#
 楼主| 发表于 2017-9-4 14:55 | 只看该作者
本帖最后由 hadba 于 2017-9-6 08:35 编辑

up, up, up

使用道具 举报

回复
论坛徽章:
0
12#
发表于 2017-11-21 21:33 来自手机 | 只看该作者
Good,good.....

使用道具 举报

回复
论坛徽章:
3
2010新春纪念徽章
日期:2010-03-01 11:20:522011新春纪念徽章
日期:2011-01-04 10:37:102011新春纪念徽章
日期:2011-02-18 11:43:36
13#
发表于 2017-11-29 14:38 | 只看该作者
文档呢?

使用道具 举报

回复
论坛徽章:
2
娜美
日期:2017-08-09 02:16:30蒙奇·D·路飞
日期:2017-08-09 02:24:40
14#
发表于 2018-1-11 09:29 | 只看该作者

文档呢?

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
0
15#
 楼主| 发表于 2018-1-18 10:48 | 只看该作者
本帖最后由 hadba 于 2018-11-10 22:08 编辑

up up up

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
0
16#
 楼主| 发表于 2018-1-18 11:14 | 只看该作者
本帖最后由 hadba 于 2018-11-30 23:51 编辑

good good

[SHPBLSP] Recovering RAC Standby using an RMAN Incremental Backup 2018_11_30
SQL> SELECT CURRENT_SCN FROM V$DATABASE;
CURRENT_SCN
-----------
    4419414

***********************************************************************************
Step 5: Run RMAN Incremental Backup on Primary
***********************************************************************************
On the primary cluster, while connected to a recovery catalog, take an incremental backup using the
SCN from step Step 4:
$ mkdir -p /u01/app/oracle/backup/SHPBLSP/4standby
$ cd /u01/app/oracle/backup/SHPBLSP/4standby
$ vi rman_inc_com_backup_4standby.ksh
#!/bin/ksh
$ORACLE_HOME/bin/rman << EOF
connect target
sql 'alter system switch logfile';
sql 'alter system switch logfile';
run{
change archivelog all crosscheck;
allocate channel d1 type disk;
allocate channel d2 type disk;
BACKUP INCREMENTAL FROM SCN 4419414 as compressed backupset DATABASE FORMAT
'/u01/app/oracle/backup/SHPBLSP/4standby/4standby_%d_inc_%U.rmn' TAG 'FOR STANDBY';
copy current controlfile for standby to '/u01/app/oracle/backup/SHPBLSP/4standby/4standby_%d_inc_ctl.ctl';
}
exit
EOF

$ chmod 777 rman_inc_com_backup_4standby.ksh
$ nohup /u01/app/oracle/backup/SHPBLSP/4standby/rman_inc_com_backup_4standby.ksh > rman_inc_com_backup.log &

SQL> set linesize 150
column sid format 999999
column serial# format 9,999,999
column sofar format 9,999,999,999
column totalwork format 99,999,999,999
column opname format a35
select sid, serial#, sofar, totalwork,opname,
round(sofar/totalwork*100,2) "% Complete"
from v$session_longops
where opname LIKE 'RMAN%aggregate%'
and totalwork != 0
and sofar <> totalwork
order by sid;
    SID    SERIAL#          SOFAR       TOTALWORK OPNAME                              % Complete
------- ---------- -------------- --------------- ----------------------------------- ----------
     91      2,960              0      12,676,619 RMAN: aggregate input                        0
    SID    SERIAL#          SOFAR       TOTALWORK OPNAME                              % Complete
------- ---------- -------------- --------------- ----------------------------------- ----------
     91      2,960      5,596,160      12,676,619 RMAN: aggregate input                    44.15


SQL> set linesize 150
column sid format 999999
column serial# format 9,999,999,999
column sofar format 9,999,999,999
column totalwork format 99,999,999,999
column opname format a35
select sid, serial#, sofar, totalwork, opname,
round(sofar/totalwork*100,2) "% Complete"
from v$session_longops
where opname LIKE 'RMAN%'
and opname NOT LIKE '%aggregate%'
and totalwork != 0
and sofar <> totalwork
order by sid;
    SID        SERIAL#          SOFAR       TOTALWORK OPNAME                              % Complete
------- -------------- -------------- --------------- ----------------------------------- ----------
     46         39,752      1,886,962       5,596,160 RMAN: incremental datafile backup        33.72
    106         13,955        792,052       7,077,888 RMAN: incremental datafile backup        11.19
    SID        SERIAL#          SOFAR       TOTALWORK OPNAME                              % Complete
------- -------------- -------------- --------------- ----------------------------------- ----------
    106         13,955      2,573,811       7,077,888 RMAN: incremental datafile backup        36.36


SQL> set linesize 150
column sid format 999999
column serial# format 999999
column spid format 9999999999
column client_info format a25
SELECT b.sid, b.serial#, a.spid, b.client_info
FROM v$process a, v$session b
WHERE a.addr = b.paddr
AND b.client_info LIKE '%rman%'
order by sid;
    SID SERIAL# SPID                     CLIENT_INFO
------- ------- ------------------------ -------------------------
     46   39752 8480                     rman channel=d2
    106   13955 8475                     rman channel=d1


[SHPBLSP1]oracle@shainorap1a.cn.db.com $ cat rman_inc_com_backup.log
Recovery Manager: Release 12.1.0.2.0 - Production on Fri Nov 30 17:39:10 2018
Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
RMAN>
connected to target database: SHPBLSP (DBID=86255385)
RMAN>
using target database control file instead of recovery catalog
sql statement: alter system switch logfile
RMAN>
sql statement: alter system switch logfile
RMAN> 2> 3> 4> 5> 6> 7> 8>
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=106 instance=SHPBLSP1 device type=DISK
validation succeeded for archived log
archived log file name=+RECO01/SHPBLSP/ARCHIVELOG/2018_11_30/thread_1_seq_1433.8626.993576663 RECID=5356 STAMP=993576662
validation succeeded for archived log
archived log file name=+RECO01/SHPBLSP/ARCHIVELOG/2018_11_30/thread_1_seq_1434.4169.993577153 RECID=5361 STAMP=993577153
validation succeeded for archived log
archived log file name=+RECO01/SHPBLSP/ARCHIVELOG/2018_11_30/thread_1_seq_1435.12847.993577153 RECID=5362 STAMP=993577153
validation succeeded for archived log
archived log file name=+RECO01/SHPBLSP/ARCHIVELOG/2018_11_30/thread_2_seq_1340.862.993576663 RECID=5357 STAMP=993576663
Crosschecked 4 objects

released channel: ORA_DISK_1
allocated channel: d1
channel d1: SID=106 instance=SHPBLSP1 device type=DISK
allocated channel: d2
channel d2: SID=46 instance=SHPBLSP1 device type=DISK
Starting backup at 30-NOV-18
channel d1: starting compressed full datafile backup set
channel d1: specifying datafile(s) in backup set
input datafile file number=00008 name=+REG_DATA01/SHPBLSP/DATAFILE/pbls_tab01.445.993308893
input datafile file number=00003 name=+REG_DATA01/SHPBLSP/DATAFILE/undo.430.992454147
input datafile file number=00001 name=+REG_DATA01/SHPBLSP/DATAFILE/system.432.992454207
input datafile file number=00006 name=+REG_DATA01/SHPBLSP/DATAFILE/audits.433.992454243
input datafile file number=00010 name=+REG_DATA01/SHPBLSP/DATAFILE/pbls_idx01.447.993308975
channel d1: starting piece 1 at 30-NOV-18
channel d2: starting compressed full datafile backup set
channel d2: specifying datafile(s) in backup set
input datafile file number=00009 name=+REG_DATA01/SHPBLSP/DATAFILE/pbls_tab01.446.993308945
input datafile file number=00007 name=+REG_DATA01/SHPBLSP/DATAFILE/undotbs2.437.992454317
input datafile file number=00002 name=+REG_DATA01/SHPBLSP/DATAFILE/sysaux.431.992454181
input datafile file number=00005 name=+REG_DATA01/SHPBLSP/DATAFILE/users.434.992454243
input datafile file number=00004 name=+REG_DATA01/SHPBLSP/DATAFILE/tools.435.992454245
channel d2: starting piece 1 at 30-NOV-18
channel d2: finished piece 1 at 30-NOV-18
piece handle=/u01/app/oracle/backup/SHPBLSP/4standby/4standby_SHPBLSP_inc_1itjhi64_1_1.rmn tag=FOR STANDBY comment=NONE
channel d2: backup set complete, elapsed time: 00:01:25
channel d2: starting compressed full datafile backup set
channel d2: specifying datafile(s) in backup set
including current control file in backup set
channel d2: starting piece 1 at 30-NOV-18
channel d2: finished piece 1 at 30-NOV-18
piece handle=/u01/app/oracle/backup/SHPBLSP/4standby/4standby_SHPBLSP_inc_1jtjhi8p_1_1.rmn tag=FOR STANDBY comment=NONE
channel d2: backup set complete, elapsed time: 00:00:01
channel d1: finished piece 1 at 30-NOV-18
piece handle=/u01/app/oracle/backup/SHPBLSP/4standby/4standby_SHPBLSP_inc_1htjhi64_1_1.rmn tag=FOR STANDBY comment=NONE
channel d1: backup set complete, elapsed time: 00:02:31
Finished backup at 30-NOV-18
Starting backup at 30-NOV-18
channel d1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/backup/SHPBLSP/4standby/4standby_SHPBLSP_inc_ctl.ctl tag=TAG20181130T174148 RECID=8 STAMP=993577309
channel d1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 30-NOV-18
released channel: d1
released channel: d2
RMAN>
Recovery Manager complete.




Step 6: Copy Backup files and Control file to Standby - DR host
[On DR Host] $ mkdir -p /u01/app/oracle/backup/SHPBLSP_SB/4standby
[On PRD Host] $ cd /u01/app/oracle/backup/SHPBLSP/4standby/ && ls -lrt
$ scp 4standby_SHPBLSP_inc* \
[url=mailtoracle@shainorab1a.cn.db.com:/u01/app/oracle/backup/SHPBLSP_SB/4standby/]oracle@shainorab1a.cn.db.com:/u01/app/oracle/backup/SHPBLSP_SB/4standby/[/url]

Access to this computer is prohibited unless authorised
Accessing programs or data unrelated to your job is prohibited
4standby_SHPBLSP_inc_1htjhi64_1_1.rmn                                                                                              100%  905MB
4standby_SHPBLSP_inc_1itjhi64_1_1.rmn                                                                                              100%  562MB
4standby_SHPBLSP_inc_1jtjhi8p_1_1.rmn                                                                                              100% 1472KB
4standby_SHPBLSP_inc_ctl.ctl                                                                                                       100%   37MB


[SHPBLSP1]oracle@shainorab1a.cn.db.com $ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Fri Nov 30 17:47:12 2018
Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
connected to target database: SHPBLSP (not mounted)
RMAN> restore controlfile from '/u01/app/oracle/backup/SHPBLSP_SB/4standby/4standby_SHPBLSP_inc_ctl.ctl';
Starting restore at 30-NOV-18
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=7 instance=SHPBLSP1 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=+REDOLOG01/SHPBLSP_SB/CONTROLFILE/current.309.993573923
output file name=+REDOLOG02/SHPBLSP_SB/CONTROLFILE/current.309.993573923
Finished restore at 30-NOV-18

$ sqlplus / as sysdba;
SQL> alter system set control_files='+REDOLOG01/SHPBLSP_SB/CONTROLFILE/current.309.993573923',
'+REDOLOG02/SHPBLSP_SB/CONTROLFILE/current.309.993573923' scope=spfile sid='*';
SQL> shutdown immediate;


RMAN> CATALOG START WITH '+REG_DATA01/SHPBLSP_SB/DATAFILE/';
searching for all files that match the pattern +REG_DATA01/SHPBLSP_SB/DATAFILE/
List of Files Unknown to the Database
=====================================
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.384.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.385.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.386.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.387.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.388.992466177
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.389.992466177
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.390.992466177
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.431.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.425.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.391.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.418.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.453.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.459.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.457.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.456.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.455.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.458.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.460.993574091
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.417.993574091
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.454.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.461.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.463.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.467.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.466.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.462.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.464.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.465.993574093
Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.384.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.385.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.386.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.387.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.388.992466177
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.389.992466177
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.390.992466177
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.431.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.425.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.391.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.418.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.453.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.459.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.457.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.456.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.455.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.458.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.460.993574091
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.417.993574091
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.454.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.461.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.463.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.467.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.466.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.462.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.464.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.465.993574093

RMAN> REPORT SCHEMA;
RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name SHPBLSP_SB
List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    0        SYSTEM               ***     +REG_DATA01/SHPBLSP/DATAFILE/system.432.992454207
2    0        SYSAUX               ***     +REG_DATA01/SHPBLSP/DATAFILE/sysaux.431.992454181
3    0        UNDO                 ***     +REG_DATA01/SHPBLSP/DATAFILE/undo.430.992454147
4    0        TOOLS                ***     +REG_DATA01/SHPBLSP/DATAFILE/tools.435.992454245
5    0        USERS                ***     +REG_DATA01/SHPBLSP/DATAFILE/users.434.992454243
6    0        AUDITS               ***     +REG_DATA01/SHPBLSP/DATAFILE/audits.433.992454243
7    0        UNDOTBS2             ***     +REG_DATA01/SHPBLSP/DATAFILE/undotbs2.437.992454317
8    0        PBLS_TAB01           ***     +REG_DATA01/SHPBLSP/DATAFILE/pbls_tab01.445.993308893
9    0        PBLS_TAB01           ***     +REG_DATA01/SHPBLSP/DATAFILE/pbls_tab01.446.993308945
10   0        PBLS_IDX01           ***     +REG_DATA01/SHPBLSP/DATAFILE/pbls_idx01.447.993308975
List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    512      TEMP                 32767       +REG_DATA01/SHPBLSP/TEMPFILE/temp.436.992454305

RMAN> SWITCH DATABASE TO COPY;
datafile 1 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/system.464.993574093"
datafile 2 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.463.993574093"
datafile 3 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/undo.461.993574093"
datafile 4 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/tools.466.993574093"
datafile 5 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/users.467.993574093"
datafile 6 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/audits.465.993574093"
datafile 7 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.454.993574093"
datafile 8 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.460.993574091"
datafile 9 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.417.993574091"
datafile 10 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.462.993574093"

RMAN> REPORT SCHEMA;
RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name SHPBLSP_SB
List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    2048     SYSTEM               ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/system.464.993574093
2    2048     SYSAUX               ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.463.993574093
3    10240    UNDO                 ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.461.993574093
4    200      TOOLS                ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.466.993574093
5    512      USERS                ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/users.467.993574093
6    2048     AUDITS               ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.465.993574093
7    10240    UNDOTBS2             ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.454.993574093
8    30720    PBLS_TAB01           ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.460.993574091
9    30720    PBLS_TAB01           ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.417.993574091
10   10240    PBLS_IDX01           ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.462.993574093
List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    512      TEMP                 32767       +REG_DATA01/SHPBLSP/TEMPFILE/temp.436.992454305


RMAN> RECOVER DATABASE NOREDO;
Starting recover at 30-NOV-18
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.464.993574093
destination for restore of datafile 00003: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.461.993574093
destination for restore of datafile 00006: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.465.993574093
destination for restore of datafile 00008: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.460.993574091
destination for restore of datafile 00010: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.462.993574093
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/backup/SHPBLSP_SB/4standby/4standby_SHPBLSP_inc_1htjhi64_1_1.rmn
channel ORA_DISK_1: piece handle=/u01/app/oracle/backup/SHPBLSP_SB/4standby/4standby_SHPBLSP_inc_1htjhi64_1_1.rmn tag=FOR STANDBY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:05:05
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00002: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.463.993574093
destination for restore of datafile 00004: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.466.993574093
destination for restore of datafile 00005: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.467.993574093
destination for restore of datafile 00007: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.454.993574093
destination for restore of datafile 00009: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.417.993574091
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/backup/SHPBLSP_SB/4standby/4standby_SHPBLSP_inc_1itjhi64_1_1.rmn
channel ORA_DISK_1: piece handle=/u01/app/oracle/backup/SHPBLSP_SB/4standby/4standby_SHPBLSP_inc_1itjhi64_1_1.rmn tag=FOR STANDBY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:02:55
Finished recover at 30-NOV-18




****************************************************************************************************
Step 12: Start the redo apply on the Standby database
****************************************************************************************************

SQL> set lines 132
set pagesize 9999
col client_pid format a12
SELECT PID, PROCESS, STATUS,
CLIENT_PROCESS, CLIENT_PID,
THREAD#, SEQUENCE#, BLOCK#,
BLOCKS, DELAY_MINS
FROM GV$MANAGED_STANDBY;
PID                      PROCESS   STATUS       CLIENT_P CLIENT_PID      THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS
------------------------ --------- ------------ -------- ------------ ---------- ---------- ---------- ---------- ----------
4455                     ARCH      CONNECTED    ARCH     4455                  0          0          0          0          0
4460                     ARCH      CONNECTED    ARCH     4460                  0          0          0          0          0
4467                     ARCH      CONNECTED    ARCH     4467                  0          0          0          0          0
4471                     ARCH      CONNECTED    ARCH     4471                  0          0          0          0          0
22716                    MRP0      WAIT_FOR_LOG N/A      N/A                   1       1436          0          0          0

PID                      PROCESS   STATUS       CLIENT_P CLIENT_PID      THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS
------------------------ --------- ------------ -------- ------------ ---------- ---------- ---------- ---------- ----------
4455                     ARCH      CONNECTED    ARCH     4455                  0          0          0          0          0
4460                     ARCH      CONNECTED    ARCH     4460                  0          0          0          0          0
4467                     ARCH      CONNECTED    ARCH     4467                  0          0          0          0          0
4471                     ARCH      CONNECTED    ARCH     4471                  0          0          0          0          0
31607                    MRP0      WAIT_FOR_LOG N/A      N/A                   2       1344          0          0          0
23893                    RFS       IDLE         ARCH     36874                 0          0          0          0          0
23939                    RFS       IDLE         ARCH     8925                  0          0          0          0          0
23818                    RFS       IDLE         LGWR     36372                 1       1439        506          1          0
23899                    RFS       IDLE         UNKNOWN  8933                  0          0          0          0          0
23837                    RFS       IDLE         UNKNOWN  36882                 0          0          0          0          0
23860                    RFS       IDLE         UNKNOWN  8919                  0          0          0          0          0
23866                    RFS       IDLE         LGWR     8230                  2       1344        521          1          0
12 rows selected.

*********************************************************************************************************************************
Step 13: Enable logshipping from primary
****************************************************************************************************


PID                      PROCESS   STATUS       CLIENT_P CLIENT_PID      THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS
------------------------ --------- ------------ -------- ------------ ---------- ---------- ---------- ---------- ----------
4455                     ARCH      CONNECTED    ARCH     4455                  0          0          0          0          0
4460                     ARCH      CONNECTED    ARCH     4460                  0          0          0          0          0
4467                     ARCH      CONNECTED    ARCH     4467                  0          0          0          0          0
4471                     ARCH      CONNECTED    ARCH     4471                  0          0          0          0          0
22716                    MRP0      WAIT_FOR_LOG N/A      N/A                   2       1344          0          0          0
23893                    RFS       IDLE         ARCH     36874                 0          0          0          0          0
23939                    RFS       IDLE         ARCH     8925                  0          0          0          0          0
23818                    RFS       IDLE         LGWR     36372                 1       1439         41          1          0
23899                    RFS       IDLE         UNKNOWN  8933                  0          0          0          0          0
23837                    RFS       IDLE         UNKNOWN  36882                 0          0          0          0          0
23860                    RFS       IDLE         UNKNOWN  8919                  0          0          0          0          0
23866                    RFS       IDLE         LGWR     8230                  2       1344        100          1          0
12 rows selected.

PID                      PROCESS   STATUS       CLIENT_P CLIENT_PID      THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS
------------------------ --------- ------------ -------- ------------ ---------- ---------- ---------- ---------- ----------
4455                     ARCH      CLOSING      ARCH     4455                  1       1458       6144       1130          0
4460                     ARCH      CONNECTED    ARCH     4460                  0          0          0          0          0
4467                     ARCH      CLOSING      ARCH     4467                  2       1363       6144        194          0
4471                     ARCH      CLOSING      ARCH     4471                  1       1459          1       1479          0
31607                    MRP0      APPLYING_LOG N/A      N/A                   1       1460        501    1048576          0
23893                    RFS       IDLE         ARCH     36874                 0          0          0          0          0
23939                    RFS       IDLE         ARCH     8925                  0          0          0          0          0
23818                    RFS       IDLE         LGWR     36372                 1       1460        502          1          0
23899                    RFS       IDLE         UNKNOWN  8933                  0          0          0          0          0
23837                    RFS       IDLE         UNKNOWN  36882                 0          0          0          0          0
23860                    RFS       IDLE         UNKNOWN  8919                  0          0          0          0          0
23866                    RFS       IDLE         LGWR     8230                  2       1365        531          1          0
12 rows selected.

NAME            VALUE                UNIT                           TIME_COMPUTED
--------------- -------------------- ------------------------------ ------------------------------
transport lag   +00 00:00:00         day(2) to second(0) interval   11/30/2018 18:03:14
apply lag       +00 00:00:00         day(2) to second(0) interval   11/30/2018 18:03:14


ERROR_CODE SEVERITY      MESSAGE                                                                     TIMESTAMP
---------- ------------- --------------------------------------------------------------------------- ---------------------
         0 Control       LGWR: Completed archiving log 6 thread 1 sequence 1438                      30-NOV-18 18:03:37
         0 Control       ARC2: Beginning to archive thread 1 sequence 1438 (4550601-4550758)         30-NOV-18 18:03:37
         0 Control       LGWR: Beginning to archive log 7 thread 1 sequence 1439                     30-NOV-18 18:03:37
         0 Control       ARC2: Completed archiving thread 1 sequence 1438 (4550601-4550758)          30-NOV-18 18:03:37
         0 Control       ARC2: Completed archiving thread 1 sequence 1437 (4548672-4550601)          30-NOV-18 18:02:41
         0 Control       ARC2: Beginning to archive thread 1 sequence 1437 (4548672-4550601)         30-NOV-18 18:02:41
         0 Control       LGWR: Beginning to archive log 6 thread 1 sequence 1438                     30-NOV-18 18:02:41
         0 Control       ARC0: Completed archiving thread 1 sequence 1436 (4546207-4548672)          30-NOV-18 17:54:09
         0 Control       ARC0: Beginning to archive thread 1 sequence 1436 (4546207-4548672)         30-NOV-18 17:54:09
         0 Control       ARC3: Completed archiving thread 1 sequence 1434 (4544959-4546193)          30-NOV-18 17:39:13
         0 Control       ARC0: Beginning to archive thread 1 sequence 1435 (4546193-4546207)         30-NOV-18 17:39:13
         0 Control       ARC0: Completed archiving thread 1 sequence 1435 (4546193-4546207)          30-NOV-18 17:39:13
         0 Control       ARC3: Beginning to archive thread 1 sequence 1434 (4544959-4546193)         30-NOV-18 17:39:13
         0 Control       LGWR: Completed archiving log 7 thread 1 sequence 1434                      30-NOV-18 17:39:12


****************************************************************************************************
Step 14: Run a switch logfile from primary database
****************************************************************************************************
Run a switch logfile from primary database to ensure logfiles are shipping properly

SQL> set linesize 180
set pagesize 1000
column message format a75
SELECT ERROR_CODE, SEVERITY, MESSAGE,
TO_CHAR(TIMESTAMP, 'DD-MON-RR HH24:MI:SS') TIMESTAMP
FROM V$DATAGUARD_STATUS
WHERE CALLOUT='YES'
AND TIMESTAMP > SYSDATE-1
ORDER BY TIMESTAMP DESC;SQL> SQL> SQL>   2    3    4    5    6
ERROR_CODE SEVERITY      MESSAGE                                                                     TIMESTAMP
---------- ------------- --------------------------------------------------------------------------- ---------------------
         0 Control       LGWR: Beginning to archive log 2 thread 1 sequence 1461                     30-NOV-18 23:29:20
         0 Control       ARC3: Beginning to archive thread 1 sequence 1460 (4654862-4656397)         30-NOV-18 23:29:20
         0 Control       ARC3: Completed archiving thread 1 sequence 1460 (4654862-4656397)          30-NOV-18 23:29:20
         0 Control       LGWR: Completed archiving log 1 thread 1 sequence 1460                      30-NOV-18 23:29:20
         0 Control       LGWR: Completed archiving log 7 thread 1 sequence 1459                      30-NOV-18 23:18:37
         0 Control       ARC2: Beginning to archive thread 1 sequence 1459 (4652419-4654862)         30-NOV-18 23:18:37
         0 Control       ARC2: Completed archiving thread 1 sequence 1459 (4652419-4654862)          30-NOV-18 23:18:37
         0 Control       LGWR: Beginning to archive log 1 thread 1 sequence 1460                     30-NOV-18 23:18:37
         0 Control       ARC0: Beginning to archive thread 1 sequence 1458 (4649556-4652419)         30-NOV-18 23:03:36
         0 Control       LGWR: Beginning to archive log 7 thread 1 sequence 1459                     30-NOV-18 23:03:36
         0 Control       LGWR: Completed archiving log 6 thread 1 sequence 1458                      30-NOV-18 23:03:36
         0 Control       ARC0: Completed archiving thread 1 sequence 1458 (4649556-4652419)          30-NOV-18 23:03:36
         0 Control       LGWR: Completed archiving log 5 thread 1 sequence 1457                      30-NOV-18 22:48:37
         0 Control       ARC3: Beginning to archive thread 1 sequence 1457 (4647225-4649556)         30-NOV-18 22:48:37
         0 Control       ARC3: Completed archiving thread 1 sequence 1457 (4647225-4649556)          30-NOV-18 22:48:37
         0 Control       LGWR: Beginning to archive log 6 thread 1 sequence 1458                     30-NOV-18 22:48:37
         0 Control       LGWR: Completed archiving log 2 thread 1 sequence 1456                      30-NOV-18 22:33:36
         0 Control       ARC2: Completed archiving thread 1 sequence 1456 (4644879-4647225)          30-NOV-18 22:33:36

PID                      PROCESS   STATUS       CLIENT_P CLIENT_PID      THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS
------------------------ --------- ------------ -------- ------------ ---------- ---------- ---------- ---------- ----------
4455                     ARCH      CLOSING      ARCH     4455                  1       1458       6144       1130          0
4460                     ARCH      CONNECTED    ARCH     4460                  0          0          0          0          0
4467                     ARCH      CLOSING      ARCH     4467                  1       1460          1        691          0
4471                     ARCH      CLOSING      ARCH     4471                  1       1459          1       1479          0
31607                    MRP0      APPLYING_LOG N/A      N/A                   1       1461        270    1048576          0
23893                    RFS       IDLE         ARCH     36874                 0          0          0          0          0
23939                    RFS       IDLE         ARCH     8925                  0          0          0          0          0
23818                    RFS       IDLE         LGWR     36372                 1       1461        270          1          0
23899                    RFS       IDLE         UNKNOWN  8933                  0          0          0          0          0
23837                    RFS       IDLE         UNKNOWN  36882                 0          0          0          0          0
23860                    RFS       IDLE         UNKNOWN  8919                  0          0          0          0          0
23866                    RFS       IDLE         LGWR     8230                  2       1365        817          1          0
12 rows selected.


SQL> set linesize 180
column name format a15
column value format a20
column unit format a30
SELECT NAME, VALUE, UNIT, TIME_COMPUTED
FROM V$DATAGUARD_STATS
WHERE NAME IN ('transport lag', 'apply lag');
NAME            VALUE                UNIT                           TIME_COMPUTED
--------------- -------------------- ------------------------------ ------------------------------
transport lag   +00 00:00:00         day(2) to second(0) interval   11/30/2018 23:27:26
apply lag       +00 00:00:00         day(2) to second(0) interval   11/30/2018 23:27:26

NAME            VALUE                UNIT                           TIME_COMPUTED
--------------- -------------------- ------------------------------ ------------------------------
transport lag   +00 00:00:00         day(2) to second(0) interval   11/30/2018 23:30:52
apply lag       +00 00:00:00         day(2) to second(0) interval   11/30/2018 23:30:52


*********************************************************************************
Step 9: Clear and Recreate DataGuard Standby Logfiles
*********************************************************************************
[On Standby Host] $ sqlplus / as sysdba;
SQL> set pagesize 200
set linesize 200
column member heading 'member' format a70
select group#, type, member
from v$logfile
order by group#, member;



Step 15: Restart the Standby RAC database

INSTANCE_NAME        STATUS     DATABASE_STATUS   INSTANCE_ROLE      HOST_NAME                 LOGINS     STARTUP_TIME
-------------------- ---------- ----------------- ------------------ ------------------------- ---------- -------------------
SHPBLSP1             MOUNTED    ACTIVE            PRIMARY_INSTANCE   shainorab1a.cn.db.com     ALLOWED    2018_11_30 23:32:29
SHPBLSP2             MOUNTED    ACTIVE            PRIMARY_INSTANCE   shainorab1b.cn.db.com     ALLOWED    2018_11_30 23:32:24

使用道具 举报

回复
论坛徽章:
1
ITPUB 11周年纪念徽章
日期:2012-10-09 18:06:20
17#
发表于 2018-4-20 10:47 | 只看该作者
啊~~!噗。。。。。  up   救命啊

使用道具 举报

回复
论坛徽章:
17
授权会员
日期:2005-10-30 17:05:33优秀写手
日期:2014-03-20 06:00:352013年新春福章
日期:2013-02-25 14:51:242012新春纪念徽章
日期:2012-01-04 11:49:54ITPUB十周年纪念徽章
日期:2011-11-01 16:19:412011新春纪念徽章
日期:2011-02-18 11:43:352011新春纪念徽章
日期:2011-01-04 10:38:442010新春纪念徽章
日期:2010-03-01 11:05:00生肖徽章2007版:马
日期:2009-11-03 13:55:02祖国60周年纪念徽章
日期:2009-10-09 08:28:00
18#
发表于 2018-7-31 14:21 | 只看该作者
多谢,非常好的书

使用道具 举报

回复
论坛徽章:
1
ITPUB十周年纪念徽章
日期:2011-11-01 16:25:22
19#
发表于 2018-8-7 11:09 | 只看该作者
very good one!

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
0
20#
 楼主| 发表于 2018-11-10 22:03 | 只看该作者
本帖最后由 hadba 于 2018-11-30 23:43 编辑

good good good

[SHPBLSP] Recovering RAC Standby using an RMAN Incremental Backup 2018_11_30
SQL> SELECT CURRENT_SCN FROM V$DATABASE;
CURRENT_SCN
-----------
    4419414

***********************************************************************************
Step 5: Run RMAN Incremental Backup on Primary
***********************************************************************************
On the primary cluster, while connected to a recovery catalog, take an incremental backup using the
SCN from step Step 4:
$ mkdir -p /u01/app/oracle/backup/SHPBLSP/4standby
$ cd /u01/app/oracle/backup/SHPBLSP/4standby
$ vi rman_inc_com_backup_4standby.ksh
#!/bin/ksh
$ORACLE_HOME/bin/rman << EOF
connect target
sql 'alter system switch logfile';
sql 'alter system switch logfile';
run{
change archivelog all crosscheck;
allocate channel d1 type disk;
allocate channel d2 type disk;
BACKUP INCREMENTAL FROM SCN 4419414 as compressed backupset DATABASE FORMAT
'/u01/app/oracle/backup/SHPBLSP/4standby/4standby_%d_inc_%U.rmn' TAG 'FOR STANDBY';
copy current controlfile for standby to '/u01/app/oracle/backup/SHPBLSP/4standby/4standby_%d_inc_ctl.ctl';
}
exit
EOF

$ chmod 777 rman_inc_com_backup_4standby.ksh
$ nohup /u01/app/oracle/backup/SHPBLSP/4standby/rman_inc_com_backup_4standby.ksh > rman_inc_com_backup.log &

SQL> set linesize 150
column sid format 999999
column serial# format 9,999,999
column sofar format 9,999,999,999
column totalwork format 99,999,999,999
column opname format a35
select sid, serial#, sofar, totalwork,opname,
round(sofar/totalwork*100,2) "% Complete"
from v$session_longops
where opname LIKE 'RMAN%aggregate%'
and totalwork != 0
and sofar <> totalwork
order by sid;
    SID    SERIAL#          SOFAR       TOTALWORK OPNAME                              % Complete
------- ---------- -------------- --------------- ----------------------------------- ----------
     91      2,960              0      12,676,619 RMAN: aggregate input                        0
    SID    SERIAL#          SOFAR       TOTALWORK OPNAME                              % Complete
------- ---------- -------------- --------------- ----------------------------------- ----------
     91      2,960      5,596,160      12,676,619 RMAN: aggregate input                    44.15


SQL> set linesize 150
column sid format 999999
column serial# format 9,999,999,999
column sofar format 9,999,999,999
column totalwork format 99,999,999,999
column opname format a35
select sid, serial#, sofar, totalwork, opname,
round(sofar/totalwork*100,2) "% Complete"
from v$session_longops
where opname LIKE 'RMAN%'
and opname NOT LIKE '%aggregate%'
and totalwork != 0
and sofar <> totalwork
order by sid;
    SID        SERIAL#          SOFAR       TOTALWORK OPNAME                              % Complete
------- -------------- -------------- --------------- ----------------------------------- ----------
     46         39,752      1,886,962       5,596,160 RMAN: incremental datafile backup        33.72
    106         13,955        792,052       7,077,888 RMAN: incremental datafile backup        11.19
    SID        SERIAL#          SOFAR       TOTALWORK OPNAME                              % Complete
------- -------------- -------------- --------------- ----------------------------------- ----------
    106         13,955      2,573,811       7,077,888 RMAN: incremental datafile backup        36.36


SQL> set linesize 150
column sid format 999999
column serial# format 999999
column spid format 9999999999
column client_info format a25
SELECT b.sid, b.serial#, a.spid, b.client_info
FROM v$process a, v$session b
WHERE a.addr = b.paddr
AND b.client_info LIKE '%rman%'
order by sid;
    SID SERIAL# SPID                     CLIENT_INFO
------- ------- ------------------------ -------------------------
     46   39752 8480                     rman channel=d2
    106   13955 8475                     rman channel=d1


[SHPBLSP1]oracle@shainorap1a.cn.db.com $ cat rman_inc_com_backup.log
Recovery Manager: Release 12.1.0.2.0 - Production on Fri Nov 30 17:39:10 2018
Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
RMAN>
connected to target database: SHPBLSP (DBID=86255385)
RMAN>
using target database control file instead of recovery catalog
sql statement: alter system switch logfile
RMAN>
sql statement: alter system switch logfile
RMAN> 2> 3> 4> 5> 6> 7> 8>
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=106 instance=SHPBLSP1 device type=DISK
validation succeeded for archived log
archived log file name=+RECO01/SHPBLSP/ARCHIVELOG/2018_11_30/thread_1_seq_1433.8626.993576663 RECID=5356 STAMP=993576662
validation succeeded for archived log
archived log file name=+RECO01/SHPBLSP/ARCHIVELOG/2018_11_30/thread_1_seq_1434.4169.993577153 RECID=5361 STAMP=993577153
validation succeeded for archived log
archived log file name=+RECO01/SHPBLSP/ARCHIVELOG/2018_11_30/thread_1_seq_1435.12847.993577153 RECID=5362 STAMP=993577153
validation succeeded for archived log
archived log file name=+RECO01/SHPBLSP/ARCHIVELOG/2018_11_30/thread_2_seq_1340.862.993576663 RECID=5357 STAMP=993576663
Crosschecked 4 objects

released channel: ORA_DISK_1
allocated channel: d1
channel d1: SID=106 instance=SHPBLSP1 device type=DISK
allocated channel: d2
channel d2: SID=46 instance=SHPBLSP1 device type=DISK
Starting backup at 30-NOV-18
channel d1: starting compressed full datafile backup set
channel d1: specifying datafile(s) in backup set
input datafile file number=00008 name=+REG_DATA01/SHPBLSP/DATAFILE/pbls_tab01.445.993308893
input datafile file number=00003 name=+REG_DATA01/SHPBLSP/DATAFILE/undo.430.992454147
input datafile file number=00001 name=+REG_DATA01/SHPBLSP/DATAFILE/system.432.992454207
input datafile file number=00006 name=+REG_DATA01/SHPBLSP/DATAFILE/audits.433.992454243
input datafile file number=00010 name=+REG_DATA01/SHPBLSP/DATAFILE/pbls_idx01.447.993308975
channel d1: starting piece 1 at 30-NOV-18
channel d2: starting compressed full datafile backup set
channel d2: specifying datafile(s) in backup set
input datafile file number=00009 name=+REG_DATA01/SHPBLSP/DATAFILE/pbls_tab01.446.993308945
input datafile file number=00007 name=+REG_DATA01/SHPBLSP/DATAFILE/undotbs2.437.992454317
input datafile file number=00002 name=+REG_DATA01/SHPBLSP/DATAFILE/sysaux.431.992454181
input datafile file number=00005 name=+REG_DATA01/SHPBLSP/DATAFILE/users.434.992454243
input datafile file number=00004 name=+REG_DATA01/SHPBLSP/DATAFILE/tools.435.992454245
channel d2: starting piece 1 at 30-NOV-18
channel d2: finished piece 1 at 30-NOV-18
piece handle=/u01/app/oracle/backup/SHPBLSP/4standby/4standby_SHPBLSP_inc_1itjhi64_1_1.rmn tag=FOR STANDBY comment=NONE
channel d2: backup set complete, elapsed time: 00:01:25
channel d2: starting compressed full datafile backup set
channel d2: specifying datafile(s) in backup set
including current control file in backup set
channel d2: starting piece 1 at 30-NOV-18
channel d2: finished piece 1 at 30-NOV-18
piece handle=/u01/app/oracle/backup/SHPBLSP/4standby/4standby_SHPBLSP_inc_1jtjhi8p_1_1.rmn tag=FOR STANDBY comment=NONE
channel d2: backup set complete, elapsed time: 00:00:01
channel d1: finished piece 1 at 30-NOV-18
piece handle=/u01/app/oracle/backup/SHPBLSP/4standby/4standby_SHPBLSP_inc_1htjhi64_1_1.rmn tag=FOR STANDBY comment=NONE
channel d1: backup set complete, elapsed time: 00:02:31
Finished backup at 30-NOV-18
Starting backup at 30-NOV-18
channel d1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/backup/SHPBLSP/4standby/4standby_SHPBLSP_inc_ctl.ctl tag=TAG20181130T174148 RECID=8 STAMP=993577309
channel d1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 30-NOV-18
released channel: d1
released channel: d2
RMAN>
Recovery Manager complete.




Step 6: Copy Backup files and Control file to Standby - DR host
[On DR Host] $ mkdir -p /u01/app/oracle/backup/SHPBLSP_SB/4standby
[On PRD Host] $ cd /u01/app/oracle/backup/SHPBLSP/4standby/ && ls -lrt
$ scp 4standby_SHPBLSP_inc* \
[url=mailtoracle@shainorab1a.cn.db.com:/u01/app/oracle/backup/SHPBLSP_SB/4standby/]oracle@shainorab1a.cn.db.com:/u01/app/oracle/backup/SHPBLSP_SB/4standby/[/url]

Access to this computer is prohibited unless authorised
Accessing programs or data unrelated to your job is prohibited
4standby_SHPBLSP_inc_1htjhi64_1_1.rmn                                                                                              100%  905MB
4standby_SHPBLSP_inc_1itjhi64_1_1.rmn                                                                                              100%  562MB
4standby_SHPBLSP_inc_1jtjhi8p_1_1.rmn                                                                                              100% 1472KB
4standby_SHPBLSP_inc_ctl.ctl                                                                                                       100%   37MB


[SHPBLSP1]oracle@shainorab1a.cn.db.com $ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Fri Nov 30 17:47:12 2018
Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
connected to target database: SHPBLSP (not mounted)
RMAN> restore controlfile from '/u01/app/oracle/backup/SHPBLSP_SB/4standby/4standby_SHPBLSP_inc_ctl.ctl';
Starting restore at 30-NOV-18
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=7 instance=SHPBLSP1 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=+REDOLOG01/SHPBLSP_SB/CONTROLFILE/current.309.993573923
output file name=+REDOLOG02/SHPBLSP_SB/CONTROLFILE/current.309.993573923
Finished restore at 30-NOV-18

$ sqlplus / as sysdba;
SQL> alter system set control_files='+REDOLOG01/SHPBLSP_SB/CONTROLFILE/current.309.993573923',
'+REDOLOG02/SHPBLSP_SB/CONTROLFILE/current.309.993573923' scope=spfile sid='*';
SQL> shutdown immediate;


RMAN> CATALOG START WITH '+REG_DATA01/SHPBLSP_SB/DATAFILE/';
searching for all files that match the pattern +REG_DATA01/SHPBLSP_SB/DATAFILE/
List of Files Unknown to the Database
=====================================
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.384.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.385.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.386.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.387.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.388.992466177
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.389.992466177
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.390.992466177
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.431.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.425.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.391.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.418.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.453.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.459.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.457.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.456.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.455.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.458.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.460.993574091
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.417.993574091
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.454.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.461.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.463.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.467.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.466.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.462.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.464.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.465.993574093
Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.384.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.385.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.386.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.387.992466163
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.388.992466177
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.389.992466177
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.390.992466177
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.431.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.425.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.391.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.418.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.453.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.459.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.457.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.456.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.455.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.458.993329905
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.460.993574091
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.417.993574091
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.454.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.461.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.463.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.467.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.466.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.462.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.464.993574093
File Name: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.465.993574093

RMAN> REPORT SCHEMA;
RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name SHPBLSP_SB
List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    0        SYSTEM               ***     +REG_DATA01/SHPBLSP/DATAFILE/system.432.992454207
2    0        SYSAUX               ***     +REG_DATA01/SHPBLSP/DATAFILE/sysaux.431.992454181
3    0        UNDO                 ***     +REG_DATA01/SHPBLSP/DATAFILE/undo.430.992454147
4    0        TOOLS                ***     +REG_DATA01/SHPBLSP/DATAFILE/tools.435.992454245
5    0        USERS                ***     +REG_DATA01/SHPBLSP/DATAFILE/users.434.992454243
6    0        AUDITS               ***     +REG_DATA01/SHPBLSP/DATAFILE/audits.433.992454243
7    0        UNDOTBS2             ***     +REG_DATA01/SHPBLSP/DATAFILE/undotbs2.437.992454317
8    0        PBLS_TAB01           ***     +REG_DATA01/SHPBLSP/DATAFILE/pbls_tab01.445.993308893
9    0        PBLS_TAB01           ***     +REG_DATA01/SHPBLSP/DATAFILE/pbls_tab01.446.993308945
10   0        PBLS_IDX01           ***     +REG_DATA01/SHPBLSP/DATAFILE/pbls_idx01.447.993308975
List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    512      TEMP                 32767       +REG_DATA01/SHPBLSP/TEMPFILE/temp.436.992454305

RMAN> SWITCH DATABASE TO COPY;
datafile 1 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/system.464.993574093"
datafile 2 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.463.993574093"
datafile 3 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/undo.461.993574093"
datafile 4 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/tools.466.993574093"
datafile 5 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/users.467.993574093"
datafile 6 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/audits.465.993574093"
datafile 7 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.454.993574093"
datafile 8 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.460.993574091"
datafile 9 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.417.993574091"
datafile 10 switched to datafile copy "+REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.462.993574093"

RMAN> REPORT SCHEMA;
RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name SHPBLSP_SB
List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    2048     SYSTEM               ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/system.464.993574093
2    2048     SYSAUX               ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.463.993574093
3    10240    UNDO                 ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.461.993574093
4    200      TOOLS                ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.466.993574093
5    512      USERS                ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/users.467.993574093
6    2048     AUDITS               ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.465.993574093
7    10240    UNDOTBS2             ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.454.993574093
8    30720    PBLS_TAB01           ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.460.993574091
9    30720    PBLS_TAB01           ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.417.993574091
10   10240    PBLS_IDX01           ***     +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.462.993574093
List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    512      TEMP                 32767       +REG_DATA01/SHPBLSP/TEMPFILE/temp.436.992454305


RMAN> RECOVER DATABASE NOREDO;
Starting recover at 30-NOV-18
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: +REG_DATA01/SHPBLSP_SB/DATAFILE/system.464.993574093
destination for restore of datafile 00003: +REG_DATA01/SHPBLSP_SB/DATAFILE/undo.461.993574093
destination for restore of datafile 00006: +REG_DATA01/SHPBLSP_SB/DATAFILE/audits.465.993574093
destination for restore of datafile 00008: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.460.993574091
destination for restore of datafile 00010: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_idx01.462.993574093
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/backup/SHPBLSP_SB/4standby/4standby_SHPBLSP_inc_1htjhi64_1_1.rmn
channel ORA_DISK_1: piece handle=/u01/app/oracle/backup/SHPBLSP_SB/4standby/4standby_SHPBLSP_inc_1htjhi64_1_1.rmn tag=FOR STANDBY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:05:05
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00002: +REG_DATA01/SHPBLSP_SB/DATAFILE/sysaux.463.993574093
destination for restore of datafile 00004: +REG_DATA01/SHPBLSP_SB/DATAFILE/tools.466.993574093
destination for restore of datafile 00005: +REG_DATA01/SHPBLSP_SB/DATAFILE/users.467.993574093
destination for restore of datafile 00007: +REG_DATA01/SHPBLSP_SB/DATAFILE/undotbs2.454.993574093
destination for restore of datafile 00009: +REG_DATA01/SHPBLSP_SB/DATAFILE/pbls_tab01.417.993574091
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/backup/SHPBLSP_SB/4standby/4standby_SHPBLSP_inc_1itjhi64_1_1.rmn
channel ORA_DISK_1: piece handle=/u01/app/oracle/backup/SHPBLSP_SB/4standby/4standby_SHPBLSP_inc_1itjhi64_1_1.rmn tag=FOR STANDBY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:02:55
Finished recover at 30-NOV-18




****************************************************************************************************
Step 12: Start the redo apply on the Standby database
****************************************************************************************************

SQL> set lines 132
set pagesize 9999
col client_pid format a12
SELECT PID, PROCESS, STATUS,
CLIENT_PROCESS, CLIENT_PID,
THREAD#, SEQUENCE#, BLOCK#,
BLOCKS, DELAY_MINS
FROM GV$MANAGED_STANDBY;
PID                      PROCESS   STATUS       CLIENT_P CLIENT_PID      THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS
------------------------ --------- ------------ -------- ------------ ---------- ---------- ---------- ---------- ----------
4455                     ARCH      CONNECTED    ARCH     4455                  0          0          0          0          0
4460                     ARCH      CONNECTED    ARCH     4460                  0          0          0          0          0
4467                     ARCH      CONNECTED    ARCH     4467                  0          0          0          0          0
4471                     ARCH      CONNECTED    ARCH     4471                  0          0          0          0          0
22716                    MRP0      WAIT_FOR_LOG N/A      N/A                   1       1436          0          0          0

PID                      PROCESS   STATUS       CLIENT_P CLIENT_PID      THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS
------------------------ --------- ------------ -------- ------------ ---------- ---------- ---------- ---------- ----------
4455                     ARCH      CONNECTED    ARCH     4455                  0          0          0          0          0
4460                     ARCH      CONNECTED    ARCH     4460                  0          0          0          0          0
4467                     ARCH      CONNECTED    ARCH     4467                  0          0          0          0          0
4471                     ARCH      CONNECTED    ARCH     4471                  0          0          0          0          0
31607                    MRP0      WAIT_FOR_LOG N/A      N/A                   2       1344          0          0          0
23893                    RFS       IDLE         ARCH     36874                 0          0          0          0          0
23939                    RFS       IDLE         ARCH     8925                  0          0          0          0          0
23818                    RFS       IDLE         LGWR     36372                 1       1439        506          1          0
23899                    RFS       IDLE         UNKNOWN  8933                  0          0          0          0          0
23837                    RFS       IDLE         UNKNOWN  36882                 0          0          0          0          0
23860                    RFS       IDLE         UNKNOWN  8919                  0          0          0          0          0
23866                    RFS       IDLE         LGWR     8230                  2       1344        521          1          0
12 rows selected.

*********************************************************************************************************************************
Step 13: Enable logshipping from primary
****************************************************************************************************


PID                      PROCESS   STATUS       CLIENT_P CLIENT_PID      THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS
------------------------ --------- ------------ -------- ------------ ---------- ---------- ---------- ---------- ----------
4455                     ARCH      CONNECTED    ARCH     4455                  0          0          0          0          0
4460                     ARCH      CONNECTED    ARCH     4460                  0          0          0          0          0
4467                     ARCH      CONNECTED    ARCH     4467                  0          0          0          0          0
4471                     ARCH      CONNECTED    ARCH     4471                  0          0          0          0          0
22716                    MRP0      WAIT_FOR_LOG N/A      N/A                   2       1344          0          0          0
23893                    RFS       IDLE         ARCH     36874                 0          0          0          0          0
23939                    RFS       IDLE         ARCH     8925                  0          0          0          0          0
23818                    RFS       IDLE         LGWR     36372                 1       1439         41          1          0
23899                    RFS       IDLE         UNKNOWN  8933                  0          0          0          0          0
23837                    RFS       IDLE         UNKNOWN  36882                 0          0          0          0          0
23860                    RFS       IDLE         UNKNOWN  8919                  0          0          0          0          0
23866                    RFS       IDLE         LGWR     8230                  2       1344        100          1          0
12 rows selected.

PID                      PROCESS   STATUS       CLIENT_P CLIENT_PID      THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS
------------------------ --------- ------------ -------- ------------ ---------- ---------- ---------- ---------- ----------
4455                     ARCH      CLOSING      ARCH     4455                  1       1458       6144       1130          0
4460                     ARCH      CONNECTED    ARCH     4460                  0          0          0          0          0
4467                     ARCH      CLOSING      ARCH     4467                  2       1363       6144        194          0
4471                     ARCH      CLOSING      ARCH     4471                  1       1459          1       1479          0
31607                    MRP0      APPLYING_LOG N/A      N/A                   1       1460        501    1048576          0
23893                    RFS       IDLE         ARCH     36874                 0          0          0          0          0
23939                    RFS       IDLE         ARCH     8925                  0          0          0          0          0
23818                    RFS       IDLE         LGWR     36372                 1       1460        502          1          0
23899                    RFS       IDLE         UNKNOWN  8933                  0          0          0          0          0
23837                    RFS       IDLE         UNKNOWN  36882                 0          0          0          0          0
23860                    RFS       IDLE         UNKNOWN  8919                  0          0          0          0          0
23866                    RFS       IDLE         LGWR     8230                  2       1365        531          1          0
12 rows selected.

NAME            VALUE                UNIT                           TIME_COMPUTED
--------------- -------------------- ------------------------------ ------------------------------
transport lag   +00 00:00:00         day(2) to second(0) interval   11/30/2018 18:03:14
apply lag       +00 00:00:00         day(2) to second(0) interval   11/30/2018 18:03:14


ERROR_CODE SEVERITY      MESSAGE                                                                     TIMESTAMP
---------- ------------- --------------------------------------------------------------------------- ---------------------
         0 Control       LGWR: Completed archiving log 6 thread 1 sequence 1438                      30-NOV-18 18:03:37
         0 Control       ARC2: Beginning to archive thread 1 sequence 1438 (4550601-4550758)         30-NOV-18 18:03:37
         0 Control       LGWR: Beginning to archive log 7 thread 1 sequence 1439                     30-NOV-18 18:03:37
         0 Control       ARC2: Completed archiving thread 1 sequence 1438 (4550601-4550758)          30-NOV-18 18:03:37
         0 Control       ARC2: Completed archiving thread 1 sequence 1437 (4548672-4550601)          30-NOV-18 18:02:41
         0 Control       ARC2: Beginning to archive thread 1 sequence 1437 (4548672-4550601)         30-NOV-18 18:02:41
         0 Control       LGWR: Beginning to archive log 6 thread 1 sequence 1438                     30-NOV-18 18:02:41
         0 Control       ARC0: Completed archiving thread 1 sequence 1436 (4546207-4548672)          30-NOV-18 17:54:09
         0 Control       ARC0: Beginning to archive thread 1 sequence 1436 (4546207-4548672)         30-NOV-18 17:54:09
         0 Control       ARC3: Completed archiving thread 1 sequence 1434 (4544959-4546193)          30-NOV-18 17:39:13
         0 Control       ARC0: Beginning to archive thread 1 sequence 1435 (4546193-4546207)         30-NOV-18 17:39:13
         0 Control       ARC0: Completed archiving thread 1 sequence 1435 (4546193-4546207)          30-NOV-18 17:39:13
         0 Control       ARC3: Beginning to archive thread 1 sequence 1434 (4544959-4546193)         30-NOV-18 17:39:13
         0 Control       LGWR: Completed archiving log 7 thread 1 sequence 1434                      30-NOV-18 17:39:12


****************************************************************************************************
Step 14: Run a switch logfile from primary database
****************************************************************************************************
Run a switch logfile from primary database to ensure logfiles are shipping properly

SQL> set linesize 180
set pagesize 1000
column message format a75
SELECT ERROR_CODE, SEVERITY, MESSAGE,
TO_CHAR(TIMESTAMP, 'DD-MON-RR HH24:MI:SS') TIMESTAMP
FROM V$DATAGUARD_STATUS
WHERE CALLOUT='YES'
AND TIMESTAMP > SYSDATE-1
ORDER BY TIMESTAMP DESC;SQL> SQL> SQL>   2    3    4    5    6
ERROR_CODE SEVERITY      MESSAGE                                                                     TIMESTAMP
---------- ------------- --------------------------------------------------------------------------- ---------------------
         0 Control       LGWR: Beginning to archive log 2 thread 1 sequence 1461                     30-NOV-18 23:29:20
         0 Control       ARC3: Beginning to archive thread 1 sequence 1460 (4654862-4656397)         30-NOV-18 23:29:20
         0 Control       ARC3: Completed archiving thread 1 sequence 1460 (4654862-4656397)          30-NOV-18 23:29:20
         0 Control       LGWR: Completed archiving log 1 thread 1 sequence 1460                      30-NOV-18 23:29:20
         0 Control       LGWR: Completed archiving log 7 thread 1 sequence 1459                      30-NOV-18 23:18:37
         0 Control       ARC2: Beginning to archive thread 1 sequence 1459 (4652419-4654862)         30-NOV-18 23:18:37
         0 Control       ARC2: Completed archiving thread 1 sequence 1459 (4652419-4654862)          30-NOV-18 23:18:37
         0 Control       LGWR: Beginning to archive log 1 thread 1 sequence 1460                     30-NOV-18 23:18:37
         0 Control       ARC0: Beginning to archive thread 1 sequence 1458 (4649556-4652419)         30-NOV-18 23:03:36
         0 Control       LGWR: Beginning to archive log 7 thread 1 sequence 1459                     30-NOV-18 23:03:36
         0 Control       LGWR: Completed archiving log 6 thread 1 sequence 1458                      30-NOV-18 23:03:36
         0 Control       ARC0: Completed archiving thread 1 sequence 1458 (4649556-4652419)          30-NOV-18 23:03:36
         0 Control       LGWR: Completed archiving log 5 thread 1 sequence 1457                      30-NOV-18 22:48:37
         0 Control       ARC3: Beginning to archive thread 1 sequence 1457 (4647225-4649556)         30-NOV-18 22:48:37
         0 Control       ARC3: Completed archiving thread 1 sequence 1457 (4647225-4649556)          30-NOV-18 22:48:37
         0 Control       LGWR: Beginning to archive log 6 thread 1 sequence 1458                     30-NOV-18 22:48:37
         0 Control       LGWR: Completed archiving log 2 thread 1 sequence 1456                      30-NOV-18 22:33:36
         0 Control       ARC2: Completed archiving thread 1 sequence 1456 (4644879-4647225)          30-NOV-18 22:33:36

PID                      PROCESS   STATUS       CLIENT_P CLIENT_PID      THREAD#  SEQUENCE#     BLOCK#     BLOCKS DELAY_MINS
------------------------ --------- ------------ -------- ------------ ---------- ---------- ---------- ---------- ----------
4455                     ARCH      CLOSING      ARCH     4455                  1       1458       6144       1130          0
4460                     ARCH      CONNECTED    ARCH     4460                  0          0          0          0          0
4467                     ARCH      CLOSING      ARCH     4467                  1       1460          1        691          0
4471                     ARCH      CLOSING      ARCH     4471                  1       1459          1       1479          0
31607                    MRP0      APPLYING_LOG N/A      N/A                   1       1461        270    1048576          0
23893                    RFS       IDLE         ARCH     36874                 0          0          0          0          0
23939                    RFS       IDLE         ARCH     8925                  0          0          0          0          0
23818                    RFS       IDLE         LGWR     36372                 1       1461        270          1          0
23899                    RFS       IDLE         UNKNOWN  8933                  0          0          0          0          0
23837                    RFS       IDLE         UNKNOWN  36882                 0          0          0          0          0
23860                    RFS       IDLE         UNKNOWN  8919                  0          0          0          0          0
23866                    RFS       IDLE         LGWR     8230                  2       1365        817          1          0
12 rows selected.


SQL> set linesize 180
column name format a15
column value format a20
column unit format a30
SELECT NAME, VALUE, UNIT, TIME_COMPUTED
FROM V$DATAGUARD_STATS
WHERE NAME IN ('transport lag', 'apply lag');
NAME            VALUE                UNIT                           TIME_COMPUTED
--------------- -------------------- ------------------------------ ------------------------------
transport lag   +00 00:00:00         day(2) to second(0) interval   11/30/2018 23:27:26
apply lag       +00 00:00:00         day(2) to second(0) interval   11/30/2018 23:27:26

NAME            VALUE                UNIT                           TIME_COMPUTED
--------------- -------------------- ------------------------------ ------------------------------
transport lag   +00 00:00:00         day(2) to second(0) interval   11/30/2018 23:30:52
apply lag       +00 00:00:00         day(2) to second(0) interval   11/30/2018 23:30:52


*********************************************************************************
Step 9: Clear and Recreate DataGuard Standby Logfiles
*********************************************************************************
[On Standby Host] $ sqlplus / as sysdba;
SQL> set pagesize 200
set linesize 200
column member heading 'member' format a70
select group#, type, member
from v$logfile
order by group#, member;



Step 15: Restart the Standby RAC database

INSTANCE_NAME        STATUS     DATABASE_STATUS   INSTANCE_ROLE      HOST_NAME                 LOGINS     STARTUP_TIME
-------------------- ---------- ----------------- ------------------ ------------------------- ---------- -------------------
SHPBLSP1             MOUNTED    ACTIVE            PRIMARY_INSTANCE   shainorab1a.cn.db.com     ALLOWED    2018_11_30 23:32:29
SHPBLSP2             MOUNTED    ACTIVE            PRIMARY_INSTANCE   shainorab1b.cn.db.com     ALLOWED    2018_11_30 23:32:24

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表