SHELL中执行Oracle SQL语句查询性能视图

 

查询alert日志出现错误

#!/bin/bash

loadsql="SELECT count(1)
FROM  v\$diag_alert_ext 
WHERE
  originating_timestamp > ( sysdate - interval '1' HOUR )
 and
  ( message_text LIKE '%error%'
OR message_text LIKE '%ORA-%'
OR message_text LIKE '%terminating the instance%'
OR message_text LIKE '%CRS-%');"

loadsql="$loadsql"
result=`sqlplus -s /nolog  < 
 

 查询session

 

你可能感兴趣的:(SHELL中执行Oracle SQL语句查询性能视图)