Home » Infrastructure » Unix » Getting oracle_sid's from the oratab file
Getting oracle_sid's from the oratab file [message #366995] Wed, 05 April 2000 09:58 Go to next message
Henrik Wengholt
Messages: 2
Registered: April 2000
Junior Member
Hello

We are in the process of migrating 100 Oracle databases (v8.1.5) from OpenVMS to HP-UX v11.

I am new to UNIX, and I need a shell script (Korn Shell) which list all oracle_sid's on the box from the oratab file.
Anyone with some hints or links ??

Regards, Henrik

Henrik Wengholt
Novo Nordisk A/S
Krogshoejvej 45, 2880 Bagsvśrd
Denmark
Email: hww@novo.dk
Re: Getting oracle_sid's from the oratab file [message #366997 is a reply to message #366995] Wed, 05 April 2000 11:38 Go to previous messageGo to next message
Melissa
Messages: 65
Registered: January 2000
Member
This is assuming that the databases in the oratab are marked Y to startup on reboot.

cat /etc/oratab | while read LINE
do
case $LINE in
\#*) ;; #comment-line in oratab
*)
SID=`echo $LINE | awk -F: '{print $1}' -`
echo $SID
esac
done
Re: Getting oracle_sid's from the oratab file [message #367025 is a reply to message #366995] Wed, 09 August 2000 09:59 Go to previous messageGo to next message
Allan Peda
Messages: 1
Registered: August 2000
Junior Member
Well I'm guessing that you want a list of the $ORACLE_SID's that are up, not just a list of SIDs in the /etc/oratab.

Here's a perl script of use:

# Script to list database and associated processes
# Allan Peda
# allan@panix.com
# GNU GPL
# Aug 2000

use strict;
use English;
use diagnostics;
use Getopt::Std;
# mirrors args to getopts()
use vars qw($opt_h $opt_d $opt_n $opt_t);

my %plist;
my $db;
my $proc;

getopts('hdnt');

if(defined($opt_h)){
print <<DONE
usage: $PROGRAM_NAME -hdnt
-h displays this help message
-d database - only display
-n no line numbers
-t no title
DONE
;
exit 0;
}

open( PSOUTPUT, "ps -ef |" );

# if $t stays unchanged, there are no databases up
my $t="0";
while(<PSOUTPUT>){
if( m/(ora_\w+)$/ ){
($t, $proc, $db) = split(/_/, $1);
push(@{$plist{$db}}, $proc);
}
}

unless(defined($opt_t)){
if($t ne "0"){
print "The following databases are running: \n";
} else {
print "No databases are running. \n";
exit 0;
}
}

my $i=0;
foreach $db (sort(keys(%plist))){
$i++;
defined($opt_n) || print ' ' x 5, $i, ' ';
print $db , (' ' x (12 - length($db)));
unless(defined($opt_d)) {
foreach $proc ( sort(@{$plist{$db}}) ){
print $proc, ' ' x 4;
}
}
print "\n";
}
DBSNMP Sub Agent not Started [message #367043 is a reply to message #366995] Tue, 05 September 2000 11:31 Go to previous messageGo to next message
Salman Khan
Messages: 51
Registered: September 2000
Member
Hi,

Iam getting an error in dbsnmp agent, my database sub agent is not starting, its giving me an error when I started.

"LSNRCTL> dbsnmp_start
LSNRCTL> Tcl_RegisterChannel: duplicate channel names "

I check the log file and the messages apppers
"NMS-0001" uable to start the sub agent.

Anyone can help me how to resolve this problem
thanks
skhan2000@hotmail.com
SCN [message #367047 is a reply to message #366995] Mon, 11 September 2000 21:15 Go to previous messageGo to next message
help
Messages: 5
Registered: September 2000
Junior Member
Let me where can I find the scn
I searched in all the dump file and alert file
Please let me know how can i find the current scn number

Sincerely
Prashantha (pramu@metabyte.com
Re: DBSNMP Sub Agent not Started [message #367123 is a reply to message #366995] Tue, 26 December 2000 09:43 Go to previous message
Eileen Granier
Messages: 2
Registered: December 2000
Junior Member
Try deleting or renaming the file pkgIndex.tcl from the $ORACLE_HOME/network/agent/library directory.
Previous Topic: When create database under svrmgrl occur ora3113 Error
Next Topic: Dbsnmp sub agent not started
Goto Forum:
  


Current Time: Wed Jun 07 18:11:46 CDT 2023