I am setting a commonly used alias for the usage of sqlplus called "sql" depending on the ORACLE_SID being set to the cdb or the pdb.
It differs slightly since I you can only do a bequath session when connecting to the former, and not the latter:
read -p 'Will you be administrating the cdb or the PDB? ' container case $container in CDB|cdb) . $ORACLE_HOME/cdb_settings.env; alias sql='sqlplus / as sysdba';; PDB1|pdb1) . $ORACLE_HOME/pdb1.env; alias sql='sqlplus sys@pdb1 as sysdba';; *) echo "You must select cdb or pdb1"; exit 1;; esac
No comments:
Post a Comment