{"id":1016,"date":"2015-07-09T11:43:40","date_gmt":"2015-07-09T03:43:40","guid":{"rendered":"http:\/\/j178.mtgbb.com\/?p=1016"},"modified":"2017-02-14T17:50:13","modified_gmt":"2017-02-14T09:50:13","slug":"oracle-rowid-%e6%ac%84%e4%bd%8d%e5%9e%8b%e6%85%8b%e7%89%b9%e6%80%a7","status":"publish","type":"post","link":"https:\/\/j178.mtgbb.com\/?p=1016","title":{"rendered":"Oracle RowID \u6b04\u4f4d\u578b\u614b\u7279\u6027"},"content":{"rendered":"<p>1. rowid \u662f\u5341\u516d\u9032\u4f4d\u5b57\u4e32\uff0c\u8868\u793a\u8cc7\u6599\u8868\u4e2d\u8cc7\u6599\u5217\u7684\u552f\u4e00\u4f4d\u7f6e\u3002<\/p>\n<p>  \u9019\u7a2e\u8cc7\u6599\u578b\u5225\u4e3b\u8981\u4f9b ROWID \u865b\u64ec\u8cc7\u6599\u884c (pseudo column) \u7684\u50b3\u56de\u503c\u4f7f\u7528 <\/p>\n<p>  Example:<br \/>\n  SELECT rowidtochar(ROWID) row_id1, ROWID row_id2 FROM emp<\/p>\n<p>  \u7576\u4e00\u500bTable\u90fd\u6c92\u6709Key,\u5247\u53ef\u4f7f\u7528ROWID\u4f86\u7576\u4f5cKey<br \/>\n  ROWID \u4e0d\u9700\u624b\u52d5\u5efa\u7acb , \u6bcf\u500b Table \u90fd\u6703\u6709<\/p>\n<p><!--more--><\/p>\n<p>2. rowid \u662f\u7531object number + file number + block number + row number \u56db\u500b\u9805\u76ee\u6240\u7d44\u6210\u7684(\u53ef\u8996\u70ba\u8cc7\u6599\u7684\u5b58\u653e\u4f4d\u7f6e)<\/p>\n<p>  \u4e5f\u5c31\u662f\u8aaa\u8a18\u9304\u6bcf\u4e00\u7b46\u5217\u7684\u4f4d\u7f6e,\u5b58\u5728\u65bc\u67d0\u4e00\u500b block, \u4e0d\u9700\u8981\u641c\u5c0b\u5c31\u53ef\u4ee5\u6307\u5b9a\u8b80\u53d6\u67d0\u4e00\u5217,<br \/>\n  \u56e0\u6b64\u5b83\u7684\u67e5\u8a62\u901f\u5ea6\u662f\u6700\u5feb\u7684.<\/p>\n<p>3.\u800c\u5efa\u7acbindex\u5c31\u662f\u628a\u4f60\u7684\u4e3b\u9375\u5c0d\u61c9\u4e00\u500browid,\u6240\u4ee5\u53ef\u4ee5\u589e\u5feb\u67e5\u8a62\u901f\u5ea6<\/p>\n<p>4.rowid \u662f\u6703\u8b8a\u52d5\u7684,<br \/>\n  rowid \u662f\u6703\u8b8a\u52d5\u7684,<br \/>\n  rowid \u662f\u6703\u8b8a\u52d5\u7684, (\u8981\u8aaa\u4e09\u6b21)<\/p>\n<p>  \u6240\u4ee5\u4ee5rowid\u7576\u67e5\u8a62\u689d\u4ef6\u4e26\u4e0d\u9069\u7576;\u5efaindex\u6703\u662f\u6bd4\u8f03\u597d\u7684\u65b9\u5f0f,\u56e0\u70baoracle\u6703\u53bb\u7dad\u8b77index,<br \/>\n  \u7576rowid\u8b8a\u52d5\u6642, index\u4e2d\u7684rowid\u4e5f\u6703\u8ddf\u8457\u8b8a\u52d5<\/p>\n<p>  Example:<br \/>\n  \u505a\u500b\u5c0f\u5be6\u9a57\u5c31\u53ef\u8b49\u660e&#8230;.rowid\u662f\u6703\u8b8a\u7684, \u628a table \u642c\u5230\u53e6\u4e00\u500b tablespace ,rowid \u503c\u5c31\u6703\u8b8a\u52d5<\/p>\n<p>SQL> select rowid,ename from scott.emp;<\/p>\n<p>ROWID ENAME<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;-<br \/>\nAAAQheAAQAABdy8AAA SMITH<br \/>\nAAAQheAAQAABdy8AAB ALLEN<br \/>\nAAAQheAAQAABdy8AAC WARD<br \/>\nAAAQheAAQAABdy8AAD JONES<br \/>\nAAAQheAAQAABdy8AAE MARTIN<br \/>\nAAAQheAAQAABdy8AAF BLAKE<br \/>\nAAAQheAAQAABdy8AAG CLARK<br \/>\nAAAQheAAQAABdy8AAH SCOTT<br \/>\nAAAQheAAQAABdy8AAI KING<br \/>\nAAAQheAAQAABdy8AAJ TURNER<br \/>\nAAAQheAAQAABdy8AAK ADAMS<br \/>\nAAAQheAAQAABdy8AAL JAMES<br \/>\nAAAQheAAQAABdy8AAM FORD<br \/>\nAAAQheAAQAABdy8AAN MILLER <\/p>\n<p>\u5df2\u9078\u53d6 14 \u500b\u8cc7\u6599\u5217.<\/p>\n<p>SQL> alter table scott.emp move tablespace users;<br \/>\n\u5df2\u66f4\u6539\u8868\u683c.<\/p>\n<p>SQL> select rowid,ename from scott.emp;<\/p>\n<p>ROWID ENAME<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;-<br \/>\nAAAQhfAAEAAAAAcAAA SMITH<br \/>\nAAAQhfAAEAAAAAcAAB ALLEN<br \/>\nAAAQhfAAEAAAAAcAAC WARD<br \/>\nAAAQhfAAEAAAAAcAAD JONES<br \/>\nAAAQhfAAEAAAAAcAAE MARTIN<br \/>\nAAAQhfAAEAAAAAcAAF BLAKE<br \/>\nAAAQhfAAEAAAAAcAAG CLARK<br \/>\nAAAQhfAAEAAAAAcAAH SCOTT<br \/>\nAAAQhfAAEAAAAAcAAI KING<br \/>\nAAAQhfAAEAAAAAcAAJ TURNER<br \/>\nAAAQhfAAEAAAAAcAAK ADAMS<br \/>\nAAAQhfAAEAAAAAcAAL JAMES<br \/>\nAAAQhfAAEAAAAAcAAM FORD<br \/>\nAAAQhfAAEAAAAAcAAN MILLER <\/p>\n<p>\u5df2\u9078\u53d6 14 \u500b\u8cc7\u6599\u5217.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. rowid \u662f\u5341\u516d\u9032\u4f4d\u5b57\u4e32\uff0c\u8868\u793a\u8cc7\u6599\u8868\u4e2d\u8cc7\u6599\u5217\u7684\u552f\u4e00\u4f4d\u7f6e\u3002 \u9019\u7a2e\u8cc7\u6599\u578b\u5225\u4e3b\u8981\u4f9b ROWID \u865b\u64ec\u8cc7\u6599\u884c  &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1016","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts\/1016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1016"}],"version-history":[{"count":0,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts\/1016\/revisions"}],"wp:attachment":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}