A Very Cool Oracle Bash Profile

# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH # Oracle Settings export TMP=/tmp export ORACLE_HOSTNAME=easyoradba.com export ORACLE_UNQNAME=ora12c export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1 export ORACLE_SID=ora12c export CATALINA_HOME=/home/oracle/apache-tomcat PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin:$CATALINA_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; alias ob='cd $ORACLE_BASE' alias oh='cd $ORACLE_HOME' … Continue reading A Very Cool Oracle Bash Profile

Shell Script to Ping Hostnames and Send SMS if Host is not Available

We use the below procedure to ping hosts and based on availability send SMS to our team. The SMS is send by calling a web service from the BASH Shell script using curl  The hosts are defined in a file called hosts.txt -- Shell Script -- #!/bin/bash current_time=$(date "+%Y%m%d%H%M%S%3N") #### Above Date Format is in … Continue reading Shell Script to Ping Hostnames and Send SMS if Host is not Available

RMAN Script for Tape Backup : Tivoli Storage Manager

[sourcecode language="sql"] run { allocate channel sbt1 type sbt parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)'; allocate channel sbt2 type sbt parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)'; CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE'; BACKUP DATABASE FORMAT 'MW_FULL_%s_%D_%M_%Y' tag 'MW_DAILY_FULL_DB_BKP'; BACKUP archivelog all not backed up 1 times format 'ARCH_%d_ALL_%s_%t' tag 'MW_ARCH_LOG_BKP'; release channel sbt1; release channel sbt2; } [/sourcecode]

Linux Matrix Effects Shell Script

Sometimes to have a funky time on the BASH shell you can run the below shell script [code language="bash"] #!/bin/bash clear virtcent=$((`tput lines`/2)) horcent=$((`tput cols`/2-10)) tput setf 6 tput cup $virtcent $horcent && echo "entering the matrix" sleep 1 tput cup $virtcent $horcent && echo " " sleep 1 tput cup $virtcent $horcent && echo … Continue reading Linux Matrix Effects Shell Script

Shell Script to Monitor AIX Filesystem and Send Email

The Below Shell Script checks the Filesystem mount points and using AWK outputs all filesystem exceeding 90% space to a file called diskspacepoll. Once that is done the sed command removes any special character like '%' from the output file and cleans it to a file called output.log The next important logic is in the … Continue reading Shell Script to Monitor AIX Filesystem and Send Email

Running SQL Script for Multiple Databases SQL*PLUS | Mutiple Servers SQL*PLUS in Shell Script | BASH Script Looping SQL*PLUS commands

For running a single SQL Command via sqlplus on multiple servers, we have to first do a few pre-requisites 1. Oracle client should be installed on the Unix/Linux Server 2. Create Local TNS entry in the tnsnames.ora file for the databases where you will run the commands 3. All databases should have one common user … Continue reading Running SQL Script for Multiple Databases SQL*PLUS | Mutiple Servers SQL*PLUS in Shell Script | BASH Script Looping SQL*PLUS commands