HKEY_CURRENT_USER\EnvironmentIf using Windows powershell, use
Get-ItemProperty -Path "HKCU:\Environment"In windows command-line enviroment use
echo %PATH%
Minimalistic Oracle contains a collection of practical examples from my encounters with Oracle technologies. When relevant, I also write about other technologies, like Linux or PostgreSQL. Many of the posts starts with "how to" since they derive directly from my own personal experience. My goal is to provide simple examples, so that they can be easily adapted to other situations.
HKEY_CURRENT_USER\EnvironmentIf using Windows powershell, use
Get-ItemProperty -Path "HKCU:\Environment"In windows command-line enviroment use
echo %PATH%
DGMGRL> show configuration; Configuration - DB01 Protection Mode: MaxPerformance Members: DB01 - Primary database DB01_STB - Physical standby database DB01_TSTB - Physical standby database (receiving current redo) Error: ORA-16665: time out waiting for the result from a member DB01_RO - Physical standby databaseWhen looking at the details by using
show database verbose "DB01_TSTB"the entire operation would take very long, and at the, the following message is displayed:
Database Status: DGM-17016: failed to retrieve status for database "DB01_TSTB" ORA-16665: time out waiting for the result from a memberThe broker log file showed:
09/02/2020 15:08:52 Data Guard Broker Status Summary: Type Name Severity Status Configuration DB01 Warning ORA-16607 Primary Database DB01 Success ORA-0 Physical Standby Database DB01_STB Success ORA-0 Physical Standby Database DB01_RO Success ORA-0 Physical Standby Database DB01_TSTB Error ORA-16665Root cause here was firewalls. The terminal standby database could not reach the primary database. Although the terminal standby database isn't set up to receive redo data from the primary database directly, in a broker configuration all members must be able to communicate with eachother. A good tool for troubleshooting issues dealing with ports and firewalls is nmap. I installed it on the terminal server and issued:
[root@db04_server ~]# nmap -n -p 1511 db01_sever.oric.no Starting Nmap 6.40 ( http://nmap.org ) at 2020-09-02 14:23 CEST Nmap scan report for db01_sever.oric.no (xxx.xxx.xxx.xxx) Host is up (0.016s latency). PORT STATE SERVICE 1511/tcp filtered 3l-l1 Nmap done: 1 IP address (1 host up) scanned in 0.49 secondsA filtered port means that it is not possible to determine whether the port is open or closed, most often due to firewalls along the way. Further checks in the firewall log files showed
action=Drop service=1511 dst=xxx.xxx.xxx.xxx scr=yyy.yyy.yyy.yyywhere xxx.xxx.xxx.xxx was matching the ipadress of the terminal standby server, while yyy.yyy.yyy.yyy was matching the ipadress of the primary server. The network admin opened the port, and the ORA-16665 immediately disappeared from the dgmgrl output.
oracle@oric01.oric.no:[PRODDB01]# orapwd describe file=/u01/oracle/product/12201/dbs/orapwPRODDB01 Password file Description : format=LEGACYIf you try to create the password file with a password that is too simple, you may see this error from orapwd:
OPW-00029: Password complexity failed for SYS user : Password must contain at least 8 charactersThe format is set to 12.2 by default, and from the orapwd help text there doesn't seem to be anything lower than this.
orapwd file=u01/oracle/product/12201/dbs/orapwPRODDB01 format=legacy force=Y Enter password for SYS:
pg_dump db01 -v -Fc >db01.dmp
pg_restore -v -d db01 -1 db01.dmp
pg_restore -v -C -d postgres /exports/full_db_export.dmp
pg_dump -Fd db01 -f /exports/full_db01 -v
pg_restore /exports/full_db01 -C -c -d postgres -j 2 -v
pg_restore /exports/full_db01 -c -d db02 -j 2 -v
db, extended'
. dgmgrl / as sysdba Connected to "hdal_stb" Connected as SYSDBA. DGMGRL> show configuration; Configuration - DGConfig1 Protection Mode: MaxPerformance Members: hdal - Primary database hdal_stb - Physical standby database hdal_tstb - Physical standby database (receiving current redo)
DGMGRL> edit database 'hdal_stb' set property ApplyParallel=4;
In the database's alert log, we can se that Oracle is cancelling the ongoing recovery process:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL 2020-08-10T09:26:24.249847+02:00 MRP0: Background Media Recovery cancelled with status 16037 Managed Standby Recovery not using Real Time Apply Recovery interrupted! Recovered data files to a consistent state at change 27754456 2020-08-10T09:26:24.510262+02:00 ORA-16037: user requested cancel of managed recovery operation 2020-08-10T09:26:24.617519+02:00 MRP0: Background Media Recovery process shutdown (hdal) 2020-08-10T09:26:25.250904+02:00 Managed Standby Recovery Canceled (hdal)And then starting it again:
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT PARALLEL 4 NODELAY 2020-08-10T09:26:25.284547+02:00 Attempt to start background Managed Standby Recovery process (hdal) Starting background process MRP0 2020-08-10T09:26:25.306150+02:00 MRP0 started with pid=77, OS id=115854 2020-08-10T09:26:25.311038+02:00 MRP0: Background Managed Standby Recovery process started (hdal) 2020-08-10T09:26:30.339894+02:00 Started logmerger process 2020-08-10T09:26:30.378497+02:00 Managed Standby Recovery starting Real Time Apply 2020-08-10T09:26:30.515607+02:00 Parallel Media Recovery started with 4 slaves 2020-08-10T09:26:30.741846+02:00 Media Recovery Waiting for thread 1 sequence 8299 (in transit)Verify the new setting by looking at the properties (output truncated for brevity):
DGMGRL> show database verbose hdal_stb Database - hdal_stb Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: 0 Byte/s Active Apply Rate: 0 Byte/s Maximum Apply Rate: 0 Byte/s Real Time Query: OFF Instance(s): hdal Properties: DGConnectIdentifier = 'hdal_stb' LogXptMode = 'ASYNC' ApplyParallel = '4'The change will be propagated to the other members of the data guard configuration. The data guard broker logfile, located in $ORACLE_BASE/diag/rdbms/$UNIQUE_NAME/$ORACLE_SID/trace, shows:
08/10/2020 09:26:24 Forwarding EDIT_RES_PROP operation to member hdal for processing 08/10/2020 09:26:31 Updated broker configuration file available, loading from "$ORACLE_HOME/dbs/dr2hdal_stb.dat" 08/10/2020 09:42:35 Forwarding MON_PROPERTY operation to member hdal_tstb for processingThe cascading database hdal_tstb simply confirms that the broker configuration has been updated:
08/10/2020 09:26:31 Updated broker configuration file available, loading from "$ORACLE_HOME/dbs/dr2hdal_tstb.dat"The primary database is also verifying the change, although a bit more detailed:
08/10/2020 09:26:24 EDIT DATABASE hdal_stb SET PROPERTY applyparallel = 4 08/10/2020 09:26:31 EDIT INSTANCE hdal ON DATABASE hdal_stb SET PROPERTY applyparallel = 4 completed successfullyDocumentation for dgmgrl version 19c can be found here