ÃüÁîÐÐά»¤Oracle AWR
ÃüÁîÐÐά»¤Oracle AWR
ÓÐʱºòÓÉÓÚÖÖÖÖÔÒò£¬Ö»ÄÜʹÓÃÃüÁîÐÐÀ´Î¬»¤Oracle10g¡£µ±È»ÎÒÃÇÒÀÈ»¿ÉÒÔʹÓÃstatspack£¬µ«ÓÉÓÚstatspack¹¦Äܲ»ÈçAWR£¬¶ø
ÇÒÈç¹ûʹÓÃÁ½ÖÖÐÔÄÜÕï¶Ï¹¤¾ßÒ²ÊÇÒ»ÖÖÀË·Ñ¡£Òò´ËÊÖ¶¯Î¬»¤AWR»¹ÊÇÓбØÒªµÄ£¬ÏÂÃæÁгöһЩ³£ÓõÄAWRÃüÁÒÔ±¸ºó²é¡£
1¡¢ÐÞ¸ÄAWRµÄ´¥·¢ÆµÂÊ
AWRĬÈÏÊÇÿСʱ´¥·¢Ò»´Î£¬µ«ÓÐʱºòÕâ¸öĬÈÏδ±Ø·ûºÏʵ¼ÊÒªÇó£¬Õâ¾ÍÐèÒª½øÐе÷Õû´¥·¢ÆµÂÊ¡£
SQL>exec
dbms_workload_repository.modify_snapshot_settings(retention=>20160,
interval=>15);
ÉÏÊöÃüÁî±íʾ£º15·ÖÖÓ´¥·¢Ò»´Î£¬ÀúÊ·¼Ç¼±£Áô14Ì죨20160=60*24*14£©¡£
2¡¢²é¿´AWRµÄ´¥·¢ÆµÂÊ
SQL>select *
from dba_hist_wr_control;
È磺
4008876392
+00000 02:00:00.0
--Á½Ð¡Ê±Ò»´Î
+00014 00:00:00.0
--ÀúÊ·Êý¾Ý±£Áô14Ìì
DEFAULT
3¡¢´´½¨Ð¿ìÕÕ
SQL>exec
dbms_workload_repository.create_snapshot
4¡¢²é¿´¿ìÕÕ
SQL>select
snap_id, begin_interval_time, end_interval_time from
dba_hist_snapshot order by 1
5¡¢Éú³É¿ìÕÕ±¨¸æ
SQL>start
$ORACLE_HOME/rdbms/admin/awrrpt.sql
Ïà¹ØÎĵµ£º
CASE±í´ïʽ¿ÉÒÔÔÚSQLÖÐʵÏÖif-then-elseÐ͵ÄÂß¼£¬¶ø²»±ØʹÓÃPL/SQL¡£CASEµÄ¹¤×÷·½Ê½ÓëDECODE()ÀàËÆ£¬µ«Ó¦¸ÃʹÓÃCASE,ÒòΪËüÓëANSI¼æÈÝ¡£
CASEÓÐÁ½ÖÖ±í´ïʽ:
1. ¼òµ¥CASE±í´ïʽ,ʹÓñí´ïʽȷ¶¨·µ»ØÖµ.
Óï·¨:
CASE search_expression
WHEN expression1 THEN result1
WHEN expression2 THEN ......
select * from (select t.*,rownum rn from (select * from emp) t where rownum<=10) where rn>=6;
´´½¨·ÖÒ³½á¹û¼¯µÄÓαê
create or replace package fenyepackage as
type testcursor is ref cursor;
end fenyepackage;
´´½¨·ÖÒ³´æ´¢¹ý³Ì
create or replace procedure fenye3(
tableName varchar2, --±íÃû
......
oracle ÖУ¬¶ÔÓÚÒ»¸öÌá½»µÄsqlÓï¾ä,´æÔÚÁ½ÖÖ¿ÉÑ¡µÄ½âÎö¹ý³Ì, Ò»ÖÖ½Ð×öÓ²½âÎö,Ò»ÖÖ½Ð×öÈí½âÎö.
Ò»¸öÓ²½âÎöÐèÒª¾½âÎö,Öƶ¨Ö´Ðз¾¶,ÓÅ»¯·ÃÎʼƻ®µÈÐí¶àµÄ²½Öè.Ó²½âÊͲ»½ö½öºÄ·Ñ´óÁ¿µÄcpu£¬¸üÖØÒªµÄÊÇ»áÕ¼¾ÝÖØÒªµÄÃÇãÅ£¨latch£©×ÊÔ´£¬ÑÏÖصÄÓ°ÏìϵͳµÄ¹æÄ£µÄÀ©´ó£¨¼´ÏÞÖÆÁËϵͳµÄ²¢·¢ÐУ©£¬ ¶øÇÒÒýÆðµÄÎÊÌâ ......
¡¾IT168¼¼ÊõÎĵµ¡¿
DATA GUARDµÄ×îÖ÷ÒªµÄ¹¦ÄÜÊÇÈßÔÖ¡£µ±È»¸ù¾ÝÅäÖõIJ»Í¬£¬DATA GUARD»¹¿ÉÒԾ߱¸ÒÔÏÂÌص㣺¸ß¿ÉÓá¢ÐÔÄÜÌáÉý¡¢Êý¾Ý±£»¤ÒÔ¼°¹ÊÕϻָ´µÈ¡£
DATA GUARD¿ÉÒÔ·ÖΪÎïÀíSTANDBYºÍÂß¼STANDBYÁ½ÖÖ¡£¶þÕßµÄ×î´ó²î±ðÔÚÓÚ£¬ÎïÀíSTANDBYÓ¦ÓõÄÊÇÖ÷¿âµÄ¹éµµÈÕÖ¾£¬¶ø ......