• Home
  • DBA Scripts
    • Oracle Scripts
    • SQL Server Scripts
  • Knowledge Base
    • Oracle Database
    • MS SQL Server
    • MongoDB
    • MariaDB
  • Troubleshoot
    • Oracle Database Issues
    • SQL Server Issues
  • Interview Questions
    • AWS Interview Questions
    • Oracle DBA Interview Questions
    • SQL Server Interview Questions
  • Courses
    • Oracle Database
    • Oracle DBA L1
    • Oracle DBA L2
    • Oracle DBA L3
  • Home
  • DBA Scripts
    • Oracle Scripts
    • SQL Server Scripts
  • Knowledge Base
    • Oracle Database
    • MS SQL Server
    • MongoDB
    • MariaDB
  • Troubleshoot
    • Oracle Database Issues
    • SQL Server Issues
  • Interview Questions
    • AWS Interview Questions
    • Oracle DBA Interview Questions
    • SQL Server Interview Questions
  • Courses
    • Oracle Database
    • Oracle DBA L1
    • Oracle DBA L2
    • Oracle DBA L3
home/Knowledge Base/Oracle Database/Oracle Standby Database/How to Build Oracle Standby Database
Popular Search:Oracle, SQL Server, MongoDB

How to Build Oracle Standby Database

213 views 3 October 28, 2020 April 2, 2021 admin

Oracle Standby Database

Topic: How to build Oracle Standby Database in 11g or 12c version.

======================================================
*********Build Standby Database: 11g / 12c************
======================================================

1. Take RMAN HOT backup of Primary Database.
2. Transfer backup to Standby Server.
3. Restore the Standby database using the Primary database backup. Do Not Open Standby Database.

RMAN> DUPLICATE TARGET DATABASE FOR STANDBY BACKUP LOCATION ‘/DATA/BACKUP’ NOFILENAMECHECK DORECOVER;
or
RMAN> DUPLICATE DATABASE ‘PRIMARY’ FOR STANDBY BACKUP LOCATION ‘/DATA/BACKUP’ NOFILENAMECHECK;
or
RMAN> DUPLICATE DATABASE TO PRIMARY BACKUP LOCATION ‘/DATA/BACKUP’ NOFILENAMECHECK NOOPEN;

4. Copy TNS Entry of Primary DB to Standby and Standby DB to Prim locations.
5. Create new password file at Primary DB and scp to Standby location.
orapwd file=orapwPRIMARY password=oracle entries=12 ignorecase=y
6. Set parameters on both Primary and Standby Databses.

******ON PRIMARY*******

SQL> select name, open_mode from v$database;
NAME      OPEN_MODE
——— ——————–
PRIMARY   READ WRITE

SQL> alter system set log_archive_config=’DG_CONFIG=(PRIMARY,STANDBY)’ SCOPE=both ;
SQL> alter system set log_archive_dest_1=’LOCATION=/u01/archivelogs valid_for=(ALL_LOGFILES,ALL_ROLES) db_unique_name=PRIM’ ;
SQL> ALTER SYSTEM SET log_archive_dest_2=’SERVICE=STANDBY LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=STANDBY’ SCOPE=BOTH ;
SQL> alter system set fal_server=STANDBY SCOPE=both ;
SQL> alter system set fal_client=PRIMARY SCOPE=both ;
SQL> alter system set standby_file_management=AUTO scope=both ;

*******ON STANDBY********

SQL> select name, open_mode from v$database;
NAME      OPEN_MODE
——— ——————–
PRIMARY   MOUNTED

SQL> alter system set log_archive_config=’DG_CONFIG=(PRIMARY,STANDBY)’ SCOPE=both ;
SQL> alter system set fal_server=PRIMARY SCOPE=both ;
SQL> alter system set fal_client=STANDBY SCOPE=both ;
SQL> alter system set standby_archive_dest=’/u01/archivelogs’ scope=both;
SQL> alter system set standby_file_management=AUTO scope=both ;

7. Start MRP process at Standby database.
SQL> alter database recover managed standby database disconnect from session;
8. Enable dest_state_2 parameter at Primary Database.
SQL> alter system set log_archive_dest_state_2=ENABLE ;
9. Switch logfile at Primary Database.
SQL> alter system switch logfile;
10. Check Standby Database Gap.

Was this helpful?

3 Yes  No
Related Articles
  • Delete Applied Archives from Standby Database
  • Sync Oracle Standby Database using SCN Backup
  • Step by Step Configuration Of Oracle 11gR2 Two Node RAC Dataguard Setup
  • Oracle 11gR2 RAC to RAC Standby Database Manual Failover Steps
Leave A Comment Cancel reply

Oracle Standby Database
  • How to Build Oracle Standby Database
  • Delete Applied Archives from Standby Database
  • Sync Oracle Standby Database using SCN Backup
  • Step by Step Configuration Of Oracle 11gR2 Two Node RAC Dataguard Setup
  • Oracle 11gR2 RAC to RAC Standby Database Manual Failover Steps
Popular Articles
  • Upgrade Oracle Database from 11.2.0.3 to 12.1.0.2
  • Upgrading MariaDB on Windows
  • Oracle DBA Basic Interview Questions Part A
  • Purging Oracle Sysaux Tablespace
  • Client – Server Architecture
KB Categories
  • Oracle Database
    • Oracle RAC
    • Oracle ASM
    • Oracle GoldenGate
    • Oracle Tuning
    • Oracle 11g Database
    • Oracle Database Upgrade
    • Oracle 12c Database
    • ALL KB Oracle
    • Oracle 18c Database
    • Oracle Standby Database
  • MongoDB
  • MS SQL Server
  • MySQL
  • Interview Questions
    • AWS Interview Questions
    • Oracle DBA Interview Questions
    • SQL Server Interview Questions
  • MariaDB
Database Organization

Database Organization (DB ORG) is knowledge base for DBA to learn and execute the fundamental of different databases under one website. DB ORG is a non-profit initiative. ORACLE, MS SQL Server, MongoDB, MariaDB, Couchbase

Join Our Community
  • KnowledgeBase
  • Documentation
  • Troubleshoot
  • FAQ
Information Links
  • About DBOrg
  • Licenses
  • Terms
  • Privacy Policy
Contact Us
    DB ORG - Database Administration,
    Knowledge Base for DBA
    Mail: support@databaseorg.com
    WhatsApp: (+91) 9306440957
    Monday to Friday: EST - 11:30 AM to 06:30 PM (IST - 9:00 PM to 4:00 AM)
  • © 2023 Database Organization - DB ORG. All Rights Reserved.

Popular Search:Oracle, SQL Server, MongoDB

WhatsApp DB Org