Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • FGA Part-I Oracle
  • Sequence Resetting Oracle
  • Getting started with notebook Python/PySpark
  • Nice Article about semaphores and init.ora Processes parameter relations Linux/Unix
  • The most important Tuning Notes Oracle
  • column level grant syntax Oracle
  • oracle 10g on linux Linux/Unix
  • changing kernel parameter in Oracle Enterpise Linux Linux/Unix
  • Rollback force for distributed transactions Oracle
  • Find All internal Parameters Oracle
  • How To Limit The Access To The Database So That Only One User Per Schema Are Connected (One Concurrent User Per Schema) Oracle
  • Settting up get_vmstat.sh for colletinf CPU Usage. Oracle
  • Move WordPress site from one hosting service to other. PHP/MYSQL/Wordpress
  • SQL_PROFILE – I explaination Oracle
  • Renaming Oracle Instance Name 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

  • Generate SSH without password authentication. Linux/Unix
  • note id 373303.1 Linux/Unix
  • Adding a new disk and mount it automatically. on VMWARE LINUX Linux/Unix
  • Monitor and Trace Unix processes using truss Linux/Unix
  • Find Command Linux/Unix
  • switchlogfile.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 (387)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (336)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • Add new columns in dataframe30-Sep-2023

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Processes Parameter decision Oracle
  • fkwoind.sql fkwoindex.sql Oracle
  • Changing the Global Database Name Oracle
  • database trigger failing Oracle
  • Oracle Statspack survival Guide Oracle
  • How to collect CPU usage on Linux using Shell script Linux/Unix
  • Difference between SYNC and AFFIRM Oracle
  • Important Script Method for tuning Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme