$ dgmgrl / DGMGRL for Linux: Release21.0.0.0.0 - Production on Sun Feb 613:11:592022 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. Connected to"cdb1" Connected as SYSDG. DGMGRL> help prepare
Prepare a primary database for a Data Guard environment.
Syntax:
PREPARE DATABASE FOR DATA GUARD [WITH [DB_UNIQUE_NAME IS ] [DB_RECOVERY_FILE_DEST IS ] [DB_RECOVERY_FILE_DEST_SIZE IS ] [BROKER_CONFIG_FILE_1 IS ] [BROKER_CONFIG_FILE_2 IS ]];
dgmgrl / <<EOF prepare database for data guard with db_unique_name is ${NODE1_DB_UNIQUE_NAME} db_recovery_file_dest is "${ORACLE_BASE}/fast_recovery_area" db_recovery_file_dest_size is 20g; exit; EOF
代入环境变量如下:
1 2 3 4 5 6 7
dgmgrl / <<EOF prepare database for data guard with db_unique_name is cdb1 db_recovery_file_dest is '/u01/app/oracle/fast_recovery_area' db_recovery_file_dest_size is 20G; exit; EOF
DGMGRL for Linux: Release 21.0.0.0.0 - Production on Sun Feb 6 14:03:10 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. Connected to"cdb1" Connected as SYSDG. DGMGRL> > > > Preparing database "cdb1"for Data Guard. Initialization parameter DB_FILES setto 1024. Initialization parameter LOG_BUFFER setto 268435456. Primary database must be restarted after setting static initialization parameters. Primary database must be restarted toenable archivelog mode. Shutting down database "cdb1". Database closed. Database dismounted. ORACLE instance shut down. Starting database "cdb1"to mounted mode. ORACLE instance started. Database mounted. Initialization parameter DB_FLASHBACK_RETENTION_TARGET setto 120. Initialization parameter DB_LOST_WRITE_PROTECT setto'TYPICAL'. RMAN configuration archivelog deletion policy setto SHIPPED TO ALL STANDBY. Initialization parameter DB_RECOVERY_FILE_DEST_SIZE setto'20g'. Initialization parameter DB_RECOVERY_FILE_DEST setto'/u01/app/oracle/fast_recovery_area'. LOG_ARCHIVE_DEST_n initialization parameter already setfor local archival. Initialization parameter LOG_ARCHIVE_DEST_2 setto'location=use_db_recovery_file_dest valid_for=(all_logfiles, all_roles)'. Initialization parameter LOG_ARCHIVE_DEST_STATE_2 setto'Enable'. Adding standby log group size 52428800 and assigning it to thread 1. Adding standby log group size 52428800 and assigning it to thread 1. Adding standby log group size 52428800 and assigning it to thread 1. Initialization parameter STANDBY_FILE_MANAGEMENT setto'AUTO'. Initialization parameter DG_BROKER_START settoTRUE. Database setto FORCE LOGGING. Database setto ARCHIVELOG. Database setto FLASHBACK ON. Database opened. DGMGRL>
通过以上输出结果,我们可以看到执行了常见的设置任务,并且设置了一些额外的初始化参数:
1 2 3 4 5 6 7
DB_FILES=1024 LOG_BUFFER=256M DB_BLOCK_CHECKSUM=TYPICAL # Unchanged if FULL DB_LOST_WRITE_PROTECT=TYPICAL # Unchanged if FULL DB_FLASHBACK_RETENTION_TARGET=120# Unchanged if non-default PARALLEL_THREADS_PER_CPU=1 DG_BROKER_START=TRUE