iT邦幫忙

DAY 23
3

Oracle and MS SQL系列 第 24

[Day 23]Oracle-System Views

當使用者反映查詢資料庫很慢,往往DBA需要找出兇手是誰??
這時就需要System View來幫助我們,同時我也幫大家找到10g所有的system view
方便以後查詢。
搭配Catalog View編寫DBA管理相關PL/SQL語法,提高工作效率。

--查看tablespace usage
select b.file_id,b.tablespace_name,b.bytes,sum(nvl(a.bytes,0)) left,sum(nvl(a.bytes,0))/(b.bytes)*100 left_percent
from dba_free_space a,dba_data_files b
where a.file_id=b.file_id group by b.tablespace_name,b.file_id,b.bytes order by b.file_id;

--查看shared pool usage
select sum(pins) "Total Pins", sum(reloads) "Total Reloads",
(1-sum(reloads)/sum(pins) *100) libcache
from v$librarycache;

--查看pga
select a.sid,b.name,a.value from v$sesstat a,v$statname b
where (b.name like '%uga%' or b.name like '%pga%') and a.statistic# = b.statistic#
order by sid ;

10g_view.rar


上一篇
[Day 22]Oracle-善用Partiton Table#測試
下一篇
[Day 24]SQL SERVER-Oracle 2 SQL
系列文
Oracle and MS SQL34
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言