Description:-
Starting with Oracle 21c new features, one of them called PREPARE DATABASE FOR DATA GUARD , which is used to perform basic configurations on the primary server when creating a database with Dataguard like Creates standby redo log files, Enables force logging, Enables Flashback & enables Archivelog, Set required parameters
Note:- Remember that version 21c is Innovation Release ,It is not Long Term support Release
Let’s start Demo:-
Prepare a primary database for a Data Guard environment in Oracle 21c
Environment:-
Before Activity: –
SQL> show parameter db_name
NAME TYPE VALUE
———————————— ———– ——————————
db_name string oradbwr
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
———- —————————— ———- ———-
2 PDB$SEED READ ONLY NO
3 ORADBWRPDB1 READ WRITE NO
SQL> select flashback_on,log_mode from v$database;
FLASHBACK_ON LOG_MODE
—————— ————
NO NOARCHIVELOG
SQL> select * from v$standby_log;
no rows selected
Activity Started:-
[oracle@oracle21c ~]$ dgmgrl
DGMGRL for Linux: Release 21.0.0.0.0 – Production on Mon Sep 5 21:25:38 2022
Version 21.3.0.0.0
Copyright (c) 1982, 2021, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type “help” for information.
DGMGRL> connect / as sysdba
Connected to “oradbwr”
Connected as SYSDBA.
DGMGRL> PREPARE DATABASE FOR DATA GUARD
WITH
DB_UNIQUE_NAME IS oradbwr
DB_RECOVERY_FILE_DEST IS “/u01/app/oracle/fast_recovery_area”
DB_RECOVERY_FILE_DEST_SIZE IS “10G”;
Preparing database “oradbwr” for Data Guard.
Initialization parameter DB_FILES set to 1024.
Initialization parameter LOG_BUFFER set to 268435456.
Primary database must be restarted after setting static initialization parameters.
Primary database must be restarted to enable archivelog mode.
Shutting down database “oradbwr”.
Database closed.
Database dismounted.
ORACLE instance shut down.
Starting database “oradbwr” to mounted mode.
ORACLE instance started.
Database mounted.
Initialization parameter DB_FLASHBACK_RETENTION_TARGET set to 120.
Initialization parameter DB_LOST_WRITE_PROTECT set to ‘TYPICAL’.
RMAN configuration archivelog deletion policy set to SHIPPED TO ALL STANDBY.
Initialization parameter DB_RECOVERY_FILE_DEST_SIZE set to ’10G’.
Initialization parameter DB_RECOVERY_FILE_DEST set to ‘/u01/app/oracle/fast_recovery_area’.
LOG_ARCHIVE_DEST_n initialization parameter already set for local archival.
Initialization parameter LOG_ARCHIVE_DEST_2 set to ‘location=use_db_recovery_file_dest valid_for=(all_logfiles, all_roles)’.
Initialization parameter LOG_ARCHIVE_DEST_STATE_2 set to ‘Enable’.
Adding standby log group size 209715200 and assigning it to thread 1.
Adding standby log group size 209715200 and assigning it to thread 1.
Adding standby log group size 209715200 and assigning it to thread 1.
Initialization parameter STANDBY_FILE_MANAGEMENT set to ‘AUTO’.
Initialization parameter DG_BROKER_START set to TRUE.
Database set to FORCE LOGGING.
Database set to ARCHIVELOG.
Database set to FLASHBACK ON.
Database opened.
DGMGRL>
After Activity:-
SQL> select flashback_on,log_mode,force_logging from v$database;
FLASHBACK_ON LOG_MODE FORCE_LOGGING
—————— ———— —————————————
YES ARCHIVELOG YES
SQL> select group# from v$standby_log;
GROUP#
———-
4
5
6
SQL> show parameter log_archive_dest_2
NAME TYPE VALUE
———————————— ———– ——————————
log_archive_dest_2 string location=use_db_recovery_file_
dest valid_for=(all_logfiles,
all_roles)
Connect with me:-
Telegram App:https://t.me/oracledbwr
LinkedIn:https://www.linkedin.com/in/hariprasathdba
Facebook:https://www.facebook.com/HariPrasathdba
FB Group:https://www.facebook.com/groups/894402327369506/
FB Page : https://www.facebook.com/dbahariprasath/?
Twitter : https://twitter.com/oracledbwr