Sei sulla pagina 1di 8

SELECT COUNT (*) FROM PS_EI_SBX_EE WHERE EI_SBX_COMPARE_ID = 'SEQ_DEC_12_2017';

alter system kill session '383, 24613';

select a.sid, a.serial#

from v$session a, v$locked_object b, dba_objects c

where b.object_id = c.object_id

and a.sid = b.session_id

and OBJECT_NAME = 'PS_EI_SBX_EE';

select * from PS_PRCSDEFN where prcstype like 'SQR%' AND PRCSNAME = 'MSPM01';

SELECT * FROM PSPRCSRQST WHERE PRCSINSTANCE IN (31336, 31334, 31333);

DELETE FROM PSPRCSRQST WHERE PRCSINSTANCE IN (31336, 31334, 31333);

COMMIT;

------------

-- PLEASE DROP THE INDEX ON PS_EI_SBX_CHK, PS_EI_SBX_SPCL_HRS, PS_EI_SBX_SPCL,


PS_EI_SBX_ERN, PS_EI_SBX_ERN_HRS & PS_EI_SBX_ERN_ACTCD AND RE-CREATE.

-- NOTE: The below queries will delete "entire data" from the corresponding tables. So, if necessary,
please take back of the data from the tables.
DELETE FROM PS_EI_SBX_CHK;

DROP INDEX PS_EI_SBX_CHK;

CREATE UNIQUE INDEX PS_EI_SBX_CHK ON PS_EI_SBX_CHK (EI_SBX_COMPARE_ID,


EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, EI_SBX_OLD_OR_NEW, EI_SBX_COMP_STATUS)
TABLESPACE PSINDEX;

COMMIT;

DELETE FROM PS_EI_SBX_ERN;

DROP INDEX PS_EI_SBX_ERN;

CREATE UNIQUE INDEX PS_EI_SBX_ERN ON PS_EI_SBX_ERN (EI_SBX_COMPARE_ID, EMPL_RCD,


EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, ERNCD, EI_SBX_OLD_OR_NEW, EI_SBX_COMP_STATUS)
TABLESPACE PSINDEX;

COMMIT;

DELETE FROM PS_EI_SBX_ERN_HRS;

DROP INDEX PS_EI_SBX_ERN_HRS;

CREATE UNIQUE INDEX PS_EI_SBX_ERN_HRS ON PS_EI_SBX_ERN_HRS (EI_SBX_COMPARE_ID,


EMPL_RCD, EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, ERNCD, EI_SBX_OLD_OR_NEW,
EI_SBX_COMP_STATUS) TABLESPACE PSINDEX;

COMMIT;

DELETE FROM PS_EI_SBX_ERN_ACTCD;


DROP INDEX PS_EI_SBX_ERN_ACTCD;

CREATE UNIQUE INDEX PS_EI_SBX_ERN_ACTCD ON PS_EI_SBX_ERN_ACTCD (EI_SBX_COMPARE_ID,


EMPL_RCD, EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, ERNCD, FIELDNAME,
EI_SBX_OLD_OR_NEW, EI_SBX_COMP_STATUS) TABLESPACE PSINDEX;

COMMIT;

DELETE FROM PS_EI_SBX_SPCL;

DROP INDEX PS_EI_SBX_SPCL;

CREATE UNIQUE INDEX PS_EI_SBX_SPCL ON PS_EI_SBX_SPCL (EI_SBX_COMPARE_ID, EMPL_RCD,


EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, ERNCD_SPCL, EI_SBX_OLD_OR_NEW,
EI_SBX_COMP_STATUS) TABLESPACE PSINDEX;

COMMIT;

DELETE FROM PS_EI_SBX_SPCL_HRS;

DROP INDEX PS_EI_SBX_SPCL_HRS;

CREATE UNIQUE INDEX PS_EI_SBX_SPCL_HRS ON PS_EI_SBX_SPCL_HRS (EI_SBX_COMPARE_ID,


EMPL_RCD, EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, ERNCD_SPCL, EI_SBX_OLD_OR_NEW,
EI_SBX_COMP_STATUS) TABLESPACE PSINDEX;

COMMIT;

DELETE FROM PS_EI_SBX_EE;

DROP INDEX PS_EI_SBX_EE;


CREATE UNIQUE INDEX PS_EI_SBX_SPCL_HRS ON PS_EI_SBX_SPCL_HRS (EI_SBX_COMPARE_ID,
EMPL_RCD, EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, ERNCD_SPCL, EI_SBX_OLD_OR_NEW,
EI_SBX_COMP_STATUS) TABLESPACE PSINDEX;

CREATE INDEX PS_EI_SBX_EE ON PS_EI_SBX_EE (EI_SBX_COMPARE_ID, EI_SBX_COMPARE_SEQ,


EMPLID, COUNTRY, EI_SBX_COMP_STATUS, NAME); TABLESPACE PSINDEX;

COMMIT;

select a.sid, a.serial#

from v$session a, v$locked_object b, dba_objects c

where b.object_id = c.object_id

and a.sid = b.session_id

and OBJECT_NAME = 'PS_EI_SBX_EE';

alter system kill session '383, 24613';

----------

-- PLEASE DROP THE INDEX ON PS_EI_SBX_CHK, PS_EI_SBX_SPCL_HRS, PS_EI_SBX_SPCL,


PS_EI_SBX_ERN, PS_EI_SBX_ERN_HRS & PS_EI_SBX_ERN_ACTCD AND RE-CREATE.

-- NOTE: The below queries will delete "entire data" from the corresponding tables. So, if necessary,
please take back of the data from the tables.

DELETE FROM PS_EI_SBX_CHK;


DROP INDEX PS_EI_SBX_CHK;

CREATE UNIQUE INDEX PS_EI_SBX_CHK ON PS_EI_SBX_CHK (EI_SBX_COMPARE_ID,


EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, EI_SBX_OLD_OR_NEW, EI_SBX_COMP_STATUS)
TABLESPACE PYLARGE;

COMMIT;

DELETE FROM PS_EI_SBX_ERN;

DROP INDEX PS_EI_SBX_ERN;

CREATE UNIQUE INDEX PS_EI_SBX_ERN ON PS_EI_SBX_ERN (EI_SBX_COMPARE_ID, EMPL_RCD,


EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, ERNCD, EI_SBX_OLD_OR_NEW, EI_SBX_COMP_STATUS)
TABLESPACE PYLARGE;

COMMIT;

DELETE FROM PS_EI_SBX_ERN_HRS;

DROP INDEX PS_EI_SBX_ERN_HRS;

CREATE UNIQUE INDEX PS_EI_SBX_ERN_HRS ON PS_EI_SBX_ERN_HRS (EI_SBX_COMPARE_ID,


EMPL_RCD, EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, ERNCD, EI_SBX_OLD_OR_NEW,
EI_SBX_COMP_STATUS) TABLESPACE PYLARGE;

COMMIT;

DELETE FROM PS_EI_SBX_ERN_ACTCD;

DROP INDEX PS_EI_SBX_ERN_ACTCD;


CREATE UNIQUE INDEX PS_EI_SBX_ERN_ACTCD ON PS_EI_SBX_ERN_ACTCD (EI_SBX_COMPARE_ID,
EMPL_RCD, EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, ERNCD, FIELDNAME,
EI_SBX_OLD_OR_NEW, EI_SBX_COMP_STATUS) TABLESPACE PYLARGE;

COMMIT;

DELETE FROM PS_EI_SBX_SPCL;

DROP INDEX PS_EI_SBX_SPCL;

CREATE UNIQUE INDEX PS_EI_SBX_SPCL ON PS_EI_SBX_SPCL (EI_SBX_COMPARE_ID, EMPL_RCD,


EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, ERNCD_SPCL, EI_SBX_OLD_OR_NEW,
EI_SBX_COMP_STATUS) TABLESPACE PYLARGE;

COMMIT;

DELETE FROM PS_EI_SBX_SPCL_HRS;

DROP INDEX PS_EI_SBX_SPCL_HRS;

CREATE UNIQUE INDEX PS_EI_SBX_SPCL_HRS ON PS_EI_SBX_SPCL_HRS (EI_SBX_COMPARE_ID,


EMPL_RCD, EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, ERNCD_SPCL, EI_SBX_OLD_OR_NEW,
EI_SBX_COMP_STATUS) TABLESPACE PYLARGE;

COMMIT;

DELETE FROM PS_EI_SBX_EE;

DROP INDEX PS_EI_SBX_EE;

rollback;
CREATE UNIQUE INDEX PS_EI_SBX_SPCL_HRS ON PS_EI_SBX_SPCL_HRS (EI_SBX_COMPARE_ID,
EMPL_RCD, EI_SBX_COMPARE_SEQ, EMPLID, COUNTRY, ERNCD_SPCL, EI_SBX_OLD_OR_NEW,
EI_SBX_COMP_STATUS) TABLESPACE PYLARGE;

COMMIT;

select count(*) from ps_EI_SBX_ee;

delete from ps_EI_SBX_ee;

set feedback off

alter session set nls_date_format='DD-MON-YYYY HH24:MI:SS';

set feedback on

select

jr.job,

s.username,

s.sid,

s.serial#,

p.spid,

s.lockwait,

s.logon_time

from

dba_jobs_running jr,

v$session s,

v$process p

where

jr.sid = s.sid

and

s.paddr = p.addr
order by

jr.job;