SET LINESIZE 200
SET PAGESIZE 1000
SET VERIFY OFF

SPOOL drop_iem_as_client_db.log

ACCEPT Server PROMPT 'Enter DATABASE name (default - MAG1101.TRANSITCARD.RU): ' DEFAULT MAGICASH
ACCEPT MGUSER PROMPT 'Enter MGUSER name (default - MAGICASH5): ' DEFAULT MAGICASH5
ACCEPT SYSpsw PROMPT 'Enter MGUSER password: ' DEFAULT NCTMAGICASH5 HIDE

CONNECT &MGUSER/&SYSpsw@&Server

SET SERVEROUTPUT ON

SET HEADING OFF
-- Время начала исполнения
PROMPT Current time:
select to_char(sysdate,'DD.MM.YYYY HH24:MI:SS') TIME from dual;
SET HEADING ON

DROP TRIGGER TRG_INSTALL_LOG_DDL_ONL;
 
DROP TABLE psync_events;
DROP TABLE psync_exports;
DROP TABLE psync_imports;
DROP TABLE psync_imports_iem;
 
DROP TABLE c$ecfil001;
DROP TABLE c$ecfil005;
DROP TABLE c$ecfil010;
DROP TABLE c$ecfil011;
DROP TABLE c$ecfil012;
DROP TABLE c$ecfil015;
DROP TABLE c$ecfil030;
DROP TABLE c$ecfil054;
DROP TABLE c$ecfil061;
DROP TABLE c$ecfil139;
DROP TABLE c$ecfil144;
DROP TABLE c$oc_history_time_credit;
DROP TABLE c$oc_onl_acquirer_emitent;
DROP TABLE c$oc_onl_cards;
DROP TABLE c$oc_onl_cards_limits;
DROP TABLE c$oc_onl_customers;
DROP TABLE c$oc_onl_customers_limits;
DROP TABLE c$oc_onl_group_transactions;
DROP TABLE c$oc_onl_transactions;
DROP TABLE X$OC_ONL_PSYNC_ERRORS;
DROP TABLE C$PCPN_COUPONS;
DROP TABLE C$OC_ONL_EXCHANGE_RATES;
DROP TABLE C$OC_ONL_VC_GROUPS;
DROP TABLE C$OC_ONL_VIRTUAL_COUPONS;
DROP TABLE "C$OC_VC_SEND_REQUESTS";
DROP TABLE "C$OC_VC_SEND_REQUEST_CONTENT";
DROP TABLE C$ECFIL078;
DROP TABLE C$TRANSACTIONS_ORIGINAL;
DROP TABLE C$LNR_TRANZACTIONS;
DROP TABLE "C$ECFIL037";
DROP TABLE C$OC_CG;
DROP TABLE C$OC_CI_CARD_ISSUED;
DROP TABLE C$OC_CG_LOG;

DROP TABLE "C$OC_DCL_TRANSACTION_EMITENT";
DROP TABLE "C$OC_DCL_TRANSACTION_ACQUIRER";
DROP TABLE "C$OC_SHIFT_TRANS_POS";
DROP TABLE "C$ECFIL138";

DROP TABLE C$OC_BL_FROM_PC;

DROP TRIGGER ECFIL001$IN;
DROP TRIGGER ECFIL010$IN;
DROP TRIGGER ECFIL011$IN;
DROP TRIGGER ECFIL012$IN;
DROP TRIGGER ECFIL015$IN;
DROP TRIGGER ECFIL030$IN;
DROP TRIGGER ECFIL054$IN;
DROP TRIGGER ECFIL061$IN;
DROP TRIGGER ECFIL139$IN;
DROP TRIGGER ECFIL144$IN;
DROP TRIGGER OC_HISTORY_TIME_CREDIT$IN;
DROP TRIGGER OC_ONL_ACQUIRER_EMITENT$IN;
DROP TRIGGER OC_ONL_CARDS$IN;
DROP TRIGGER OC_ONL_CARDS_LIMITS$IN;
DROP TRIGGER OC_ONL_CUSTOMERS$IN;
DROP TRIGGER OC_ONL_CUSTOMERS_LIMITS$IN;
DROP TRIGGER OC_ONL_GROUP_TRANSACTIONS$IN;
DROP TRIGGER OC_ONL_TRANSACTIONS$IN;
DROP TRIGGER PCPN_COUPONS$IN;
DROP TRIGGER OC_ONL_EXCHANGE_RATES$IN;
DROP TRIGGER OC_ONL_VC_GROUPS$IN;
DROP TRIGGER OC_ONL_VIRTUAL_COUPONS$IN;
DROP TRIGGER OC_VC_SEND_REQUESTS$IN;
DROP TRIGGER OC_VC_SEND_REQUEST_CONTENT$IN;
DROP TRIGGER ECFIL078$IN;
DROP TRIGGER VIRTUAL_COUPONS$IN;
DROP TRIGGER TRANSACTIONS_ORIGINAL$IN;
DROP TRIGGER LNR_TRANZACTIONS$IN;
DROP TRIGGER ECFIL037$IN;
DROP TRIGGER CUSTOMERS_OFF_INFO$IEM_C_IN;

DROP TRIGGER CG$IN;
DROP TRIGGER OC_CI_CARD_ISSUED$IN;
DROP TRIGGER CG_LOG$IN;

DROP TRIGGER OC_DCL_TRANSACTION$IN;
DROP TRIGGER OC_SHIFT_TRANS_POS$IN;
DROP TRIGGER ECFIL138$IN;

DROP TRIGGER ECFIL005$IN;
DROP TRIGGER OC_BL_FROM_PC$IN;

DROP PACKAGE PSYNC;
DROP PACKAGE PETROL_INSTALL_ONL;
DROP PACKAGE PETROL_REPL_OC;

DROP sequence sq_psync_events;
DROP sequence sq_psync_exports; 
DROP sequence sq_psync_imports;
DROP sequence sq_psync_imports_iem;
DROP sequence sq_psync_order;
DROP sequence sq_virtual_coupons;
 
DROP TABLE X$INSTALLID;
DROP TABLE INSTALL_ONL;

SET HEADING OFF
-- Время конца исполнения
PROMPT Current time:
select to_char(sysdate,'DD.MM.YYYY HH24:MI:SS') TIME from dual;
SET HEADING ON

SPOOL OFF

EXIT;