2017年4月23日 星期日

omscripts_db_10_autorep.sh

vi /oracle/u02/omscripts/10_autorep.sh



#!/bin/bash
. ~/.bash_profile
sqlplus -S <<EOF
conn / as sysdba
column minsnapid noprint new_value begsnapid
column maxsnapid noprint new_value endsnapid
column spreportname noprint new_value reportname

select min(snap_id) minsnapid
from perfstat.stats\$snapshot
where SNAP_TIME > trunc(sysdate) -1 ;


select max(snap_id) maxsnapid
from perfstat.stats\$snapshot
where SNAP_TIME > trunc(sysdate) -1
and SNAP_TIME <= trunc(sysdate) + 1/24;


select '/tmp/sp_' || instance || '_' || to_char(sysdate -1 , 'yyyy_mm_dd') || '.txt' spreportname
from v\$thread;

define begin_snap=&begsnapid
define end_snap=&endsnapid
define report_name=&reportname

@$ORACLE_HOME/rdbms/admin/spreport.sql
EOF

沒有留言:

RHEL install EPEL

  https://www.linuxtechi.com/install-epel-repo-on-rhel-system/ EPEL dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest...