Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • DBMS_SQL for alter session. Oracle
  • find_string_in_database.sql Oracle
  • Vivek Tuning for Row Locks. Oracle
  • Caching sequence in Memory Oracle
  • How to change hostname in Linux Linux/Unix
  • Roles and Stored Procs II Oracle
  • changing kernel parameter in Oracle Enterpise Linux Linux/Unix
  • Jai Shree Ram Oracle
  • shr1.sql for MTS or Shared server configuration Oracle
  • Implementing Listener Security Oracle
  • Exadata Basics Oracle
  • Changing Instance Name ( No DB_NAME) Oracle
  • Formatter Explain plan Output 1 Oracle
  • Good link for LIO in Oracle ( Logical IOs) Oracle
  • All Hints for Oracle Databases 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

  • Changing default shell Linux/Unix
  • rm_backup_arch_file.ksh Linux/Unix
  • on IBM-AIX for display Linux/Unix
  • Directory wise folder wise space usage Linux/Unix
  • rm_backup_arch_file.ksh Linux/Unix
  • remove archfiles only when it is applied to DR rm_archfiles.sh 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 (388)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (337)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Export Import with QUERY Oracle
  • The most important Tuning Notes Oracle
  • OPENING A STANDBY DATABASE IN READ-ONLY MODE Oracle
  • 751131.1 New Article Error 2819 While Requesting a Systemstate Dump Oracle
  • Jai Shree Ram Oracle
  • telnet listening Linux/Unix
  • FRA Information. Oracle
  • Running select from V$ views from remote server Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme