Skip to content

Commit 28ff450

Browse files
authored
Create runroundpmon.sh
1 parent 331246c commit 28ff450

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

runroundpmon.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/ksh
2+
3+
4+
ps -ef|grep pmon |grep -v grep |grep -v ASM | grep -v ksh | while read line
5+
do
6+
7+
sid=`echo $line | awk '{print $8}' | cut -d_ -f3`
8+
9+
10+
export ORACLE_SID=$sid
11+
export ORACLE_HOME=`grep $sid /etc/oratab | cut -d: -f2`
12+
export PATH=/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin:$ORACLE_HOME/bin
13+
export LD_LIBRARAY_PATH=$ORACLE_HOME/lib
14+
15+
#echo line=$line
16+
#echo sid=$ORACLE_SID
17+
#echo path=$PATH
18+
19+
sqlplus -s / as sysdba <<EOF
20+
21+
set head off
22+
23+
/*
24+
select name, log_mode, database_role, open_mode from v\$database;
25+
26+
select a.total_gb + b.total_gb total_size_gb
27+
from (select (round ( sum(bytes)/(1024*1024*1024))) total_gb from v\$datafile) a,
28+
(select (round ( sum(bytes)/(1024*1024*1024))) total_gb from v\$tempfile) b ;
29+
*/
30+
31+
select c.name, c.log_mode, c.database_role, c.open_mode, a.total_gb + b.total_gb total_size_gb
32+
from (select (round ( sum(bytes)/(1024*1024*1024))) total_gb from v\$datafile) a,
33+
(select (round ( sum(bytes)/(1024*1024*1024))) total_gb from v\$tempfile) b,
34+
(select name, log_mode, database_role, open_mode from v\$database) c;
35+
36+
EOF
37+
38+
done

0 commit comments

Comments
 (0)