I will tell you Oracle dataguard configuration and installation in this article.
Let’s read Dataguard Architecture if you don’t know.
With Oracle DataGuard technology, we can create Physical and Logical Standby for our databases for providing disaster recovery . I will explain the most used Physical Standby configuration and setup in Oracle 12c, Oracle 18c database on Linux server.
Before starting installation, I will use db_name DEVECI for my Primary database. The name of the Physical Standby database will be DEVECIDG. I will proceed step by step through the configuration and installation.
1- An Oracle Software must be installed on the standby database server, which versions will be the same as the Primary database and also Patchset versions. (Database must not be created with DBCA and If your primary database is 126.96.36.199, it must be 188.8.131.52 for Standby database)
2- A Listener must be created on the standby database server that will listen to the physical standby that will be created by NETCA with Oracle Software.
3- The primary database must be in Archivelog mode. For detailed information about Archivelog mode, please read the following article. You can find out whether the database is in archive mode with the following query.
SELECT log_mode FROM v$database; LOG_MODE ------------ ARCHIVELOG SQL>
4- All changes namely transactions (except TEMP Tablespace) running in the primary database must be logged and applied to the Standby. The following command must be run in Primary so that all changes and transactions in the primary database will be logged.
SQL> alter database force logging; Database altered.
5- In the primary database, we should set some parameters required for Data Guard, and I will explain what these parameters are in the following article.
After making the following parameter change, the database must be closed and opened due to static parameters. Those who do not know how to close or open the database can read the following article.
Following scripts have to execute on Primary Side.
SQL> alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(DEVECI,DEVECIDG)'; System altered. SQL> alter system set LOG_ARCHIVE_DEST_2='SERVICE=DEVECIDG LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DEVECIDG'; System altered. SQL> alter system set LOG_ARCHIVE_DEST_1='LOCATION=/oracle/DATA/DEVECI/ARCH/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=DEVECI'; System altered. SQL> alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE; System altered. SQL> alter system set FAL_SERVER=DEVECIDG; System altered. SQL> alter system set FAL_CLIENT=DEVECI; System altered. SQL> ALTER SYSTEM SET LOG_ARCHIVE_MAX_PROCESSES=20; System altered. SQL> ALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE SCOPE=SPFILE; System altered. SQL> alter system set DB_FILE_NAME_CONVERT='/oracle/DATA/DEVECIDG/DEVECIDG','/oracle/DATA/DEVECI/DEVECI' scope=spfile; System altered. SQL> alter system set LOG_FILE_NAME_CONVERT='/oracle/DATA/DEVECIDG/DEVECIDG','/oracle/DATA/DEVECI/DEVECI' scope=spfile; System altered.
I will continue to tell installation of dataguard in the next post.
Do you want to learn Oracle Database for Beginners, then read the following articles.
3,532 views last month, 1 views today