oratest->cat search.sh
#!/bin/bash
#set the environment..
ORACLE_SID=$ORACLE_SID
export ORACLE_SID
ORACLE_HOME=$ORACLE_HOME
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
export PATH
$ORACLE_HOME/bin/sqlplus hxg/hxg<<1
spool date.log
select count(executions) exectimes
from
v/$sqlarea
order by 1 desc;
spool off;
select count(*) from t1 ;
exit
;
oratest->
oratest->sh search.sh
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Jul 12 07:17:23 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> SQL> 2 3 4
EXECTIMES
----------
300
SQL> SQL>
COUNT(*)
----------
190828
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
oratest->
oratest->
oratest->ll
total 68
-rw-r--r-- 1 oracle oinstall 348 Jul 12 07:17 date.log
drwxr-xr-x 2 oracle oinstall 4096 Jul 8 19:24 Desktop
-rwxrwxrwx 1 oracle oinstall 324 Jul 12 07:15 search.sh
-rw-r--r-- 1 oracle oinstall 45973 Jul 10 00:40 systex-dbcheck.txt
-rw-r--r-- 1 oracle oinstall 6144 Jul 10 00:47 systex.sql
oratest->cat date.log
SQL> select count(executions) exectimes
2 from
3 v$sqlarea
4 order by 1 desc;
EXECTIMES
----------
300
SQL> spool off;
oratest->
oratest->