1
1
#! /bin/ksh
2
2
3
-
4
3
ps -ef| grep pmon | grep -v grep | grep -v ASM | grep -v ksh | while read line
5
4
do
6
5
7
6
sid=` echo $line | awk ' {print $8}' | cut -d_ -f3`
8
7
9
-
10
8
export ORACLE_SID=$sid
11
9
export ORACLE_HOME=` grep $sid /etc/oratab | cut -d: -f2`
12
10
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
19
17
sqlplus -s / as sysdba << EOF
20
18
21
19
set head off
20
+ set lines 120
21
+ column db_unique_name format a15
22
22
23
23
/*
24
24
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
28
28
(select (round ( sum(bytes)/(1024*1024*1024))) total_gb from v\$ tempfile) b ;
29
29
*/
30
30
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
32
32
from (select (round ( sum(bytes)/(1024*1024*1024))) total_gb from v\$ datafile) a,
33
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;
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;
35
36
36
37
EOF
37
38
0 commit comments