Note:
You can create physical standby database using dbca silent method in 12c or any rman duplicate method, but here, I creating it by manual method.
Primary DB Server:
test.localdomain
DB Name: orcl
db_unique_name:
orcl
DB Version:
12.2.0.1
ORACLE_HOME: /u01/app/oracle/product/12.2.0/dbhome_1/dbs
Standby DB Server:
clone.localdomain
DB Name: orcl
db_unique_name:
orcl2
DB Version:
12.2.0.1
ORACLE_HOME:
/u02/app/oracle/product/12.2.0/dbhome_1
Step 2: Create pfile
for both primary and standby databases.
Primary Database
pfile:
orcl.__data_transfer_cache_size=0
orcl.__db_cache_size=230686720
orcl.__inmemory_ext_roarea=0
orcl.__inmemory_ext_rwarea=0
orcl.__java_pool_size=4194304
orcl.__large_pool_size=8388608
orcl.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from
environment
orcl.__pga_aggregate_target=188743680
orcl.__sga_target=734003200
orcl.__shared_io_pool_size=16777216
orcl.__shared_pool_size=251658240
orcl.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='12.2.0'
*.control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/recovery_area/orcl/control02.ctl'
*.db_block_size=8192
*.db_domain='localdomain'
*.db_name='orcl'
*.db_unique_name='orcl'
*.db_recovery_file_dest='/u01/app/oracle/recovery_area'
*.db_recovery_file_dest_size=12780m
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.enable_pluggable_database=true
*.fal_client='ORCL'
*.fal_server='ORCL2'
*.inmemory_size=209715200
*.local_listener='(address=(protocol=tcp)(host=test.localdomain)(port=1522))'
*.log_archive_config='dg_config=(orcl,orcl2)'
*.log_archive_dest_1='location=/u01/app/oracle/recovery_area
valid_for=(all_logfiles,all_roles) db_unique_name=orcl'
*.log_archive_dest_2='service=orcl2 async
valid_for=(all_logfiles,all_roles) db_unique_name=orcl2'
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=300
*.pga_aggregate_target=180m
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=700m
*.standby_file_management='AUTO'
*.undo_tablespace='UNDOTBS1'
Standby Database
Pfile:
[oracle@clone dbs]$ cat standinitorcl.ora
orcl.__data_transfer_cache_size=0
orcl.__db_cache_size=230686720
orcl.__inmemory_ext_roarea=0
orcl.__inmemory_ext_rwarea=0
orcl.__java_pool_size=4194304
orcl.__large_pool_size=8388608
orcl.__oracle_base='/u02/app/oracle'#ORACLE_BASE set from
environment
orcl.__pga_aggregate_target=188743680
orcl.__sga_target=734003200
orcl.__shared_io_pool_size=16777216
orcl.__shared_pool_size=251658240
orcl.__streams_pool_size=0
*.audit_file_dest='/u02/app/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='12.2.0'
*.control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/recovery_area/orcl/control02.ctl'
*.db_block_size=8192
*.db_domain='localdomain'
*.db_name='orcl'
*.db_unique_name='orcl2'
*.db_recovery_file_dest='/u01/app/oracle/recovery_area'
*.db_recovery_file_dest_size=12780m
*.diagnostic_dest='/u02/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.enable_pluggable_database=true
*.fal_client='ORCL2'
*.fal_server='ORCL'
*.inmemory_size=209715200
*.local_listener='(address=(protocol=tcp)(host=test.localdomain)(port=1522))'
*.log_archive_config='dg_config=(orcl,orcl2)'
*.log_archive_dest_1='location=/u01/app/oracle/recovery_area
valid_for=(all_logfiles,all_roles) db_unique_name=orcl2'
*.log_archive_dest_2='service=orcl async valid_for=(all_logfiles,all_roles)
db_unique_name=orcl'
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=300
*.pga_aggregate_target=180m
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=700m
*.standby_file_management='AUTO'
*.undo_tablespace='UNDOTBS1'
Step 3: Create
password file for both primary and standby database.
Primary:
[oracle@test dbs]$ pwd
/u01/app/oracle/product/12.2.0/dbhome_1/dbs
[oracle@test dbs]$ hostname
test.localdomain
[oracle@test dbs]$
orapwd file=orapworcl password=oracle format=12 force=y entries=20
[oracle@test dbs]$ ls
-ltr orapworcl
-rw-r----- 1 oracle oinstall 2048 Jul 18 15:27 orapworcl
[oracle@test dbs]$
md5sum orapworcl
4b3d41b7af8cead29028201b5a2c02af orapworcl
Later you can copy this password file on standby server.
Step 4: Add entries
in tnsnames.ora and listerner.ora files on both primary and standby server.
Primary:
[oracle@test admin]$
cat tnsnames.ora
ORCL =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)(HOST = test.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER =
DEDICATED)
(SERVICE_NAME =
orcl)
)
)
ORCL2 =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)(HOST = clone.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER =
DEDICATED)
(SERVICE_NAME =
orcl)
)
)
ORCLPDB =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)(HOST = test.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER =
DEDICATED)
(SERVICE_NAME =
orcl)
)
)
[oracle@test admin]$
cat listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME =
/u01/app/oracle/product/12.2.0/dbhome_1)
(SID_NAME =
orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)(HOST = test.localdomain)(PORT = 1521))
)
)
Standby:
[oracle@clone admin]$
cat tnsnames.ora
ORCL =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)(HOST = test.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER =
DEDICATED)
(SERVICE_NAME =
orcl)
)
)
ORCL2 =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)(HOST = clone.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER =
DEDICATED)
(SERVICE_NAME =
orcl)
)
)
ORCLPDB =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)(HOST = clone.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER =
DEDICATED)
(SERVICE_NAME =
orcl)
)
)
[oracle@clone admin]$
cat listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME =
orcl)
(ORACLE_HOME =
/u02/app/oracle/product/12.2.0/dbhome_1/)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)(HOST = clone.localdomain)(PORT = 1521))
)
)
Step 5: Create same
directory structure on standby database or use different.
On Standby:
$mkdir -p /u02/app/oracle/admin/orcl/adump
$mkdir -p /u01/app/oracle/oradata/orcl
$mkdir -p /u01/app/oracle/recovery_area/orcl
Step 6: Take full
database plus archivelog rman backup.
[oracle@test ~]$ env | grep ORA
ORACLE_SID=orcl
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
[oracle@test ~]$ hostname
test.localdomain
[oracle@test ~]$ id
uid=1001(oracle) gid=1002(oinstall)
groups=1002(oinstall),1003(dba)
[oracle@test ~]$
[oracle@test ~]$ rman target /
Recovery Manager: Release 12.2.0.1.0 - Production on Wed Jul
18 15:38:20 2018
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1505367143)
RMAN> backup database plus archivelog;
Starting backup at 18-JUL-18
current log archived
using target database control file instead of recovery
catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=12 RECID=2
STAMP=981716078
input archived log thread=1 sequence=13 RECID=1
STAMP=981716077
input archived log thread=1 sequence=14 RECID=3
STAMP=981716079
input archived log thread=1 sequence=15 RECID=4
STAMP=981716079
input archived log thread=1 sequence=16 RECID=5
STAMP=981716081
input archived log thread=1 sequence=17 RECID=6
STAMP=981716082
input archived log thread=1 sequence=18 RECID=7
STAMP=981716082
input archived log thread=1 sequence=19 RECID=8
STAMP=981716168
input archived log thread=1 sequence=20 RECID=9
STAMP=981716204
input archived log thread=1 sequence=21 RECID=10
STAMP=981717746
input archived log thread=1 sequence=22 RECID=11
STAMP=981718049
input archived log thread=1 sequence=23 RECID=12
STAMP=981740904
channel ORA_DISK_1: starting piece 1 at 18-JUL-18
channel ORA_DISK_1: finished piece 1 at 18-JUL-18
piece handle=/u01/app/oracle/recovery_area/ORCL/backupset/2018_07_18/o1_mf_annnn_TAG20180718T153835_fny4f4k3_.bkp
tag=TAG20180718T153835 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time:
00:00:03
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=24 RECID=13
STAMP=981750495
input archived log thread=1 sequence=25 RECID=14
STAMP=981752262
input archived log thread=1 sequence=26 RECID=15 STAMP=981753173
input archived log thread=1 sequence=27 RECID=16
STAMP=981753176
input archived log thread=1 sequence=28 RECID=17
STAMP=981753179
input archived log thread=1 sequence=29 RECID=18
STAMP=981753179
input archived log thread=1 sequence=30 RECID=19 STAMP=981753183
input archived log thread=1 sequence=31 RECID=20
STAMP=981753446
input archived log thread=1 sequence=32 RECID=21
STAMP=981753699
input archived log thread=1 sequence=33 RECID=22
STAMP=981754176
input archived log thread=1 sequence=34 RECID=23
STAMP=981754177
input archived log thread=1 sequence=35 RECID=24
STAMP=981754177
input archived log thread=1 sequence=36 RECID=25
STAMP=981754177
input archived log thread=1 sequence=37 RECID=26
STAMP=981754309
input archived log thread=1 sequence=38 RECID=42
STAMP=981755027
input archived log thread=1 sequence=39 RECID=44
STAMP=981755028
input archived log thread=1 sequence=40 RECID=46
STAMP=981755029
input archived log thread=1 sequence=41 RECID=48
STAMP=981755211
input archived log thread=1 sequence=42 RECID=49
STAMP=981755265
input archived log thread=1 sequence=43 RECID=52
STAMP=981755272
input archived log thread=1 sequence=44 RECID=54
STAMP=981755294
input archived log thread=1 sequence=45 RECID=56
STAMP=981755296
input archived log thread=1 sequence=46 RECID=58
STAMP=981755299
input archived log thread=1 sequence=47 RECID=60
STAMP=981755302
input archived log thread=1 sequence=48 RECID=62
STAMP=981755306
input archived log thread=1 sequence=49 RECID=64
STAMP=981755309
input archived log thread=1 sequence=50 RECID=66
STAMP=981755312
input archived log thread=1 sequence=51 RECID=68
STAMP=981755315
input archived log thread=1 sequence=52 RECID=70
STAMP=981755318
input archived log thread=1 sequence=53 RECID=72
STAMP=981756204
input archived log thread=1 sequence=54 RECID=74
STAMP=981756355
input archived log thread=1 sequence=55 RECID=78
STAMP=981756843
input archived log thread=1 sequence=56 RECID=80
STAMP=981756844
input archived log thread=1 sequence=57 RECID=82
STAMP=981756847
input archived log thread=1 sequence=58 RECID=84
STAMP=981756847
input archived log thread=1 sequence=59 RECID=85
STAMP=981756847
input archived log thread=1 sequence=60 RECID=88
STAMP=981756853
input archived log thread=1 sequence=61 RECID=90
STAMP=981757092
input archived log thread=1 sequence=62 RECID=92
STAMP=981757092
input archived log thread=1 sequence=63 RECID=94
STAMP=981757093
input archived log thread=1 sequence=64 RECID=96
STAMP=981757652
input archived log thread=1 sequence=65 RECID=98
STAMP=981758572
input archived log thread=1 sequence=66 RECID=99
STAMP=981758585
input archived log thread=1 sequence=67 RECID=100
STAMP=981758587
input archived log thread=1 sequence=68 RECID=101
STAMP=981758587
input archived log thread=1 sequence=69 RECID=102
STAMP=981758620
input archived log thread=1 sequence=70 RECID=108
STAMP=981758971
input archived log thread=1 sequence=71 RECID=155
STAMP=981760204
input archived log thread=1 sequence=72 RECID=157
STAMP=981760210
input archived log thread=1 sequence=73 RECID=159 STAMP=981760663
input archived log thread=1 sequence=74 RECID=161
STAMP=981760878
input archived log thread=1 sequence=75 RECID=163
STAMP=981760879
input archived log thread=1 sequence=76 RECID=165
STAMP=981760879
input archived log thread=1 sequence=77 RECID=167
STAMP=981760895
input archived log thread=1 sequence=78 RECID=169
STAMP=981763079
input archived log thread=1 sequence=79 RECID=170
STAMP=981763220
input archived log thread=1 sequence=80 RECID=171
STAMP=981763222
input archived log thread=1 sequence=81 RECID=172
STAMP=981763223
input archived log thread=1 sequence=82 RECID=173
STAMP=981763331
input archived log thread=1 sequence=83 RECID=174
STAMP=981763363
input archived log thread=1 sequence=84 RECID=175
STAMP=981763371
input archived log thread=1 sequence=85 RECID=176
STAMP=981763371
input archived log thread=1 sequence=86 RECID=177
STAMP=981763373
input archived log thread=1 sequence=87 RECID=178
STAMP=981763373
channel ORA_DISK_1: starting piece 1 at 18-JUL-18
channel ORA_DISK_1: finished piece 1 at 18-JUL-18
piece handle=/u01/app/oracle/recovery_area/ORCL/backupset/2018_07_18/o1_mf_annnn_TAG20180718T153835_fny4f7yv_.bkp
tag=TAG20180718T153835 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time:
00:00:01
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=88 RECID=179
STAMP=981763373
input archived log thread=1 sequence=89 RECID=180
STAMP=981763524
input archived log thread=1 sequence=90 RECID=181
STAMP=981801953
input archived log thread=1 sequence=91 RECID=182
STAMP=981801954
input archived log thread=1 sequence=92 RECID=183
STAMP=981801957
input archived log thread=1 sequence=93 RECID=184
STAMP=981801957
input archived log thread=1 sequence=94 RECID=185
STAMP=981803747
input archived log thread=1 sequence=95 RECID=203
STAMP=981803780
input archived log thread=1 sequence=96 RECID=205
STAMP=981803781
input archived log thread=1 sequence=97 RECID=206
STAMP=981803781
input archived log thread=1 sequence=98 RECID=209
STAMP=981803786
input archived log thread=1 sequence=99 RECID=210
STAMP=981803786
input archived log thread=1 sequence=100 RECID=213
STAMP=981811179
input archived log thread=1 sequence=101 RECID=215
STAMP=981811963
input archived log thread=1 sequence=102 RECID=216
STAMP=981811999
input archived log thread=1 sequence=103 RECID=217
STAMP=981813888
input archived log thread=1 sequence=104 RECID=219
STAMP=981814168
input archived log thread=1 sequence=105 RECID=221
STAMP=981814262
input archived log thread=1 sequence=106 RECID=223
STAMP=981814374
input archived log thread=1 sequence=107 RECID=226
STAMP=981814378
input archived log thread=1 sequence=108 RECID=227
STAMP=981814381
input archived log thread=1 sequence=109 RECID=229 STAMP=981814381
input archived log thread=1 sequence=110 RECID=231
STAMP=981814470
input archived log thread=1 sequence=111 RECID=233
STAMP=981814783
input archived log thread=1 sequence=112 RECID=234
STAMP=981814828
input archived log thread=1 sequence=113 RECID=235
STAMP=981814866
input archived log thread=1 sequence=114 RECID=236
STAMP=981815366
input archived log thread=1 sequence=115 RECID=238
STAMP=981815562
input archived log thread=1 sequence=116 RECID=240
STAMP=981815568
input archived log thread=1 sequence=117 RECID=242
STAMP=981815571
input archived log thread=1 sequence=118 RECID=244
STAMP=981815571
input archived log thread=1 sequence=119 RECID=246
STAMP=981815589
input archived log thread=1 sequence=120 RECID=248
STAMP=981816099
input archived log thread=1 sequence=121 RECID=250
STAMP=981816197
input archived log thread=1 sequence=122 RECID=252
STAMP=981816240
input archived log thread=1 sequence=123 RECID=254
STAMP=981816282
input archived log thread=1 sequence=124 RECID=256
STAMP=981816402
input archived log thread=1 sequence=125 RECID=257
STAMP=981816402
input archived log thread=1 sequence=126 RECID=260
STAMP=981816406
input archived log thread=1 sequence=127 RECID=262
STAMP=981816406
input archived log thread=1 sequence=128 RECID=264 STAMP=981816409
input archived log thread=1 sequence=129 RECID=265
STAMP=981816409
input archived log thread=1 sequence=130 RECID=268
STAMP=981816412
input archived log thread=1 sequence=131 RECID=269
STAMP=981816412
input archived log thread=1 sequence=132 RECID=272
STAMP=981816415
input archived log thread=1 sequence=133 RECID=273
STAMP=981816415
input archived log thread=1 sequence=134 RECID=276
STAMP=981816418
input archived log thread=1 sequence=135 RECID=278
STAMP=981816423
input archived log thread=1 sequence=136 RECID=280
STAMP=981818220
input archived log thread=1 sequence=137 RECID=282
STAMP=981819515
channel ORA_DISK_1: starting piece 1 at 18-JUL-18
channel ORA_DISK_1: finished piece 1 at 18-JUL-18
piece handle=/u01/app/oracle/recovery_area/ORCL/backupset/2018_07_18/o1_mf_annnn_TAG20180718T153835_fny4f9dw_.bkp
tag=TAG20180718T153835 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time:
00:00:01
Finished backup at 18-JUL-18
Starting backup at 18-JUL-18
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001
name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00003
name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00013
name=/u01/app/oracle/oradata/orcl/test01.dbf
input datafile file number=00004
name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00007
name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-JUL-18
channel ORA_DISK_1: finished piece 1 at 18-JUL-18
piece handle=/u01/app/oracle/recovery_area/ORCL/backupset/2018_07_18/o1_mf_nnndf_TAG20180718T153842_fny4fcc7_.bkp
tag=TAG20180718T153842 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time:
00:00:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00010
name=/u01/app/oracle/oradata/orcl/orclpdb/sysaux01.dbf
input datafile file number=00009
name=/u01/app/oracle/oradata/orcl/orclpdb/system01.dbf
input datafile file number=00011
name=/u01/app/oracle/oradata/orcl/orclpdb/undotbs01.dbf
input datafile file number=00012
name=/u01/app/oracle/oradata/orcl/orclpdb/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-JUL-18
channel ORA_DISK_1: finished piece 1 at 18-JUL-18
piece handle=/u01/app/oracle/recovery_area/ORCL/6D7EEA3BCB554731E0535B021CACF4F5/backupset/2018_07_18/o1_mf_nnndf_TAG20180718T153842_fny4ftod_.bkp
tag=TAG20180718T153842 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time:
00:00:07
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf
input datafile file number=00005
name=/u01/app/oracle/oradata/orcl/pdbseed/system01.dbf
input datafile file number=00008
name=/u01/app/oracle/oradata/orcl/pdbseed/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 18-JUL-18
channel ORA_DISK_1: finished piece 1 at 18-JUL-18
piece handle=/u01/app/oracle/recovery_area/ORCL/6D7EC6F8CC0F38D1E0535B021CACBA2D/backupset/2018_07_18/o1_mf_nnndf_TAG20180718T153842_fny4g1v7_.bkp
tag=TAG20180718T153842 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time:
00:00:07
Finished backup at 18-JUL-18
Starting backup at 18-JUL-18
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=138 RECID=283
STAMP=981819553
channel ORA_DISK_1: starting piece 1 at 18-JUL-18
channel ORA_DISK_1: finished piece 1 at 18-JUL-18
piece handle=/u01/app/oracle/recovery_area/ORCL/backupset/2018_07_18/o1_mf_annnn_TAG20180718T153913_fny4g9lp_.bkp
tag=TAG20180718T153913 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time:
00:00:01
Finished backup at 18-JUL-18
Starting Control File and SPFILE Autobackup at 18-JUL-18
piece handle=/u01/app/oracle/recovery_area/ORCL/autobackup/2018_07_18/o1_mf_s_981819554_fny4gc9l_.bkp
comment=NONE
Finished Control File and SPFILE Autobackup at 18-JUL-18
RMAN>
Step 7: Add standby redo log files for standby
databases.
On Primary:
SQL> set lines 300 pages 3000
SQL> col member for a67
SQL> select * from v$logfile;
GROUP# STATUS TYPE
MEMBER IS_
CON_ID
---------- ------- -------
------------------------------------------------------------------- ---
----------
3 ONLINE
/u01/app/oracle/oradata/orcl/redo03.log NO 0
2 ONLINE
/u01/app/oracle/oradata/orcl/redo02.log NO 0
1 ONLINE
/u01/app/oracle/oradata/orcl/redo01.log NO 0
SQL> select * from v$log;
GROUP# THREAD#
SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM
NEXT_CHANGE# NEXT_TIME CON_ID
---------- ---------- ---------- ---------- ----------
---------- --- ---------------- ------------- --------- ------------ ---------
----------
1 1 139
209715200 512 1
NO CURRENT 2582639
18-JUL-18 1.8447E+19 0
2 1 137
209715200 512 1
YES INACTIVE 2579526 18-JUL-18 2582549 18-JUL-18
0
3 1 138
209715200 512 1
YES INACTIVE 2582549 18-JUL-18 2582639 18-JUL-18 0
SQL> alter database add standby logfile group 4
'/u01/app/oracle/oradata/orcl/redo04.log' size 200m;
Database altered.
SQL> alter database add standby logfile group 5
'/u01/app/oracle/oradata/orcl/redo05.log' size 200m;
Database altered.
SQL> alter database add standby logfile group 6
'/u01/app/oracle/oradata/orcl/redo06.log' size 200m;
Database altered.
SQL> alter database add standby logfile group 7
'/u01/app/oracle/oradata/orcl/redo07.log' size 200m;
Database altered.
SQL> select * from v$logfile;
GROUP# STATUS TYPE
MEMBER IS_
CON_ID
---------- ------- ------- -------------------------------------------------------------------
--- ----------
3 ONLINE
/u01/app/oracle/oradata/orcl/redo03.log NO 0
2 ONLINE
/u01/app/oracle/oradata/orcl/redo02.log NO 0
1 ONLINE
/u01/app/oracle/oradata/orcl/redo01.log NO 0
4 STANDBY
/u01/app/oracle/oradata/orcl/redo04.log NO 0
5 STANDBY
/u01/app/oracle/oradata/orcl/redo05.log NO 0
6 STANDBY
/u01/app/oracle/oradata/orcl/redo06.log NO 0
7 STANDBY
/u01/app/oracle/oradata/orcl/redo07.log NO 0
7 rows selected.
Step 8: Create
standby controlfile for standby database.
On Primary:
SQL> alter database create standby controlfile as
'/u01/app/oracle/product/12.2.0/dbhome_1/dbs/stand.ctl';
Database altered.
SQL> !ls -ltr
/u01/app/oracle/product/12.2.0/dbhome_1/dbs/stand.ctl
-rw-r----- 1 oracle oinstall 20824064 Jul 18 15:56
/u01/app/oracle/product/12.2.0/dbhome_1/dbs/stand.ctl
Step 9: Copy below
files from primary to standby dbs.
- Standby Pfile
- Standby controlfile
- Password file
- Backup pieces
[oracle@test dbs]$ hostname
test.localdomain
[oracle@test dbs]$ id
uid=1001(oracle) gid=1002(oinstall) groups=1002(oinstall),1003(dba)
[oracle@test dbs]$ scp standinitorcl.ora
oracle@clone.localdomain:/u02/app/oracle/product/12.2.0/dbhome_1/dbs/
oracle@clone.localdomain's password:
standinitorcl.ora
100%
1565 1.3MB/s 00:00
[oracle@test dbs]$ scp stand.ctl
oracle@clone.localdomain:/u02/app/oracle/product/12.2.0/dbhome_1/dbs/
oracle@clone.localdomain's password:
stand.ctl 100% 20MB
50.1MB/s 00:00
[oracle@test dbs]$ scp orapworcl
oracle@clone.localdomain:/u02/app/oracle/product/12.2.0/dbhome_1/dbs/
oracle@clone.localdomain's password:
orapworcl
100% 2048 1.6MB/s 00:00
[oracle@test dbs]$ scp
/u01/app/oracle/recovery_area/ORCL/backupset/2018_07_18/o1_mf_annnn_TAG20180718T153835_fny4f4k3_.bkp
oracle@clone.localdomain:/u02/app/oracle/product/12.2.0/dbhome_1/dbs
oracle@clone.localdomain's password:
o1_mf_annnn_TAG20180718T153835_fny4f4k3_.bkp
100% 149MB 37.3MB/s
00:04
[oracle@test dbs]$
scp
/u01/app/oracle/recovery_area/ORCL/backupset/2018_07_18/o1_mf_annnn_TAG20180718T153835_fny4f7yv_.bkp
oracle@clone.localdomain:/u02/app/oracle/product/12.2.0/dbhome_1/dbs
oracle@clone.localdomain's password:
o1_mf_annnn_TAG20180718T153835_fny4f7yv_.bkp
100% 72MB 24.2MB/s
00:02
[oracle@test dbs]$
scp /u01/app/oracle/recovery_area/ORCL/backupset/2018_07_18/o1_mf_annnn_TAG20180718T153835_fny4f9dw_.bkp
oracle@clone.localdomain:/u02/app/oracle/product/12.2.0/dbhome_1/dbs
oracle@clone.localdomain's password:
o1_mf_annnn_TAG20180718T153835_fny4f9dw_.bkp
100% 26MB
28.7MB/s 00:00
[oracle@test dbs]$
scp
/u01/app/oracle/recovery_area/ORCL/backupset/2018_07_18/o1_mf_nnndf_TAG20180718T153842_fny4fcc7_.bkp
oracle@clone.localdomain:/u02/app/oracle/product/12.2.0/dbhome_1/dbs
oracle@clone.localdomain's password:
o1_mf_nnndf_TAG20180718T153842_fny4fcc7_.bkp
100% 1197MB 34.2MB/s 00:35
[oracle@test dbs]$
scp /u01/app/oracle/recovery_area/ORCL/6D7EEA3BCB554731E0535B021CACF4F5/backupset/2018_07_18/o1_mf_nnndf_TAG20180718T153842_fny4ftod_.bkp
oracle@clone.localdomain:/u02/app/oracle/product/12.2.0/dbhome_1/dbs
oracle@clone.localdomain's password:
o1_mf_nnndf_TAG20180718T153842_fny4ftod_.bkp 100% 613MB
31.8MB/s 00:19
[oracle@test dbs]$
scp
/u01/app/oracle/recovery_area/ORCL/6D7EC6F8CC0F38D1E0535B021CACBA2D/backupset/2018_07_18/o1_mf_nnndf_TAG20180718T153842_fny4g1v7_.bkp oracle@clone.localdomain:/u02/app/oracle/product/12.2.0/dbhome_1/dbs
oracle@clone.localdomain's password:
o1_mf_nnndf_TAG20180718T153842_fny4g1v7_.bkp
100% 608MB 32.0MB/s
00:18
[oracle@test dbs]$
scp
/u01/app/oracle/recovery_area/ORCL/backupset/2018_07_18/o1_mf_annnn_TAG20180718T153913_fny4g9lp_.bkp
oracle@clone.localdomain:/u02/app/oracle/product/12.2.0/dbhome_1/dbs
oracle@clone.localdomain's password:
o1_mf_annnn_TAG20180718T153913_fny4g9lp_.bkp
100% 23KB 6.1MB/s
00:00
[oracle@test dbs]$
scp
/u01/app/oracle/recovery_area/ORCL/autobackup/2018_07_18/o1_mf_s_981819554_fny4gc9l_.bkp oracle@clone.localdomain:/u02/app/oracle/product/12.2.0/dbhome_1/dbs
oracle@clone.localdomain's password:
o1_mf_s_981819554_fny4gc9l_.bkp
100% 20MB 42.1MB/s
00:00
[oracle@test dbs]$
scp /u01/app/oracle/recovery_area/ORCL/autobackup/2018_07_18/o1_mf_s_981821010_fny5vvjz_.bkp
oracle@clone.localdomain:/u02/app/oracle/product/12.2.0/dbhome_1/dbs
oracle@clone.localdomain's password:
o1_mf_s_981821010_fny5vvjz_.bkp
100% 20MB 34.3MB/s
00:00
Check all files are
sent to standby server:
[oracle@clone dbs]$ id
uid=1001(oracle) gid=1002(oinstall)
groups=1002(oinstall),1003(dba)
[oracle@clone dbs]$
[oracle@clone dbs]$ pwd
/u02/app/oracle/product/12.2.0/dbhome_1/dbs
[oracle@clone dbs]$
[oracle@clone dbs]$
[oracle@clone dbs]$ ls -ltr
total 2788684
-rwxr-xr-x 1 oracle oinstall 3079 May 15 2015 init.ora
-rw-r----- 1 oracle oinstall 1536 Jun 14 11:35 orapwclone
-rwxr-xr-x 1 oracle oinstall 1544 Jul 17 11:58 hc_clone.dat
-rw-r----- 1 oracle oinstall 2048 Jul 17 21:29 orapwDB01
-rw-r----- 1 oracle oinstall 2048 Jul 17 23:56 bkp_orapworcl
-rw-r--r-- 1 oracle oinstall 1565 Jul 18 13:31 initorcl.ora
-rw-rw---- 1 oracle oinstall 1544 Jul 18 15:20 hc_orcl.dat
-rw-r--r-- 1 oracle oinstall 1565 Jul 18 16:06 standinitorcl.ora
-rw-r----- 1 oracle oinstall 20824064 Jul 18 16:07 stand.ctl
-rw-r----- 1 oracle oinstall 2048 Jul 18 16:08 orapworcl
-rw-r----- 1 oracle oinstall
156310528 Jul 18 16:10 o1_mf_annnn_TAG20180718T153835_fny4f4k3_.bkp
-rw-r----- 1 oracle oinstall 75032064 Jul 18 16:11
o1_mf_annnn_TAG20180718T153835_fny4f7yv_.bkp
-rw-r----- 1 oracle oinstall 26865152 Jul 18 17:02
o1_mf_annnn_TAG20180718T153835_fny4f9dw_.bkp
-rw-r----- 1 oracle oinstall 1254711296 Jul 18 17:03
o1_mf_nnndf_TAG20180718T153842_fny4fcc7_.bkp
-rw-r----- 1 oracle oinstall
642883584 Jul 18 17:04 o1_mf_nnndf_TAG20180718T153842_fny4ftod_.bkp
-rw-r----- 1 oracle oinstall
637075456 Jul 18 17:05 o1_mf_nnndf_TAG20180718T153842_fny4g1v7_.bkp
-rw-r----- 1 oracle oinstall 23040 Jul 18 17:05
o1_mf_annnn_TAG20180718T153913_fny4g9lp_.bkp
-rw-r----- 1 oracle oinstall 20922368 Jul 18 17:05
o1_mf_s_981819554_fny4gc9l_.bkp
-rw-r----- 1 oracle oinstall 20922368 Jul 18 17:06
o1_mf_s_981821010_fny5vvjz_.bkp
[oracle@clone dbs]$
Step 10: Start
standby db in nomount stage and restore standby controlfile.
[oracle@clone dbs]$ mv standinitorcl.ora initorcl.ora
[oracle@clone dbs]$ id
uid=1001(oracle) gid=1002(oinstall)
groups=1002(oinstall),1003(dba)
[oracle@clone dbs]$
hostname
clone.localdomain
[oracle@clone dbs]$
pwd
/u02/app/oracle/product/12.2.0/dbhome_1/dbs
[oracle@clone dbs]$
ls -ltr initorcl.ora
-rw-r--r-- 1 oracle oinstall 1565 Jul 18 16:06 initorcl.ora
[oracle@clone dbs]$
sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Wed Jul 18
17:11:32 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount pfile='/u02/app/oracle/product/12.2.0/dbhome_1/dbs/initorcl.ora';
ORACLE instance started.
Total System Global Area
734003200 bytes
Fixed Size 8797104 bytes
Variable Size 360711248 bytes
Database Buffers 150994944 bytes
Redo Buffers 3784704 bytes
In-Memory Area 209715200 bytes
SQL>
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition
Release 12.2.0.1.0 - 64bit Production
[oracle@clone dbs]$
Standby Controlfile
Restoration:
[oracle@clone dbs]$ rman target /
Recovery Manager: Release 12.2.0.1.0 - Production on Wed Jul
18 17:12:37 2018
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (not mounted)
RMAN> restore
standby controlfile from
'/u02/app/oracle/product/12.2.0/dbhome_1/dbs/stand.ctl';
Starting restore at 18-JUL-18
using target database control file instead of recovery
catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=35 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=/u01/app/oracle/oradata/orcl/control01.ctl
output file
name=/u01/app/oracle/recovery_area/orcl/control02.ctl
Finished restore at 18-JUL-18
RMAN>
RMAN> alter database mount standby database;
Statement processed
released channel: ORA_DISK_1
RMAN>
RMAN>
RMAN> select
name,db_unique_name,database_role,open_mode,controlfile_type from v$database;
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE
CONTROL
---------
------------------------------ ---------------- -------------------- -------
ORCL orcl2 PHYSICAL STANDBY
MOUNTED STANDBY
Catalog backup pieces:
RMAN> catalog start with
'/u02/app/oracle/product/12.2.0/dbhome_1/dbs/';
Starting implicit crosscheck backup at 18-JUL-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=43 device type=DISK
Crosschecked 8 objects
Finished implicit crosscheck backup at 18-JUL-18
Starting implicit crosscheck copy at 18-JUL-18
using channel ORA_DISK_1
Crosschecked 4 objects
Finished implicit crosscheck copy at 18-JUL-18
searching for all files in the recovery area
cataloging files...
no files cataloged
searching for all files that match the pattern
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/
List of Files Unknown to the Database
=====================================
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/init.ora
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/orapwclone
File Name: /u02/app/oracle/product/12.2.0/dbhome_1/dbs/hc_clone.dat
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/hc_orcl.dat
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/orapwDB01
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/stand.ctl
File Name: /u02/app/oracle/product/12.2.0/dbhome_1/dbs/bkp_orapworcl
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/orapworcl
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_annnn_TAG20180718T153835_fny4f4k3_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_annnn_TAG20180718T153835_fny4f7yv_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_annnn_TAG20180718T153835_fny4f9dw_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_nnndf_TAG20180718T153842_fny4fcc7_.bkp
File Name: /u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_nnndf_TAG20180718T153842_fny4ftod_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_nnndf_TAG20180718T153842_fny4g1v7_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_annnn_TAG20180718T153913_fny4g9lp_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_s_981819554_fny4gc9l_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_s_981821010_fny5vvjz_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/initorcl.ora
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/lkORCL2
Do you really want to catalog the above files (enter YES or
NO)? YES
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u02/app/oracle/product/12.2.0/dbhome_1/dbs/stand.ctl
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_annnn_TAG20180718T153835_fny4f4k3_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_annnn_TAG20180718T153835_fny4f7yv_.bkp
File Name: /u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_annnn_TAG20180718T153835_fny4f9dw_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_nnndf_TAG20180718T153842_fny4fcc7_.bkp
File Name: /u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_nnndf_TAG20180718T153842_fny4ftod_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_nnndf_TAG20180718T153842_fny4g1v7_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_annnn_TAG20180718T153913_fny4g9lp_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_s_981819554_fny4gc9l_.bkp
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_s_981821010_fny5vvjz_.bkp
List of Files Which Were Not Cataloged
=======================================
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/init.ora
RMAN-07517: Reason:
The file header is corrupted
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/orapwclone
RMAN-07518: Reason:
Foreign database file DBID: 0 Database
Name:
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/hc_clone.dat
RMAN-07517: Reason:
The file header is corrupted
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/hc_orcl.dat
RMAN-07517: Reason:
The file header is corrupted
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/orapwDB01
RMAN-07518: Reason:
Foreign database file DBID: 0 Database
Name:
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/bkp_orapworcl
RMAN-07518: Reason:
Foreign database file DBID: 0 Database
Name:
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/orapworcl
RMAN-07518: Reason:
Foreign database file DBID: 0 Database
Name:
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/initorcl.ora
RMAN-07517: Reason:
The file header is corrupted
File Name:
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/lkORCL2
RMAN-07517: Reason:
The file header is corrupted
RMAN>
You can verify backup pieces using below command:
RMAN> list backup;
List of Backup Sets
===================
…..
….
…..
Step 11: Restore
database and recover database.
RMAN> run
{
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
allocate channel ch3 device type disk;
restore database;
recover database;
}
2> 3> 4> 5> 6> 7> 8> 9> 10>
11> 12> 13> 14> 15>
released channel: ORA_DISK_1
allocated channel: ch1
channel ch1: SID=43 device type=DISK
allocated channel: ch2
channel ch2: SID=47 device type=DISK
allocated channel: ch3
channel ch3: SID=48 device type=DISK
Starting restore at 18-JUL-18
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup
set
channel ch1: restoring datafile 00001 to
/u01/app/oracle/oradata/orcl/system01.dbf
channel ch1: restoring datafile 00003 to /u01/app/oracle/oradata/orcl/sysaux01.dbf
channel ch1: restoring datafile 00004 to
/u01/app/oracle/oradata/orcl/undotbs01.dbf
channel ch1: restoring datafile 00007 to
/u01/app/oracle/oradata/orcl/users01.dbf
channel ch1: restoring datafile 00013 to /u01/app/oracle/oradata/orcl/test01.dbf
channel ch1: reading from backup piece
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_nnndf_TAG20180718T153842_fny4fcc7_.bkp
channel ch2: starting datafile backup set restore
channel ch2: specifying datafile(s) to restore from backup
set
channel ch2: restoring datafile 00009 to
/u01/app/oracle/oradata/orcl/orclpdb/system01.dbf
channel ch2: restoring datafile 00010 to
/u01/app/oracle/oradata/orcl/orclpdb/sysaux01.dbf
channel ch2: restoring datafile 00011 to
/u01/app/oracle/oradata/orcl/orclpdb/undotbs01.dbf
channel ch2: restoring datafile 00012 to
/u01/app/oracle/oradata/orcl/orclpdb/users01.dbf
channel ch2: reading from backup piece
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_nnndf_TAG20180718T153842_fny4ftod_.bkp
channel ch3: starting datafile backup set restore
channel ch3: specifying datafile(s) to restore from backup
set
channel ch3: restoring datafile 00005 to
/u01/app/oracle/oradata/orcl/pdbseed/system01.dbf
channel ch3: restoring datafile 00006 to /u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf
channel ch3: restoring datafile 00008 to
/u01/app/oracle/oradata/orcl/pdbseed/undotbs01.dbf
channel ch3: reading from backup piece
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_nnndf_TAG20180718T153842_fny4g1v7_.bkp
channel ch1: piece
handle=/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_nnndf_TAG20180718T153842_fny4fcc7_.bkp
tag=TAG20180718T153842
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:25
channel ch2: piece handle=/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_nnndf_TAG20180718T153842_fny4ftod_.bkp
tag=TAG20180718T153842
channel ch2: restored backup piece 1
channel ch2: restore complete, elapsed time: 00:00:25
channel ch3: piece handle=/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_nnndf_TAG20180718T153842_fny4g1v7_.bkp
tag=TAG20180718T153842
channel ch3: restored backup piece 1
channel ch3: restore complete, elapsed time: 00:00:25
Finished restore at 18-JUL-18
Starting recover at 18-JUL-18
starting media recovery
archived log for thread 1 with sequence 139 is already on
disk as file /u01/app/oracle/recovery_area/1_139_977586410.dbf
channel ch1: starting archived log restore to default
destination
channel ch1: restoring archived log
archived log thread=1 sequence=138
channel ch1: reading from backup piece
/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_annnn_TAG20180718T153913_fny4g9lp_.bkp
channel ch1: piece
handle=/u02/app/oracle/product/12.2.0/dbhome_1/dbs/o1_mf_annnn_TAG20180718T153913_fny4g9lp_.bkp
tag=TAG20180718T153913
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:01
archived log file
name=/u01/app/oracle/recovery_area/1_138_977586410.dbf thread=1 sequence=138
archived log file name=/u01/app/oracle/recovery_area/1_139_977586410.dbf
thread=1 sequence=139
media recovery complete, elapsed time: 00:00:02
Finished recover at 18-JUL-18
released channel: ch1
released channel: ch2
released channel: ch3
RMAN>
Step 12: Perform
post-check
Primary:
SQL> set lines 300 pages 3000
SQL> select
name,db_unique_name,database_role,open_mode,controlfile_type from v$database;
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE CONTROL
--------- ------------------------------ ----------------
-------------------- -------
ORCL orcl
PRIMARY READ WRITE CURRENT
SQL>
SQL> alter system set log_archive_dest_state_2=defer;
System altered.
SQL> alter system set log_archive_dest_state_2=enable;
System altered.
SQL> alter system switch logfile;
/
/
/
System altered.
SQL>
System altered.
SQL>
System altered.
SQL>
System altered.
SQL>
SQL>
SQL>
SQL> select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
146
On Standby:
SQL> set lines 300 pages 3000
SQL> select name,db_unique_name,database_role,open_mode,controlfile_type
from v$database;
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE CONTROL
--------- ------------------------------ ----------------
-------------------- -------
ORCL orcl2 PHYSICAL STANDBY MOUNTED
STANDBY
SQL> select max(sequence#) from v$archived_log where
applied='YES';
MAX(SEQUENCE#)
--------------
146
SQL> select process,status from v$managed_standby;
PROCESS STATUS
--------- ------------
DGRD ALLOCATED
ARCH CONNECTED
DGRD ALLOCATED
ARCH CONNECTED
ARCH CONNECTED
ARCH CONNECTED
RFS IDLE
RFS IDLE
RFS IDLE
RFS IDLE
MRP0 WAIT_FOR_LOG
11 rows selected.
You will get multiple error in standby alert log files but
both are in sync.
2018-07-18T17:34:58.632507+05:30
Errors in file
/u02/app/oracle/diag/rdbms/orcl2/orcl/trace/orcl_rfs_13846.trc:
ORA-19527: physical
standby redo log must be renamed
ORA-00312: online log 4 thread 0:
'/u01/app/oracle/oradata/orcl/redo04.log'
2018-07-18T17:34:58.632646+05:30
Errors in file
/u02/app/oracle/diag/rdbms/orcl2/orcl/trace/orcl_rfs_13846.trc:
ORA-19527: physical
standby redo log must be renamed
ORA-00312: online log 5 thread 0:
'/u01/app/oracle/oradata/orcl/redo05.log'
2018-07-18T17:34:58.632762+05:30
Errors in file
/u02/app/oracle/diag/rdbms/orcl2/orcl/trace/orcl_rfs_13846.trc:
ORA-19527: physical
standby redo log must be renamed
ORA-00312: online log 6 thread 0:
'/u01/app/oracle/oradata/orcl/redo06.log'
2018-07-18T17:34:58.632873+05:30
Errors in file
/u02/app/oracle/diag/rdbms/orcl2/orcl/trace/orcl_rfs_13846.trc:
ORA-19527: physical
standby redo log must be renamed
ORA-00312: online log 7 thread 0:
'/u01/app/oracle/oradata/orcl/redo07.log'
RFS[2]: Assigned to RFS process (PID:13846)
RFS[2]: No standby redo logfiles created for T-1
RFS[2]: Opened log for T-1.S-148 dbid 1505367143 branch
977586410
ORA-19527:
Physical Standby Redo Log Must be renamed
Solution:
1.
Since the File Structure is the same on the Primary and Standby Database, first
try to set the log_file_name_convert to a dummy Value as it was not set in
both, errors will not be appeared after some time.
On Primary:
SQL>
ALTER SYSTEM SET log_file_name_convert='dummy','dummy';
SQL>
shut immediate;
SQL>
startup;
On Standby:
SQL>
ALTER SYSTEM SET log_file_name_convert='dummy','dummy';
SQL>
shut immediate;
SQL>
startup;
Standby Alert log snap:
2018-07-18T17:44:05.987888+05:30
Serial
Media Recovery started
Managed
Standby Recovery starting Real Time Apply
2018-07-18T17:44:06.217137+05:30
Media
Recovery Log /u01/app/oracle/recovery_area/1_147_977586410.dbf
2018-07-18T17:44:06.314360+05:30
Media
Recovery Log /u01/app/oracle/recovery_area/1_148_977586410.dbf
2018-07-18T17:44:06.514762+05:30
Media
Recovery Log /u01/app/oracle/recovery_area/1_149_977586410.dbf
2018-07-18T17:44:06.904807+05:30
Media
Recovery Log /u01/app/oracle/recovery_area/1_150_977586410.dbf
2018-07-18T17:44:06.963539+05:30
Media
Recovery Log /u01/app/oracle/recovery_area/1_151_977586410.dbf
2018-07-18T17:44:06.984976+05:30
You have successfully configured physical standby database manually without any duplicate method.
Thanks for reading this post ! Please comment if you like this post !
Thank you rupesh sir, its very useful for junior DBA's
ReplyDeleteThank u rupesh sir ,its very usefull..
ReplyDelete