{"id":3870,"date":"2018-04-24T15:01:49","date_gmt":"2018-04-24T06:01:49","guid":{"rendered":"http:\/\/haisins.epac.to\/wordpress\/?p=3870"},"modified":"2018-04-24T15:01:49","modified_gmt":"2018-04-24T06:01:49","slug":"select-for-update-%eb%8a%94-%eb%a7%89%ea%b3%a0-select-%eb%a7%8c-%ed%97%88%ec%9a%a9%ed%95%98%ea%b3%a0-%ec%8b%b6%ec%9d%84-%eb%95%8c","status":"publish","type":"post","link":"http:\/\/haisins.synology.me\/wordpress\/?p=3870","title":{"rendered":"SELECT FOR UPDATE \ub294 \ub9c9\uace0 &#8230; SELECT \ub9cc \ud5c8\uc6a9\ud558\uace0 \uc2f6\uc744 \ub54c &#8230;"},"content":{"rendered":"<p>A \uc0ac\uc774\ud2b8\uc758 \uae30\uc220 \uc758\ub8b0 &#8230;<\/p>\n<p>\uac1c\ubc1c\uc790\ub4e4\uc774 DB\uc5d0 \ub4e4\uc5b4\uc640 \uc870\ud68c\ub97c \ud558\ub294 \ub370 \uc870\ud68c \uc804\uc6a9 \uc720\uc800\uc5d0 SELECT \ub9cc \ud5c8\uc6a9\ud558\uace0 SELECT FOR UPDATE \ub97c \ub9c9\uc744 \uc218 \uc788\ub294 \ubc29\ubc95\uc774 \uc5c6\ub098\uc694?<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:plsql decode:true\">SELECT \u2026 FROM&amp;lt;table_name&amp;gt; FOR UPDATE ;<\/pre>\n<p>&nbsp;<\/p>\n<p>\uc0ac\uc2e4 Oracle 12c \ubd80\ud130\ub294 READ \ub77c\ub294 \uad8c\ud55c\uc774 \uc0dd\uaca8\uc11c \uc870\ud68c \ub9cc \uac00\ub2a5\ud55c Synonym \uc720\uc800\uc5d0 \uadf8\ub0e5 \uc8fc\uba74 \ub429\ub2c8\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>12c \uc774\ud6c4 \ubd80\ud130\ub294 \uc6b4\uc601\uacfc \ubcf4\uc548\uc744 \uc704\ud574 \ud14c\uc774\ube14 \ub610\ub294 \ubdf0\uc5d0 \ub300\ud55c \ucffc\ub9ac \uad8c\ud55c \ub9cc \ud544\uc694\ud55c \uc0ac\uc6a9\uc790\uc5d0\uac8c<br \/>\nSELECT \ub610\ub294 SELECT ANY TABLE \ub300\uc2e0 READ \ub610\ub294 READ ANY TABLE \uad8c\ud55c\uc744 \ubd80\uc5ec\ud558\uae30 \uc2dc\uc791\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>Examples :<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:plsql decode:true\"> SQL&gt; GRANT READ ON XX.XXLE_CUSTOMERS_T TO smith;\r\n SQL&gt; GRANT READ ON XX.XXLE_SUPPLIERS_VW TO smith;\r\n SQL&gt; GRANT READ ANY TABLE TO peter;\r\n SQL&gt; REVOKE READ ON XX.XXLE_SUPPLIERS_VW FROM smith;\r\n SQL&gt; REVOKE READ ANY TABLE FROM peter;<\/pre>\n<p>&nbsp;<\/p>\n<p>Oracle 12c \uc774\ud558\uc5d0\uc11c\ub294 \uc5b4\ub5bb\uac8c \ud574\uc57c \ud560\uae4c???<\/p>\n<p>\uc544\uc27d\uac8c \ubb38\uc758 \uc8fc\uc5c8\ub358 \uc0ac\uc774\ud2b8\ub294 Oracle 10g \ubc84\uc804\uc744 \uc0ac\uc6a9\ud558\uace0 \uacc4\uc167\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ub2e4\uc74c\uacfc \uac19\uc774 \ubdf0\ub97c \ub9cc\ub4e4\uba74 SELECT\ub97c \ud558\uba74 \ub429\ub2c8\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:plsql decode:true\">SQL&gt; create or replace view v as select * from t union all select * from t where 1=0 with read only;<\/pre>\n<p>&nbsp;<\/p>\n<p>\uc774\ub807\uac8c VIEW\ub97c \ud574\ub2f9 \uc870\ud68c \uc804\uc6a9 \uc720\uc800\uc5d0 \ub9cc\ub4e4\uc5b4 \uc8fc\uba74 SELECT \ub9cc \ub418\uace0 SELECT FOR UPDATE \ub294 \ub9c9\ud788\uac8c \ub429\ub2c8\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:plsql decode:true\">SQL&gt; select * from system.v for update;\r\n select * from system.v for update\r\n *\r\n ERROR at line 1:\r\n ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A \uc0ac\uc774\ud2b8\uc758 \uae30\uc220 \uc758\ub8b0 &#8230; \uac1c\ubc1c\uc790\ub4e4\uc774 DB\uc5d0 \ub4e4\uc5b4\uc640 \uc870\ud68c\ub97c \ud558\ub294 \ub370 \uc870\ud68c \uc804\uc6a9 \uc720\uc800\uc5d0 SELECT \ub9cc \ud5c8\uc6a9\ud558\uace0 SELECT FOR UPDATE \ub97c \ub9c9\uc744 \uc218 \uc788\ub294 \ubc29\ubc95\uc774 \uc5c6\ub098\uc694? &nbsp; SELECT \u2026 FROM&amp;lt;table_name&amp;gt; FOR UPDATE ; &nbsp; \uc0ac\uc2e4 Oracle 12c \ubd80\ud130\ub294 READ \ub77c\ub294 \uad8c\ud55c\uc774 \uc0dd\uaca8\uc11c \uc870\ud68c \ub9cc \uac00\ub2a5\ud55c Synonym \uc720\uc800\uc5d0 \uadf8\ub0e5 \uc8fc\uba74 \ub429\ub2c8\ub2e4. &nbsp; 12c \uc774\ud6c4 \ubd80\ud130\ub294 \uc6b4\uc601\uacfc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2880,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"spay_email":""},"categories":[9],"tags":[1091,1093,1092],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/haisins.synology.me\/wordpress\/wp-content\/uploads\/2018\/02\/tips-newsletter.jpg?fit=680%2C530","amp_enabled":true,"_links":{"self":[{"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3870"}],"collection":[{"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3870"}],"version-history":[{"count":1,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3870\/revisions"}],"predecessor-version":[{"id":3871,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3870\/revisions\/3871"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/media\/2880"}],"wp:attachment":[{"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3870"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}