{"id":728,"date":"2013-08-29T21:08:53","date_gmt":"2013-08-29T19:08:53","guid":{"rendered":"http:\/\/clemente.pamplona.name\/dba\/?p=728"},"modified":"2013-12-31T11:18:52","modified_gmt":"2013-12-31T10:18:52","slug":"ora-00959-el-tablespace-_deleted820-no-existe-durante-un-impdp","status":"publish","type":"post","link":"http:\/\/clemente.pamplona.name\/dba\/ora-00959-el-tablespace-_deleted820-no-existe-durante-un-impdp\/","title":{"rendered":"ORA-00959: el tablespace &#8216;_$deleted$82$0&#8217; no existe  durante un impdp"},"content":{"rendered":"<p><strong>Nos hemos mudado a bloger!<br \/>\nEl contenido actualizado de esta entrada lo tienes en:<\/strong><\/p>\n<ul>\n<a href=\"http:\/\/dba.pamplona.name\/2013\/08\/ora-00959-el-tablespace-no-existe.html\" title=\"http:\/\/dba.pamplona.name\/2013\/08\/ora-00959-el-tablespace-no-existe.html\">http:\/\/dba.pamplona.name\/2013\/08\/ora-00959-el-tablespace-no-existe.html<\/a><\/p>\n<p>Hoy vamos a ver como solucionar los problemas ORA-00959  cuando van asociados a un tablespace borrado.<br \/>\nEste error es bastante com\u00fan y es un bug identificado de oracle que es facil que te encuentres cuando se usan tablas particionadas, y se elimina o se mueve el tablespace original de la tabla. Es muy habitual el rehacer los objetos indicando los tablespaces por defecto de las particiones, pero no cambiando el de la tabla original<br \/>\nEsto hace que, cuando vayas a importar la tabla, el tablespace original de la tabla no exsista, recibiendo el error del enunciado.<\/p>\n<p>\u00bfComo lo solucionamos?<\/p>\n<p>Hay 2 maneras:<\/p>\n<p><strong>1- Solucion en origen<\/strong><br \/>\nEsta es la soluci\u00f3n correcta, y lo que hacemos es buscar que tablas tienen la sintaxsis de creacion en un tablespace inexistente y modificarlas.<\/p>\n<pre>\r\nselect distinct 'ALTER INDEX '||index_owner||'.'||index_name||' MODIFY DEFAULT ATTRIBUTES TABLESPACE '||tablespace_name||';' cmd from dba_ind_partitions where tablespace_name not in ('SYSTEM','SYSAUX') order by 1;\r\n\r\n select distinct 'ALTER INDEX '||index_owner||'.'||index_name||' MODIFY DEFAULT ATTRIBUTES FOR PARTITION '||partition_name||' TABLESPACE '||tablespace_name||';' cmd from dba_ind_subpartitions where tablespace_name not in ('SYSTEM','SYSAUX') order by 1;\r\n\r\n select distinct 'ALTER TABLE '||table_owner||'.'||table_name||' MODIFY DEFAULT ATTRIBUTES TABLESPACE '||tablespace_name||';' cmd from dba_tab_partitions where tablespace_name not in ('SYSTEM','SYSAUX') order by 1;\r\n\r\n select distinct 'ALTER TABLE '||table_owner||'.'||table_name||' MODIFY DEFAULT ATTRIBUTES FOR PARTITION '||partition_name||' TABLESPACE '||tablespace_name||';' cmd from dba_tab_subpartitions where tablespace_name not in ('SYSTEM','SYSAUX') order by 1;\r\n\r\n select 'alter user '||username||' default tablespace '||default_tablespace||' temporary tablespace '||temporary_tablespace||';' cmd from dba_users order by default_tablespace;\r\n<\/pre>\n<p>Y ejecutamos la salida de estas consultas<\/p>\n<p><strong>2- Solucion en destino<\/strong><\/p>\n<p>Creamos a mano las tablas que dan el error e importamos con la opcion \u00abtruncate\u00bb<\/p>\n<p><fonr size=+1> <font color=red>N<strong>OTA<\/strong>:<\/font><\/font><br \/>\nIndpendientemente de estas chapucillas, lo mejor ser\u00e1 contactar con soporte oracle para identificar el bug que nos afecta y parchear la base de datos <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nos hemos mudado a bloger! El contenido actualizado de esta entrada lo tienes en: http:\/\/dba.pamplona.name\/2013\/08\/ora-00959-el-tablespace-no-existe.html Hoy vamos a ver como solucionar los problemas ORA-00959 cuando van asociados a un tablespace borrado. Este error es bastante com\u00fan y es un bug &hellip; <a href=\"http:\/\/clemente.pamplona.name\/dba\/ora-00959-el-tablespace-_deleted820-no-existe-durante-un-impdp\/\">Sigue leyendo <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66,4],"tags":[120,106,119,118,121,22],"class_list":["post-728","post","type-post","status-publish","format-standard","hentry","category-errores-ora","category-tablespaces","tag-_deleted","tag-impdp","tag-importacion","tag-ora-00959","tag-partitioning","tag-tablespace"],"_links":{"self":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts\/728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/comments?post=728"}],"version-history":[{"count":7,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts\/728\/revisions"}],"predecessor-version":[{"id":841,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts\/728\/revisions\/841"}],"wp:attachment":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/media?parent=728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/categories?post=728"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/tags?post=728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}