從此SQLPLUS有了Top命令

rongshiyuan發表於2012-08-21

從此SQLPLUS有了Top命令

Jagjeet Singh為我們提供了這樣一個sqlplus下的RAC dashboard,實時的效能工具,看上去和top或者nmon命令的介面很相似,藉助於這個工具我們將可以實時監控RAC的效能指標而不依賴於圖形介面。

點選這裡下載Jagjeet Singh的sqlplus dashboard for rac工具

具體的安裝方法如下:

解壓zip包 

[oracle@vrh1 ~]$ unzip Pck.zip 
Archive:  Pck.zip
   creating: Pck/
  inflating: Pck/1_grants.sql        
  inflating: Pck/2_Types.sql         
  inflating: Pck/3_pkg.sql           
  inflating: Pck/drop.sql            
  inflating: Pck/howtoinstall.sql    
  inflating: Pck/outputexplained.pdf  
  inflating: Pck/sampleoutput.png    

[oracle@vrh1 ~]$ cd Pck

[oracle@vrh1 Pck]$ sqlplus  / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Aug 8 02:08:49 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

1.  執行授權檔案1_grants.sql        

SQL> start 1_grants.sql
Enter value for _usr: maclean

需要指定安裝在哪個schema下

2. 登入上面指定的schema,並執行 2_Types.sql 建立type

SQL> conn maclean/maclean
Connected.
SQL> 
SQL> 
SQL> start 2_Types.sql

Type created.

Type created.

Type created.

Type created.

Type created.

Type created.

Type created.

Type created.

Type created.

Type created.

3. 執行3_pkg.sql 建立包體

SQL> start 3_pkg.sql

Package created.

No errors.

Package body created.

 若想刪除該工具嗎,解除安裝的方法 

SQL> connect maclean/maclean
SQL> start drop.sql

具體使用的方法如下:

 SQL>set lines 190 pages 0 arraysize 50
 SQL>select * from table(jss.gtop(50,10)) ;

50代表 arraysize 一般不用修改
10代表 10s取樣一次,取樣間隔

示例輸出:

這很酷,彷彿文字版的spotlight FOR RAC

相關文章 | Related posts:

  1. 瞭解sqlplus中的copy命令
  2. 在Unix上使用管道壓縮exp匯出檔案
  3. "hcheck.sql" script. to check for known problems in Oracle8i, Oracle9i, Oracle10g and Oracle 11g
  4. Unix平臺上OUI啟動常見問題
  5. CTAS VS create table and then insert
<!--

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-741503/,如需轉載,請註明出處,否則將追究法律責任。

相關文章