#!/bin/bash
# use your actual ORACLE_SID instead of db
ORACLE_SID=db
export ORACLE_SID
#The follow only use /etc/oratab have ORACLE_SID, if not, please write the actual PATH
ORACLE_HOME=`cat /etc/oratab|grep ^$ORACLE_SID:|cut -f2 -d':'`
#ORACLE_HOME=`cat /etc/oratab|grep ^$ORACLE_SID:|awk -F':' '{print $2}'`
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
export PATH
$ORACLE_HOME/bin/sqlplus perfstat/perfstat@db<select
name,
snap_id,
to_char(snap_time,' dd Mon YYYY HH24:mi:ss') snap_time
from
stats\$snapshot,
v\$database
order by
snap_id
;
exit
!
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7865774/viewspace-624606/ ,如需转载,请注明出处,否则将追究法律责任。