{"id":576,"date":"2017-08-25T11:25:43","date_gmt":"2017-08-25T07:25:43","guid":{"rendered":"https:\/\/provolotski.wordpress.com\/?p=576"},"modified":"2017-08-25T11:25:43","modified_gmt":"2017-08-25T07:25:43","slug":"%d0%bf%d0%be%d0%bb%d0%b5%d0%b7%d0%bd%d1%8b%d0%b5-%d0%b7%d0%b0%d0%bf%d1%80%d0%be%d1%81%d1%8b","status":"publish","type":"post","link":"https:\/\/provolotski.by\/?p=576","title":{"rendered":"\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b"},"content":{"rendered":"<p>\u041f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0449\u0438\u0435 \u0436\u0438\u0442\u044c<\/p>\n<p><!--more--><\/p>\n<p>\u0423\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e \u0441\u0445\u0435\u043c\u0430\u043c<\/p>\n<pre>SELECT T.OWNER,\n         T.TABLE_NAME,\n         TM.TIMESTAMP,\n         SYSDATE,\n            ROUND (\n                 (  (TM.INSERTS + TM.UPDATES + TM.DELETES)\n                  \/ DECODE (T.NUM_ROWS,\n                            0, (TM.INSERTS + TM.UPDATES + TM.DELETES),\n                            T.NUM_ROWS))\n               * 100,\n               1)\n         || ' %'\n            AS change_pct\n    FROM DBA_TAB_MODIFICATIONS tm, DBA_TABLES t\n   WHERE     TM.TABLE_OWNER = T.OWNER\n         AND T.OWNER IN ('....\u041f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u0441\u0445\u0435\u043c .....')\n         AND TM.TABLE_NAME = T.TABLE_NAME\n         AND (TM.INSERTS + TM.UPDATES + TM.DELETES) &gt; 0\n         AND   (  (TM.INSERTS + TM.UPDATES + TM.DELETES)\n                \/ DECODE (T.NUM_ROWS,\n                          0, (TM.INSERTS + TM.UPDATES + TM.DELETES),\n                          T.NUM_ROWS))\n             * 100 &gt;\n                DBMS_STATS.GET_PREFS ('STALE_PERCENT', T.OWNER, T.TABLE_NAME)\nORDER BY (  (TM.INSERTS + TM.UPDATES + TM.DELETES)\n          \/ DECODE (T.NUM_ROWS,\n                    0, (TM.INSERTS + TM.UPDATES + TM.DELETES),\n                    T.NUM_ROWS)) DESC\n<\/pre>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u043c\u0435\u044e\u0449\u0438\u0435 foreignKey \u043d\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u0443\u044e<\/p>\n<pre>select table_name, constraint_name, status, owner\nfrom all_constraints\nwhere r_owner = :r_owner\nand constraint_type = 'R'\nand r_constraint_name in\n (\n   select constraint_name from all_constraints\n   where constraint_type in ('P', 'U')\n   and table_name = :r_table_name\n   and owner = :r_owner\n )\norder by table_name, constraint_name\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0449\u0438\u0435 \u0436\u0438\u0442\u044c<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,5],"tags":[],"class_list":["post-576","post","type-post","status-publish","format-standard","hentry","category-oracle","category-sql"],"_links":{"self":[{"href":"https:\/\/provolotski.by\/index.php?rest_route=\/wp\/v2\/posts\/576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/provolotski.by\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/provolotski.by\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/provolotski.by\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/provolotski.by\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=576"}],"version-history":[{"count":0,"href":"https:\/\/provolotski.by\/index.php?rest_route=\/wp\/v2\/posts\/576\/revisions"}],"wp:attachment":[{"href":"https:\/\/provolotski.by\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/provolotski.by\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/provolotski.by\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}