11-08-2006
database status script
Hi all,
take two files.
one file contains with total database list
second file contains with current running database list.(i will show the command in script)
#!/bin/bash
ps -ef |grep pmon |awk '{ print $8 $9 }'|cut -b10-|sed 's/mon_//' >/export/home/kmidatad/rundbs.txt
echo "RUNNING"
echo "================="
cat rundbs.txt
echo "================="
echo "TOTAL DATABASES ARE"
cat rundbs.txt|wc -l
echo "================="
echo "NOT RUNNING"
echo "================="
alldbsvar=`cat alldbs.txt`
rundbsvar=`cat rundbs.txt`
for i in $alldbsvar
do
a=0
for j in $rundbsvar
do
if [ $i = $j ]
then
a=1
# echo "aaa"
break
fi
done
if [ $a -eq 0 ]
then
echo $i
fi
done
echo "===================="
echo "process is completed"
echo "===================="
--------------------------------------
above example 1. alldbs.txt is the total database file
2. rundbs.txt is the current running database file.
thanks
Krishna murthy
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i have activated mysql, and apache on my redhat 9 box, i went to mr BASH and wrote a php script, and it wouldn't execute.
any help?????????????????????????????????????
is there something that i need to activate???????
i have RUBY on there too,does it matter or no???
... (2 Replies)
Discussion started by: mbabeli
2 Replies
2. UNIX for Advanced & Expert Users
hi all
by using gethostbyname, i can know whether the net is available or not.
it is working fine when i activate or deactivate in neat.
the problem is when i remove cable(netcable) it is not working proparly,
i would like to know it.
am using fedora5, AMD
can u please help me .
thank... (3 Replies)
Discussion started by: munna_dude
3 Replies
3. SCO
Hi,
in our business we have a formerly (few years ago) installed computer with an openserver SCO 5.05
there are 3 network cards in it. one on board and two 3Com-cards
Looking with ifconfig (or scoadmin) they seemed to be installed correctly.
IP-Adress, netmask broadcas looks OK.
But no... (3 Replies)
Discussion started by: klex
3 Replies
4. Shell Programming and Scripting
Now i'm up to making a script from which you could activate all Linux services without being an expert. It's gonna be a powerful tool, I'll look forward to make it able to change the port which the service is assigned to. But I need some help, post some script to activate services and I'll fusion... (8 Replies)
Discussion started by: Dax01
8 Replies
5. AIX
hi Guys,
I just wondering if someone has gone through this process before. We are about to migrate all our current LPARS from a Power6 server to a new Power7 server. The only concern we have is that we are runing a few DB2 V8 databases on AIX 5.3 and basically DB2 v8 is been out of support for... (2 Replies)
Discussion started by: arizah
2 Replies
6. Shell Programming and Scripting
Hi,
I have written a function which will blink a text "Scanning...". Now in the main script when I am doing the scan in the server I want to call this function so that user will see a blinking text on the screen and at the same time script will proceed will the scan function. Once scan is... (2 Replies)
Discussion started by: suhasingale
2 Replies
7. Shell Programming and Scripting
I need to create a script to list all the databases that are in cluster environment.
The reason is that there are databases which are not in under cluster control and we need to identify those.
The easiest way to identify is:
clrt list (if SUNW.oracle_server:6, SUNW.oracle_listener:5 are not... (0 Replies)
Discussion started by: misterx12345
0 Replies
8. Shell Programming and Scripting
Hi Friends,
I was successfully able to login passwordlessly to server 1.1.1.2 from server 1.1.1.1 by following the below steps. I had already generated the keys using (ssh-keygen -t rsa) once and i am assuming i do not have to do that again.
ssh id@1.1.1.2 mkdir -p .ssh
cat... (8 Replies)
Discussion started by: srkmish
8 Replies
9. Shell Programming and Scripting
Hi Team,
I am Oracle Databse developer. I am currently working on two databases.
DB1 and DB2.
in DB1 I have a Select query which will return 100 records.
In Db2 I have a Select query which also return 100 records.
In these two tables ( in different Schemas) we have a common column.
... (2 Replies)
Discussion started by: vasuvv
2 Replies
LEARN ABOUT PHP
mssql_field_seek
MSSQL_FIELD_SEEK(3) MSSQL_FIELD_SEEK(3)
mssql_field_seek - Seeks to the specified field offset
SYNOPSIS
bool mssql_field_seek (resource $result, int $field_offset)
DESCRIPTION
Seeks to the specified field offset. If the next call to mssql_fetch_field(3) won't include a field offset, this field would be returned.
PARAMETERS
o $result
- The result resource that is being evaluated. This result comes from a call to mssql_query(3).
o $field_offset
- The field offset, starts at 0.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Using mssql_field_seek(3) on the example for mssql_fetch_field(3)
<?php
// Connect to MSSQL and select the database
mssql_connect('MANGOSQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php');
// Send a select query to MSSQL
$query = mssql_query('SELECT * FROM [php].[dbo].[persons]');
// Construct table
echo '<h3>Table structure for 'persons'</h3>';
echo '<table border="1">';
// Table header
echo '<thead>';
echo '<tr>';
echo '<td>Field name</td>';
echo '<td>Data type</td>';
echo '<td>Max length</td>';
echo '</tr>';
echo '</thead>';
// Dump all fields
echo '<tbody>';
for ($i = 0; $i < mssql_num_fields($query); ++$i) {
// Fetch the field information, notice the
// field_offset parameter is not set. See
// the mssql_field_seek call below
$field = mssql_fetch_field($query);
// Print the row
echo '<tr>';
echo '<td>' . $field->name . '</td>';
echo '<td>' . strtoupper($field->type) . '</td>';
echo '<td>' . $field->max_length . '</td>';
echo '</tr>';
// Move the internal seek pointer to the next
// row in the result set
mssql_field_seek($query, $i + 1);
}
echo '</tbody>';
echo '</table>';
// Free the query result
mssql_free_result($query);
?>
SEE ALSO
mssql_fetch_field(3).
PHP Documentation Group MSSQL_FIELD_SEEK(3)