Os details:
[oracle@db11g ~]$ cat /etc/oracle-release
Oracle Linux Server release 6.8
Database details:
Release 12.2.0.1.0
Node details:
node01(source database)
node02(targate database)
==> check and create souce database in archive log mode.
[oracle@node01 ~]$ sqlplus
SQL*Plus: Release 12.2.0.1.0 Production on Mon Mar 27 06:18:05 2017
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Enter user-name: /as sysdba
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SELECT log_mode FROM v$database;
LOG_MODE
------------
NOARCHIVELOG
SQL>
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;
ALTER DATABASE FORCE LOGGING;
==> tnsname.ora file details on both node.
Node01:
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node01.example.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
orcl_tar =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node02.example.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
Node02:
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node02.example.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
orcl_tar =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node01.example.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
===> configure datagaurd using dbca silent command.
[oracle@node02 admin]$ dbca -silent -createDuplicateDB -gdbName orcl -primaryDBConnectionString orcl.example.com:1521/orcl -sid orcl -createAsStandby -dbUniqueName orcl1
Enter SYS user password: -----Enter sysp assword of source database.
Listener config step
33% complete
Auxiliary instance creation
66% complete
RMAN duplicate
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl1/orcl.log" for further details.
For more details about data gaurd configuration progress check below logs.
[oracle@node02 admin]$ tail -f /u01/app/oracle/cfgtoollogs/dbca/orcl1/orcl.log
[ 2017-03-27 05:37:15.662 IST ] Listener config step
DBCA_PROGRESS : 33%
[ 2017-03-27 05:37:20.555 IST ] Auxiliary instance creation
DBCA_PROGRESS : 66%
[ 2017-03-27 05:38:01.103 IST ] RMAN duplicate
DBCA_PROGRESS : 100%
Note: automaticaly password file and parameter file have been created.
[oracle@node02 admin]$ cd /u01/app/oracle/product/12.1.0.2/db_1/dbs
[oracle@node02 dbs]$ ls -ltr
total 24
-rw-r--r--. 1 oracle oinstall 3079 May 15 2015 init.ora
-rw-r-----. 1 oracle oinstall 82 Mar 27 05:37 initorcl.ora
-rw-r-----. 1 oracle oinstall 3584 Mar 27 05:38 orapworcl
-rw-r-----. 1 oracle oinstall 24 Mar 27 05:38 lkORCL1
-rw-rw----. 1 oracle oinstall 1544 Mar 27 05:39 hc_orcl.dat
-rw-r-----. 1 oracle oinstall 3584 Mar 27 05:39 spfileorcl.ora
===> create standby log files on both database.
Node01:
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=MANUAL;
ALTER DATABASE ADD LOGFILE ('/u01/app/oracle/oradata/ORCL/onlinelog/online_redo01.log') SIZE 50M;
ALTER DATABASE ADD LOGFILE ('/u01/app/oracle/oradata/ORCL/onlinelog/online_redo02.log') SIZE 50M;
ALTER DATABASE ADD LOGFILE ('/u01/app/oracle/oradata/ORCL/onlinelog/online_redo03.log') SIZE 50M;
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO;
Node02:
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=MANUAL;
ALTER DATABASE ADD LOGFILE ('/u01/app/oracle/oradata/ORCL1/onlinelog/online_redo01.log') SIZE 50M;
ALTER DATABASE ADD LOGFILE ('/u01/app/oracle/oradata/ORCL1/onlinelog/online_redo02.log') SIZE 50M;
ALTER DATABASE ADD LOGFILE ('/u01/app/oracle/oradata/ORCL1/onlinelog/online_redo03.log') SIZE 50M;
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO;
SQL> SELECT protection_mode FROM v$database;
check standby protection mode:
PROTECTION_MODE
--------------------
MAXIMUM PERFORMANCE
SQL> ALTER DATABASE FORCE LOGGING;
Database altered.
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
log sequence on both database :
Node1:
SQL> ALTER SESSION SET nls_date_format='DD-MON-YYYY HH24:MI:SS';
Session altered.
SQL> SELECT sequence#, first_time, next_time
FROM v$archived_log
ORDER BY sequence#; 2 3
SEQUENCE# FIRST_TIME NEXT_TIME
---------- -------------------- --------------------
4 27-MAR-2017 05:10:37 27-MAR-2017 05:38:07
5 27-MAR-2017 05:38:07 27-MAR-2017 05:39:32
6 27-MAR-2017 05:39:32 27-MAR-2017 05:39:32
7 27-MAR-2017 05:39:32 27-MAR-2017 05:59:36
8 27-MAR-2017 05:59:36 27-MAR-2017 05:59:37
Node2:
SQL> ALTER SESSION SET nls_date_format='DD-MON-YYYY HH24:MI:SS';
Session altered.
SQL> SELECT sequence#, first_time, next_time
FROM v$archived_log
ORDER BY sequence#; 2 3
SEQUENCE# FIRST_TIME NEXT_TIME
---------- -------------------- --------------------
5 27-MAR-2017 05:38:07 27-MAR-2017 05:39:32
6 27-MAR-2017 05:39:32 27-MAR-2017 05:39:32
*********end************
No comments:
Post a Comment