Sometimes OS team may request for outage on standby database server for maintenance activites. In that we need to stop the log shipping to avoid error in the alert log.
Run below commands to disable and enable the log shipping.
primary db -> prod
standby db - > proddr
1. Login to primary db server
$dgmgrl sys/manager@prod
DGMGRL for Linux: Release 12.2.0.1.0 - Production on Wed Oct 7 14:32:15 2020
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Conprodcted to "prod"
Conprodcted as SYSDBA.
DGMGRL> show configuration
Configuration - dg_config_prod
Protection Mode: MaxPerformance
Members:
prod - Primary database
proddr - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 8 seconds ago)
2. Check the apply and transport status:
DGMGRL> show database proddr
Database - proddr
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Average Apply Rate: 335.00 KByte/s
Real Time Query: ON
Instance(s):
proddr
Database Status:
SUCCESS
3. Disable shipping and apply process:
DGMGRL> edit database proddrstby set state='APPLY-OFF';
Succeeded.
DGMGRL> edit database proddrstby set state='LOG-TRANSPORT-OFF';
DGMGRL> show database proddrstby
Database - proddrstby
Role: PHYSICAL STANDBY
Intended State: TRANSPORT-OFF
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: (unknown)
Average Apply Rate: (unknown)
Real Time Query: OFF
Instance(s):
proddrstby
Database Status:
SUCCESS
4. Now enable shipping and apply process:
DGMGRL> edit database proddrstby set state='APPLY-ON';
Succeeded.
DGMGRL> edit database proddrstby set state='TRANSPORT-ON';
DGMGRL> show database proddrstby
Database - proddrstby
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: (unknown)
Average Apply Rate: (unknown)
Real Time Query: ON
Instance(s):
proddrstby
Database Status:
SUCCESS
dgmgrlstandby DATAGUARD