Oracle ³£ÓÃ¼à¿ØSQL
1.¼à¿ØÊÂÀýµÄµÈ´ý£º
select event,sum(decode(wait_time,0,0,1)) prev, sum(decode(wait_time,0,1,0)) curr,count(*)
from v$session_wait
group by event order by 4;
2.»Ø¹ö¶ÎµÄÕùÓÃÇé¿ö£º
select name,waits,gets,waits/gets ratio from v$rollstat a,v$rollname b where a.usn=b.usn;
3.¼à¿Ø±í¿Õ¼äµÄI/O±ÈÀý£º
select df.tablespace_name name,df.file_name "file",f.phyrds pyr,f.phyblkrd pbr,f.phywrts pyw,
f.phyblkwrt pbw
from v$filestat f,dba_data_files df
where f.file#=df.file_id
4.¼à¿ÕÎļþϵͳµÄI/O±ÈÀý£º
select substr(a.file#,1,2) "#",substr(a.name,1,30) "name",a.status,a.bytes,
b.phyrds,b.phywrts
from v$datafile a,v$filestat b
where a.file#=b.file#
5.ÔÚij¸öÓû§ÏÂÕÒËùÓеÄË÷Òý£º
select user_indexes.table_name, user_indexes.index_name,uniqueness, column_name
from user_ind_columns, user_indexes
where user_ind_columns.index_name = user_indexes.index_name
and user_ind_columns.table_name = user_indexes.table_name
order by user_indexes.table_type, user_indexes.table_name,
user_indexes.index_name, column_position;
6. ¼à¿Ø SGA µÄÃüÖÐÂÊ
select a.value + b.value "logical_reads", c.value "phys_reads",
round(100 * ((a.value+b.value)-c.value) / (a.value+b.value)) "BUFFER HIT RATIO"
from v$sysstat a, v$sysstat b, v$sysstat c
where a.statistic# = 38 and b.statistic# = 39
and c.statistic# = 40;
7. ¼à¿Ø SGA ÖÐ×ֵ仺³åÇøµÄÃüÖÐÂÊ
select parameter, gets,Getmisses , getmisses/(gets+getmisses)*100 "miss ratio",
(1-(sum(getmisses)/ (sum(gets)+sum(getmisses))))*100 "Hit ratio"
from v$rowcache
where gets+getmisses <>0
group by parameter, gets, getmisses;
8. ¼à¿Ø SGA Öй²Ïí»º´æÇøµÄÃüÖÐÂÊ£¬Ó¦¸ÃСÓÚ1%
select sum(pins) "Total Pins", sum(reloads) "Total Reloads",
sum(reloads)/sum(pins) *100 libcache
from v$librarycache;
select sum(pinhits-reloads)/sum(pins) "hit radio",sum(reloads)/sum(pins) "reload perc
Ïà¹ØÎĵµ£º
±¸·ÝµÄ·½·¨
ORACLEÊý¾Ý¿âÓÐÈýÖÖ±ê×¼µÄ±¸·Ý¡£µ¼³ö/µ¼Èë(EXPORT/IMPORT) ¡¢À䱸·Ý¡¢Èȱ¸·Ý¡£
µ¼³ö±¸·ÝÊÇÒ»ÖÖÂß¼±¸·Ý£¬ÕâÖÖ·½·¨°üÀ¨¶ÁȡһϵÁеÄÊý¾Ý¿âÈÕÖ¾£¬²¢Ð´ÈëÎļþÖУ¬ÕâЩÈÕÖ¾µÄ¶ÁÈ¡ÓëÆäËù´¦Î»ÖÃÎ޹ء£
À䱸·ÝºÍÈȱ¸·ÝÊÇÎïÀí±¸·Ý(Ò²³ÆµÍ¼¶±¸·Ý)£¬ËüÉæ¼°µ½ ......
ÿÌì1µãÖ´ÐеÄoracle JOBÑùÀý
DECLARE
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
( job => X,
what => 'ETL_RUN_D_Date;',
next_date => to_date('2009-08-26 01:00:00','yyyy-mm-dd hh24:mi:ss'),
interval => 'trunc(sysdate)+1+1/24',
no_parse => FALSE
);
SYS.DBMS_OUTPUT.PUT_LINE('Job Number ......
dc-test2<oracle>sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 25 19:23:35 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
SQL> desc v$datafile;
SP2-0640: Not connected
SP2-0641: "DESCRIBE" requires connection to server
SQL> conn / a ......
Ò»£®ÒýÑÔ
ORACLE
Êý¾Ý¿â×Ö·û¼¯£¬¼´Oracle
È«Çò»¯Ö§³Ö(Globalization Support)
£¬»ò¼´¹ú¼ÒÓïÑÔÖ§³Ö£¨NLS
£©Æä×÷ÓÃÊÇÓñ¾¹úÓïÑԺ͸ñʽÀ´´æ´¢¡¢´¦ÀíºÍ¼ìË÷Êý¾Ý¡£ÀûÓÃÈ«Çò»¯Ö§³Ö£¬ORACLE
ΪÓû§Ìṩ×Ô¼ºÊìϤµÄÊý¾Ý¿âĸÓï»·¾³£¬ÖîÈçÈÕÆÚ¸ñʽ¡¢Êý×Ö¸ñʽºÍ´æ´¢ÐòÁеȡ£Oracle
¿ÉÒÔÖ§³Ö¶àÖÖÓïÑÔ¼°×Ö·û¼ ......
1£®OracleΪ¿Í»§¶Ë¿ªÆô»á»°ÓÐÁ½ÖÖ·½Ê½£º¹²Ïí·þÎñºÍרÓ÷þÎñ¡£ÔÚרÓ÷þÎñÇé¿öÏ£¬¼àÌýÆ÷ΪÁ¬½ÓÇëÇó´´½¨Ð½ø³Ì£¨Unix»·¾³ÏÂÊÇProcess£¬WindowsÏÂÎÒÏëÓ¦¸ÃÊÇThread°É£©£»¹²Ïí·þÎñÇé¿öÏ£¬¼àÌýÆ÷½«¿Í»§ÇëÇ󽻸øDispatcher£¬ÓÉDispatcher°²ÅŶà¿Í»§µÄ×÷Òµ¡£SQL ServerÔÚĬÈÏÇé¿öÏÂ×Ô¶¯Îª¿Í»§¶ËÁ¬½Ó´´½¨Ị̈߳¬µ±Óзdz£¶àµÄ¿Í ......