PROMPT Doing Post-Installation Steps...
DECLARE
max_id PLS_INTEGER := 0;
temp_id PLS_INTEGER := 0;
CURSOR cur IS SELECT table_name AS tabla FROM user_tables WHERE Upper(TABLE_name) NOT LIKE 'CG%' AND Upper(TABLE_name) NOT LIKE 'PLAN%'
                                                                AND Upper(TABLE_name) NOT LIKE 'NIT_SMS%' AND Upper(TABLE_name) NOT LIKE 'NIT_CSV%';
BEGIN

FOR rec in cur LOOP
	EXECUTE IMMEDIATE 'SELECT MAX(ID) FROM ' || rec.tabla
  INTO temp_id;

	IF (temp_id > max_id) THEN
		max_id := temp_id;
	END IF;

  EXECUTE IMMEDIATE 'ALTER SEQUENCE NIT_SEQ MINVALUE ' || max_id;
END LOOP;

END;
/

ANALYZE TABLE CG_CODE_CONTROLS COMPUTE STATISTICS ;
ANALYZE TABLE CG_REF_CODES COMPUTE STATISTICS ;
ANALYZE TABLE NIT_CIT_RELATION_TYPES COMPUTE STATISTICS ;
ANALYZE TABLE NIT_CI_ATTRIBUTES COMPUTE STATISTICS ;
ANALYZE TABLE NIT_CI_PROPERTIES COMPUTE STATISTICS ;
ANALYZE TABLE NIT_CI_PROPERTY_TYPES COMPUTE STATISTICS ;
ANALYZE TABLE NIT_CI_PROPERTY_VALUES COMPUTE STATISTICS ;
ANALYZE TABLE NIT_CI_RELATIONS COMPUTE STATISTICS ;
ANALYZE TABLE NIT_CI_TYPES COMPUTE STATISTICS ;
ANALYZE TABLE NIT_CI_TYPE_RELATIONS COMPUTE STATISTICS ;
ANALYZE TABLE NIT_CONFIG_ITEMS COMPUTE STATISTICS ;
ANALYZE TABLE NIT_EXCEPTIONS COMPUTE STATISTICS ;
ANALYZE TABLE NIT_LOCATIONS COMPUTE STATISTICS ;
ANALYZE TABLE NIT_MESSAGES COMPUTE STATISTICS ;
ANALYZE TABLE NIT_OPERATIONS COMPUTE STATISTICS ;
ANALYZE TABLE NIT_PARAMETERS COMPUTE STATISTICS ;
ANALYZE TABLE NIT_POSITIONS COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_ADD_REMOVE_PROGRAMS COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_CDROM COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_COMPUTER_SYSTEM COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_DESKTOP_MONITOR COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_DISK COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_IDE_CONTROLLER COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_MODEM_DEVICE COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_MOTHERBOARD_DEVICE COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_NETWORK_ADAPTER COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_NETWORK_ADAPTER_CONFIG COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_OPERATING_SYSTEM COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_PARALLEL_PORT COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_PC_BIOS COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_PROCESSOR COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_SCSI_CONTROLLER COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_SERVICE COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_SOUND_DEVICE COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_TAPE_DRIVE COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_USB_CONTROLLER COMPUTE STATISTICS ;
ANALYZE TABLE NIT_SMS_X86_PC_MEMORY COMPUTE STATISTICS ;
ANALYZE TABLE NIT_USERS COMPUTE STATISTICS ;

PROMPT Done.