ORACLEÎﻯÊÓͼ ÎﻯÊÓͼÈÕÖ¾½á¹¹
http://space.itpub.net/4227/viewspace-68592
ÎﻯÊÓͼµÄ¿ìËÙË¢ÐÂÒªÇó»ù±¾±ØÐ뽨Á¢ÎﻯÊÓͼÈÕÖ¾£¬ÕâƪÎÄÕ¼òµ¥ÃèÊöÒ»ÏÂÎﻯÊÓͼÈÕÖ¾Öи÷¸ö×ֶεĺ¬ÒåºÍÓÃ;¡£
ÎﻯÊÓͼÈÕÖ¾µÄÃû³ÆΪMLOG$_ºóÃæ¸ú»ù±íµÄÃû³Æ£¬Èç¹û±íÃûµÄ³¤¶È³¬¹ý20룬Ôòֻȡǰ20룬µ±½Ø¶Ìºó³öÏÖÃû³ÆÖظ´Ê±£¬Oracle»á×Ô¶¯ÔÚÎﻯÊÓͼÈÕÖ¾Ãû³ÆºóÃæ¼ÓÉÏÊý×Ö×÷ΪÐòºÅ¡£
ÎﻯÊÓͼÈÕÖ¾ÔÚ½¨Á¢Ê±ÓжàÖÖÑ¡Ï¿ÉÒÔÖ¸¶¨ÎªROWID¡¢PRIMARY KEYºÍOBJECT ID¼¸ÖÖÀàÐÍ£¬Í¬Ê±»¹¿ÉÒÔÖ¸¶¨SEQUENCE»òÃ÷È·Ö¸¶¨ÁÐÃû¡£ÉÏÃæÕâЩÇé¿ö²úÉúµÄÎﻯÊÓͼÈÕÖ¾µÄ½á¹¹¶¼²»Ïàͬ¡£
ÈκÎÎﻯÊÓͼ¶¼»á°üÀ¨µÄÁУº
SNAPTIME$$£ºÓÃÓÚ±íʾˢÐÂʱ¼ä¡£
DMLTYPE$$£ºÓÃÓÚ±íʾDML²Ù×÷ÀàÐÍ£¬I±íʾINSERT£¬D±íʾDELETE£¬U±íʾUPDATE¡£
OLD_NEW$$£ºÓÃÓÚ±íʾÕâ¸öÖµÊÇÐÂÖµ»¹ÊǾÉÖµ¡£N£¨EW£©±íʾÐÂÖµ£¬O£¨LD£©±íʾ¾ÉÖµ£¬U±íʾUPDATE²Ù×÷¡£
CHANGE_VECTOR$$±íʾÐÞ¸ÄʸÁ¿£¬ÓÃÀ´±íʾ±»Ð޸ĵÄÊÇÄĸö»òÄļ¸¸ö×ֶΡ£
Èç¹ûWITHºóÃæ¸úÁËROWID£¬ÔòÎﻯÊÓͼÈÕÖ¾Öлá°üº¬£º
M_ROW$$£ºÓÃÀ´´æ´¢·¢Éú±ä»¯µÄ¼Ç¼µÄROWID¡£
Èç¹ûWITHºóÃæ¸úÁËPRIMARY KEY£¬ÔòÎﻯÊÓͼÈÕÖ¾Öлá°üº¬Ö÷¼üÁС£
Èç¹ûWITHºóÃæ¸úÁËOBJECT ID£¬ÔòÎﻯÊÓͼÈÕÖ¾Öлá°üº¬£º
SYS_NC_OID$£ºÓÃÀ´¼Ç¼ÿ¸ö±ä»¯¶ÔÏóµÄ¶ÔÏóID¡£
Èç¹ûWITHºóÃæ¸úÁËSEQUENCE£¬ÔòÎﻯÊÓͼÈÕ×ÓÖлá°üº¬£º
SEQUENCE$$£º¸øÿ¸ö²Ù×÷Ò»¸öSEQUENCEºÅ£¬´Ó¶ø±£Ö¤Ë¢ÐÂʱ°´ÕÕ˳Ðò½øÐÐˢС£
Èç¹ûWITHºóÃæ¸úÁËÒ»¸ö»ò¶à¸öCOLUMNÃû³Æ£¬ÔòÎﻯÊÓͼÈÕÖ¾Öлá°üº¬ÕâЩÁС£
ÏÂÃæͨ¹ýÀý×Ó½øÐÐÏêϸ˵Ã÷£º
SQL> create table t_rowid (id number, name varchar2(30), num number);
±íÒÑ´´½¨¡£
SQL> create materialized view log on t_rowid with rowid, sequence (name, num) including new values;
ʵÌ廯ÊÓͼÈÕÖ¾ÒÑ´´½¨¡£
SQL> create table t_pk (id number primary key, name varchar2(30), num number);
±íÒÑ´´½¨¡£
SQL> create materialized view log on t_pk with primary key;
ʵÌ廯ÊÓͼÈÕÖ¾ÒÑ´´½¨¡£
SQL> create type t_object as object (id number, name varchar2(30), num number);
2 /
ÀàÐÍÒÑ´´½¨¡£
SQL> create table t_oid of t_object;
±íÒÑ´´½¨¡£
SQL> create materialized view log on t_oid with object id;
ʵÌ廯ÊÓͼÈÕÖ¾ÒÑ´´½¨¡£
½¨Á¢»·¾³ºóÀ´¿´¿´ÎﻯÊÓͼÈÕÖ¾Öаüº¬µÄ×Ô¶¯£º
SQL> desc mlog$_t_rowid
Ãû³Æ 
Ïà¹ØÎĵµ£º
--È¡µÃµ±Ìì0ʱ0·Ö0Ãë
select TRUNC(SYSDATE) from dual;
--È¡µÃµ±Ìì23ʱ59·Ö59Ãë(ÔÚµ±Ìì0ʱ0·Ö0ÃëµÄ»ù´¡ÉϼÓ1ÌìºóÔÙ¼õ1Ãë)
SELECT TRUNC(SYSDATE)+1-1/86400 from dual;
--È¡µÃµ±Ç°ÈÕÆÚÊÇÒ»¸öÐÇÆÚÖеĵڼ¸Ìì,×¢Ò⣺ÐÇÆÚÈÕÊǵÚÒ»Ìì
select to_char(sysdate,'D'),to_char(sysdate,'DAY') from dual;
--ÔÚoracleÖÐÈçºÎµÃ ......
OracleÓ¦ÓÃϵͳµÄÓÅ»¯Ëĸö·½Ãæ
1.¡¡¡¡¡¡ Ó¦ÓóÌÐòSQLÓï¾äÓÅ»¯;
2.¡¡¡¡¡¡ ORACLEÊý¾Ý¿â²ÎÊýµ÷Õû;
3.¡¡¡¡¡¡ ²Ù×÷ϵͳ²ÎÊýµ÷Õû;
4.¡¡¡¡¡¡ ÍøÂçÐÔÄܵ÷Õû.
oracleÓ¦ÓÃϵͳµÄÐÔÄÜÖ¸±ê
1.¡¡¡¡¡¡ Êý¾Ý¿âÍÌÍÂÁ¿;
2.¡¡¡¡¡¡ Êý¾Ý¿âÓû§ÏìӦʱ¼ä.
ORACLEÊý¾Ý¿âÐÔÄÜÓÅ»¯µÄ¼¸¸ö²¿·Ö
Êý¾Ý¿âÐÔÄÜÓÅ»¯°üÀ¨Èçϼ¸¸ö²¿·Ö£º
1¡¢1¡¢µ÷Õ ......
µÚÒ»¿Î£º¿Í»§¶Ë
1. Sql Plus(¿Í»§¶Ë£©£¬ÃüÁîÐÐÖ±½ÓÊäÈ룺sqlplus£¬È»ºó°´ÌáʾÊäÈëÓû§Ãû£¬ÃÜÂë¡£
2. ´Ó¿ªÊ¼³ÌÐòÔËÐÐ:sqlplus£¬ÊÇͼÐΰæµÄsqlplus.
3. http://localhost:5560/isqlplus
Toad£º¹ÜÀí£¬ PlSql Developer:
µÚ¶þ¿Î£º¸ü¸ÄÓû§
1. sqlplus sys/bjsxt as sysdba
2. alter user scott account unlock;(½âËø)
......
1 oracle ʵÀý
°²×°--È«¾ÖÊý¾Ý¿âÃû£º¿ÉÒÔ¼ÓÀ©Õ¹Ãû£º±ÈÈçtest.com.cn£¨¶øÊý¾Ý¿âʵÀýÃûΪtest£©
Êý¾Ý¿â¿ÚÁî:ΪÊý¾Ý¿âϵͳÕÊ»§£ºsys,system,sysman,dbsnmpÌṩÃÜÂë
¸ß¼¶°²×°£ºÎªÃ¿¸öÓû§Ìṩ²»Í¬µÄÃÜÂë
sys: change_on_install
system:manager
sysman:oem_temp
dbsnmp:dbsnmp
internal: orcale
scott:tiger
demo: ......
MViewÖØÒªÊÓͼÔÚÔ´Êý¾Ý¿â¶ËµÄÏà¹ØÊÓͼDBA_BASE_TABLE_MVIEWSDBA_REGISTERED_MVIEWSDBA_MVIEW_LOGSÔÚMViewÊý¾Ý¿â¶ËµÄÏà¹ØÊÓͼDBA_MVIEWSDBA_MVIEW_REFRESH_TIMESDBA_REFRESHºÍDBA_REFRESH_CHILDRENMViewÏà¹Ø°üһЩMViewά»¤µÄÏà¹ØÎÊÌâSNAPSHOT vs. Materialized ViewÇåÀíÎÞЧµÄMView Log²éѯMView LogµÄ´óС¼ì²éMVµÄˢмæ ......