Wednesday, October 21, 2020

dgmgrl validate database spfile and ORA-12154

I've got this error during execution of "validate database verbose db_name spfile ;" on Oracle 12.2. 

The error encountered when property DGConnectIdentifier for the database was set to easyconnect string with shared or dedicated connection type (like 'hostname/service_name:dedicated') or expanded tns entry was used (like '(description=...)'). 

 DataGuard Broker build the connection string with additional useless fragments of database dispatchers setting making the connection string invalid :

Unable to connect to database using hostname/service_name:dedicatedf)(connections=100)(sessions=100)

The error had gone when property DGConnectIdentifier was set to easyconnect string without ":dedicated" piece or to the name of the tns entry (from tnsnames.ora or from ldap).

Update : the issue can occur when validated database also has got dispatchers parameter set to non-default value.

Good Luck !

Friday, October 9, 2020

Bash : empty variable value outside of while loop using pipelines for input

Instead of the following which returns empty value of a :

$> a=0 ; find /dev/shm/ -uid 54321 -ls | awk '{print $7}' | while read line ; do let a+=${line}; done ; echo "a="${a}

try to use bash's process substitution like this :

a=0 ; while read line ; do let a+=$line ; done < <(find /dev/shm/ -uid 54321 -ls | awk '{print $7}') ; echo "a="$a

This will prevent using newly created shells for pipelines, using the current shell for all operands. Good Luck !