解密dbms_rowid -for 10g
本站文章除注明转载外,均为本站原创: 转载自love wife love life —Roger的Oracle/MySQL/PostgreSQL数据恢复博客
本文链接地址: 解密dbms_rowid -for 10g
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
PACKAGE BODY dbms_rowid IS PROCEDURE ROWIDBUILD(ROW_ID OUT ROWID, TYPE IN NUMBER, OBJNUM IN NUMBER, FILENUM IN NUMBER, BLOCKNUM IN NUMBER, ROWNUM IN NUMBER); PRAGMA INTERFACE(C, ROWIDBUILD); PROCEDURE ROWIDINFO(ROW_ID IN ROWID, TYPE OUT NUMBER, OBJNUM OUT NUMBER, FILENUM OUT NUMBER, BLOCKNUM OUT NUMBER, ROWNUM OUT NUMBER, TS_TYPE_IN IN VARCHAR2 DEFAULT 'SMALLFILE'); PRAGMA INTERFACE(C, ROWIDINFO); PROCEDURE ROWIDAFN(ROW_ID IN ROWID, SCHEMA_NAME IN VARCHAR2, OBJECT_NAME IN VARCHAR2, ABSOLUTE_FNO OUT NUMBER); PRAGMA INTERFACE(C, ROWIDAFN); PROCEDURE ROWIDCNVTE(NEW_ROWID OUT ROWID, OLD_ROWID IN ROWID, SCHEMA_NAME IN VARCHAR2, OBJECT_NAME IN VARCHAR2, CONVERSION_TYPE IN INTEGER); PRAGMA INTERFACE(C, ROWIDCNVTE); PROCEDURE ROWIDCNVTR(NEW_ROWID OUT ROWID, OLD_ROWID IN ROWID, CONVERSION_TYPE IN INTEGER); PRAGMA INTERFACE(C, ROWIDCNVTR); FUNCTION ROWID_CREATE(ROWID_TYPE IN NUMBER, OBJECT_NUMBER IN NUMBER, RELATIVE_FNO IN NUMBER, BLOCK_NUMBER IN NUMBER, ROW_NUMBER IN NUMBER) RETURN ROWID IS ROW_ID ROWID; BEGIN ROWIDBUILD(ROW_ID, ROWID_TYPE, OBJECT_NUMBER, RELATIVE_FNO, BLOCK_NUMBER, ROW_NUMBER); RETURN(ROW_ID); END; PROCEDURE ROWID_INFO(ROWID_IN IN ROWID, ROWID_TYPE OUT NUMBER, OBJECT_NUMBER OUT NUMBER, RELATIVE_FNO OUT NUMBER, BLOCK_NUMBER OUT NUMBER, ROW_NUMBER OUT NUMBER, TS_TYPE_IN IN VARCHAR2 DEFAULT 'SMALLFILE') IS BEGIN ROWIDINFO(ROWID_IN, ROWID_TYPE, OBJECT_NUMBER, RELATIVE_FNO, BLOCK_NUMBER, ROW_NUMBER, TS_TYPE_IN); END; FUNCTION ROWID_TYPE(ROW_ID IN ROWID) RETURN NUMBER IS ROWID_TYPE NUMBER; OBJECT_NUMBER NUMBER; RELATIVE_FNO NUMBER; BLOCK_NUMBER NUMBER; ROW_NUMBER NUMBER; BEGIN ROWIDINFO(ROW_ID, ROWID_TYPE, OBJECT_NUMBER, RELATIVE_FNO, BLOCK_NUMBER, ROW_NUMBER); RETURN(ROWID_TYPE); END; FUNCTION ROWID_OBJECT(ROW_ID IN ROWID) RETURN NUMBER IS ROWID_TYPE NUMBER; OBJECT_NUMBER NUMBER; RELATIVE_FNO NUMBER; BLOCK_NUMBER NUMBER; ROW_NUMBER NUMBER; BEGIN ROWIDINFO(ROW_ID, ROWID_TYPE, OBJECT_NUMBER, RELATIVE_FNO, BLOCK_NUMBER, ROW_NUMBER); RETURN(OBJECT_NUMBER); END; FUNCTION ROWID_RELATIVE_FNO(ROW_ID IN ROWID, TS_TYPE_IN IN VARCHAR2 DEFAULT 'SMALLFILE') RETURN NUMBER IS ROWID_TYPE NUMBER; OBJECT_NUMBER NUMBER; RELATIVE_FNO NUMBER; BLOCK_NUMBER NUMBER; ROW_NUMBER NUMBER; BEGIN ROWIDINFO(ROW_ID, ROWID_TYPE, OBJECT_NUMBER, RELATIVE_FNO, BLOCK_NUMBER, ROW_NUMBER, TS_TYPE_IN); RETURN(RELATIVE_FNO); END; FUNCTION ROWID_BLOCK_NUMBER(ROW_ID IN ROWID, TS_TYPE_IN IN VARCHAR2 DEFAULT 'SMALLFILE') RETURN NUMBER IS ROWID_TYPE NUMBER; OBJECT_NUMBER NUMBER; RELATIVE_FNO NUMBER; BLOCK_NUMBER NUMBER; ROW_NUMBER NUMBER; BEGIN ROWIDINFO(ROW_ID, ROWID_TYPE, OBJECT_NUMBER, RELATIVE_FNO, BLOCK_NUMBER, ROW_NUMBER, TS_TYPE_IN); RETURN(BLOCK_NUMBER); END; FUNCTION ROWID_ROW_NUMBER(ROW_ID IN ROWID) RETURN NUMBER IS ROWID_TYPE NUMBER; OBJECT_NUMBER NUMBER; RELATIVE_FNO NUMBER; BLOCK_NUMBER NUMBER; ROW_NUMBER NUMBER; BEGIN ROWIDINFO(ROW_ID, ROWID_TYPE, OBJECT_NUMBER, RELATIVE_FNO, BLOCK_NUMBER, ROW_NUMBER); RETURN(ROW_NUMBER); END; FUNCTION ROWID_TO_ABSOLUTE_FNO(ROW_ID IN ROWID, SCHEMA_NAME IN VARCHAR2, OBJECT_NAME IN VARCHAR2) RETURN NUMBER IS ABSOLUTE_FNO NUMBER; BEGIN ROWIDAFN(ROW_ID, SCHEMA_NAME, OBJECT_NAME, ABSOLUTE_FNO); RETURN(ABSOLUTE_FNO); END; FUNCTION ROWID_TO_EXTENDED(OLD_ROWID IN ROWID, SCHEMA_NAME IN VARCHAR2, OBJECT_NAME IN VARCHAR2, CONVERSION_TYPE IN INTEGER) RETURN ROWID IS NEW_ROWID ROWID; BEGIN ROWIDCNVTE(NEW_ROWID, OLD_ROWID, SCHEMA_NAME, OBJECT_NAME, CONVERSION_TYPE); RETURN(NEW_ROWID); END; FUNCTION ROWID_TO_RESTRICTED(OLD_ROWID IN ROWID, CONVERSION_TYPE IN INTEGER) RETURN ROWID IS NEW_ROWID ROWID; BEGIN ROWIDCNVTR(NEW_ROWID, OLD_ROWID, CONVERSION_TYPE); RETURN(NEW_ROWID); END; FUNCTION ROWID_VERIFY(ROWID_IN IN ROWID, SCHEMA_NAME IN VARCHAR2, OBJECT_NAME IN VARCHAR2, CONVERSION_TYPE IN INTEGER) RETURN NUMBER IS NEW_ROWID ROWID; BEGIN ROWIDCNVTE(NEW_ROWID, ROWID_IN, SCHEMA_NAME, OBJECT_NAME, CONVERSION_TYPE); RETURN(0); EXCEPTION WHEN ROWID_INVALID OR ROWID_BAD_BLOCK THEN RETURN(1); END; END; |
3 Responses to “解密dbms_rowid -for 10g”
Hi, this is a well written post. I just bookmarked your site. To be truthful, although I read a lot in this area. I still picked up quite a lot today. Kindly continue the amazingly good post and I will tell my friends about it.
I learned a lot from this post, much appreciated!! 🙂
you obtained a instead excellent website, Glad I seen it via yahoo.
Leave a Reply
You must be logged in to post a comment.