Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

oracleÊý¾Ý¿â¼¶±ðÓÅ»¯·ÖÎö¹¤¾ß½éÉÜ

author£ºskate
time£º2010/03/04
oracleÊý¾Ý¿â¼¶±ðÓÅ»¯·ÖÎö¹¤¾ß½éÉÜ
µ±ÎÒÃǶÔÊý¾Ý¿âÓÅ»¯Õï¶Ïʱ£¬ÐèÒªÊÕ¼¯ÏàÓ¦µÄÐÅÏ¢ÒÔ¹©²Î¿¼£¬´Ó¸öÈ˵ÄʹÓþ­ÑéÀ´Ëµ£¬ÕâÖÖͳ¼ÆÊý¾Ý·ÖΪÁ½´óÀà
Ò»ÀàÊÇÊý¾Ý¿â¼¶±ðµÄͳ¼ÆÐÅÏ¢
¶þÀàÊÇos¼¶±ðµÄͳ¼ÆÐÅÏ¢
ÏÂÃæ¾Í·Ö±ð½éÉÜÔÚ²»Í¬µÄ¼¶±ðÏ£¬³£ÓÃʲô¹¤¾ßÀ´ÊÕ¼¯ÐÅÏ¢°ïÖúÓÅ»¯Õï¶Ï
Ê×ÏÈÊÇoracleÊý¾Ý¿â¼¶±ðÓÅ»¯·ÖÎö¹¤¾ß½éÉÜ
Ŀ¼£º
1.statspack
2.ASH
3.AWR
4.ORACLE EXPLAIN PLANµÄ×ܽá(²éѯsqlµÄÖ´Ðмƻ®)
   a.autotrace
   b.explainµÄʹÓÃ
1.statspack
a¡£°²×°
sql> sqlplus "/ as sysdba"
SQL> select file_name from dba_data_files;
SQL> create tablespace perfstat datafile 'e:\oracle\oradata\skate\perfstat.dbf' size 2000m;
sql> @ORACLE_HOME\rdbms\admin\spcreate.sql
b¡£Ê¹ÓÃ
SQL> conn perfstat/passwd
ÊÕ¼¯Í³¼ÆÐÅÏ¢
sql> execute statspack.snap
»ò
SQL> exec statspack.SNAP(i_snap_level =>5);
Éú³É±¨¸æ
sql> @ORACLE_HOME\rdbms\admin\spreport.sql
¶¨Ê±ÊÕ¼¯ÐÅÏ¢ÓÐÁ½ÖÖ·½Ê½£¬Ò»ÖÖÊÇoracle job£¬Ò»ÖÖÊÇosµÄcrontab£¬ÎұȽÏÏ°¹ßÓÃos¼¶±ðµÄcrontab
É趨Æäÿ¸öСʱ×Ô¶¯ÊÕ¼¯Ò»´Î²ÉÑùµÄjob
declare
Variable  job  number ;
begin
  dbms_job.submit(:job, "statspack.snap;" ,trunc( sysdate + 1/24 , 'hh24' ), "trunc(sysdate+1/24,'hh24')" );
  commit ;
end ;
/
²é¿´jobʹÓÃÇé¿ö
SQL> select job,schema_user,next_date,interval,what from user_jobs
×Ô¶¯Í£Ö¹²ÉÑùjob
declare
Variable  job  number ;
begin
  dbms_job.submit(:job, "dbms_job.broken(44,true);" ,trunc( sysdate + 1 ), "null" );
  commit ;
end ;
/
Çå¿ÕËùÓÐstatsͳ¼ÆÐÅÏ¢±íÀïµÄÊý¾Ý
sql> @ORACLE_HOME\rdbms\admin\sptrunc.sql
snapshotµÄlevel£¬Õâ¿ÉÒÔͨ¹ýEXEC STATSPACK.MODIFY_STATSPACK_PARAMETER(i_snap_level=N)À´Ð޸ģ¬N¿ÉÒÔΪ0£¬5£¬6£¬7£¬10£¬È±Ê¡Îª5¡£
¡¡¡¡ 0 ½öÌṩһ°ãÐÔÄÜͳ¼Æ
¡¡¡¡ 5 Ôö¼ÓÁ˶ÔSQLÓï¾ä×ÜÌå·ÖÎö
¡¡¡¡ 6 Ôö¼ÓÁËSQL¼Æ»®ºÍʹÓÃ
¡¡¡¡ 7 Ôö¼ÓÁ˷ֶΣ¨Segments£©¼¶µÄͳ¼Æ
¡¡¡¡ 10Ôö¼ÓÁ˶ÔãÅËø£¨Latches£©µÄ·ÖÎö
¡¡¡¡ÆäÖÐÎĵµ½¨Òé¶Ô10ÒªÉ÷ÖØ£¬ÒòΪ´ú¼Û½Ï¸ß¡£
eg£º
SQL> exec statspack.SNAP(i_snap_level =>6);
oracle²»½öÌṩÉú³É


Ïà¹ØÎĵµ£º

oracleÍü¼Çsys/system/scottÓû§µÄÃÜÂëÔõô°ì

Ò»¡¢Íü¼Ç³ýSYS¡¢SYSTEMÓû§Ö®ÍâµÄÓû§µÄµÇ¼ÃÜÂë¡£
    ÓÃSYS (»òSYSTEM)Óû§µÇ¼¡£
   
    CONN SYS/PASS_WORD AS SYSDBA;
    ʹÓÃÈçÏÂÓï¾äÐÞ¸ÄÓû§µÄÃÜÂë¡£
    ALTER USER user_name IDENTIFIED BY newpass;
    ......

Oracle·ÖÇø¼¼Êõ

ORACLEµÄ·ÖÇø(Partitioning Option)ÊÇÒ»ÖÖ´¦Àí³¬´óÐͱíµÄ¼¼Êõ¡£·ÖÇøÊÇÒ»ÖÖ“·Ö¶øÖÎÖ®”µÄ¼¼Êõ£¬Í¨¹ý½«´ó±íºÍË÷Òý·Ö³É¿ÉÒÔ¹ÜÀíµÄС¿é£¬´Ó¶ø±ÜÃâÁ˶Ôÿ¸ö±í×÷Ϊһ¸ö´óµÄ¡¢µ¥¶ÀµÄ¶ÔÏó½øÐйÜÀí£¬Îª´óÁ¿Êý¾ÝÌṩÁË¿ÉÉìËõµÄÐÔÄÜ¡£·ÖÇøͨ¹ý½«²Ù×÷·ÖÅä¸ø¸üСµÄ´æ´¢µ¥Ôª£¬¼õÉÙÁËÐèÒª½øÐйÜÀí²Ù×÷µÄʱ¼ä£¬²¢Í¨¹ýÔöÇ¿µÄ²¢Ðд ......

oracle³£ÓÃÊý¾ÝÀàÐÍ

author£ºskate
time£º2010/03/03
oracle³£ÓÃÊý¾ÝÀàÐÍ
½ñÌìͬÊÂÎÊЩÊý¾ÝÀàÐ͵ÄÎÊÌ⣬ÓеĻ¹ÕæÓеã¼Ç²»ÇåÁË£¬ÓÚÊǾͼòµ¥×ܽáϳ£ÓõÄÊý¾ÝÀàÐÍÒÔ±¸ÈÕºó²éÓÃ
1¡¢Char
¶¨³¤¸ñʽ×Ö·û´®£¬ÔÚÊý¾Ý¿âÖд洢ʱ²»×ãλÊýÌî²¹¿Õ¸ñ£¬ËüµÄÉùÃ÷·½Ê½ÈçÏÂCHAR(L)£¬LΪ×Ö·û´®³¤¶È£¬
ȱʡΪ1£¬×÷Ϊ±äÁ¿×î´ó32767¸ö×Ö·û£¬×÷ΪÊý¾Ý´æ´¢ÔÚORA ......

oracle³éÈ¡º¯Êý extract()

auhtor£ºskate
time£º2010/03/03
oracle³éÈ¡º¯Êý
½ñÌìÅóÓÑÎʸöÎÊÌ⣬ÈçºÎ³éȡʱ¼äµÄ“Сʱ”
oracleµÄ³éÈ¡º¯ÊýÊÇ extrac()Óï·¨:
SELECT EXTRACT(YEAR from SYSDATE) from DUAL; return Current Year
SELECT EXTRACT(MONTH from SYSDATE) from DUAL; return Current Month
SELECT EXTRACT(DAY from SYSDA ......

oracleÖÐtimestampÎÊÌâ

ÎÊÌâÃèÊö£º
µ±Êý¾Ý¿âµÄ×Ö·û¼¯ÎªÖÐÎÄʱ£¬timestampÀàÐ͵Ä×Ö¶ÎΪÒÔϸñʽ£º
04-3ÔÂ -10 03.57.41.631000 ÏÂÎç
ÎÒÔÚÓÃJDOM½«Êý¾Ýµ¼³öΪXMLʱ£¬timestampÀàÐÍ×ֶεÄÖµ·´ÉúÁ˱仯£¬±ä³ÉÁËһϸñʽ
<CREATE_DATE>2010-3-4.15.57. 30. 505000000</CREATE_DATE>
½â¾ö·½°¸£º
ÔÚ²éѯ¸Ã×Ö¶ÎʱÊ×ÏÈÓÃto_char£¨£©º¯Êý½ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ