

--
--    Licensed Materials - Property of IBM
--    
--    BI and PM: JSM
--    
--    (c) Copyright IBM Corp. 2003, 2010.
--    
--    US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
--    


-------------------------------------------------------------------------------
-- NC304_UPDATE_ORA.SQL	       *DO NOT EDIT*		Data Store Version: 304		 
-------------------------------------------------------------------------------


-------------------------------------------------------------------------------
--$100-- backup create begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$110-- backup inserts begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$130-- views drop begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$140-- tables drop begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$200-- recreate tables begin
-------------------------------------------------------------------------------

CREATE TABLE NC_TASK_QUEUE (
	TASK_ID 			CHAR(20) NOT NULL,
    SERVICE_NAME 		VARCHAR2(40),
    SERVER_GROUP 		VARCHAR2(40),
    DATE_ENTERED 		NUMERIC NOT NULL,
    TASK 				BLOB,
    STATUS 				INTEGER NOT NULL,
    PRIORITY 			INTEGER NOT NULL,
    OPERATIONS 			BLOB,
    SDS_INSTANCE_ID 	CHAR(32),
    HISTORY_STORE_ID 	CHAR(34)
);

 

CREATE TABLE NC_TSE_STATE_MAP (
	TASK_ID 			CHAR(20) NOT NULL,
    STATUS 				INTEGER,
    SEQ 				INTEGER,
    STEP_COUNT 			INTEGER,
    CUR_SEQ 			INTEGER,
    COUNT_SEQ 			INTEGER,
    STOP_ON_ERROR 		INTEGER,
    RUN_VIA_MS 			INTEGER,
    STEP_FAILED 		INTEGER,
    SEQ_ON_END 			INTEGER,
    WRITE_ALL_HISTORIES INTEGER,
    FAIL_STATUS 		INTEGER,
    PARENT_ID 			CHAR(20)
);





-------------------------------------------------------------------------------
--$202-- primary keys add begin
-------------------------------------------------------------------------------

ALTER TABLE NC_TASK_QUEUE ADD CONSTRAINT PN_TASK_QUEUE PRIMARY KEY (TASK_ID);

ALTER TABLE NC_TSE_STATE_MAP ADD CONSTRAINT PN_TSE_STATE_MAP PRIMARY KEY (TASK_ID);

CREATE INDEX IX_NC_TSE_STATE_MAP ON NC_TSE_STATE_MAP (PARENT_ID, SEQ);

CREATE INDEX IX_NC_TASK_QUEUE_SLTR ON NC_TASK_QUEUE (STATUS, SERVICE_NAME, SERVER_GROUP, DATE_ENTERED);

-------------------------------------------------------------------------------
--$210-- views create begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$220-- server data inserts begin
-------------------------------------------------------------------------------

INSERT INTO NC_DB_VERSION (DB_VERSION_ID,BUILD) VALUES(304,'build no.');

 -------------------------------------------------------------------------------
 --$230-- restore inserts begin
 -------------------------------------------------------------------------------


 -------------------------------------------------------------------------------
 --$250-- backup drop begin
 -------------------------------------------------------------------------------



-------------------------------------------------------------------------------
--$260-- end sql by function
-------------------------------------------------------------------------------
--	END NC304_UPDATE_ORA.SQL			*	DO NOT EDIT	 * 		 
-------------------------------------------------------------------------------