반응형

 

■ 구성환경

HP-UX IA64 to Sun 11.4
19.25 RAC to 19.25 RAC

■ 현상

xTTS Meta 입력 후 Full Meta Import 를 exclude=table 옵션을 지정하고 넣으면 일부 Dictionary 테이블의 데이터가 중복으로 입력이 됨.

■ 원인

Impdp 기능상 제약조건과 인덱스는 비활성화된 채로 데이터가 입력됨.
Expdp에서 Metadata only로 full을 받으면 일부 딕셔너리 테이블의 데이터가 추출되며,
Impdp 시 exclude=table 옵션을 적용하면 기존 테이블을 Skip 하지 않고 데이터가 입력됨.
PK가 존재함에도 제약 조건과 인덱스 비활성화로 중복값이 입력되며, 이후 PK 리빌드와 제약 조건 활성화에 실패함.

■ 해소방법

  • 아래 두가지 방법중 하나를 선택하면 됨.
  1. Full metadata import 시 exclude=table 옵션을 제외.
  2. 아니면 Full Metadata export 시 exclude=EARLY_OPTIONS,NORMAL_OPTIONS 주면 문제가 되는 딕셔너리 데이터를 제외함.

■ 해소방법

TSDP Objects Contain Duplicate Entries ORA-600: [kkdc1prc:BadType] (Doc ID 2427771.1)
Some Data Dictionary Objects Are Unloaded In 12c by Datapump (문서 ID KB149027)

■ 중복된 딕셔너리 데이터 정리 방법

select owner, index_name from dba_indexes where status='UNUSABLE'; 

shut immediate
startup restrict
alter pluggable database all open restricted;
alter session set container=<pdb>;
alter session set "_oracle_script"=true;
set pages 200 lines 200 long 2000000
select dbms_metadata.get_ddl('INDEX','TSDP_POLICY$PK') from dual;
select dbms_metadata.get_ddl('INDEX','TSDP_POLICY$UK') from dual;
select dbms_metadata.get_ddl('INDEX','TSDP_SUBPOL$PK') from dual;
drop index TSDP_POLICY$PK;
drop index TSDP_POLICY$UK;
drop index TSDP_SUBPOL$PK;

tsdp_subpol$
=============================
ALTER TABLE TSDP_PROTECTION$ DISABLE CONSTRAINT TSDP_PROTECTION$FKPC;
ALTER TABLE TSDP_CONDITION$ DISABLE CONSTRAINT TSDP_CONDITION$FK;
ALTER TABLE TSDP_PARAMETER$ DISABLE CONSTRAINT TSDP_PARAMETER$FK;
alter table tsdp_subpol$ DISABLE CONSTRAINT tsdp_subpol$fk;
alter table sys.tsdp_subpol$ disable constraint TSDP_SUBPOL$PK;
select rowid,SUBPOL#,POLICY#,SUBPOLNUM,PROPERTY from tsdp_subpol$;
delete from tsdp_subpol$ where rowid='AAAB+NAABAAADyaAAA'; --- delete the last rowid from the previous output.
commit;
alter table sys.tsdp_subpol$ enable constraint TSDP_SUBPOL$PK;
alter table tsdp_subpol$ enable CONSTRAINT tsdp_subpol$fk;
ALTER TABLE TSDP_PROTECTION$ enable CONSTRAINT TSDP_PROTECTION$FKPC;
ALTER TABLE TSDP_CONDITION$ enable CONSTRAINT TSDP_CONDITION$FK;
ALTER TABLE TSDP_PARAMETER$ enable CONSTRAINT TSDP_PARAMETER$FK;

tsdp_policy$
===========================
alter table tsdp_subpol$ disable constraint tsdp_subpol$fk;
alter table tsdp_association$ disable constraint tsdp_association$fkpo;
alter table tsdp_policy$ disable constraint tsdp_policy$pk;
alter table tsdp_policy$ disable constraint tsdp_policy$uk;
select rowid,rownum,POLICY#,NAME,SEC_FEATURE from tsdp_policy$;
delete from tsdp_policy$ where rowid='AAAB+KAABAAADyCAAA'; -- delete the last rowid from the previous output
commit;
alter table tsdp_policy$ enable constraint tsdp_policy$pk;
alter table tsdp_policy$ enable constraint tsdp_policy$uk;
alter table tsdp_subpol$ enable constraint tsdp_subpol$fk;
alter table tsdp_association$ enable constraint tsdp_association$fkpo;

tsdp_parameters
=========================================
alter table tsdp_parameter$ disable constraint tsdp_parameter$fk;
select rowid,SUBPOL#,PARAMETER,VALUE from tsdp_parameter$;
delete from tsdp_parameter$ where rowid='AAAB+QAABAAADyyAAA'; ----- delete the last rowid (probably 2 here as you are seeing a count of 3)
commit;
Commit complete.
alter table tsdp_parameter$ enable constraint tsdp_parameter$fk;
Recreate the indexes taken before. Please also check the stat
us of them.
select index_name, table_name, tablespace_name, status from dba_indexes where index_name in ('TSDP_POLICY$PK','TSDP_POLICY$UK','TSDP_SUBPOL$PK');
alter session set "_oracle_script"=false;
Once done, please do below -
shutdown abort ----- this is so important too.
반응형
반응형

 

 

■ OEL 7.9에서 Transparent HugePages 비활성화

1 THP 상태 조회 방법

  • redhat에서 확인 방법
cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
  • OEL에서 확인 방법
cat /sys/kernel/mm/transparent_hugepage/enabled
  • enable 여부
[always] never

2. 비활성화 방법

  • 아래 방법은 서버 환경마다 다르기 때문에 OS엔지니어의 도움이 필요. (현 TEST)
vi /etc/default/grub

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet numa=off transparent_hugepage=never" <= 'transparent_hugepage=never'추가
GRUB_DISABLE_RECOVERY="true"

regenerate grub.cfg

  • BIOS 모드 확인
[ -d /sys/firmware/efi ] && echo "UEFI 모드" || echo "BIOS(Legacy) 모드"
  • BIOS (Legacy) 모드 인 경우
grub2-mkconfig -o /boot/grub2/grub.cfg
  • UEFI 모드 + RHEL 7 / RHEL 8 일 때
grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
  • RHEL 9 (OEL 9)
grub2-mkconfig -o /boot/grub2/grub.cfg --update-bls-cmdline

적용 여부 확인

cat /sys/kernel/mm/transparent_hugepage/enabled
cat /sys/kernel/mm/transparent_hugepage/defrag

■ OEL 9에서 Transparent HugePages 비활성화

OEL9에서 두가지 방법으로 THP 를 비활성화 할 수 있다.

1. /etc/default/grub 수정으로 THP 비활성화

vi /etc/default/grub

GRUB_CMDLINE_LINUX="... rhgb quiet transparent_hugepage=never transparent_hugepage.defrag=never"
grub2-mkconfig -o /boot/grub2/grub.cfg --update-bls-cmdline

reboot
  • 변경 확인
cat /sys/kernel/mm/transparent_hugepage/enabled
cat /sys/kernel/mm/transparent_hugepage/defrag

2. grubby 명령어 사용으로 THP 비활성화

grubby --args="transparent_hugepage=never" --update-kernel=DEFAULT

reboot

cat /proc/cmdline

 

■ 참조

RHEL10 THP Disable 방법

 

반응형
반응형

LOB reorg 방법

■ LOB reorg 다섯가지 방법

  1. ALTER TABLE ... SHRINK SPACE
    alter table <table name> modify lob(<lob column name>) (shrink space [cascade]);
  • 관련문서
    Why is no space released after an ALTER TABLE ... SHRINK? (문서 ID 820043.1)
    How to determine the actual size of the LOB segments and how to free the deleted/unused space above/below the HWM (문서 ID 386341.1)
  1. DBMS_REDEFINITION
  • 관련문서
    How to Shrink a Securefile LOB Using Online Redefinition (DBMS_REDEFINITION)? (문서 ID 1394613.1)
    How to Shrink a Table Using Online Redefinition (문서 ID 1357878.1)
  1. ALTER TABLE ... MOVE
    ALTER TABLE <테이블명> MOVE TABLESPACE <테이블스페이스명>;
    ALTER TABLE TEST <테이블명> LOB(<컬럼명>) STORE AS SECUREFILE (TABLESPACE <테이블스페이스명>);
  • 관련문서
    How To Use ALTER TABLE ... MOVE To Shrink A Table (Including BASICFILE / SECUREFILE LOBs) (문서 ID 1396120.1)
  1. EXPORT / DROP THE TABLE / IMPORT

  2. Add / Drop columns

  • 관련문서
    How to release unused space (SHRINK) occupied by a LOB segment by adding / dropping columns? (문서 ID 1417697.1)

■ 참조

How To Move LOB Data To Another Tablespace (문서 ID 130814.1)
How to Shrink (make less sparse) a LOB (BASICFILE or SECUREFILE)? (문서 ID 1451124.1)
How to Determine what storage is used in a LOBSEGMENT and should it be shrunk / reorganized? (문서 ID 1453350.1)
How To Change The Default Tablespace For The Lob Index (문서 ID 2881734.1)

반응형
반응형

 

■ 구성환경

OS : Sun 11.4 (11.4.71.170.2)
DB : 19.27 RAC

■ 현상

19.21 -> 19.27 RU Patch 작업이 완료 후 $GRID_HOME/crs/install/rootcrs.sh -prepatch -nonrolling수행 후 $GRID_HOME/crs/install/rootcrs.sh -postpatch -nonrolling 정상 수행 완료 확인
이후 ASM Instance 및 CRS Resource가 기동 되지 않는 것을 확인 함.

# crsctl check crs

CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
sqlplus / as sysasm

SQL> startup 
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance 
ORA-39511: Start of CRS resource for instance '2' failed with error:[CRS-2717: Server 'rac2' is not in any of the server pool(s) hosting resource 'ora.orcl.db' CRS-0223: Resource 'ora.orcl.db' has placement error.

■ 원인 및 해소방법

  1. 리소스 관리 파라미터 확인
# GRID_HOME/bin/crsctl stat server -f
  • 정상 노드: RESOURCE_USE_ENABLED=1로 되어 있음.
  • 문제 노드 (ASM이 안 뜨는 곳): RESOURCE_USE_ENABLED=0으로 설정되어 보임.
  1. 문제 노드에서 설정 변경
# GRID_HOME/bin/crsctl set resource use 1 
CRS-4416: Server attribute 'RESOURCE_USE_ENABLED' successfully changed.
  • ASM이 기동되지 않는 노드에 접속하여 값을 1로 변경
  1. CRS 재 기동 후 값 확인 (19c 에서는 재기동 해야 함)
# GRID_HOME/bin/crsctl stop crs -f 

# GRID_HOME/bin/crsctl start crs

# crsctl stat server -f
...
RESOURCE_USE_ENABLED=1  <<<< 1로 변경된 것을 확인
...

 

■ 참조

ORA-39510/ORA-39511: CRS-2549 and CRS-0223 errors When Starting ASM After applying GI BP (KB99051)

 

반응형

+ Recent posts