My Oracle Database Server Alias List

Logo from the Alias TV show

I help a team manage a bunch of Oracle servers that use an OFA layout with the Oracle software and their database on /u01 and the fast recovery area on /u02.

These are all Linux servers, so we’ve installed rlwap so that we can reverse grep (CTRL-r) through our command history in the command line tools and use the up arrow to cycle through previous commands.

With the following in my .bashrc file, our lives as DBAs are much easier.

# User specific aliases and functions
# rlwrap for Oracle command line tools
alias adrci='rlwrap adrci'
alias asmcmd='rlwrap asmcmd'
alias expdp='rlwrap expdp'
alias impdp='rlwrap impdp'
alias rman='rlwrap rman'
alias sqlplus='rlwrap sqlplus'
 
# Quick Navigation
alias home='cd $ORACLE_HOME'
alias audit='cd $ORACLE_BASE/admin/$ORACLE_SID/adump'
alias alert='cd $ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace'
alias trace='cd $ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace'
alias log='cd $ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace'
alias dbs='cd $ORACLE_BASE/dbs'
alias network='cd $(orabasehome)/network/admin'
alias admin='cd $ORACLE_BASE/admin'
alias diag='cd $ORACLE_BASE/diag'
alias oradata='cd $ORACLE_BASE/oradata'
alias fra='cd /u02/app/oracle/fast_recovery_area'
 
# Commands
alias opatch='$ORACLE_HOME/OPatch/opatch'
alias sql='/u01/app/oracle/product/19.0.0.0/dbhome_1/sqlcl/bin/sql'
alias pmon='ps -ef | grep pmon | grep -v grep'
alias oratab='cat /etc/oratab'
alias rmanc='rlwrap rman target / catalog /@rcat'

Some notes:

  • As I mentioned, the fast recovery area is on /u02 so the “fra” alias is hard coded to that location.

  • The “rmanc” (connect to the local database and the remote recovery catalog in one command) alias uses a SEPS wallet with the recovery catalog username and password aliased to “rcat”. A SEPS wallet allows bequeath connections to remote databases which means that you don’t have to put passwords into your scripts.

  • Why are there three aliases for the same location (“alert”,”trace”,”log”)? Different team members liked different aliases and why not?

  • The “network” alias is designed to work with both an old style read/write Oracle Software Home and the new Read Only Software Home.




Leave a comment