GCT Utilities

  • Title AIM - 자료가 너무 많아서 오류가 나면
  • Writer Minwoo, Song Date 2025-02-19/09:01 Read 26
AIM에 자료가 너무 많아서 오류가 나고 Import 조차 되지 않을때는
DB에 있는 모든 테이블에서 ID를 늘려줘야 한다.
아래의 쿼리들을 실행하여 개선한 사례가 있다.
제공은 아비바코리아 김진우 프로님이 했다.

추가로 DATA type에 대한 차이이다.
INT 2,147,483,647
BIGINT 9,223,372,036,854,775,807
--------------------------------------------

//1. vnet_association_i

// 기본 키 조회
EXEC sp_helpindex [vnet_association_i]

//기본 키 삭제
ALTER TABLE [vnet_association_i] drop constraint vnet_association_i_pk
drop index vnet_association_i.vnet_association_i_i01
drop index vnet_association_i.vnet_association_i_i02

// 컬럼 속성 변경
ALTER TABLE [vnet_association_i] ALTER COLUMN noderef bigint NOT NULL;
ALTER TABLE [vnet_association_i] ALTER COLUMN target bigint NOT NULL;
ALTER TABLE [vnet_association_i] ALTER COLUMN source bigint NOT NULL;

// 기본 키 추가
ALTER TABLE [vnet_association_i] add constraint [vnet_association_i_pk] primary key (noderef);
create index vnet_association_i_i01 on vnet_association_i (source, type, target)
create index vnet_association_i_i02 on vnet_association_i (target, type, source)


//2.vnet_instance_i
/ 기본 키 조회
EXEC sp_helpindex [vnet_instance_i]

//기본 키 삭제
ALTER TABLE [vnet_instance_i] drop constraint vnet_instance_i_pk
drop index vnet_instance_i.vnet_instance_i_i01
drop index vnet_instance_i.vnet_instance_i_i02
//c. 컬럼 속성 변경
ALTER TABLE [vnet_instance_i] ALTER COLUMN noderef bigint NOT NULL;
ALTER TABLE [vnet_instance_i] ALTER COLUMN tag bigint NOT NULL;

// 기본 키 추가
ALTER TABLE [vnet_instance_i] add constraint [vnet_instance_i_pk] primary key (noderef);
create index vnet_instance_i_i01 on vnet_instance_i (tag)
create index vnet_instance_i_i02 on vnet_instance_i (noderef, next_version, mask)


//3.vnet_attribute_i
// 기본 키 조회
EXEC sp_helpindex [vnet_attribute_i]

// 기본 키 삭제
ALTER TABLE [vnet_attribute_i] drop constraint vnet_attribute_i_pk
drop index vnet_attribute_i.vnet_attribute_i01
drop index vnet_attribute_i.vnet_attribute_i02
drop index vnet_attribute_i.vnet_attribute_i03
drop index vnet_attribute_i.vnet_attribute_i04
drop index vnet_attribute_i.vnet_attribute_i05
drop index vnet_attribute_i.vnet_attribute_i06

// 컬럼 속성 변경
ALTER TABLE [vnet_attribute_i] ALTER COLUMN noderef bigint NOT NULL;
ALTER TABLE [vnet_attribute_i] ALTER COLUMN parent bigint NOT NULL;

// 기본 키 추가
ALTER TABLE [vnet_attribute_i] add constraint [vnet_attribute_i_pk] primary key (parent, noderef);
create index vnet_attribute_i01 on vnet_attribute_i (noderef, indexed_value)
create index vnet_attribute_i02 on vnet_attribute_i (noderef, datetimestamp)
create index vnet_attribute_i03 on vnet_attribute_i (noderef, converted)
create index vnet_attribute_i04 on vnet_attribute_i (noderef, converted)
create index vnet_attribute_i05 on vnet_attribute_i (noderef, valid, data_type)
create index vnet_attribute_i06 on vnet_attribute_i (noderef, indexed_value)


//4.vnet_tag_i - Full text index 삭제 후 완료하고 다시 생성해야 됨
// 기본 키 조회
EXEC sp_helpindex [vnet_tag_i]

// 기본 키 삭제
ALTER TABLE [vnet_tag_i] drop constraint vnet_tag_i_pk
drop index vnet_tag_i.vnet_tag_i_i01
// 컬럼 속성 변경
ALTER TABLE [vnet_tag_i] ALTER COLUMN noderef bigint NOT NULL;
ALTER TABLE [vnet_tag_i] ALTER COLUMN parent bigint NOT NULL;
// 기본 키 추가
ALTER TABLE [vnet_tag_i] add constraint [vnet_tag_i_pk] primary key (noderef);
create index vnet_tag_i_i01 on vnet_tag_i (parent)

//5. vnet_session_i
EXEC sp_helpindex [vnet_session_i]

ALTER TABLE [vnet_session_i] drop constraint vnet_session_i_pk

ALTER TABLE [vnet_session_i] ALTER COLUMN noderef bigint NOT NULL;

ALTER TABLE [vnet_session_i] add constraint [vnet_session_i_pk] primary key (noderef);

//6. part of session
ALTER TABLE [vnet_association_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_association_type_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_attribute_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_attribute_lookup_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_catalogue_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_class_group_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_class_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_class_library_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_class_property_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_data_group_entry_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_data_group_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_import_file_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_import_file_ref_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_import_folder_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_import_package_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_instance_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_job_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_job_type_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_metadata_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_metadata_template_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_right_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_session_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_tag_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_template_ref_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_uom_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_user_i] ALTER COLUMN part_of_session bigint NOT NULL;
ALTER TABLE [vnet_workflow_i] ALTER COLUMN part_of_session bigint NOT NULL;
로그인 하시면 댓글을 남길 수 있습니다.