Skip to content

Commit 2a7771c

Browse files
authored
Update runroundpmon.sh
1 parent 28ff450 commit 2a7771c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

runroundpmon.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#!/bin/ksh
22

3-
43
ps -ef|grep pmon |grep -v grep |grep -v ASM | grep -v ksh | while read line
54
do
65

76
sid=`echo $line | awk '{print $8}' | cut -d_ -f3`
87

9-
108
export ORACLE_SID=$sid
119
export ORACLE_HOME=`grep $sid /etc/oratab | cut -d: -f2`
1210
export PATH=/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin:$ORACLE_HOME/bin
@@ -19,6 +17,8 @@ export LD_LIBRARAY_PATH=$ORACLE_HOME/lib
1917
sqlplus -s / as sysdba <<EOF
2018
2119
set head off
20+
set lines 120
21+
column db_unique_name format a15
2222
2323
/*
2424
select name, log_mode, database_role, open_mode from v\$database;
@@ -28,10 +28,11 @@ from (select (round ( sum(bytes)/(1024*1024*1024))) total_gb from v\$datafile) a
2828
(select (round ( sum(bytes)/(1024*1024*1024))) total_gb from v\$tempfile) b ;
2929
*/
3030
31-
select c.name, c.log_mode, c.database_role, c.open_mode, a.total_gb + b.total_gb total_size_gb
31+
select c.name, d.db_unique_name, c.log_mode, c.database_role, c.open_mode, (a.total_gb + b.total_gb) || ' GB' total_size_gb
3232
from (select (round ( sum(bytes)/(1024*1024*1024))) total_gb from v\$datafile) a,
3333
(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;
34+
(select name, log_mode, database_role, open_mode from v\$database) c,
35+
(select value db_unique_name from v\$parameter where name='db_unique_name') d;
3536
3637
EOF
3738

0 commit comments

Comments
 (0)