first sqlplus shell

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->

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值