환경: 10.2.0.3 RAC on AIX

 

변경내용: 트레이스 파일이 문제 DML 혹은 버그로 인한 에러 발생시마다 약 4GB Trace(trc)파일을 생성(OS ASCII 파일의 제한값으로 추측됨)하여 MAX_DUMP_FILE_SIZE 값을 기존 unlimited에서 100 MB를 목적으로 100m 설정하였으나 ora-02065 발생하여 102400000 으로 변경

$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Mon May 12 15:54:15 2014

 

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning option

 

SQL> alter system set max_dump_file_size=100m scope=both;

alter system set max_dump_file_size=100m scope=both

                                       *

ERROR at line 1:

ORA-02065: illegal option for ALTER SYSTEM

 

SQL> alter system set max_dump_file_size=102400000 scope=both;

 

System altered.

 

문제: 여전히 에러 발생시 4GB정도의 Trace 파일 생성

 

원인오라클 공식 매뉴얼의 애매한 정보로 인한 잘못된 값 설정, 버그로 인한 k, m 설정 불가.

문서상의 내용은 아래와 같음

Parameter type String

Syntax MAX_DUMP_FILE_SIZE = { integer [K | M] | UNLIMITED }

Default value UNLIMITED

Modifiable ALTER SESSION, ALTER SYSTEM

Range of values 0 to unlimited, or UNLIMITED

Basic No

MAX_DUMP_FILE_SIZE specifies the maximum size of trace files (excluding the alert file). Change this limit if you are concerned that trace files may use too much space.

A numerical value for MAX_DUMP_FILE_SIZE specifies the maximum size in operating system blocks.

A number followed by a K or M suffix specifies the file size in kilobytes or megabytes.

The special value string UNLIMITED means that there is no upper limit on trace file size. Thus, dump files can be as large as the operating system permits.

k m으로 설정할 경우 파일크기로 설정할 수 있다고 하나 이는 2014 5월 최신 버전인 11.2.0.4 버전조차 적용되지 않고 ora-02065를 발생. k m을 사용하지 않을 경우 이는 OS block의 개수를 의미

 

해결: 작은따옴표 (‘ ‘)를 사용하여 명령어 수행

SQL> alter system set max_dump_file_size=’100m’ scope=both;

 

System altered.

 

결과확인: 100MB는 테스트하기 너무 크기에 4KB로 제한해서 테스트

SQL> alter session set tracefile_identifier=’test’;

 

Session altered.

SQL> alter system set max_dump_file_size='4k' scope=both;

 

System altered.

 

SQL> alter session set sql_trace=true;

 

Session altered.

 

SQL> select * from v$backup;   --아무 문장이나 조회 가능한 문장을 반복 수행하여 trc 파일의 크기를 늘림

$ pwd

/oracle/app/oracle/diag/rdbms/orcl/orcl/trace

$ ls -l | grep test

-rw-r-----    1 oracle   oinstall       4135 May 12 17:03 orcl_ora_7471202_test.trc

-rw-r-----    1 oracle   oinstall        137 May 12 17:03 orcl_ora_7471202_test.trm

$ tail orcl_ora_7471202_test.trc

FETCH #4573087688:c=292,e=12519,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,plh=4031894181,tim=451245055341

FETCH #4573087688:c=238,e=2816,p=0,cr=0,cu=0,mis=0,r=4,dep=0,og=1,plh=4031894181,tim=451245058417

STAT #4573087688 id=1 cnt=5 pid=0 pos=1 obj=0 op='FIXED TABLE FULL X$KCVFHONL (cr=0 pr=0 pw=0 time=12501 us cost=0 size=74 card=1)'

 

*** 2014-05-12 17:03:45.961

CLOSE #4573087688:c=14,e=15,dep=0,type=0,tim=451247403409

=====================

PARSING IN CURSOR #4573087688 len=22 dep=0 uid=0 oct=3 lid=0 tim=451247403554 hv=1902309294 ad='70001000bd1a178' sqlid='0579bzjsq5vxf'

*** DUMP FILE SIZE IS LIMITED TO 4000 BYTES ***

 

기타: 모든 버전, 모든 OS에 적용 가능.

11gR2 매뉴얼에서도 오라클은 해당 항목의 오류를 고치지 않고 있으며 MOS에서는 unpublished bug로 기록됨

참고문서: Oracle Database Reference 10gR2, 11gR2

ORA-2065 Or ORA-2248 When Setting Max_dump_file_size To K / M Or G (문서 ID 1387694.1)

Posted by neo-orcl
,

Disk 관련 문제로 Media Recover 과정중 발생
핫백업이 있어서 해당 파일로 복구를 전부 완료 했으나 rollback segment 관련 에러가 나타남

OS: SunOS 5.7
Oracle db version: 8.1.7.4

1. 복구 후 DB startup 시 에러 나타남

SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-00264: no recovery required
SQL> startup
ORACLE instance started.

Total System Global Area  919359164 bytes
Fixed Size                   102076 bytes
Variable Size             487653376 bytes
Database Buffers          429490176 bytes
Redo Buffers                2113536 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced

얼럿로그 내용: ORA-01545: rollback segment 'RBS1' specified not available

2. init파일에서 rollback_segments 주석처리 후 open

SQL> startup
ORACLE instance started.

Total System Global Area  919359164 bytes
Fixed Size                   102076 bytes
Variable Size             487653376 bytes
Database Buffers          429490176 bytes
Redo Buffers                2113536 bytes
Database mounted.
ORA-00604: error occurred at recursive SQL level 1
ORA-00376: file 3 cannot be read at this time
ORA-01110: data file 3: '/oradata/rbs01.dbf'

3. v$recover_file 확인해서 파일별 복구 수행후 online

SQL> select * from v$recover_file;
SQL> recover datafile 8;
ORA-00279: change 377347436 generated at 03/06/2013 22:10:36 needed for thread 1
ORA-00289: suggestion : /oradata/archive/arch_1_37864.arc
ORA-00280: change 377347436 for thread 1 is in sequence #37864
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

SQL> alter database datafile 8 online;
Database altered.

4. rbs파일인 (여기선 3번) 3번파일 offline + recover + online 수행

SQL> alter database datafile 3 offline;
Database altered.

SQL> recover datafile 3;      
Media recovery complete.

SQL> alter database datafile 3 online;
Database altered.

5. db shutdown 후 init파일 rollback_segments 주석처리 제거하여 startup 후 정상 확인

Posted by neo-orcl
,

환경: RAC 11.2.0.4 e/e 64bit on AIX, Oracle Grid Infrastructure without HACMP

 

변경내용: OS 엔지니어가 OS Timezone KORST9KORDT 에서 KORST9 로 변경 후 하루가 지난 뒤 개발자가 OS 시간이 현실의 시간보다 1시간 느려짐을 확인하여 OS엔지니어가 date 설정으로 1시간 빠르게 진행함

         당시 DB CRS는 전부 중지 후 OS 작업을 진행했었음

 

문제: sqlplus / as sysdba로 접속하면 sysdate OS의 시간과 같지만 sqlplus system/xxx@tns 형식과 같이 리스너를 통해 접속하여 sysdate를 조회하면 1시간 빠르게 나타남. 당연히 toad orange 등을 통해서도 같은 현상 발생

$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 8 20:51:50 2014

 

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning and Real Application Clusters options

 

SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';

 

Session altered.

 

SQL> select sysdate from dual;

 

SYSDATE

-------------------

2014-05-08 20:51:57

 

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning and Real Application Clusters options

$ sqlplus system/xxxx@real1/realdb

 

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 8 20:52:15 2014

 

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning and Real Application Clusters options

 

SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';

 

Session altered.

 

SQL> select sysdate from dual;

 

SYSDATE

-------------------

2014-05-08 21:52:20

 

원인: CRS를 통해 Listener TZ 값을 CRS의 설정을 가져와 시작되는데 OS Timezone 값은 변경되었으나 CRS Timezone은 변경되지 않아 발생

해결:

1.    모든 노드의 root로 접속하여 $GRID_HOME/crs/install/s_crsconfig_<nodename>_env.txt 파일의 TZ 값을 OS TZ 값과 같이 변경

※각 OS TZ 값 확인은 검색하면 바로 나오기에 생략

#TZ=KORST9KORDT

TZ=KORST9

 

2.    모든 노드의 DB 중지(srvctl stop instance ...)

3.    모든 노드의 CRS 중지(crsctl stop crs)

4.    모든 노드의 CRS 시작(crsctl start crs)

5.    모든 노드의 DB 시작(srvctl start instance ...)

 

결과확인:

$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 8 21:08:47 2014

 

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning and Real Application Clusters options

 

SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';

 

Session altered.

 

SQL> select sysdate from dual;

 

SYSDATE

-------------------

2014-05-08 21:08:47

 

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning and Real Application Clusters options

$ sqlplus system/xxxx@real1/realdb

 

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 8 21:08:55 2014

 

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning and Real Application Clusters options

 

SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';

 

Session altered.

 

SQL> select sysdate from dual;

 

SYSDATE

-------------------

2014-05-08 21:08:55

 

기타: 위 방법으로 보통 해결되나 안될 경우는 아래 방법이 필요할 수도 있다. 또한 11gR2미만에서는 위처럼 crs 설정 파일이 없을 수 있기에 아래 방법이 필요할 수도 있다.

 

srvctl setenv database -d <dbname> -t TZ=<the TZ you want>
srvctl setenv nodeapps -n <nodename> -t TZ=<the TZ you want>
--
만약 11gR2 이상이라면 nodeapps 대신 listener를 사용한다.
srvctl setenv listener -l <listenername> -t TZ=<the TZ you want>

 

참고문서: Oracle Support Document 1390015.1 (Incorrect SYSDATE shown when connected via Listener in RAC)

Dates & Calendars - Frequently Asked Questions (문서 ID 227334.1)

 

 

Posted by neo-orcl
,