CREATE UNDO TABLESPACE undotbs2 DATAFILE '/u01/app/oracle/oradata/oralxbp/undotbs02.

dbf' SIZE 3000M; ALTER SYSTEM SET undo_tablespace = 'UNDOTBS2'; ALTER TABLESPACE undotbs1 OFFLINE; DROP TABLESPACE undotbs1 INCLUDING CONTENTS AND DATAFILES; 13.982 usados orabpel 14.014 --------------------------delete noprompt archivelog until time 'sysdate-0.1/24'; crosscheck archivelog all; SQLPLUS orabpel/orabpel1@oralxbp2_pivote -------------------------------------------------Declare P_OLDER_THAN Timestamp; Begin P_OLDER_THAN := '01/oct/2010'; PURGE_INSTANCES(P_OLDER_THAN => P_OLDER_THAN); End; / Declare P_OLDER_THAN Timestamp; Begin P_OLDER_THAN := '01/FEB/10'; ORABPEL.PURGE_INSTANCES(P_OLDER_THAN => P_OLDER_THAN); End; / -----------------en el SOA1 -----------------Declare P_OLDER_THAN Timestamp; Begin P_OLDER_THAN := '01/aug/13'; ORABPEL.PURGE_INSTANCES(P_OLDER_THAN => P_OLDER_THAN); End; / ------------select min(modify_date) from orabpel.cube_instance where state >= 5 ------------------------INSERT into temp_cube_instance

PURGE_INSTANCES(P_OLDER_THAN => P_OLDER_THAN).cikey = tpic. End. VER ESTAS TABLAS ANTES DE LIMPIAR.. DELETE FROM wi_exception WHERE cikey IN (SELECT /*+ ORDERED */ wie..SELECT cikey FROM cube_instance WHERE state >= 3 AND modify_date < p_older_than.cikey). / fijarse en la generacion de archive.cikey)..EL ESPACIO Y NUMERO DE REGISTROS ---------------XML_DOCUMENT WI_EXCEPTION -----------------en el SOA2 -----------------sqlplus orabpel/varadero9 set timi on Declare P_OLDER_THAN Timestamp. commit.dockey FROM document_ci_ref doc_r ef. Begin P_OLDER_THAN := '01/dec/13'. DELETE FROM xml_document WHERE dockey IN (SELECT /*+ ORDERED */ doc_ref. cube_instance tpic WHERE doc_ref.deben ser eliminado para que no se llene e l disco Create or Replace procedure purge_instances( p_older_than in timestamp) as cursor c_cube_instance(p_date timestamp) is select cikey from cube_instance where state >= 5 and modify_date < p_date.cikey FROM wi_exception wie. ORABPEL.cikey = tpic. cursor c_invoke_message(p_date timestamp) is . cube_instance tpic WHERE wie.

alter table orabpel. alter table orabpel.document_ci_ref enable row movement. / ---------------------------------------------------------alter table orabpel. alter table orabpel. alter table orabpel.cube_instance shrink space compact.cube_instance shrink space.work_item enable row movement. end loop.cube_instance disable row movement.cube_scope shrink space compact. for r_dlv_message in c_dlv_message(p_older_than) loop delete from dlv_message where message_guid = r_dlv_message. alter table orabpel. end loop. alter table orabpel. alter table orabpel. commit. alter table orabpel.wi_exception shrink space compact.work_item shrink space compact. cursor c_dlv_message(p_date timestamp) is select message_guid from dlv_message where state > 1 and receive_date < p_date.cube_scope disable row movement.message_guid. --alter table orabpel.cube_instance enable row movement.wi_exception shrink space.cube_scope shrink space. alter table orabpel. end purge_instances. alter table orabpel. alter table orabpel. begin for r_cube_instance in c_cube_instance(p_older_than) loop collaxa.message_guid.wi_exception disable row movement.delete_ci( r_cube_instance.select message_guid from invoke_message where state > 1 and receive_date < p_date.cikey ). --alter table orabpel. commit. for r_invoke_message in c_invoke_message(p_older_than) loop delete from invoke_message where message_guid = r_invoke_message.wi_exception enable row movement. end loop. alter table orabpel.cube_scope enable row movement.work_item disable row movement. .work_item shrink space. --alter table orabpel. --alter table orabpel.

sync_store enable row movement. --alter table orabpel.scope_activation shrink space compact. --alter table orabpel.scope_activation enable row movement.dlv_message shrink space compact.document_dlv_msg_ref disable row movement. --------------------------------hasta qui llegue---ocupe 4 gb en UNDO --------------------------------------alter table orabpel. alter table orabpel. alter table orabpel.ci_indexes shrink space. alter table orabpel.audit_details shrink space. --alter table orabpel. alter table orabpel.invoke_message disable row movement. alter table orabpel.audit_trail shrink space compact.dlv_message disable row movement.ci_indexes enable row movement.invoke_message enable row movement.alter table orabpel.sync_trail shrink space compact.document_dlv_msg_ref shrink space.sync_store disable row movement. --alter table orabpel. --alter table orabpel.dlv_message shrink space. alter table orabpel. alter table orabpel.sync_store shrink space compact. alter table orabpel. alter table orabpel. alter table orabpel. alter table orabpel. alter table orabpel.dlv_subscription disable row movement.ci_indexes disable row movement.dlv_message enable row movement.native_correlation enable row movement. alter table orabpel.document_ci_ref shrink space compact. alter table orabpel. alter table orabpel. --alter table orabpel. alter table orabpel.document_dlv_msg_ref enable row movement.invoke_message shrink space. alter table orabpel.dlv_subscription enable row movement. --alter table orabpel.audit_details enable row movement.sync_trail disable row movement.document_dlv_msg_ref shrink space compact. --alter table orabpel. --alter table orabpel. alter table orabpel. alter table orabpel. alter table orabpel.sync_trail enable row movement. alter table orabpel.scope_activation shrink space.native_correlation shrink space compact. alter table orabpel. alter table orabpel.audit_trail shrink space.invoke_message shrink space compact.sync_trail shrink space.document_ci_ref shrink space. alter table orabpel. alter table orabpel. --alter table orabpel.document_ci_ref disable row movement. alter table orabpel.sync_store shrink space.audit_details disable row movement. . alter table orabpel. --alter table orabpel.dlv_subscription shrink space.scope_activation disable row movement. alter table orabpel.dlv_subscription shrink space compact.audit_trail enable row movement. alter table orabpel.ci_indexes shrink space compact.native_correlation shrink space. alter table orabpel. alter table orabpel.audit_details shrink space compact. alter table orabpel.audit_trail disable row movement. alter table orabpel.

log impdp orabpel/orabpel1 schemas=orabpel directory=expdp1 dumpfile=orabpel_soa1. alter table orabpel. spool off start bpel. --alter table orabpel.xml_document disable row movement. impdp orabpel/orabpel1 schemas=orabpel directory=expdp dumpfile=orabpel_soa1.xml_document enable row movement.xml_document shrink space.log impdp orabpel/varadero9 schemas=orabpel directory=expdp dumpfile=orabpel_soa2.dmp logfile=impsoa1.dm p logfile=soa2.dmp logfile=soa1.log select 'drop ' || object_type || ' orabpel.log .log expdp orabpel/varadero9 schemas=orabpel directory=expdp dumpfile=orabpel_soa2.' from dba_objects where owner='ORABPEL'.dm p logfile=impsoa1.log sqlplus sys@oralxbp as sysdba spool bpel.log start bpel. alter table orabpel.dm p logfile=impsoa2.xml_document shrink space compact.dm p logfile=soa1.log purge dba_recyclebin.--alter table orabpel. alter table orabpel.native_correlation disable row movement.'||object_name || '. --------------------------------------------------------------------------------------------SOA1 ---export ORACLE_SID=oralxbp expdp orabpel/orabpel1 schemas=orabpel directory=expdp dumpfile=orabpel_soa1.log expdp orabpel/orabpel1 schemas=orabpel directory=expdp1 dumpfile=orabpel_soa1.

Sign up to vote on this title
UsefulNot useful