ORACLE ROWIDµÄÒ»µã֪ʶ
oracle8µÄROWID½á¹¹
2004-04-23 15:18 pm
À´×Ô£ºLinuxÎĵµ
µØÖ·£ºhttp://linux.sheup.com/linux/linux3983.htm
1¡¢ÎªÊ²Ã´Ê¹ÓÃROWID
ORACLE°ÑROWID×÷ΪB-Ê÷ºÍÆäÄÚ²¿Ëã·¨±êʾROWµÄΨһ±êʾ¡£
ÔÚORACLE8ÒÔǰµÄ°æ±¾ÖУ¬ROWID±êʾFILE¡¢BLOCK¡¢ROW NUMBER£¬Ö»ÓÃÒ»¸öÊý×Ö´ú
±íFILEºÅ¡£
ÔÚORACLE8ÖУ¬Ò»¸öDATAFILEÓÐÁ½¸öÊý×Ö´ú±í£º
Ò»¸ö¾ø¶ÔÖµ£¬ÊÇÕû¸öÊý¾Ý¿âΨһµÄ¡£¿ÉÒÔ¿´DBA_DATA_FILESÖеÄFILE_ID¡£
Ò»¸öÏà¶ÔÖµ£¬ÔÚTABLESPACEÖÐÊÇΨһµÄ£¬¿ÉÒÔ¿´DBA_DATA_FILESÖеÄRELATIVE_
FNO¡£
еÄROWIDʹÓÃÏà¶ÔÖµ£¬ËùÒÔ±ØÐë´æ·ÅSEGMENTµÄ±êʾ£¬·ñÔò¾Í»á»ìÏý¡£ËùÒÔORAC
LE8ÔÚROWIDÖмÓÈë¶ÔÏóµÄSEGMENTºÅ£¬ÓÃÀ´±êʾTABLE»òÕßPARTITION¡£
2¡¢ROWIDµÄ½á¹¹
ʹÓÃbase-64´úÂ룬°üÀ¨a-z£¬A-Z£¬0-9£¬+,-¡£Ò»¹²18λ¡£
1-6λ£º´ú±íOBJECT
7-9λ£ºÎļþÏà¶ÔÖµ
10-15£ºÎļþÖеÄBLOCK
16-18£ºBLOCKÖеÄSLOTÖµ
3¡¢TABLESPACE-RelativeѰַ·½Ê½
ʹÓõÄÊÇTABLESPACE-RelativeѰַ·½Ê½£¬¶à¸öÎļþ¿ÉÒÔÓÐÏàͬµÄÏà¶ÔÖµ£¬ÒòΪËü
ÃÇÊôÓÚ²»Í¬µÄTABLESPACE£¬ËùÒÔ²»ÄÜ´ÓеÄROWIDµÃµ½¾ø¶ÔµØÖ·£¬µ«ÊÇÕâûÓÐÎÊÌâ
£¬ÒòΪµ±Òª´¦Àíij¸öOBJECTʱ£¬ÒѾÄÜÈ·¶¨ËüÊôÓÚÄĸöTABLESAPCEÁË¡£ÔÚTABLES
PACEÖУ¬ÎļþÏà¶ÔÖµÊÇΨһµÄ£¬ËùÒÔROWID»¹ÊÇ¿ÉÒÔΨһ±êʾһ¸öOBJECT¡£TABLE
SPACE-RelativeѰַ·½Ê½ÊÇORACLE8ÖÐÖ§³Ö³¬´óÊý¾Ý¿âµÄ¹Ø¼ü¼¼Êõ¡£
4¡¢DATA OBJECT NUMBER
DATA OBJECT NUMBERÓÃÓÚָʾSEGMENT£¬ËùÓÐSEGMENT¶¼ÓÐDATA OBJECT NUMBER£¬
´æ·ÅÔÚÿ¸öDATA BLOCKÖУ¬¶øÇÒ²»Öظ´¡£
×ʼµÄʱºò£¬DBA_OBJECTS.OBJECT_ID=DBA_OBJECTS.DATA-OBJECT_ID£¬µ«ÊÇÔÚ
ÉÏÊöÇé¿öÏÂDATA-OBJECT_ID»áÔÚÈçÏÂÇé¿öÏÂÔö¼Ó
TRUNCATE TABLE
MOVE PARTITION
ORACLE»á¼ì²éROWIDÖеÄDATA OBJECT NUMBERºÍBLOCKÖеÄDATA OBJECT NUMBER£¬
±£Ö¤ËûÃÇÖ®¼äµÄ°æ±¾ÊÇÒ»Öµġ£
ORACLEҲʹÓÃDATA OBJECT NUMBERÒÔÈ·±£ROLLBACKµÄ¼Í¼ºÍ×îеÄSEGMENT¼Í¼һ
Ö¡£
ҪעÒâµÄÊÇDATA OBJECT NUMBER²»ÊÇOBJECT µÄ±êÖ¾
5¡¢RESTRICTED ROWID
ORACLE7µÄROWID¸ñʽÊÇ
1-8λ£ºBLOCK NUMBER
9-12λ£ºROW NUMBER
13-16λ£ºFILE NUMBER
ORACLE8Ö§³Ö¶ÌµÄ¡¢¾É¸ñʽµÄROWID£¬×÷ÓÃÊÇ
¶ÔNOPARTITION TABLEµÄINDEX ENTRY
¶ÔPARTITION TABLEµÄLOCAL INDEX ENTRY
ROW Piece CHain pointer
ÊÜÏÞROWIDµÄÄÚ²¿´æ·ÅÊÇ6BYTE£¬
4BYTE=DATA BLOCK NUMBER
2BYTE=ROW NUMBER
Õâ¾
Ïà¹ØÎĵµ£º
¡¶Oracle´óÐÍÊý¾Ý¿âϵͳÔÚAIXUNIXÉϵÄʵսÏê½â¡·¼¯ÖÐÌÖÂÛÖ®15 ¼ÌÐø×òÌìµÄ»°Ì⣬ÓÐÁËͳ¼Æ£¬Í³¼ÆÖÐÓкܶàÊǵȴýʼþ¡£µÈ´ýʼþÈçºÎÀí½â£¿Õâ¿ÉÄÜÊÇ´ó¼ÒÓʼþÖÐËù˵µÄÎÊÌâËùÔÚ¡£ µÈ´ýʼþ£¬ÊÇÖ¸µ±Ò»¸ö·þÎñÆ÷½ø³Ì/Ị̈߳¨Windowsƽ̨£©²»µÃ²»µÈºòijһ¸öʼþÍê³É£¬³ÆÖ®ÎªÒ»´Î¡°µÈ´ýʼþ¡±¡£µ±µÈ´ýµÄÕâ¸öʼþÍê³Éºóºñ£¬¸Ã· ......
ºÜ¶àÅóÓÑÔÚʹÓÃORACLE½øÐкǫ́Êý¾Ý´æ´¢Ê±¶¼¿ÉÄÜÓöµ½ÕâÑùµÄÎÊÌ⣬ÄľÍÊÇ£¬Éè¼ÆµÄÊý¾Ý¿âÖв»¿É±ÜÃâµÄÓÐÒ»Á½¸ö±È½Ï´óµÄÊý¾Ý±í£¬ÓÐʱ¿ÉÄܸü¶à£¬Èç¹û¶ÔÕâЩÊý¾Ý±íÖ»½øÐÐINSERT²Ù×÷£¬ÄÄ»¹±È½ÏºÃһЩ£¬¿ÉÊÇÈç¹ûÒª¾³£½øÐÐÊý¾Ý¸üУ¨UPDATE£©ºÍÊý¾Ýѡȡ£¨SELECT£©£¬ÔÚÊý¾ÝÁ¿±È½ÏÉÙʱ£¬³ÌÐò»¹ÄܹýµÄÈ¥£¬Èç¹ûÊý¾ÝÁ¿Ò»´ó£¬ÉÏÁ˰ÙÍòÊýÁ¿ ......
88. CHR()µÄ·´º¯ÊýÊÇ?
¡¡¡¡ ASCII()
¡¡¡¡ SELECT CHAR(65) from DUAL;
¡¡¡¡ SELECT ASCII('A') from DUAL;
¡¡¡¡ 89. ×Ö·û´®µÄÁ¬½Ó
¡¡¡¡ SELECT CONCAT(COL1,COL2) from TABLE
¡¡¡¡ SELECT COL1||COL2 from TABLE
¡¡¡¡ 90. Ôõô°Ñselect³öÀ´µÄ½á¹ûµ¼µ½Ò»¸öÎı¾ÎļþÖУ¿
¡¡¡¡ SQL>SPOOL C:\ABCD.TXT;
¡¡ ......
783. ALL_ALL_TABLES
Óû§¿É´æÈ¡µÄËùÓбí.
784. ALL_ARGUMENTS
Óû§¿É´æÈ¡µÄ¶ÔÏóµÄËùÓвÎÊý.
785. ALL_ASSOCIATIONS
Óû§¶¨ÒåµÄͳ¼ÆÐÅÏ¢.
786. ALL_BASE_TABLE_MVIEWS
Óû§¿É´æÈ¡µÄËùÓÐÎﻯÊÓͼÐÅÏ¢.
787. ALL_CATALOG
Óû§¿É´æÈ¡µÄÈ«²¿±í,ͬÒå´Ê,ÊÓÍÁºÍÐòÁÐ.
788. ALL_CLUSTER_HASH_EXPRESSIONS
Óû§¿É´æÈ¡µÄ¾Û ......
ѧÉúÔÚѧϰjdbcµÄʱºò£¬»áÎʵ½Ôõôµ÷Óô洢¹ý³Ì£¬ÏÖÔÚ½«javaµ÷ÓÃoracle´æ´¢¹ý³ÌµÄʾÀý×ܽáÈçÏ¡££¨¹ØÓÚµ÷ÓÃsqlserverµÄ´æ´¢¹ý³Ì½«ÔÚÏ´νøÐÐС½áÇë¹Ø×¢£©
Ò»£ºÎÞ·µ»ØÖµµÄ´æ´¢¹ý³Ì
´æ´¢¹ý³ÌΪ£º
• create or replace procedure adddept(deptno number,dname varc ......