Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Looping for remote servers and find its database from oratab file. Linux/Unix
  • Find Multiple levels of object dependencies : depen.sql Oracle
  • Mutating Table Error while using database trigger Oracle
  • Session_info.ksh Linux/Unix
  • Follwoing korn shell is used to move files from source folder to destination folder and gzip it in destination folder. mv_iotto.ksh Linux/Unix
  • Running some SQL on multiple databases connecting using monitoring userid and password Linux/Unix
  • Space padding in korn shell Linux/Unix
  • Search and replace pattern Linux/Unix
  • Sending email with file attachment. Linux/Unix
  • How to find the real execution plan and binds used in that explain plan in Oracle 10g?? Oracle
  • EXTPROC Oracle
  • Finding last recovered file on DR and remove all chanracters before any “/” Linux/Unix
  • Parallel DML Oracle
  • DB Console Mainenance. Oracle
  • Facts about SCN and Rollback Segment Oracle

Validating ORACLE_SID againt oratab file.

Posted on 05-Oct-2006 By Admin No Comments on Validating ORACLE_SID againt oratab file.

The following script shows how to check an Oracle SID to be sure that it’s valid. The script expects the SID to be passed in as the first parameter, and it begins by checking to see if a parameter was even passed. The script next counts the number of times the first parameter value appears in the /etc/oratab file. A valid Oracle SID will appear once in that file.

#!/bin/ksh

# Exit if no first parameter $1 passed.

if [ -z “$1” ]

then

echo “Please pass a valid ORACLE_SID

to this script”

exit 99

fi

# Validate the Oracle database name with

# lookup in /etc/oratab.

TEMP=`cat /etc/oratab|grep ^$1:|

cut -f1 -d’:’|wc -l`

tmp=`expr TEMP` # Convert string to number.

if [ $tmp -ne 1 ]

then

echo “Your input $1 is not a valid ORACLE_SID.”

exit 99

fi

Linux/Unix, shell

Post navigation

Previous Post: Some useful Unix Commands
Next Post: Looping for remote servers and find its database from oratab file.

Related Posts

  • checking redhat linux version Linux/Unix
  • To find all disk io ( EMC as well as local) Linux/Unix
  • ipcs -l Linux/Unix
  • Directory wise folder wise space usage Linux/Unix
  • rm_backup_arch_file.ksh Linux/Unix
  • Finding last recovered file on DR and remove all chanracters before any “/” Linux/Unix

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • currwaitobj.sql SQl_ID and SQL statement you can get from currwaitobj.sql Oracle
  • Read CSV File using Python Python/PySpark
  • sid_wise_cursor.sql find open cursor basis on username or SID Oracle
  • sid_wise_sql.sql Further explaination Oracle
  • Find execution plan from dba_hist_sql_plan for a specific SQL_ID and PLAN_HASH_VALUE fplan.sql Oracle
  • Oracle Internal Good Websites 1 Oracle
  • Oracle Metalink useful notes Oracle
  • ipcs -l Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme