Oracle 19c | Data Guard |Disaster Recovery Creation Steps| Oracle 19c DG Step by Step Configuration|
Hello All,
In this video, I am coming up with Oracle 19c Data Guard Configuration step by step with Demonstration.
Oracle Data Guard is a high availability model which prevent downtime and data loss by using redundant system and software to eliminate single point of failure.
Step 1:
------
Lab Environment for this practice:
----------------------------------
Primary Environment:
--------------------
DB_NAME : SRCDB2
DB_UNIQUE_NAME : SRCDB2
SERVER NAME : SRLABPRMY.LOCALDOMAIN
SERVER IP : 192.168.58.201
DATABASE VERSION: 19.3.0.0
OS : Oracle Enterprise Linux 7.5
ORACLE PORT : 1522
Standby Environment:
-------------------
DB_NAME : SRCDB2
DB_UNIQUE_NAME : SRCDB2SBY
SERVER NAME : SRLABSBY.LOCALDOMAIN
SERVER IP : 192.168.58.202
DATABASE VERSION: 19.3.0.0
OS : Oracle Enterprise Linux 7.5
ORACLE PORT : 1522
After configuring OS-level settings now we need to configure database level parameters to configure oracle 19c data guard.
Step 2:
------
Action on Primary Server:
-------------------------
1. Make sure the primary database running in archive log mode.
Check Archive mode using the below queries.
SQL> archive log list
or
SQL> select log_mode from v$database;
If your database is not running in archive log then follow the below steps.
SQL> shut immediate
SQL> startup mount
SQL> alter database archivelog;
SQL> alter database open;
Step 3:
-------
Enable force logging.
Check force logging enabled or not?
SQL> select force_logging from v$database;
If it showing "NO", then change force logging mode using below command.
SQL> ALTER DATABASE FORCE LOGGING;
Step 4:
-------
Enable Flashback Database
SQL> select flashback_on from v$database;
If not enabled,
SQL> alter database flashback on;
Step 5:
-------
Change below dynamic parameters for Data Guard configuration.
SQL> alter system set log_archive_config='DG_CONFIG=(SRCDB2,SRCDB2SBY)' scope=both;
SQL> alter system set log_archive_dest_2='service=SRCDB2SBY noaffirm async valid_for=(online_logfiles,primary_role) db_unique_name=SRCDB2SBY' scope=both;
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE scope=both;
SQL> ALTER SYSTEM SET FAL_SERVER=SRCDB2SBY;
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO;
Step 6:
-------
Set parameter REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE and you can set archive formats this is optional.
SQL> ALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE SCOPE=SPFILE;
SQL> ALTER SYSTEM SET LOG_ARCHIVE_FORMAT='%t_%s_%r.arc' SCOPE=SPFILE; (By default)
Step 7:
-------
Create a STANDBY redo log file on PRIMARY as well using the following query.
SQL> select member from v$logfile;
SQL> select group#,bytes/1024/1024 from v$log;
alter database add standby logfile ('/u02/oradata/SRCDB2/sredo04.log') size 200m;
alter database add standby logfile ('/u02/oradata/SRCDB2/sredo05.log') size 200m;
alter database add standby logfile ('/u02/oradata/SRCDB2/sredo06.log') size 200m;
alter database add standby logfile ('/u02/oradata/SRCDB2/sredo07.log') size 200m;
Step 8:
-------
Now take restart your primary database after that we need to create listeners and TNS services on both sides (primary & standby).
The Listener.ora file looks like this on primary for standby just change the SRCDB2 into SRCDB2SBY and IP Address.
# listener.ora Network Configuration File: /u01/app/oracle/product/19.0.0.0/db_3/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = SRCDB2)
(ORACLE_HOME = /u01/app/oracle/product/19.0.0.0/db_3 )
(SID_NAME = SRCDB2)
)
)
LISTENER_SRCDB2 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.201)(PORT = 1522))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
)
)
ADR_BASE_LISTENER = /u01/app/oracle/product/19.0.0.0/db_3 /home/oracle/log
Step 9:
-------
Your tnsname.ora file looks like this check below on both sides. You can copy it from production or recreate it on standby.
[oracle@srlabprmy admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.0.0.0/db_3/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
#Primary
SRCDB2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.201)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SRCDB2)
)
)
SRCDB2SBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SRCDB2SBY)
)
)
LISTENER_SRCDB2 =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.201)(PORT = 1522))
#Standby
SRCDB2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.201)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SRCDB2)
)
)
SRCDB2SBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SRCDB2)
)
)
LISTENER =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522))
Step 10:
--------
Start listener and check TNS ping using both services on both sides.
Primary Site:
-------------
[oracle@srlabprmy admin]$ hostname
srlabprmy.localdomain
[oracle@srlabprmy admin]$ env |grep ORA
ORACLE_UNQNAME=SRCDB2
ORACLE_SID=SRCDB2
ORACLE_BASE=/u01/app/oracle
ORACLE_HOSTNAME=srlabprmy.localdomain
ORA_INVENTORY=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/db_3
Start Listener and do tnsping from Primary Site:
[oracle@srlabprmy admin]$ lsnrctl start LISTENER_SRCDB2
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 31-JUL-2020 22:47:11
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Starting /u01/app/oracle/product/19.0.0.0/db_3/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.0.0.0/db_3/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/srlabprmy/listener_srcdb2/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.58.201)(PORT=1522)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.58.201)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SRCDB2
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 31-JUL-2020 22:47:13
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.0.0.0/db_3/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/srlabprmy/listener_srcdb2/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.58.201)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
The listener supports no services
The command completed successfully
[oracle@srlabprmy admin]$
[oracle@srlabprmy admin]$
[oracle@srlabprmy admin]$ ps -ef |grep tns
root 19 2 0 21:31 ? 00:00:00 [netns]
oracle 7894 1 1 22:47 ? 00:00:00 /u01/app/oracle/product/19.0.0.0/db_3/bin/tnslsnr LISTENER_SRCDB2 -inherit
oracle 7902 4766 0 22:47 pts/0 00:00:00 grep --color=auto tns
[oracle@srlabprmy admin]$ tnsping SRCDB2SBY
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 31-JUL-2020 22:47:28
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0.0/db_3/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SRCDB2SBY)))
OK (0 msec)
Standby Site:
-------------
[oracle@srlabsby srcdb2]$ hostname
srlabsby.localdomain
[oracle@srlabsby srcdb2]$
[oracle@srlabsby srcdb2]$ env |grep ORA
ORACLE_UNQNAME=SRCDB02SBY
ORACLE_SID=SRCDB2
ORACLE_BASE=/u01/app/oracle
ORACLE_HOSTNAME=srlabsby.localdomain
ORA_INVENTORY=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/db_3
Start Listener and do tnsping from Standby Site:
[oracle@srlabsby admin]$ lsnrctl start listener
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 31-JUL-2020 23:21:06
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Starting /u01/app/oracle/product/19.0.0.0/db_3/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.0.0.0/db_3/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/19.0.0.0/db_3/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.58.202)(PORT=1522)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.58.202)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias listener
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 31-JUL-2020 23:21:09
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.0.0.0/db_3/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/19.0.0.0/db_3/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.58.202)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
Services Summary...
Service "SRCDB2" has 1 instance(s).
Instance "SRCDB2", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@srlabsby admin]$
[oracle@srlabsby admin]$ tnsping SRCDB2SBY
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 31-JUL-2020 23:21:19
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0.0/db_3/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SRCDB2)))
OK (0 msec)
[oracle@srlabsby admin]$ tnsping SRCDB2
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 31-JUL-2020 23:21:51
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0.0/db_3/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.201)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SRCDB2)))
OK (10 msec)
[oracle@srlabprmy admin]$ tnsping SRCDB2
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 31-JUL-2020 23:20:00
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0.0/db_3/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.201)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SRCDB2)))
OK (10 msec)
[oracle@srlabprmy admin]$ tnsping SRCDB2SBY
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 31-JUL-2020 23:21:25
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0.0/db_3/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SRCDB2)))
OK (10 msec)
[oracle@srlabprmy admin]$ ps -ef |grep pmon
oracle 8482 1 0 22:56 ? 00:00:00 ora_pmon_SRCDB2
oracle 10533 4766 0 23:24 pts/0 00:00:00 grep --color=auto pmon
[oracle@srlabprmy admin]$ ps -ef |grep tns
root 19 2 0 21:31 ? 00:00:00 [netns]
oracle 7894 1 0 22:47 ? 00:00:00 /u01/app/oracle/product/19.0.0.0/db_3/bin/tnslsnr LISTENER_SRCDB2 -inherit
oracle 10537 4766 0 23:24 pts/0 00:00:00 grep --color=auto tns
[oracle@srlabsby admin]$ ps -ef |grep tns
root 19 2 0 21:31 ? 00:00:00 [netns]
oracle 9574 1 0 23:21 ? 00:00:00 /u01/app/oracle/product/19.0.0.0/db_3/bin/tnslsnr listener -inherit
oracle 9728 2568 0 23:23 pts/0 00:00:00 grep --color=auto tns
[oracle@srlabsby admin]$
[oracle@srlabsby admin]$ ps -ef |grep pmon
oracle 8690 1 0 23:08 ? 00:00:00 ora_pmon_SRCDB2
oracle 9733 2568 0 23:23 pts/0 00:00:00 grep --color=auto pmon
Step 11:
--------
Standby side:
Create password file and pfile from spfile on production and move it on standby.
select * from v$pwfile_users;
orapwd file=$ORACLE_HOME/dbs/orapwSRCDB2 entries=10 force=y
In my case I am creating pfile the same SID of Primary database name
[oracle@srlabsby dbs]$ vi initSRCDB2SBY.ora
[oracle@srlabsby dbs]$ cat initSRCDB2SBY.ora
db_name='SRCDB2'
SQL> startup nomount pfile='/u01/app/oracle/product/19.0.0.0/db_3/dbs/initSRCDB2SBY.ora';
If everything is running ok then start the replication using RMAN Duplicate which makes a full clone of production.
[oracle@srlabprmy admin]$ rman
Recovery Manager: Release 19.0.0.0.0 - Production on Fri Jul 31 23:24:21 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
RMAN> connect target sys/ora$db12@SRCDB2;
RMAN> connect auxiliary sys/ora$db12@SRCDB2SBY;
Action on Standby Server:
-------------------------
Step 12:
--------
Connect with the host or open a new terminal and run the following command.
[oracle@srlabsby admin]$ rman
RMAN> connect target sys/ora$db12@SRCDB2;
RMAN> connect auxiliary sys/ora$db12@SRCDB2SBY;
RMAN> DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE DORECOVER SPFILE SET db_unique_name='SRCDB2SBY' COMMENT 'Is Standby' NOFILENAMECHECK;
Step 13:
-------
Create the standby redo logs on standby site.
SELECT group#, type, member FROM v$logfile WHERE type = 'STANDBY' order by group#;
alter database add standby logfile ('/u02/oradata/SRCDB2/sredo04.log') size 200m;
alter database add standby logfile ('/u02/oradata/SRCDB2/sredo05.log') size 200m;
alter database add standby logfile ('/u02/oradata/SRCDB2/sredo06.log') size 200m;
alter database add standby logfile ('/u02/oradata/SRCDB2/sredo07.log') size 200m;
Step 14:
--------
Once the above duplicate finished then you can start the MRP process.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
Primary Site:
-------------
SQL> alter system set log_archive_dest_state_2='DEFER';
System altered.
SQL> alter system set log_archive_dest_state_2='ENABLE';
SQL> alter system switch logfile;
SQL> alter system set redo_transport_user='C##DBIDG';
Standby Site:
-------------
Check database role, open mode and database name using the following query.
SQL> select name,database_role,open_mode from v$database;
How to check the MRP process is running or not?
Using the following query you can easily check the MRP process is running or not.
SQL>select sequence#,process,status from v$managed_standby;
How to check which archive applied currently? If not enable the below
SQL> alter system set log_archive_dest_2='service=SRCDB2 noaffirm async valid_for=(online_logfiles,primary_role) db_unique_name=SRCDB2 scope=both';
The following query will show you the details about all applied archive in standby.
SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
After everything goes fine, stop MRP and check the flashback enabled or not. if not enabled, please enable it
SQL> alter database recover managed standby database cancel;
SQL> select flashback_on from v$database;
SQL> alter database flashback on;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
SQL> select sequence#,process,status from v$managed_standby;
Activity Logs (Primary and Standby):
---------------------------------------------
Oracle 19c Data Guard Configuration step by step: Quick update!
The below steps we are going to perform the both the sides.
putting TNS entry for both sides (Primary and Standby)
putting Listener entry on target side and start the listener
do tnsping across the server (Primary TNS service and Standby TNS service)
Primary Database Configuration steps:
-------------------------------------
Check the archive log enabled or not. if not enable it.
check force logging enabled or not. if not enable it.
check flashback enabled or not. if not enable it.
check the log member and log file size
create the standby redo log files on primary side.
Enable all the Dataguard parameters on primary side.
Standby Database Configuration Steps:
-------------------------------------f
create password file on target side
create init.ora paramteter file on target side
startup the database in nomount with init.ora file
connect rman
connect target database
connect auxiliary database
start the duplication from active database for standby
once duplication completes,
need to check the database name, open mode, log mode, database role on standby side.
create standby redo log on standby side
enabe MRP on standby side
check the log apply, if not applied enable the log_archive_dest_2 paramter on standby side
check for log apply, if everything goes fine,
stop MRP, and enable flashback on standby side.
start MRP again and do couple of switches from primary side and check the all the logs are caught up.
Activity Log (both primary and standby):
-------------
Primary side Log:
-----------------
[oracle@srlabprmy dbs]$ ps -ef |grep pmon
oracle 8482 1 0 Jul31 ? 00:00:02 ora_pmon_SRCDB2
oracle 22145 4766 0 02:37 pts/0 00:00:00 grep --color=auto pmon
[oracle@srlabprmy dbs]$ ps -ef |grep tns
root 19 2 0 Jul31 ? 00:00:00 [netns]
oracle 7894 1 0 Jul31 ? 00:00:00 /u01/app/oracle/product/19.0.0.0/db_3/bin/tnslsnr LISTENER_SRCDB2 -inherit
oracle 22167 4766 0 02:37 pts/0 00:00:00 grep --color=auto tns
[oracle@srlabprmy dbs]$ clear
[oracle@srlabprmy dbs]$ env | grep ORA
ORACLE_UNQNAME=SRCDB01
ORACLE_SID=SRCDB2
ORACLE_BASE=/u01/app/oracle
ORACLE_HOSTNAME=srlabprmy.localdomain
ORA_INVENTORY=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/db_3
[oracle@srlabprmy dbs]$
[oracle@srlabprmy dbs]$
[oracle@srlabprmy dbs]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 1 02:43:46 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@srlabprmy dbs]$
[oracle@srlabprmy dbs]$
[oracle@srlabprmy dbs]$ cd ..
[oracle@srlabprmy db_3]$ cd network/admin
[oracle@srlabprmy admin]$ ls -lrt
total 20
-rwxr-xr-x. 1 oracle oinstall 1536 Feb 14 2018 shrept.lst
drwxr-xr-x. 2 oracle oinstall 4096 Apr 17 2019 samples
-rw-r-----. 1 oracle oinstall 200 Jul 19 05:41 sqlnet.ora
-rw-r-----. 1 oracle oinstall 608 Jul 31 23:19 tnsnames.ora
-rw-r-----. 1 oracle oinstall 609 Jul 31 23:19 listener.ora
[oracle@srlabprmy admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.0.0.0/db_3/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
SRCDB2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.201)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SRCDB2)
)
)
SRCDB2SBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SRCDB2)
)
)
LISTENER_SRCDB2 =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.201)(PORT = 1522))
[oracle@srlabprmy admin]$ ps -ef |grep pmon
oracle 8482 1 0 Jul31 ? 00:00:02 ora_pmon_SRCDB2
oracle 22597 4766 0 02:44 pts/0 00:00:00 grep --color=auto pmon
[oracle@srlabprmy admin]$ ps -ef |grep tns
root 19 2 0 Jul31 ? 00:00:00 [netns]
oracle 7894 1 0 Jul31 ? 00:00:00 /u01/app/oracle/product/19.0.0.0/db_3/bin/tnslsnr LISTENER_SRCDB2 -inherit
oracle 22602 4766 0 02:44 pts/0 00:00:00 grep --color=auto tns
[oracle@srlabprmy admin]$ lsnrctl status LISTENER_SRCDB2
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 01-AUG-2020 02:44:58
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.58.201)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SRCDB2
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 31-JUL-2020 22:47:13
Uptime 0 days 3 hr. 57 min. 44 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.0.0.0/db_3/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/srlabprmy/listener_srcdb2/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.58.201)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
Services Summary...
Service "SRCDB2" has 1 instance(s).
Instance "SRCDB2", status READY, has 1 handler(s) for this service...
Service "SRCDB2XDB" has 1 instance(s).
Instance "SRCDB2", status READY, has 1 handler(s) for this service...
Service "aacedf529d752a36e053c93aa8c0c923" has 1 instance(s).
Instance "SRCDB2", status READY, has 1 handler(s) for this service...
Service "srdbplug" has 1 instance(s).
Instance "SRCDB2", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@srlabprmy admin]$ ls -lrt
total 20
-rwxr-xr-x. 1 oracle oinstall 1536 Feb 14 2018 shrept.lst
drwxr-xr-x. 2 oracle oinstall 4096 Apr 17 2019 samples
-rw-r-----. 1 oracle oinstall 200 Jul 19 05:41 sqlnet.ora
-rw-r-----. 1 oracle oinstall 608 Jul 31 23:19 tnsnames.ora
-rw-r-----. 1 oracle oinstall 609 Jul 31 23:19 listener.ora
[oracle@srlabprmy admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.0.0.0/db_3/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
SRCDB2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.201)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SRCDB2)
)
)
SRCDB2SBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SRCDB2)
)
)
LISTENER_SRCDB2 =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.201)(PORT = 1522))
[oracle@srlabprmy admin]$ tnsping SRCDB2SBY
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 01-AUG-2020 02:47:19
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0.0/db_3/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SRCDB2)))
TNS-12541: TNS:no listener
[oracle@srlabprmy admin]$ tnsping SRCDB2SBY
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 01-AUG-2020 02:48:02
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0.0/db_3/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SRCDB2)))
OK (0 msec)
[oracle@srlabprmy admin]$ tnsping SRCDB2SBY -5
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 01-AUG-2020 02:48:10
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0.0/db_3/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SRCDB2)))
OK (0 msec)
[oracle@srlabprmy admin]$ tnsping SRCDB2SBY 5
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 01-AUG-2020 02:48:12
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0.0/db_3/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SRCDB2)))
OK (0 msec)
OK (10 msec)
OK (0 msec)
OK (10 msec)
OK (0 msec)
[oracle@srlabprmy admin]$ hostname
srlabprmy.localdomain
[oracle@srlabprmy admin]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 1 02:49:12 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select * from global_name;
GLOBAL_NAME
-------------------------------------------------------------------------
SRCDB2
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 SRDBPLUG READ WRITE NO
SQL> set lines 300 pages 2000
SQL>
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u02/archive/srcdb2
Oldest online log sequence 19
Next log sequence to archive 21
Current log sequence 21
SQL> select log_mode from v$database;
LOG_MODE
------------
ARCHIVELOG
SQL> select force_logging from v$database
FORCE_LOGGING
---------------------------------------
NO
SQL> alter database force logging;
Database altered.
SQL> select force_logging from v$database;
FORCE_LOGGING
---------------------------------------
YES
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO
SQL> alter database flashback on;
Database altered.
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------------
YES
SQL> show parameter recovery
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u02/fra
db_recovery_file_dest_size big integer 15G
recovery_parallelism integer 0
remote_recovery_file_dest string
SQL>
SQL> select * from v$recovery_area_usage;
FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES CON_ID
----------------------- ------------------ ------------------------- --------------- ----------
CONTROL FILE 0 0 0 0
REDO LOG 0 0 0 0
ARCHIVED LOG 0 0 0 0
BACKUP PIECE .12 0 1 0
IMAGE COPY 0 0 0 0
FLASHBACK LOG 2.6 0 2 0
FOREIGN ARCHIVED LOG 0 0 0 0
AUXILIARY DATAFILE COPY 0 0 0 0
8 rows selected.
SQL>
SQL> show parameter log_archive_config
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_config string
SQL>
SQL> alter system set log_archive_config='DG_CONFIG=(SRCDB2,SRCDB2SBY)' scope=both;
System altered.
SQL> show parameter log_archive_config
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_config string DG_CONFIG=(SRCDB2,SRCDB2SBY)
SQL> show parameter log_archive_dest_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_2 string
log_archive_dest_20 string
log_archive_dest_21 string
log_archive_dest_22 string
log_archive_dest_23 string
log_archive_dest_24 string
log_archive_dest_25 string
log_archive_dest_26 string
log_archive_dest_27 string
log_archive_dest_28 string
log_archive_dest_29 string
SQL> alter system set log_archive_dest_2='service=SRCDB2SBY noaffirm async valid_for=(online_logfiles,primary_role) db_unique_name=SRCDB2SBY' scope=both;
System altered.
SQL> show parameter log_archive_dest_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_2 string service=SRCDB2SBY noaffirm as
ync valid_for=(online_logfiles
,primary_role) db_unique_name=
SRCDB2SBY
log_archive_dest_20 string
log_archive_dest_21 string
log_archive_dest_22 string
log_archive_dest_23 string
log_archive_dest_24 string
log_archive_dest_25 string
log_archive_dest_26 string
log_archive_dest_27 string
log_archive_dest_28 string
log_archive_dest_29 string
SQL> show parameter LOG_ARCHIVE_DEST_STATE_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2 string enable
log_archive_dest_state_20 string enable
log_archive_dest_state_21 string enable
log_archive_dest_state_22 string enable
log_archive_dest_state_23 string enable
log_archive_dest_state_24 string enable
log_archive_dest_state_25 string enable
log_archive_dest_state_26 string enable
log_archive_dest_state_27 string enable
log_archive_dest_state_28 string enable
log_archive_dest_state_29 string enable
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE scope=both;
System altered.
SQL> show parameter LOG_ARCHIVE_DEST_STATE_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2 string ENABLE
log_archive_dest_state_20 string enable
log_archive_dest_state_21 string enable
log_archive_dest_state_22 string enable
log_archive_dest_state_23 string enable
log_archive_dest_state_24 string enable
log_archive_dest_state_25 string enable
log_archive_dest_state_26 string enable
log_archive_dest_state_27 string enable
log_archive_dest_state_28 string enable
log_archive_dest_state_29 string enable
SQL> show parameter standby
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
enabled_PDBs_on_standby string *
standby_db_preserve_states string NONE
standby_file_management string MANUAL
standby_pdb_source_file_dblink string
standby_pdb_source_file_directory string
SQL> alter system set standby_file_management=AUTO;
System altered.
SQL> show parameter standby
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
enabled_PDBs_on_standby string *
standby_db_preserve_states string NONE
standby_file_management string AUTO
standby_pdb_source_file_dblink string
standby_pdb_source_file_directory string
SQL> ALTER SYSTEM SET FAL_SERVER=SRCDB2SBY;
System altered.
SQL> show parameter fal
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
fal_client string
fal_server string SRCDB2SBY
SQL> ALTER SYSTEM SET FAL_CLIENt=SRCDB2;
System altered.
SQL> show parameter fal
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
fal_client string SRCDB2
fal_server string SRCDB2SBY
SQL> show parameter REMOTE_LOGIN_PASSWORDFILE
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string EXCLUSIVE
SQL> show parameter LOG_ARCHIVE_FORMAT
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_format string %t_%s_%r.dbf
SQL> ALTER SYSTEM SET LOG_ARCHIVE_FORMAT='%t_%s_%r.arc' SCOPE=SPFILE;
System altered.
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------------------
/u02/oradata/SRCDB2/redo03.log
/u02/oradata/SRCDB2/redo02.log
/u02/oradata/SRCDB2/redo01.log
SQL> select group#,bytes/1024/1024 from v$log;
GROUP# BYTES/1024/1024
---------- ---------------
1 200
2 200
3 200
SQL> alter database add standby logfile ('/u02/oradata/SRCDB2/sredo04.log') size 200m;
alter database add standby logfile ('/u02/oradata/SRCDB2/sredo05.log') size 200m;
alter database add standby logfile ('/u02/oradata/SRCDB2/sredo06.log') size 200m;
alter database add standby logfile ('/u02/oradata/SRCDB2/sredo07.log') size 200m;
Database altered.
SQL>
Database altered.
SQL>
Database altered.
SQL>
Database altered.
SQL> SQL> SQL> SQL>
SQL>
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------------------------
/u02/oradata/SRCDB2/redo03.log
/u02/oradata/SRCDB2/redo02.log
/u02/oradata/SRCDB2/redo01.log
/u02/oradata/SRCDB2/sredo04.log
/u02/oradata/SRCDB2/sredo05.log
/u02/oradata/SRCDB2/sredo06.log
/u02/oradata/SRCDB2/sredo07.log
7 rows selected.
SQL>
SQL> SELECT group#, type, member FROM v$logfile WHERE type = 'STANDBY' order by group#;
SQL> col member for a45
SQL> /
GROUP# TYPE MEMBER
---------- ------- ---------------------------------------------
4 STANDBY /u02/oradata/SRCDB2/sredo04.log
5 STANDBY /u02/oradata/SRCDB2/sredo05.log
6 STANDBY /u02/oradata/SRCDB2/sredo06.log
7 STANDBY /u02/oradata/SRCDB2/sredo07.log
SQL> alter system switch logfile;
System altered.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u02/archive/srcdb2
Oldest online log sequence 24
Next log sequence to archive 26
Current log sequence 26
SQL> alter system switch logfile;
System altered.
SQL> show parameter fal
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
fal_client string SRCDB2
fal_server string SRCDB2SBY
SQL> alter system switch logfile;
System altered.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u02/archive/srcdb2
Oldest online log sequence 24
Next log sequence to archive 26
Current log sequence 26
SQL> alter system switch logfile;
System altered.
SQL> show parameter fal
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
fal_client string SRCDB2
fal_server string SRCDB2SBY
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u02/archive/srcdb2
Oldest online log sequence 27
Next log sequence to archive 29
Current log sequence 29
SQL>
Standby Log:
------------
[oracle@srlabsby admin]$
[oracle@srlabsby admin]$ ps -ef |grep pmon
oracle 8690 1 0 23:08 ? 00:00:00 ora_pmon_SRCDB2
oracle 9733 2568 0 23:23 pts/0 00:00:00 grep --color=auto pmon
[oracle@srlabsby admin]$ rman
Recovery Manager: Release 19.0.0.0.0 - Production on Fri Jul 31 23:26:27 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
RMAN> connect target sys/ora$db12@SRCDB2;
connected to target database: SRCDB2 (DBID=1388754391)
RMAN> connect auxiliary sys/ora$db12@SRCDB2SBY;
connected to auxiliary database: SRCDB2 (not mounted)
RMAN> exit
Recovery Manager complete.
[oracle@srlabsby admin]$
[oracle@srlabsby admin]$ ls -lrt
total 20
-rwxr-xr-x. 1 oracle oinstall 1536 Feb 14 2018 shrept.lst
drwxr-xr-x. 2 oracle oinstall 4096 Apr 17 2019 samples
-rw-r-----. 1 oracle oinstall 200 Jul 19 05:41 sqlnet.ora
-rw-r-----. 1 oracle oinstall 620 Jul 31 23:19 tnsnames.ora
-rw-r-----. 1 oracle oinstall 602 Jul 31 23:20 listener.ora
[oracle@srlabsby admin]$ clear
[oracle@srlabsby admin]$ cd ..
[oracle@srlabsby network]$ cd ..
[oracle@srlabsby db_3]$ cd dbs
[oracle@srlabsby dbs]$ ls -lrt
total 28
-rwxr-xr-x. 1 oracle oinstall 3079 May 14 2015 init.ora
-rw-r-----. 1 oracle oinstall 24 Jul 19 05:44 lkSRCDB2
-rw-r-----. 1 oracle oinstall 2048 Jul 19 06:05 orapwSRCDB2_bkp
-rw-r--r--. 1 oracle oinstall 17 Jul 31 22:56 initSRCDB2SBY.ora
-rw-rw----. 1 oracle oinstall 1544 Jul 31 23:08 hc_SRCDB2.dat
-rw-r-----. 1 oracle oinstall 6144 Jul 31 23:26 orapwSRCDB2
[oracle@srlabsby dbs]$ cd ..
[oracle@srlabsby db_3]$ cd network/admin/
[oracle@srlabsby admin]$ ls -lrt
total 20
-rwxr-xr-x. 1 oracle oinstall 1536 Feb 14 2018 shrept.lst
drwxr-xr-x. 2 oracle oinstall 4096 Apr 17 2019 samples
-rw-r-----. 1 oracle oinstall 200 Jul 19 05:41 sqlnet.ora
-rw-r-----. 1 oracle oinstall 620 Jul 31 23:19 tnsnames.ora
-rw-r-----. 1 oracle oinstall 602 Jul 31 23:20 listener.ora
[oracle@srlabsby admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.0.0.0/db_3/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
#Standby
SRCDB2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.201)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SRCDB2)
)
)
SRCDB2SBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SRCDB2)
)
)
LISTENER_SRCDB2SBY =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522))
[oracle@srlabsby admin]$ vi tnsnames.ora
[oracle@srlabsby admin]$ vi listener.ora
[oracle@srlabsby admin]$
[oracle@srlabsby admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/19.0.0.0/db_3/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = SRCDB2)
(ORACLE_HOME = /u01/app/oracle/product/19.0.0.0/db_3 )
(SID_NAME = SRCDB2)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.202)(PORT = 1522))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
)
)
ADR_BASE_LISTENER = /u01/app/oracle/product/19.0.0.0/db_3 /home/oracle/log
[oracle@srlabsby admin]$ lsnrctl start LISTENER
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 01-AUG-2020 02:47:50
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Starting /u01/app/oracle/product/19.0.0.0/db_3/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.0.0.0/db_3/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/19.0.0.0/db_3/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.58.202)(PORT=1522)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.58.202)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 01-AUG-2020 02:47:50
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.0.0.0/db_3/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/19.0.0.0/db_3/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.58.202)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
Services Summary...
Service "SRCDB2" has 1 instance(s).
Instance "SRCDB2", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@srlabsby admin]$ hostname
srlabsby.localdomain
[oracle@srlabsby admin]$ tnsping SRCDB2
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 01-AUG-2020 02:48:26
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0.0/db_3/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.201)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SRCDB2)))
OK (10 msec)
[oracle@srlabsby admin]$ cd ..
[oracle@srlabsby network]$ cd ..
[oracle@srlabsby db_3]$ cd dbs
[oracle@srlabsby dbs]$ ls -lrt
total 28
-rwxr-xr-x. 1 oracle oinstall 3079 May 14 2015 init.ora
-rw-r-----. 1 oracle oinstall 24 Jul 19 05:44 lkSRCDB2
-rw-r-----. 1 oracle oinstall 2048 Jul 19 06:05 orapwSRCDB2_bkp
-rw-r--r--. 1 oracle oinstall 17 Jul 31 22:56 initSRCDB2SBY.ora
-rw-r-----. 1 oracle oinstall 6144 Jul 31 23:26 orapwSRCDB2
-rw-rw----. 1 oracle oinstall 1544 Aug 1 02:38 hc_SRCDB2.dat
[oracle@srlabsby dbs]$
[oracle@srlabsby dbs]$
[oracle@srlabsby dbs]$ cat initSRCDB2SBY.ora
db_name='SRCDB2'
[oracle@srlabsby dbs]$ ps -ef |grep pmon
oracle 22832 2568 0 03:02 pts/0 00:00:00 grep --color=auto pmon
[oracle@srlabsby dbs]$
[oracle@srlabsby dbs]$ ps -ef |grep tns
root 19 2 0 Jul31 ? 00:00:00 [netns]
oracle 21919 1 0 02:47 ? 00:00:00 /u01/app/oracle/product/19.0.0.0/db_3/bin/tnslsnr LISTENER -inherit
oracle 22839 2568 0 03:02 pts/0 00:00:00 grep --color=auto tns
[oracle@srlabsby dbs]$ lsnrctl status LISTENER
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 01-AUG-2020 03:02:29
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.58.202)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 01-AUG-2020 02:47:50
Uptime 0 days 0 hr. 14 min. 39 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.0.0.0/db_3/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/19.0.0.0/db_3/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.58.202)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
Services Summary...
Service "SRCDB2" has 1 instance(s).
Instance "SRCDB2", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@srlabsby dbs]$ env |grep ORA
ORACLE_UNQNAME=SRCDB01SBY
ORACLE_SID=SRCDB2
ORACLE_BASE=/u01/app/oracle
ORACLE_HOSTNAME=srlabsby.localdomain
ORA_INVENTORY=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/db_3
[oracle@srlabsby dbs]$
[oracle@srlabsby dbs]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 1 03:02:56 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount pfile='/u01/app/oracle/product/19.0.0.0/db_3/dbs/initSRCDB2SBY.ora';
ORACLE instance started.
Total System Global Area 268434280 bytes
Fixed Size 8895336 bytes
Variable Size 201326592 bytes
Database Buffers 50331648 bytes
Redo Buffers 7880704 bytes
SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@srlabsby dbs]$
[oracle@srlabsby dbs]$ ps -ef |grep pmon
oracle 22899 1 0 03:03 ? 00:00:00 ora_pmon_SRCDB2
oracle 22979 2568 0 03:03 pts/0 00:00:00 grep --color=auto pmon
[oracle@srlabsby dbs]$
[oracle@srlabsby dbs]$
[oracle@srlabsby dbs]$ rman
Recovery Manager: Release 19.0.0.0.0 - Production on Sat Aug 1 03:03:51 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
RMAN> connect target sys/ora$db12@SRCDB2;
connected to target database: SRCDB2 (DBID=1388754391)
RMAN> connect auxiliary sys/ora$db12@SRCDB2SBY;
connected to auxiliary database: SRCDB2 (not mounted)
RMAN> DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE DORECOVER SPFILE SET db_unique_name='SRCDB2SBY' COMMENT 'Is Standby' NOFILENAMECHECK;
Starting Duplicate Db at 01-AUG-20
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=20 device type=DISK
current log archived
contents of Memory Script:
{
backup as copy reuse
passwordfile auxiliary format '/u01/app/oracle/product/19.0.0.0/db_3/dbs/orapwSRCDB2' ;
restore clone from service 'SRCDB2' spfile to
'/u01/app/oracle/product/19.0.0.0/db_3/dbs/spfileSRCDB2.ora';
sql clone "alter system set spfile= ''/u01/app/oracle/product/19.0.0.0/db_3/dbs/spfileSRCDB2.ora''";
}
executing Memory Script
Starting backup at 01-AUG-20
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=44 device type=DISK
Finished backup at 01-AUG-20
Starting restore at 01-AUG-20
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: restoring SPFILE
output file name=/u01/app/oracle/product/19.0.0.0/db_3/dbs/spfileSRCDB2.ora
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 01-AUG-20
sql statement: alter system set spfile= ''/u01/app/oracle/product/19.0.0.0/db_3/dbs/spfileSRCDB2.ora''
contents of Memory Script:
{
sql clone "alter system set db_unique_name =
''SRCDB2SBY'' comment=
''Is Standby'' scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
sql statement: alter system set db_unique_name = ''SRCDB2SBY'' comment= ''Is Standby'' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 1593832624 bytes
Fixed Size 9135280 bytes
Variable Size 922746880 bytes
Database Buffers 654311424 bytes
Redo Buffers 7639040 bytes
duplicating Online logs to Oracle Managed File (OMF) location
contents of Memory Script:
{
restore clone from service 'SRCDB2' standby controlfile;
}
executing Memory Script
Starting restore at 01-AUG-20
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04
output file name=/u02/oradata/SRCDB2/control01.ctl
output file name=/u02/fra/srcdb2/control02.ctl
Finished restore at 01-AUG-20
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
RMAN-05538: warning: implicitly using DB_FILE_NAME_CONVERT
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRCDB2/system01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRCDB2/sysaux01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRCDB2/undotbs01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRCDB2/pdbseed/system01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRCDB2/pdbseed/sysaux01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRCDB2/users01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRCDB2/pdbseed/undotbs01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRCDB2/SRDBPLUG/system01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRCDB2/SRDBPLUG/sysaux01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRCDB2/SRDBPLUG/undotbs01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u02/oradata/SRCDB2/SRDBPLUG/users01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name /u02/oradata/SRCDB2/temp01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name /u02/oradata/SRCDB2/pdbseed/temp012020-07-19_07-04-20-529-AM.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name /u02/oradata/SRCDB2/SRDBPLUG/temp01.dbf conflicts with a file used by the target database
contents of Memory Script:
{
set newname for tempfile 1 to
"/u02/oradata/SRCDB2/temp01.dbf";
set newname for tempfile 2 to
"/u02/oradata/SRCDB2/pdbseed/temp012020-07-19_07-04-20-529-AM.dbf";
set newname for tempfile 3 to
"/u02/oradata/SRCDB2/SRDBPLUG/temp01.dbf";
switch clone tempfile all;
set newname for datafile 1 to
"/u02/oradata/SRCDB2/system01.dbf";
set newname for datafile 3 to
"/u02/oradata/SRCDB2/sysaux01.dbf";
set newname for datafile 4 to
"/u02/oradata/SRCDB2/undotbs01.dbf";
set newname for datafile 5 to
"/u02/oradata/SRCDB2/pdbseed/system01.dbf";
set newname for datafile 6 to
"/u02/oradata/SRCDB2/pdbseed/sysaux01.dbf";
set newname for datafile 7 to
"/u02/oradata/SRCDB2/users01.dbf";
set newname for datafile 8 to
"/u02/oradata/SRCDB2/pdbseed/undotbs01.dbf";
set newname for datafile 9 to
"/u02/oradata/SRCDB2/SRDBPLUG/system01.dbf";
set newname for datafile 10 to
"/u02/oradata/SRCDB2/SRDBPLUG/sysaux01.dbf";
set newname for datafile 11 to
"/u02/oradata/SRCDB2/SRDBPLUG/undotbs01.dbf";
set newname for datafile 12 to
"/u02/oradata/SRCDB2/SRDBPLUG/users01.dbf";
restore
from nonsparse from service
'SRCDB2' clone database
;
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
renamed tempfile 1 to /u02/oradata/SRCDB2/temp01.dbf in control file
renamed tempfile 2 to /u02/oradata/SRCDB2/pdbseed/temp012020-07-19_07-04-20-529-AM.dbf in control file
renamed tempfile 3 to /u02/oradata/SRCDB2/SRDBPLUG/temp01.dbf in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 01-AUG-20
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u02/oradata/SRCDB2/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:46
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u02/oradata/SRCDB2/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u02/oradata/SRCDB2/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u02/oradata/SRCDB2/pdbseed/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u02/oradata/SRCDB2/pdbseed/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u02/oradata/SRCDB2/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00008 to /u02/oradata/SRCDB2/pdbseed/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00009 to /u02/oradata/SRCDB2/SRDBPLUG/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:16
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00010 to /u02/oradata/SRCDB2/SRDBPLUG/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00011 to /u02/oradata/SRCDB2/SRDBPLUG/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00012 to /u02/oradata/SRCDB2/SRDBPLUG/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 01-AUG-20
sql statement: alter system archive log current
current log archived
contents of Memory Script:
{
restore clone force from service 'SRCDB2'
archivelog from scn 3543995;
switch clone datafile all;
}
executing Memory Script
Starting restore at 01-AUG-20
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=23
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service SRCDB2
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=24
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 01-AUG-20
datafile 1 switched to datafile copy
input datafile copy RECID=4 STAMP=1047265786 file name=/u02/oradata/SRCDB2/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=5 STAMP=1047265786 file name=/u02/oradata/SRCDB2/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=1047265786 file name=/u02/oradata/SRCDB2/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=1047265786 file name=/u02/oradata/SRCDB2/pdbseed/system01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=8 STAMP=1047265786 file name=/u02/oradata/SRCDB2/pdbseed/sysaux01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=9 STAMP=1047265786 file name=/u02/oradata/SRCDB2/users01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=10 STAMP=1047265786 file name=/u02/oradata/SRCDB2/pdbseed/undotbs01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=11 STAMP=1047265786 file name=/u02/oradata/SRCDB2/SRDBPLUG/system01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=12 STAMP=1047265786 file name=/u02/oradata/SRCDB2/SRDBPLUG/sysaux01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=13 STAMP=1047265787 file name=/u02/oradata/SRCDB2/SRDBPLUG/undotbs01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=14 STAMP=1047265787 file name=/u02/oradata/SRCDB2/SRDBPLUG/users01.dbf
contents of Memory Script:
{
set until scn 3544623;
recover
standby
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 01-AUG-20
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 23 is already on disk as file /u02/archive/srcdb2/1_23_1046153053.arc
archived log for thread 1 with sequence 24 is already on disk as file /u02/archive/srcdb2/1_24_1046153053.arc
archived log file name=/u02/archive/srcdb2/1_23_1046153053.arc thread=1 sequence=23
archived log file name=/u02/archive/srcdb2/1_24_1046153053.arc thread=1 sequence=24
media recovery complete, elapsed time: 00:00:01
Finished recover at 01-AUG-20
contents of Memory Script:
{
delete clone force archivelog all;
}
executing Memory Script
released channel: ORA_DISK_1
released channel: ORA_AUX_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=44 device type=DISK
deleted archived log
archived log file name=/u02/archive/srcdb2/1_23_1046153053.arc RECID=1 STAMP=1047265784
deleted archived log
archived log file name=/u02/archive/srcdb2/1_24_1046153053.arc RECID=2 STAMP=1047265785
Deleted 2 objects
Finished Duplicate Db at 01-AUG-20
RMAN>
[oracle@srlabsby dbs]$ ps -ef |grep pmon
oracle 23179 1 0 03:06 ? 00:00:00 ora_pmon_SRCDB2
oracle 23677 2568 0 03:12 pts/0 00:00:00 grep --color=auto pmon
[oracle@srlabsby dbs]$
[oracle@srlabsby dbs]$
[oracle@srlabsby dbs]$ . oraenv
ORACLE_SID = [SRCDB2] ? S
ORACLE_HOME = [/home/oracle] ?
ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID oracle.
You can set ORACLE_BASE manually if it is required.
Resetting ORACLE_BASE to its previous value or ORACLE_HOME
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@srlabsby dbs]$
[oracle@srlabsby dbs]$ . oraenv
ORACLE_SID = [S] ? SRCDB2
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@srlabsby dbs]$
[oracle@srlabsby dbs]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 1 03:12:48 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select name,log_mode,open_mode,database_role,status from v$database,v$instance;
NAME LOG_MODE OPEN_MODE DATABASE_ROLE STATUS
--------- ------------ -------------------- ---------------- ------------
SRCDB2 ARCHIVELOG MOUNTED PHYSICAL STANDBY MOUNTED
SQL> set lines 300 pages 2000
SQL>
SQL> select member from v$logfile;
MEMBER
-------------------------------------------------------------------------------------------
/u02/fra/SRCDB2SBY/onlinelog/o1_mf_3_hl93xr7y_.log
/u02/fra/SRCDB2SBY/onlinelog/o1_mf_2_hl93xmfl_.log
/u02/fra/SRCDB2SBY/onlinelog/o1_mf_1_hl93xgcn_.log
/u02/fra/SRCDB2SBY/onlinelog/o1_mf_4_hl93xwfn_.log
/u02/fra/SRCDB2SBY/onlinelog/o1_mf_5_hl93y0wk_.log
/u02/fra/SRCDB2SBY/onlinelog/o1_mf_6_hl93y5xl_.log
/u02/fra/SRCDB2SBY/onlinelog/o1_mf_7_hl93yb5r_.log
7 rows selected.
SQL> col member for a45
SQL> SELECT group#, type, member FROM v$logfile WHERE type = 'STANDBY' order by group#;
SQL> col member for a55
SQL> /
GROUP# TYPE MEMBER
---------- ------- -------------------------------------------------------
4 STANDBY /u02/fra/SRCDB2SBY/onlinelog/o1_mf_4_hl93xwfn_.log
5 STANDBY /u02/fra/SRCDB2SBY/onlinelog/o1_mf_5_hl93y0wk_.log
6 STANDBY /u02/fra/SRCDB2SBY/onlinelog/o1_mf_6_hl93y5xl_.log
7 STANDBY /u02/fra/SRCDB2SBY/onlinelog/o1_mf_7_hl93yb5r_.log
SQL> SELECT group#, type, member FROM v$logfile WHERE type = 'STANDBY' order by group#;
GROUP# TYPE MEMBER
---------- ------- -------------------------------------------------------
4 STANDBY /u02/fra/SRCDB2SBY/onlinelog/o1_mf_4_hl93xwfn_.log
5 STANDBY /u02/fra/SRCDB2SBY/onlinelog/o1_mf_5_hl93y0wk_.log
6 STANDBY /u02/fra/SRCDB2SBY/onlinelog/o1_mf_6_hl93y5xl_.log
7 STANDBY /u02/fra/SRCDB2SBY/onlinelog/o1_mf_7_hl93yb5r_.log
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
Database altered.
SQL> ! ps -ef |grep mrp
oracle 24000 1 0 03:16 ? 00:00:00 ora_mrp0_SRCDB2
oracle 24042 23719 0 03:17 pts/0 00:00:00 /bin/bash -c ps -ef |grep mrp
oracle 24044 24042 0 03:17 pts/0 00:00:00 grep mrp
SQL> select sequence#,process,status from v$managed_standby;
SEQUENCE# PROCESS STATUS
---------- --------- ------------
0 ARCH CONNECTED
0 DGRD ALLOCATED
0 DGRD ALLOCATED
0 ARCH CONNECTED
0 ARCH CONNECTED
0 ARCH CONNECTED
0 RFS IDLE
25 RFS IDLE
25 MRP0 APPLYING_LOG
9 rows selected.
SQL> select sequence#,process,status from v$managed_standby;
SEQUENCE# PROCESS STATUS
---------- --------- ------------
0 ARCH CONNECTED
0 DGRD ALLOCATED
0 DGRD ALLOCATED
0 ARCH CONNECTED
0 ARCH CONNECTED
25 ARCH CLOSING
0 RFS IDLE
26 RFS IDLE
26 MRP0 APPLYING_LOG
9 rows selected.
SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
SEQUENCE# APPLIED
---------- ---------
23 YES
24 YES
25 YES
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED MOUNTED
3 SRDBPLUG MOUNTED
SQL>
SQL> SELECT group#, dbid, thread#, sequence#, status FROM v$standby_log;
GROUP# DBID THREAD# SEQUENCE# STATUS
---------- ---------------------------------------- ---------- ---------- ----------
4 1388754391 1 27 ACTIVE
5 UNASSIGNED 1 0 UNASSIGNED
6 UNASSIGNED 0 0 UNASSIGNED
7 UNASSIGNED 0 0 UNASSIGNED
SQL> show parameter fal
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
fal_client string SRCDB2
fal_server string SRCDB2SBY
SQL> ALTER SYSTEM SET fal_client=SRCDB2SBY;
System altered.
SQL> ALTER SYSTEM SET fal_server=SRCDB2;
System altered.
SQL> show parameter fal
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
fal_client string SRCDB2SBY
fal_server string SRCDB2
SQL>
SQL> show parameter log_archive_dest_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_2 string service=SRCDB2SBY noaffirm as
ync valid_for=(online_logfiles
,primary_role) db_unique_name=
SRCDB2SBY
log_archive_dest_20 string
log_archive_dest_21 string
log_archive_dest_22 string
log_archive_dest_23 string
log_archive_dest_24 string
log_archive_dest_25 string
log_archive_dest_26 string
log_archive_dest_27 string
log_archive_dest_28 string
log_archive_dest_29 string
SQL>
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database flashback on;
Database altered.
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------------
YES
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
Database altered.
SQL> select sequence#,process,status from v$managed_standby;
SEQUENCE# PROCESS STATUS
---------- --------- ------------
0 ARCH CONNECTED
0 DGRD ALLOCATED
0 DGRD ALLOCATED
0 ARCH CONNECTED
26 ARCH CLOSING
25 ARCH CLOSING
0 RFS IDLE
27 RFS IDLE
27 MRP0 APPLYING_LOG
9 rows selected.
SQL> /
SEQUENCE# PROCESS STATUS
---------- --------- ------------
0 ARCH CONNECTED
0 DGRD ALLOCATED
0 DGRD ALLOCATED
27 ARCH CLOSING
26 ARCH CLOSING
28 ARCH CLOSING
0 RFS IDLE
29 RFS IDLE
29 MRP0 APPLYING_LOG
9 rows selected.
Hope this helps! Cheers!!!
Ramesh
Please follow me:
YOUTUBE: https://www.youtube.com/oraclef1
TWITTER: https://twitter.com/sachinrameshdba
FACEBOOK: https://www.facebook.com/rameshkumar.krishnamoorthy.9
LINKEDIN:https://www.linkedin.com/in/ramesh-kumar-krishnamoorthy-3a67ba69/
Email: oralclehelplines@gmail.com

3 comments
Much useful... Please share me dataguard broker configuration steps to my email karthik@energy-esi.com
ReplyThanks.
Karthik
Much useful... Please share me dataguard broker configuration steps to my email karthik@energy-esi.com
ReplyThanks.
Karthik
Sure Karthick! Thanks for visiting.
Reply