...
Note |
---|
It is very important to consider proper Archivelog management, otherwise your standby database will run out of sync frequently, your primary backups will fail or you will run out of space on primary or standby server. |
Table of Contents | ||
---|---|---|
|
1. AMM Concept
The Dbvisit Standby Archive Log Management Module (AMM) fully automates the management and monitoring of the Oracle database archive log space on the primary in lash recovery area or in log_archive_dest as well as the Dbvisit ARCHDEST location on the standby server.
...
Is optional to use and it’s by default disabled on primary and standby
Without its configuration, archivelogs can eventually fill disk on standby server or even primary server
Can be enabled/disabled separately for primary and standby server (primary only, standby only, both enabled or both disabled)
Can be set from dbvcontrol GUI and also by directly editing DDC file
The Dbvisit StandbyMP AMM produces a separate log file to the Dbvisit Standby database processing. The log file can be found in the same location as the Dbvisit Standby database log file. The log file is called <DDC>_arch_management.log. The location is determined by the LOGDIR and LOGDIR_DR settings in the DDC file.
2. Primary Database Archivelogs and AMM
There are three possible scenarios and approaches for primary database archivelog management when Dbvisit Synchronization is in place. If Dbvisit StandbyMP AMM is enabled, it deletes archivelogs directly from db_recovery_file_dest or log_archive_dest.
A. primary database archivedlogs are already backed up and deleted by your existing backup tools.
In this case, all primary archivelogs are backed up and deleted by your existing backups. There’s no further action required, you can leave AMM disabled.
You must however ensure that your backup scripts leave sufficient amount of archivedlogs on primary server. Minimum retention we recommend is 1-2 hours. If you fail to maintain this retention (for example you would run RMAN> delete archivelog all;) your standby database will get out of synchronization.
B. primary database archivedlogs are not managed at all
This includes for example situations when your primary database wasn’t in archivelog mode prior to Dbvisit StandbyMP deployment. In this case, we would recommend you to enable AMM for primary as described further on this page.
Note |
---|
Dbvisit Standby is not replacing your backup scripts or backup software. It is important that you still backup your database and archive log to a different storage or a tape device. |
C. primary database archivedlogs are already backed up by your existing backup tools, but you want to leave the deletion to Dbvisit
In this case, all primary archivelogs are backed up by your existing backups, but you want to delegate the deletion of archivedlogs to Dbvisit StandbyMP AMM to prevent any risk of getting your standby database out-of-sync due to missing and delete archived log.
...
Info |
---|
Archivelog deletion by AMM on primary is triggered only at the end of transfer process - and the transfer must finish successfully |
3. Standby Database Archivelogs and AMM
Archivelogs on standby server are Dbvisit specific and we recommed to enable AMM in every case. AMM should be always enabled for standby. AMM then deletes all archivedlogs from ARCHDEST location (ARCHDEST is specified during DDC creation). There are never any archivelogs placed in db_recovery_file_dest or log_archive_dest by Dbvisit StandbyMP.
4. Enable AMM on primary
We can enable AMM by accessing the Configuration ACTIONS:
2. AMM and Multiple Standby Databases
In the case of multiple standby databases, Dbvisit Standby checks if an archive log has been transferred to all active standby databases before deleting it on the primary.
A standby database is considered to be active if a Dbvisit process has run within the last DBV_LAST_RUN_OFFSET days to ship archive logs to this database from the primary.
Note the default value:
Code Block |
---|
DBV_LAST_RUN_OFFSET=1 |
Info |
---|
In this context, the cascade setup is also considered a multiple standby environment. That means the standby DB is considered to be a primary DB for the cascade standby DB. |
3. Dbvisit Standby AMM processing overview
The order of precedence in managing the archive log files are:
If there are archive log files older than days to keep the archive log files, then delete these.
If there are more archive log files than Number of archive log files to keep, then delete these (oldest ones first).
If there are more archive logs that have been backed up by RMAN at least Number of times an archive log has to be backed up rman before being deleted times, then delete these.
If the Threshold in % of how much disk space may be used < mount point fullness criteria are met, then mark archives for deletion (oldest ones first). The number of archives marked for deletion is how many archive logs. The archives will only be deleted if Delete archive files once threshold is reached=Y. After deletion of the archives, and the criteria are still met (Threshold in % of how much disk space may be used < mount point fullness), then mark more archives for deletion (number of archives marked for deletion will be again HOWMANY_ARCHSOURCE, and oldest ones first). This process will continue until the criteria are no longer met.
If Delete archive files once threshold is reached=N, then only a warning email will be sent. No archives will be deleted when the Threshold in % of how much disk space may be used < mount point fullness criteria are met. Setting variable Delete archive files once threshold is reached=N has no influence over days to keep the archive log files and Number of archive log files to keep. These will still delete archive files when their criteria are met.
4. Dbvisit Standby AMM log file
The Dbvisit Standby Archive Log Management Module (AMM) produces a separate log file to the Dbvisit Standby database processing. The log file can be found in the same location as the Dbvisit Standby database log file. The log file is called <DDC>_arch_management.log. The location is determined by the LOGDIR and LOGDIR_DR settings in the DDC file.
5. Archivelog Management Settings (AMM)
This section provides an overview of the variables that can be configured for the AMM module with regards to the Primary Database. Unlike the previous versions, the archive log management module is completely separated from the DDC configurations and now can be edited directly from control center.
...
...
2.1 Enable AMM on primary
Note |
---|
AMM on primary deletes archivelogs based on v$archive_log view. If any archivelog isn’t present in v$archive_log, it will be never deleted. |
We can enable AMM by accessing the ACTIONS right pane. You can use this example setting for your environment as well:
...
GUI field names and DDC variables referrence:
Number | GUI Field Name | DDC variable | Values and explanation |
2 | Enable Archivelog Management on Primary | ARCHSOURCE_MANAGEMENT | Y or N |
2
Number of archive log files to keep
NUM_ARCHSOURCE_TO_KEEP
whole numbers, 0 to disable
3
Days to keep the archive log files
DAYS_TO_KEEP_ARCHSOURCE
whole and decimal numbers, 0 to disable
4
Number of times an archive log has to be backed up by rman before being deleted
ARCHSOURCE_BACKUP_COUNT
whole numbers, 0 to disable
5
Threshold in % of how much disk space may be used
THRESHOLD_ARCHSOURCE
percent
6
Threshold in % of how much FRA space may be used
FRA_THRESHOLD_ARCHSOURCE
percent
7
Delete archive files once threshold is reached
DELETE_ARCHSOURCE_THRESHOLD
Y or N
8
Enable Archivelog Management on Standby
ARCHDEST_MANAGEMENT
Y or N
9
. This wholly disables or enables AMM module on primary. By default AMM on primary is disabled. | ||
3 | Number of archive log files to keep | NUM_ |
whole numbers, 0 to disable
10
Days to keep the archive log files
ARCHSOURCE_TO_KEEP |
whole |
numbers, 0 to disable |
11
Threshold in % of how much disk space may be used
THRESHOLD_ARCHDEST
percent
12
Delete archive files once threshold is reached
DELETE_ARCHDEST_THRESHOLD
Y or N
...
Note |
---|
Primary Archive Log Management by Dbvisit deletes own primary database archivelogs - so directly from Flash Recovery Area or log_archive_dest |
( 1 ) Enable archive log management on primary: By default, this setting is set to No and you can enable it when you want Dbvisit to manage the archive logs from the primary database.
...
Specifies the number of archive log files to keep on the primary server. Archive log files greater than this number will be removed (oldest first). |
...
If you are not sure, set it to 0 (disable). |
...
4 | Days to keep the archive log files |
...
DAYS_TO_KEEP_ARCHSOURCE | whole and decimal numbers (use . character), 0 to disable Specify the number of days to keep the archive log files on the primary server. If this value (in days) is reached, the archive log files will be removed from the server. |
...
If you are not sure, set it to |
...
1. Ensure that enough disk space is available to store the archive logs. |
5 |
...
Number of times an archive log has to be backed up by |
...
rman before being deleted |
...
ARCHSOURCE_BACKUP_COUNT | whole numbers, 0 to disable Specify the number of times an archive log has to be backed up by RMAN before Dbvisit Standby deletes it from the primary server. |
...
If this value is set to non-zero and archivelog is never backed up by RMAN, AMM will never delete the archivelog. | |
6 | Threshold in % of how much disk space may be used |
...
THRESHOLD_ARCHSOURCE | percent, 0 to disable Specifies the threshold in percentage (%) of how much disk space may be taken up by the archive log files on disk before an alert is triggered on the primary server. A value of 80 means at 80% space threshold is reached, an alert will be triggered. Please specify the threshold as an integer. |
...
7 | Threshold in % of how much FRA space may be used |
...
FRA_THRESHOLD_ARCHSOURCE | percent, 0 to disable Specifies the threshold in percentage (%) of how much FRA (flash/fast recovery area) space may be taken up by the archive log files on disk before an alert is triggered on the primary server. A value of 80 means at 80% FRA space threshold is reached, an alert will be triggered. Please specify the threshold as an integer. |
...
8 | Delete archive files once threshold is reached |
...
DELETE_ARCHSOURCE_THRESHOLD | Y or N Specify if archive log files should be deleted once the percentage threshold (Threshold in % of how much disk space may be used) on the primary server is reached. Once the threshold is reached oldest archive log files are deleted first. By default, this is set as No and Multiplatform notification will send out an email or slack notification once this is reached if enabled. |
...
Note |
---|
There is no verification that these archive log files have been backed up. Dbvisit Standby does not perform backups, this should be configured outside the Dbvisit Standby product. |
Note |
---|
This setting has no influence on whether archive log files are deleted for the Number of archive logs to keep or Days to keep archive log files. These settings will delete archive log files once the percentage threshold is met. |
Process Flow for Primary AMM:
...
5.2 Standby Archive Management Settings
Note |
---|
Standby Archive Log Management by Dbvisit deletes transferred archivelogs in ARCHDEST location on standby server |
...
9 | Save Settings |
In order to specify variables correctly, you need to make sure to understand the precedence and interaction between the variables.
2.2 Primary AMM Decision Diagram
Each AMM run on primary is done only after successful archivelog transfer and following flow is used:
...
2.3 Primary AMM Settings Example
Following is an example on how to set primary AMM parameters:
...
Following rules will apply for this setting:
AMM will perform archivelog deletion on primary after successful archivelog transfer
Criteria 1&2: AMM will delete any archivelogs exceeding the count of 100 file (oldest first) AND it will not delete any archivelog which less than exactly 1 day old
Criteria 3: AMM will delete only archivelogs which were backed up at least 1 time by RMAN
there is logical AND between criteria 1 & 2 & 3
If disk space where primary archivelogs reside is more than 85% used, dbvisit will disregard criteria 1,2 and 3 and delete archivelos in an attempt to get below the threshold
If disk FRA of primary database is more than 85% used, dbvisit will disregard criteria 1,2 and 3 and delete archivelos in an attempt to get below the threshold
2.4 Primary AMM advanced options
These options are by default not shown in dbvcontrol GUI and user must add manually parameters to the DDC file to enable these options. It is because they are only valid for specific use cases. Refer to https://dbvisit.atlassian.net/wiki/spaces/DSMPV12/pages/4446683207/Modifying+DDC+parameters for details how to modify DDC parameters.
A. Multiple Standby Databases and Primary AMM
In the case of multiple standby databases, Dbvisit Standby checks if an archive log has been transferred to all active standby databases before deleting it on the primary.
A standby database is considered to be active if a Dbvisit process has run within the last DBV_LAST_RUN_OFFSET days to ship archive logs to this database from the primary.
Note the default value:
Code Block |
---|
DBV_LAST_RUN_OFFSET=1 |
Info |
---|
In this context, the cascade setup is also considered a multiple standby environment. That means the standby DB is considered to be a primary DB for the cascade standby DB. |
This value must be manually set in the DDC file, it is not possible to use dbvcontrol.
B. Multiple Archivelog Destinations with ARCHSOURCE_BACKUP_COUNT enabled on primary database and AMM
In case there are multiple archivelog destinations specified on the primary database AND ARCHSOURCE_BACKUP_COUNT is set as well, it is possible to further control behavior of AMM by setting following parameter in DDC file:
Code Block |
---|
AMM_BACKUP_COUNT_FUNCTION=SUM |
value SUM means that if you have log_archive_dest_1 and log_archive_dest_2 then it is enough if archivelog is backed up in one of the locations (or both locations) for the criteria ARCHSOURCE_BACKUP_COUNT to be fulfilled.
Otherwise AMM_BACKUP_COUNT_FUNCTION has default value MIN meaning that archivelog must be backed up ARCHSOURCE_BACKUP_COUNT times in log_archive_dest_1 AND in log_archive_dest_2 at the same time, otherwise the ARCHSOURCE_BACKUP_COUNT criteria isn't fulfilled.
3. Standby Database Archivelogs and AMM
Archivelogs on standby server are Dbvisit specific and we recommed to enable AMM in every case. AMM should be always enabled for standby. AMM then deletes all archivedlogs from ARCHDEST location (ARCHDEST is specified during DDC creation). There are never any archivelogs placed in Standby database db_recovery_file_dest or log_archive_dest by Dbvisit StandbyMP.
3.1 Enable AMM on standby
...
GUI field names and DDC variables referrence:
Number | GUI Field Name | DDC variable | Values and Explanation |
2 | Enable Archivelog Management on Standby | ARCHDEST_MANAGEMENT | Y or N Specifies if the AMM module to manage the archive log files is turned on or off on the standby server. This is recommended to set to yes as it will manage the archive logs that are shipped from primary to standby’s Archive log destination location(ARCHDEST). |
3 |
...
Number of archive log files to keep |
...
NUM_ARCHDEST_TO_KEEP | whole numbers, 0 to disable Specifies the number of archive log files to keep on the standby server. Archive log files greater than this number will be removed (oldest first).To disable this setting, set to 0. If you are not sure, set to 0 (disable). | |
4 |
...
Days to keep the archive log files |
...
DAYS_TO_KEEP_ARCHDEST | whole and decimal numbers (use . character), 0 to disable Specifies the number of days to keep the archive log files on the standby server. After this, the archive log files will be removed from the server. This is specific to the archive log destination location in standby from which the archivelog is applied. |
...
5 | Threshold in % of how much disk space may be used |
...
THRESHOLD_ARCHDEST | percent, 0 to disable Specifies the threshold in percentage (%) of how much disk space may be taken up by the archive log files on disk before an alert is triggered on the standby server. | |
6 |
...
Delete archive files once threshold is reached |
...
DELETE_ARCHDEST_THRESHOLD | Y or N Specifies if the archive log files should be deleted once the percentage threshold (THRESHOLD_ARCHDEST) on the standby server is reached. Once the threshold is reached the oldest archive log files are deleted first. |
Note |
---|
There is no verification that these archive log files have been backed up, this (backups) is outside the scope of Dbvisit Standby |
Note |
---|
This setting has no influence on whether archive log files are deleted for Days to keep archive log files or Number of archive log files to keep. These settings will delete archive log files once the percentage threshold is met. |
Flow of standby AMM process:
...
Below is an example of the archive log management settings from both primary and standby. In this example we have set for both primary and standby. We recommend checking the archive logs and database backup schedules and deletion frequencies before enabling this in the primary.
...
3.2 Standby AMM Decision Diagram
Each AMM run on primary is done only after successful archivelog transfer and following flow is used:
...
3.3 Standby AMM Settings Example
Following is an example on how to set standby AMM parameters:
...
Following rules will apply for this setting:
AMM will perform archivelog deletion on standby only after successful archivelog apply
Criteria 1&2: AMM will delete any archivelogs exceeding the count of 100 files (oldest first) AND it will not delete any archivelog which less than exactly 1 day old
there is logical AND between criteria 1 & 2
If disk space where ARCHDEST is located is more than 85% used, dbvisit will disregard criteria 1 and 2 and delete archivelos in an attempt to get below the threshold