-- Licensed Materials - Property of IBM
-- IBM Cognos Products: ccllogging
-- (C) Copyright IBM Corp. 2005, 2013
-- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 

ALTER TABLE COGIPF_MIGRATION ALTER COLUMN COGIPF_OPERATION SET DATA TYPE varchar(64)

Call Sysproc.admin_cmd('REORG table COGIPF_MIGRATION')

ALTER TABLE COGIPF_MIGRATION ALTER COLUMN COGIPF_TARGET_TYPE SET DATA TYPE varchar(64)

Call Sysproc.admin_cmd('REORG table COGIPF_MIGRATION')

ALTER TABLE COGIPF_MIGRATION ALTER COLUMN COGIPF_TARGET_NAME SET DATA TYPE varchar(255)

Call Sysproc.admin_cmd('REORG table COGIPF_MIGRATION')

ALTER TABLE COGIPF_MIGRATION ALTER COLUMN  COGIPF_STATUS   SET DATA TYPE varchar(64)

Call Sysproc.admin_cmd('REORG table COGIPF_MIGRATION')

ALTER TABLE COGIPF_MIGRATION ALTER COLUMN  COGIPF_PACKAGE   SET DATA TYPE varchar(512)

Call Sysproc.admin_cmd('REORG table COGIPF_MIGRATION')

ALTER TABLE COGIPF_MIGRATION add COGIPF_MSGNUM integer default 0

Call Sysproc.admin_cmd('REORG table COGIPF_MIGRATION')

ALTER TABLE COGIPF_MIGRATION add COGIPF_SOURCE_TYPE varchar (64) default ''

Call Sysproc.admin_cmd('REORG table COGIPF_MIGRATION')

ALTER TABLE COGIPF_MIGRATION add COGIPF_SOURCE_PATH varchar (1024) default ''

Call Sysproc.admin_cmd('REORG table COGIPF_MIGRATION')

ALTER TABLE COGIPF_MIGRATION add COGIPF_SOURCE_NAME varchar (255) default ''

Call Sysproc.admin_cmd('REORG table COGIPF_MIGRATION')

CREATE TABLE COGIPF_POWERPLAY (
	COGIPF_HOST_IPADDR 	varchar (128),
	COGIPF_HOST_PORT 		integer,
	COGIPF_PROC_ID 		integer ,
	COGIPF_LOCALTIMESTAMP 	timestamp,
	COGIPF_TIMEZONE_OFFSET 	integer,
	COGIPF_SESSIONID 		varchar (255) ,
	COGIPF_REQUESTID 		varchar (255) not null,
	COGIPF_STEPID 		varchar (255) ,
	COGIPF_SUBREQUESTID 	varchar (255) ,
	COGIPF_THREADID 		varchar (255) ,
	COGIPF_COMPONENTID 	varchar (64)  ,
	COGIPF_BUILDNUMBER 	integer,
	COGIPF_LOG_LEVEL 		integer,
	COGIPF_TARGET_TYPE 	varchar (255) ,
	COGIPF_REPORTPATH 		varchar (512) ,
	COGIPF_STATUS 		varchar (255) ,
	COGIPF_RUNTIME 		integer,
	COGIPF_REPORTNAME 		varchar (255) ,
	COGIPF_PACKAGE 		varchar (512) ,
	COGIPF_DATASOURCE 	varchar (512) ,
	COGIPF_DATASOURCE_CONNECTION 	varchar (512) ,
	COGIPF_OPERATION 		varchar (128) ,
	COGIPF_MESSAGE	 	varchar (2000) ,
	COGIPF_REQUEST_TYPE 	integer,
	COGIPF_SUB_COMPONENTID 	varchar (64)
)

CREATE TABLE COGIPF_POWERPLAY_DIM_USAGE (
	COGIPF_SESSIONID 		varchar (256) ,
	COGIPF_REQUESTID 		varchar (256) not null,
	COGIPF_DIM_CODE 		varchar (256) ,
	COGIPF_DIM_NAME 		varchar (256) ,
	COGIPF_DIM_COUNT 		integer
)

CREATE TABLE COGIPF_POWERPLAY_LEVEL_USAGE (
	COGIPF_SESSIONID 		varchar (256) ,
	COGIPF_REQUESTID 		varchar (256) not null,
	COGIPF_DIM_CODE 		varchar (256) ,
	COGIPF_LEVEL_CODE 	varchar (256) ,
	COGIPF_LEVEL_NAME 	varchar (256) ,
	COGIPF_LEVEL_COUNT 	integer
)

CREATE TABLE COGIPF_POWERPLAY_MEASURE_USAGE (
	COGIPF_SESSIONID 		varchar (256) ,
	COGIPF_REQUESTID 		varchar (256) not null,
	COGIPF_MEASURE_CODE 	varchar (256) ,
	COGIPF_MEASURE_NAME 	varchar (256) ,
	COGIPF_MEASURE_COUNT 	integer
)
