{"id":70,"date":"2011-11-07T12:41:48","date_gmt":"2011-11-07T12:41:48","guid":{"rendered":"http:\/\/tomas.papp.me.uk\/?p=70"},"modified":"2011-11-07T12:41:48","modified_gmt":"2011-11-07T12:41:48","slug":"move-tables-to-a-different-tbs-the-easy-way","status":"publish","type":"post","link":"https:\/\/tomas.papp.me.uk\/?p=70","title":{"rendered":"Move tables to a different tbs, the easy way"},"content":{"rendered":"<p>Mozno sa vam obcas pritrafi, ze potrebujete z nejakeho dovodu presunut velke mnozstvo tabuliek z jedneho tbs do ineho. V pripade ze tabulka nema index je to jednoducha vec, ale ked index ma problemy sa zacinaju. Tento skript sa o vsetko postara..<\/p>\n<pre>\r\n\/\/move all non-indexed\/\/\r\n\r\nselect 'alter table '||t.owner||'.'||t.table_name|| 'move tablespace table_small;' \u00a0\r\nfrom dba_tables t \r\nwhere t.tablespace_name='USERS' \r\nand t.table_name not in \r\n(select i.table_name from dba_indexes i where t.owner=i.owner and i.table_name=t.table_name);\r\n\r\n\/\/move all indexed\/\/\r\n\r\nselect 'alter index '||i.owner||'.'||i.index_name||' unusable;' \r\n,'alter table '||t.owner||'.'||t.table_name|| ' move tablespace table_small;'\r\n,'alter index '||i.owner||'.'||i.index_name||' rebuild;'\r\nfrom dba_tables t, dba_indexes i where \r\nt.tablespace_name='USERS' and\u00a0\r\nt.table_name=i.table_nameand t.owner=i.owner;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mozno sa vam obcas pritrafi, ze potrebujete z nejakeho dovodu presunut velke mnozstvo tabuliek z jedneho tbs do ineho. V pripade ze tabulka nema index je to jednoducha vec, ale ked index ma problemy sa zacinaju. Tento skript sa o vsetko postara.. \/\/move all non-indexed\/\/ select &#8216;alter table &#8216;||t.owner||&#8217;.&#8217;||t.table_name|| &#8216;move tablespace table_small;&#8217; \u00a0 from dba_tables [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-70","post","type-post","status-publish","format-standard","hentry","category-oracle"],"_links":{"self":[{"href":"https:\/\/tomas.papp.me.uk\/index.php?rest_route=\/wp\/v2\/posts\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tomas.papp.me.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tomas.papp.me.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tomas.papp.me.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tomas.papp.me.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70"}],"version-history":[{"count":4,"href":"https:\/\/tomas.papp.me.uk\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions"}],"predecessor-version":[{"id":75,"href":"https:\/\/tomas.papp.me.uk\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions\/75"}],"wp:attachment":[{"href":"https:\/\/tomas.papp.me.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tomas.papp.me.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tomas.papp.me.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}