PineTree/etc2015. 4. 25. 23:03
반응형

역대 로또 당첨 번호 중복 숫자 분석(1회~646회)


NO COUNT
20 107
40 106
34 102
27 100
37 97
1 97
14 96
17 94
26 92
4 92
18 92
13 92
8 91
5 91
45 89
25 89
31 89
43 88
39 87
2 85
24 85
12 84
19 84
15 84
36 84
10 84
35 84
44 83
33 83
11 83
7 83
3 82
29 80
23 80
42 79
16 79
32 79
21 78
6 78
30 77
38 77
22 77
41 75
28 71
9 67



반응형

'PineTree > etc' 카테고리의 다른 글

스타크래프트 노 시디 설치  (0) 2017.01.18
IOS 9.3 새로운 기능  (0) 2016.03.23
국내 토렌트 사이트모음  (0) 2010.06.04
한글주소 영문으로 변환사이트  (0) 2010.03.17
이동통신사별 카드 활인혜택  (0) 2009.07.30
Posted by [PineTree]
ORACLE/Migration2015. 3. 23. 14:17
반응형
1. raw device에는 LVCB(Logical Volume Control Block)가 있지만
   file system에는 없음.

 

   - bs    : 파일 입출력의 block(버퍼) 크기

   - skip  : 입력 파일에서 처리하지 않고 통과할 블록의 개수
             (Raw Device to Filesystem 복사 시 지정해야 함)
   - seek  : 출력 파일에서 처리하지 않고 통과할 블록의 개수
             (Filesystem to Raw Device 복사 시 지정해야 함)

   - count : 복사할 회수 or 블록의 개수 (생략 시 모든 데이터 복사 )

             (Raw Device to Filesystem 복사 시 반드시 명시해야 함,
              그 이외의 경우는 생략 가능)

플랫폼
LVCB
플랫폼
LVCB
Solaris
0
True64
64KB
HP-UX
0
Linux
0
AIX
4KB
Windows
0

 

 

2. dbfsize로 확인

   $ORACLE_HOME/bin/dbfsize <Oracle Datafile 명>

   [file system 결과]
   /data05/TESTDB] dbfsize UNDO01_01.dbf
   Database file: UNDO01_01.dbf
   Database file type: file system             : File Type
   Database file size: 128000 8192 byte blocks :8192 byte Block이 128000 개

 

   [raw device 결과]

   Database file type: raw device             : File Type

   Database file size: 1408 8192 byte blocks  : 8192 byte Block이 1408 개

   ※ dbsize로 조회한 결과(Dictionary View에서 select로 조회한
      block 수도 마찬가지)에는 Datafile Header Block 및 LVCB가 포함되지 않음
 
      다음과 같은 경우에는 파일이 손상된 경우이므로 다시 복사
      Header block file size is bad;            trying raw file format...
      Header block magic number is bad
 
3. 참고사항
1) Raw Device 에서 Filesystem으로 변환
   dd if=/dev/rv_data001 of=/data01/TESTDB/data001.dbf bs=4096
      skip=1 count=2818
2) Filesystem 에서 Raw Device로 변환
   dd if=/data01/TESTDB/data001.dbf of=/dev/rv_data001 bs=4096 seek=1
3) Raw Device 에서 Raw Device로 복사
   dd if=/dev/re_data001 of=/dev/rv_data001_bk bs=4096 skip=1 seek=1
4) Filesystem 에서 file system으로 복사
   cp /data01/TESTDB/data001.dbf /data01/TESTDB/data001.bak
 

[출처] 이관 - raw device to file system(dd copy)|작성자 smileDBA

[출처]    http://power.iotn.co.kr/zboard.php?id=9_1_bbs&no=1197

 


[ Oracle 9.2.0.8 ]

[ filesystem to raw device ]
$ dbfsize /oracle/system/tools01.dbf

Database file: /data/system/tools01.dbf
Database file type: file system
Database file size: 83840 8192 byte blocks

SQL> alter database datafile '/data/system/tools01.dbf' offline;
SQL> !dd if=/data/system/tools01.dbf of=/dev/rdsk/c0t0d0s1 bs=8192 count=83840
83840+0 레코드 입력
83840+0 레코드 출력
SQL> alter database rename file '/data/system/tools01.dbf' to '/dev/rdsk/c0t0d0s1';
SQL> recover datafile '/dev/rdsk/c0t0d0s1';
SQL> alter database datafile '/dev/rdsk/c0t0d0s1' online;

[ raw device to filesystem ]

$ dbfsize /dev/rdsk/c0t0d0s1

Database file: /dev/rdsk/c0t0d0s1
Database file type: raw device
Database file size: 83840 8192 byte blocks

SQL> alter database datafile '/dev/rdsk/c0t0d0s1' offline;
SQL> !dd if=/dev/rdsk/c0t0d0s1 of=/data/system/tools01.dbf bs=8192 count=83840
83840+0 레코드 입력
83840+0 레코드 출력
SQL> alter database rename file '/dev/rdsk/c0t0d0s1' to '/data/system/tools01.dbf';
SQL> recover datafile '/data/system/tools01.dbf';
ORA-00283: recovery session canceled due to errors
ORA-01110: data file 2: '/data/system/tools01.dbf'
ORA-01122: database file 2 failed verification check
ORA-01110: data file 2: '/data/system/tools01.dbf'
ORA-01200: actual file size of 83839 is smaller than correct size of 83840 blocks
SQL> !dd if=/dev/rdsk/c0t0d0s1 of=/data/system/tools01.dbf bs=8192 count=83841
83841+0 레코드 입력
83841+0 레코드 출력
14:31:23 SQL> recover datafile '/data/system/tools01.dbf';
Media recovery complete.
14:31:38 SQL> alter database datafile '/data/system/tools01.dbf' online;
Database altered.

 
  $ rawutl -s /dev/vx/rdsk/oracle/system.dbf [ 운영중인 lv size 2G, datafile size 2G ]
2148532224 [ 2G ]
$ rawutl -s /dev/vx/rdsk/oracle/r_system.dbf [ 임시 복구 lv size 3G, datafile size 2G ]
3221225472 [ 3G ]

$ dbfsize /dev/vx/rdsk/oracle/system.dbf
Database file: /dev/vx/rdsk/oracle/system.dbf
Database file type: raw device
Database file size: 262144 8192 byte blocks

$ dbfsize /dev/vx/rdsk/oracle/r_system.dbf
Database file: /dev/vx/rdsk/oracle/r_system.dbf
Database file type: raw device
Database file size: 262144 8192 byte blocks

SQL> select file#,name,bytes from v$datafile where file#=1;
 FILE# NAME BYTES
---------- ---------------------------------------- ----------
 1 /dev/vx/rdsk/oracle/system.dbf 2147483648 / 8192 = 262144 +1 = 262145

$ dd if=/dev/vx/rdsk/oracle/r_system.dbf of=system.dbf bs=8192 count=262145
$ ls -al
-rw-r--r-- 1 oracle dba 2147491840 9월 7일 13:28 system.dbf

$ dbfsize system.dbf
Database file: system.dbf
Database file type: file system
Database file size: 262144 8192 byte blocks

$ dd if=/dev/vx/rdsk/oracle/r_system.dbf of=system.dbf count=262144
$ ls -al
-rw-r--r-- 1 oracle dba 134217728 9월 7일 13:31 system.dbf [ 134217728 / 262144 = 512 block ]

 

  for AIX

select 'dd if='||f.name||' of='||lower(t.name)||
row_number() over (partition by t.name order by f.file# )||
'.dbf bs=4k count='||to_char(((BLOCKS*BLOCK_SIZE)/4096)+4906)||
' #'||t.name||' '||f.file#
 from v$datafile f,v$tablespace t where t.ts#=f.ts#;

or

select 'dd if='||fname||' of='||lower(tname)||
decode(sign(rn -9),1,'','0')||rn||
'.dbf bs=4k count='||to_char(((BLOCKS*BLOCK_SIZE)/4096)+4906)||
' #'||tname||' '||file#
from (select f.name fname,t.name tname,f.file#,blocks,block_size,
row_number() over (partition by t.name order by f.file# ) rn
from v$datafile f,v$tablespace t where t.ts#=f.ts#);

select 'dd if='||member||' of=redo'||group#||'.log bs=4k count='||to_char(((lesiz*lebsz)/4096)+4096)
 from v$logfile f, x$kccle l where f.group#=l.lenum;

select 'dd if='||name||' of=control.ctl bs=4k count='||to_char(((file_size_blks*block_size)/4096)+4096)
 from v$controlfile where rownum=1;

wait: there are no child processes.
같은 서버에서 test 나기도하고 안나기도함.
파일크기 같고 rename 성공


  -- DSVM prime
vxprint -g data -m gj_v4_001_5g|grep devsubtype
 devsubtype=dsvmprime
dd if=/dev/vx/rdsk/data/gj_v4_001_5g of=/data/oradata/TSADMI_04.dbf bs=8192k
-- DSVM
vxprint -g data -m gj_v3_013_10g|grep devsubtype
 devsubtype=dsvm
dd if=/dev/vx/rdsk/data/gj_v3_013_10g of=/data/oradata/TSADMI_05.dbf bs=4096 skip=1 count=2560002

반응형
Posted by [PineTree]
ORACLE/ADMIN2015. 3. 12. 08:36
반응형
우선 DB관리자계정이 아닌 경우에 DBMS_CRYPTO를 다른 계정(x)에서 쓸 수 있도록  권한을 부여해야한다

Grant excute on DBMS_CRYPTO to x;

사용방법
rawtohex(DBMS_CRYPTO.Hash(to_clob(passwd),2))

두번째 파라미터 
1 : md4, 2 : md5, 3 : sh1 암호화 방식을 의미

넣을때 암호화하여 넣고, 비교할 때 문자열을 암호화 하여 비교 한다.
문자열 암호화 : rawtohex(DBMS_CRYPTO.Hash(to_clob(to_char('inputpw')),2)) 

ex)
where id='id' and passwd = rawtohex(DBMS_CRYPTO.Hash(to_clob(to_char('inputpw')),2))

[출처] 오라클 10g DBMS_CRYPTO 암호화 방법|작성자 positively_

-- dbms_crypto 에 대한 실행 권한만 부여하면 권한은 끝!
grant execute on DBMS_CRYPTO to sinu;

-- package 껍데기
CREATE OR REPLACE PACKAGE pkg_crypto

IS

    FUNCTION encrypt (

        input_string        IN  VARCHAR2 ,

        key_data IN VARCHAR2 := '12345678'

    ) RETURN RAW;

    

    FUNCTION decrypt (

        input_string        IN  VARCHAR2 ,

        key_data IN VARCHAR2 := '12345678'

    ) RETURN VARCHAR2;


END pkg_crypto;

/


-- package body 를 살펴보자

CREATE OR REPLACE PACKAGE BODY pkg_crypto

IS

-- 에러 발생시에 error code 와 message 를 받기 위한 변수 지정.

    SQLERRMSG   VARCHAR2(255);

    SQLERRCDE   NUMBER;


-- 암호화 함수 선언 key_data 는 입력하지 않을 시에 default 로 12345678 로 지정됨.

    FUNCTION encrypt (input_string IN VARCHAR2 , key_data IN VARCHAR2 := '12345678') 

     RETURN RAW

    IS

    

        key_data_raw        RAW(64);

        converted_raw       RAW(64);

        encrypted_raw       RAW(64);


    BEGIN


-- 들어온 data 와 암호키를 각각 RAW 로 변환한다.

        converted_raw := UTL_I18N.STRING_TO_RAW(input_string, 'AL32UTF8');

        key_data_raw     := UTL_I18N.STRING_TO_RAW(key_data, 'AL32UTF8');


-- DBMS_CRYPTO.ENCRYPT 로 암호화 하여 encrypted_raw 에 저장.

        encrypted_raw := 

             DBMS_CRYPTO.ENCRYPT(

                 src => converted_raw ,

-- typ 부분만 변경하면 원하는 알고리즘을 사용할 수 있다. 

--단, key value bype 가 다 다르니 확인해야 한다.

                 typ => DBMS_CRYPTO.DES_CBC_PKCS5 ,

                 key => key_data_raw ,

                 iv =>  NULL);

        

        RETURN encrypted_raw;

    END encrypt;


    FUNCTION decrypt (input_string IN VARCHAR2 , key_data IN VARCHAR2 := '12345678') 

     RETURN VARCHAR2

    IS

        converted_string    VARCHAR2(64);

        key_data_raw        RAW(64);

        decrypted_raw    VARCHAR2(64);


    BEGIN


        key_data_raw     := UTL_I18N.STRING_TO_RAW(key_data, 'AL32UTF8');

        

        decrypted_raw := 

            DBMS_CRYPTO.DECRYPT(

                 src => input_string ,

                 typ => DBMS_CRYPTO.DES_CBC_PKCS5 ,

                 key => key_data_raw ,

                 iv =>  NULL);


-- DBMS_CRYPTO.DECRYPT 수행 결과 나온 복호화된 raw data 를 varchar2 로 변환하면 끝!

        converted_string := UTL_I18N.RAW_TO_CHAR(decrypted_raw, 'AL32UTF8');


        RETURN converted_string;

    END decrypt ;

END pkg_crypto;

/



create table card_info ( id number, card_number varchar2(64) ) ;


-- 8자리 16자리 data 를 넣어보자.

insert into card_info values ( 1 , pkg_crypto.encrypt('1234567812345678')) ;

insert into card_info values ( 2 , pkg_crypto.encrypt('12345678')) ;

commit;


-- 암호화 되어 return 되는 bytes 가 다르다!

select * from card_info ;

        ID CARD_NUMBER                                     

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

         1 96D0028878D58C89D73FBE0238428B0A3D440C49910337FB

         2 96D0028878D58C898E250D5F4C76644B                


-- 복호화 해보니 정상적으로 잘 보인다.

select id , pkg_crypto.decrypt(card_number) card_number

from card_info;


        ID CARD_NUMBER                                     

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

         1 1234567812345678                                

         2 12345678                                        


-- key value 를 00000000 으로 바꾸어 보자

insert into card_info values ( 3 , pkg_crypto.encrypt('1234567812345678','00000000')) ;


-- 데이터는 id=1 과 같은데 key 가 다르므로 암호화된 값이 다름을 알 수 있다.

select * from card_info where id = 3;

        ID CARD_NUMBER                                     

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

         3 858B176DA8B125034356364E8179CD61040EE2CAC3041331


-- 복호화 할 때는 반드시 암호화 시 사용했던 key value 가 필요하다.

select id , pkg_crypto.decrypt(card_number,'00000000') card_number from card_info where id = 3  ;


        ID CARD_NUMBER                                     

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

         3 1234567812345678                                



포인트는 

DBMS_CRYPTO.ENCRYPT

DBMS_CRYPTO.DECRYPT

요 2가지 이고 나머지는 그냥 varchar2 와 raw 의 converting 작업이다.


나머지 세세한 사항은 메뉴얼을 참고하자!


http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_crypto.htm#i1003081

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_crypto.htm#i1004271

출처: http://m.blog.naver.com/eureka6846/110076105943
반응형
Posted by [PineTree]
OS/UNIX 공통2015. 2. 8. 09:40
반응형
ls 파일크기로 정렬 해서 보기



ls -lrt | awk '{print $5 " " $6 " " $7 " " $8 " " $9}' | sort -rn | more
반응형

'OS > UNIX 공통' 카테고리의 다른 글

세마포어에 대하여  (0) 2012.05.11
linux/unix date로 어제(yesterday) 날짜 출력  (0) 2010.05.05
Linux find 명령어 완전 정복 가이드  (0) 2009.10.07
Posted by [PineTree]
ORACLE/TroubleShooting2014. 12. 16. 13:44
반응형

출처 : http://andwiz.tistory.com/m/post/72

10gR2부터 Shared Cursor Operation에 대해 기본적으로 Mutex를 사용하게 되었다. 여기서 Shared Cursor Operation이란 library cache latches, library cache pin latches,
library cache pins.을 의미한다.

이를 위해 오라클은 _kks_use_mutex_pin라는 파라메터를 제공하고 있는데 이는 기본적으로  True이며 만약 False인 경우는 이전과 같이 Latch와 Pin/Lock의 구조를 사용하게 된다.

 그런데 mutex라는 것이 무엇일까..?

mutex는 mutual exclusion object의 약자로 다수의 스레드 혹은 프로세스가 동일한 리소스를 공유할 수 있게 해주는 것인데 만약 프로그램이 하나 시작된다고 할 때 이는 시6스템으로 부터 이 요청에 대해 주어진 리소스를 위한 mutex를 하나 생성하게 되고 시스템은 이를 위해 고유의 id혹은 이름을 부여한다. 이후 어떤 쓰레드가 이 리소스를 필요로 하게 되면 반드시 이 리소스를 사용하는 동안 다른 스레드가 이 리소스에 접근하지 못하도록 mutex를 사용해야만 하는 것이다. 만약 mutex가 이미 다른 쓰레드에 의해 lock이 걸려 있다면 이 쓰레드는 시스템의 대기 queue로 가서 대기하고 mutex가 lock이 풀릴때 주어진 작업(계속 대기 혹은 수행)을 하게 되는 것이다.

마치 이것은 No wait mode의 latch와 유사하다.  그런데 Oracle은 10g에 와서 지금껏 개량을 거듭해 온 latch 구조 대신 mutex를 사용한다고 할까..? 이것에 대해 고민을 참 많이 했었는데 아마도 mutex와 비슷한 구조로 구현이 된 latch대신 mutex를 사용하게 되면 이 제어권을 oracle에서 os로 넘길 수 있게 된다는 점이 있을 수 있다는 점이다. 

특히 mutex를 사용하게 되면 deadlock에 대한 제어를 OS에 넘길 수 있게 된다는 점도 생각할 수 있다. Mutex라는 것은 범 System적인 것이기 때문에 이를 획득하고 놓고 하는 것은 전적으로 System이 관리하게 된다. 또한 Mutex를 소유하고 있는 스레드가 다른 mutex를 잡으려고 하면 system이 이를 놓도록 되어 있다고 한다. Latch의 경우는 각 latch마다 level을 부여하여 deadlock을 방지하고 있다. 버전이 올라가 latch도 증가하면서 점점 더 복잡해 질 수 있는 부분이다.

게다가 SQL을 수행할 때 가장 민감한 영역이면서 빠른 operation이 수행되어야 하는 Cursor부분에 대해 부담을 가지고 있었을지도 모르는 일이다. 별것 아닌것 같지만 Oracle을 코딩하는 입장에서는 큰 굴레를 벗어던진 것 같은 느낌이 아니었을까 하는 생각도 든다.

 그러나 이유야 어찌되었건 Mutex를 사용하게 되면 일단 Spin이라는 작업을 수행하지 않게 되어 가벼울 수는 있지만 이 자체로도 몇가지 문제가 있을 수 있다. mutex는 system자원이기 때문에 문제가 발생하면 일단 Oracle의 해결 범위를 넘어설 수 있다는 것과 무엇보다 중요한 것은 mutex는 복구가 안된다는 점이다. latch의 경우 프로세스가 latch를 잡고 갑자기 죽어버리면 PMON이 이를 cleanup을 수행하도록 되어 있다. 이는 latch에 대한 정보가 latch recovery area에 있기 때문인데 mutex의 경우는 어떻게 동작할지 심히 궁금하다. 아마도 mutex를 놓도록 할 것 같은데 그렇게 되면 sql을 수행하는 입장에서는 어찌될지 궁금할 따름이다.

 그밖에 메타링크나 현장에 나가보면 _kks_use_mutex_pin를 true로 사용하여 발생하는 문제가 발견되는데 이것을 간략히 정리해보려 한다.

 1) bug 5485914 - "cursor: pin S wait on X", MUTEX REPORTED SELF DEADLOCK AFTER DBMS_MONITOR.SESSION_TRACE_ENABLE
10046 trace를 수행할때 cursor: pin S wait on X라는 이벤트만 과도하게 수행되고 세션이 거의 hang되는 현상으로 10.2.0.3버전에서 직접 목격한 버그임 이는 _kks_use_mutex_pin을 false로 하고 사용하면 해결이 되고 보다 근본적인 패치는 11g에 된다고 함

 2) CAS를 지원하지 않는 시스템에서 과도한 CPU 사용이 발견된다고 함
: Mutex는 compare and swap(CAS)이라는 것을 사용하는데 PA-RISC를 사욯하는 HP-UX 인 경우  CAS를 지원하지 않는다고 한다. 이 경우 oracle은 Mutex라는 이름을 가진 latch pool을 만들어서 mutex를 시뮬레이션 하는 식으로 구현을 했다고 한다. 이때 과도한 Spin을 발생시켜 발생하는 버그라고 한다. 이것도 mutex안쓰면 된다. 참고로 Mutex latch는 CAS를 지원하지 않는 시스템에만 존재한다고 한다.

3) 10.2.0.2에서 Cursor:pin S 이벤트가 과도하게 발생
이 이벤트는 같은 cursor에 대해 여러 세션이 동시에 shared mutex pin를 경합할 때 발생하는데 오라클은 이게 굉장히 드문 케이스라고 한다. 그 이유는 mutex의 갱신이 매우 빠르기 때문이란다. 근데 많이 봤다.. 암튼 이것도 mutex에 해당하는 문제인데 mutex의 경합이 심해지면 기존의 latch보다도 더 해결이 더딘것 같은 느낌이다. 이것도 _kks_use_mutex_pin을 false로 해결하라고 한다.

마지막으로 모니터링 중에 잡힌 관련 이벤트의 그림을 첨부한다.

아마도 oracle은 여지껏 그랬듯 버전이 올라가면서 더 나은 솔루션을 제공할 것이라 생각한다.


반응형
Posted by [PineTree]
ORACLE/ADMIN2014. 12. 4. 10:27
반응형
DB를 사용하다 보면 batch작업이나 long query를 사용하는 경우가 있는데, 이럴때 장시간 반응이 없어서 pc의 전원을 강제로 꺼버리거나 작업도중 정전이 발생할 수도 있는데, 이럴 경우 세션은 비정상적으로 종료가 되어 세션이 정리가 되지 않고 남아 있게된다.

 

만약 이러한 세션이 다수가 되면 정상적인 다른 세션들에게 자원배분(메모리등)이 정상적으로 되지 않거나 프로세스 초과 에러 메세지가 발생할 수 있다. 이렇게 실제 사용하지 않은 세션들을

DEAD SESSION(죽은 세션)이라고 하는데 이들을 정리할 필요가 있다.

 

KeepAlive 란 Idle TCP/IP Connection 의 Time out 기능을 말한다.

TCP/IP 기반으로 remote 로 연결된 상태에서 클라이언트의 갑작스런 리부팅이나 스위치 Off 의 경우 해당 연결을 서버에서 Closing 하지 못하게 된다.


이것은 TCP/IP의 제한인 것이지 오라클의 문제는 아니다.
이 때 KeepAlive가 정확하게 configure되어 있다면 좀 더 빨리 Dead connection을 발견하고 빨리 Closing할 것이다.
TCP/IP 에 관련된 것이므로 KeepAlive를 각 플랫폼 별로 지정하는 방법이 모두 틀리다.

예를들면 유저가 PC 에서 Unix Oracle Server로 연결 후 실수로 다음 쿼리 문을 실행했다.

 

SQL> select * from largetable, greatetable, verybigtable;

 

적게는 수십분, 많게는 몇시간이 걸릴 작업이라면 유저는 쿼리를 인터럽트하기 보다 reset 버튼을 누르게 될 것이다. 이때 클라이언트 프로세스는 없어졌지만 백그라운드 서버 프로세스는 계속

running 중일것이다.
이런 현상은 수시로 일어날 수 있다. 또한 당연한 것이다.

유저가 사용을 잘못하는 것이기 때문이다.

하지만 SQL*NET 2.1 이상에서 Dead-Connection-Detection 이라 불리는 기능을 지원한다.

이것은 곧 KeepAlive 를 지정할 수 있는 기능이다.
반드시 서버 사이드의 $ORACLE_HOME/network/admin/sqlnet.ora 파일에 다음의 파라미터

지정해야 한다. 클라이언트에는 지정해봐야 전혀 소용이 없다.

 

sqlnet.expire_time = 3   (단위 : 분)

 

Netware를 제외한 모든 Platform, Protocol에서 지원이 된다.

# Windows NT 에서 KeepAlive 를 지정하는 방법(타 플랫폼은 제외)

Regedt32 를 실행한다.

레지스트리에서

HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters

까지 이동한다.
여기서 키 추가가 아닌 값 추가를 한다.

파라미터는  KeepAliveTime (REG_DWORD) 로 입력한다.

값은 Decimal  -> 180000 (for example = 3 minutes) 으로 지정한다.

반응형
Posted by [PineTree]
ORACLE/ADMIN2014. 11. 12. 14:16
반응형
Windows 
C:\> cd \oracle\ora92\network\log 
C:\oracle\ora92\network\log> lsnrctl set log_status off 
C:\oracle\ora92\network\log>
리스너로그파일 덮어쓰기로삭제
rename listener.log listener.old 
C:\oracle\ora92\network\log> lsnrctl set log_status on 



UNIX 
% cd /u01/app/oraclein/product/9.2.0/network/log 
% lsnrctl set log_status off 
% mv listener.log listener.old 
% cp /dev/null listener.log
% lsnrctl set log_status on



반응형
Posted by [PineTree]
ORACLE/11G2014. 8. 27. 20:23
반응형



In this Document

Purpose
Details
References

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.1.0 to 11.2.0.3 [Release 11.2]
Information in this document applies to any platform.
***Checked for relevance on 19-Jun-2012***

Purpose

To show the option differences between the different editions of Oracle 11.2 server

SOURCE:

Oracle® Database Licensing Information 11g Release 2 (11.2) Part Number E10594-04

      Chapter 1 Oracle Database Editions

Details

Feature/OptionSE1SEEENotes

High Availability

       

Oracle Fail Safe

Y

Y

Y

Windows only

Oracle RAC One Node

N

N

Y

Extra cost option

Oracle Data Guard—Redo Apply

N

N

Y

 

Oracle Data Guard—SQL Apply

N

N

Y

 

Oracle Data Guard—Snapshot Standby

N

N

Y

 

Oracle Active Data Guard

N

N

Y

Extra cost option

Rolling Upgrades—Patch Set, Database, and Operating System

N

N

Y

 

Online index rebuild

N

N

Y

 

Online index-organized table organization

N

N

Y

ALTERTABLE...MOVEONLINEoperations

Online table redefinition

N

N

Y

Using theDBMS_REDEFINITIONpackage

Duplexed backup sets

N

N

Y

 

Block change tracking for fast incremental backup

N

N

Y

 

Unused block compression in backups

N

N

Y

 

Block-level media recovery

N

N

Y

 

Lost Write Protection

N

N

Y

 

Automatic Block Repair

N

N

Y

Requires Active Data Guard option

Parallel backup and recovery

N

N

Y

 

Tablespace point-in-time recovery

N

N

Y

 

Trial recovery

N

N

Y

 

Fast-start fault recovery

N

N

Y

 

Flashback Table

N

N

Y

 

Flashback Database

N

N

Y

 

Flashback Transaction

N

N

Y

 

Flashback Transaction Query

N

N

Y

 

Oracle Total Recall

N

N

Y

Extra cost option

Scalability

       

Oracle Real Application Clusters

N

Y

Y

Extra cost with EE, included with SE

Automatic Workload Management

N

Y

Y

Requires Oracle Real Application Clusters

Performance

       

Client Side Query Cache

N

N

Y

 

Query Results Cache

N

N

Y

 

PL/SQL Function Result Cache

N

N

Y

 

In-Memory Database Cache

N

N

Y

Extra cost option

Database Smart Flash Cache

N

N

Y

Solaris and Oracle Enterprise Linux only

Support for Oracle Exadata Storage Server Software

N

N

Y

 

Security

       

Advanced Security Option

N

N

Y

Extra cost option

Oracle Label Security

N

N

Y

Extra cost option

Virtual Private Database

N

N

Y

 

Fine-grained auditing

N

N

Y

 

Oracle Database Vault

N

N

Y

Extra cost option

Secure External Password Store

N

N

Y

 

Development Platform

       

SQLJ

Y

Y

Y

Requires Oracle Programmer

Oracle Developer Tools for Visual Studio .NET

Y

Y

Y

Windows only

Microsoft Distributed Transaction Coordinator support

Y

Y

Y

Windows only

Active Directory integration

Y

Y

Y

Windows only

Native .NET Data Provider—ODP.NET

Y

Y

Y

Windows only

.NET Stored Procedures

Y

Y

Y

Windows only

Manageability

       

Oracle Change Management Pack

N

N

Y

Extra cost option

Oracle Configuration Management Pack

N

N

Y

Extra cost option

Oracle Diagnostic Pack

N

N

Y

Extra cost option

Oracle Tuning Pack

N

N

Y

Extra cost option, also requires the Diagnostic Pack

Oracle Provisioning and Patch Automation Pack

N

N

Y

Extra cost option

Oracle Real Application Testing

N

N

Y

Extra cost option

Database Resource Manager

N

N

Y

 

Instance Caging

N

N

Y

 

SQL Plan Management

N

N

Y

 

VLDB, Data Warehousing, Business Intelligence

       

Oracle Partitioning

N

N

Y

Extra cost option

Oracle OLAP

N

N

Y

Extra cost option

Oracle Data Mining

N

N

Y

Extra cost option

Oracle Data Profiling and Quality

N

N

Y

Extra cost option

Oracle Data Watch and Repair Connector

N

N

Y

Extra cost option

Oracle Advanced Compression

N

N

Y

Extra cost option

Basic Table Compression

N

N

Y

 

Bitmapped index, bitmapped join index, and bitmap plan conversions

N

N

Y

 

Parallel query/DML

N

N

Y

 

Parallel statistics gathering

N

N

Y

 

Parallel index build/scans

N

N

Y

 

Parallel Data Pump Export/Import

N

N

Y

 

In-memory Parallel Execution

N

N

Y

 

Parallel Statement Queuing

N

N

Y

 

Transportable tablespaces, including cross-platform

N

N

Y

Import of transportable tablespaces supported into SE, SE1, and EE

Summary management—Materialized View Query Rewrite

N

N

Y

 

Asynchronous Change Data Capture

N

N

Y

 

Integration

       

Basic Replication

Y

Y

Y

SE1/SE: read-only, updateable materialized view

Advanced Replication

N

N

Y

Multi-master replication

Oracle Streams

Y

Y

Y

SE1/SE: no capture from redo

Database Gateways

Y

Y

Y

Separate product license

Messaging Gateway

N

N

Y

 

Networking

       

Oracle Connection Manager

N

N

Y

Available via a custom install of the Oracle Database client, usually installed on a separate machine

See "Oracle Connection Manager" for more information

Infiniband Support

N

N

Y

 

Content Management

       

Oracle Spatial

N

N

Y

Extra cost option

Semantic Technologies (RDF/OWL)

N

N

Y

Requires Oracle Spatial and the Oracle Partitioning option

References

NOTE:465465.1 - Differences Between Enterprise, Standard and Personal Editions on Oracle 10.2
NOTE:269040.1 - Differences Between Enterprise, Standard and Personal Editions on Oracle 9.2
NOTE:465460.1 - Differences Between Enterprise, Standard and Personal Editions on Oracle 11.1

반응형
Posted by [PineTree]
ORACLE/TroubleShooting2014. 8. 22. 18:44
반응형

In this Document


Symptoms

Changes

Cause

Solution

References


This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.2 and later
HP-UX Itanium

***Checked for relevance on 26-Jul-2012***

Symptoms

On HP Itanium, when trying to create a new 11.2.0.2 database or upgrade an existing database to 11.2.0.2 and the database has controlfiles, datafiles, and/or redo log files located on raw devices, we get errors like:

ALTER DATABASE MOUNT
Errors in file
/u02/oracle/app/oracle/diag/rdbms/demo/demo/trace/demo_ckpt_20205.trc:
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/dev/vg11/rcontrol_01.dbf'
...
Errors in file
/u02/oracle/app/oracle/diag/rdbms/demo/demo/trace/demo_m001_20219.trc
(incident=192165):
ORA-00600: internal error code, arguments: [kcidr_io_check_common_2], [1],
[/dev/vg11/rcontrol_01.dbf], [0], [1], [0], [], [], [], [], [], []
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/dev/vg11/rcontrol_01.dbf'
...


Doing a tusc of the startup, eg. with:

$ tusc -fao /tmp/tusc.out sqlplus "/ as sysdba"
SQL> startup mount


we can see permissions errors raised when opening the block device:

open("/dev/vg11/control_01.dbf", O_RDONLY|O_NDELAY|0x800, 060750)
--> ERR#13 EACCES


Note the difference in the file names - rcontrol_01.dbf is the character device whereas control_01.dbf (without the leading "r") is the corresponding block device.

Changes

No changes to the environment, but the 11.2.0.2 database software was just upgraded or installed

Cause

This is the same issue as described in non-published bug:10107681, which was closed as a OS/vendor problem.

From 11.2.0.2 the fix for bug:9956769 is present to add protection to the volumes - from this bug, we have the following:

If you do not want to mount disks used by Oracle ASM on a separate mount
point, then on servers where the system administrator has explicitly granted
to the Oracle Grid Infrastructure installation owner read/write access to any
/dev/rdisk/* files for use by Oracle ASM, you must enable read permissions on
the corresponding block device. You do not need to change the ownership of
the block device.

Solution

Possible solutions are:

1) Relocate database files to filesystem
The problem is only hit when using raw devices (note that the issue is also present when using ASM as it affects eg. disk discovery)

 - or -

2) Explicitly give read permissions on the block devices
This should be done for all database files (controlfiles, datafiles, redo logs) located on raw devices, eg.:

# chmod a+r /dev/vg11/control_01.dbf


- or -

3) Apply HPUX patch PHCO_41479

References


BUG:10252972 - ORA-600 OPENING CONTROLFILE DURING UPGRADE FROM 11.2.0.1.0 TO 11.2.0.2.0 ON RAW
BUG:10331267 - UNABLE TO USE RAW DEVICES WITH 11.2.0.2

반응형

'ORACLE > TroubleShooting' 카테고리의 다른 글

Ksugetosstat Failed: Op = Slsgetkstat, Location = Slsupdatesta  (0) 2015.05.01
mutex 관련 여러가지  (0) 2014.12.16
shared pool  (0) 2014.03.23
SHARED POOL에 대한 점검 사항들  (0) 2014.03.23
Oracle Dump Trace뜨기  (0) 2013.06.23
Posted by [PineTree]
ORACLE/RAC2014. 8. 15. 13:29
반응형

출처 : http://fdsblog.tistory.com/entry/Convert-Oracle-RAC-to-single-instance

Oracle 관련 자료를 보면 Single Instacne를 RAC로 전환하는 자료는 Oracle 관련 사이트에 잘 정리된 자료가 많지만, RAC 환경에서 Single instance로의 전환 자료는 찾아 보기가 힘드네요.
아래에 정리가 잘 되어 있네요.


My last post about Turn on/off RAC basically is to implement Converting/Migrating Oracle RAC to Single instance.  I try to find a way to do this in Google but it seem no result regarding this. You can find thousand of article on converting Single Instance to Oracle RAC but not the other way around. Why?

You'll find a Doc. on Metalink with step by step instructions on "How to convert a
single instance Database to RAC", but not the other way round.
The analyst's response from Oracle is "We cannot convert a RAC database into a Single
instance database, that is the reason why you didnt find any steps.
It is not supported.


Why Oracle mentioned it is not supported? It does not makes any sense that you cannot convert from RAC to non-RAC environment, unless Oracle does not want their customers to go away from RAC.
Anyway…it’s all about $$$$$.
So, based on my knowledge on how Oracle RAC work, I’ve successfully done it.


This is based on Oracle 10G Release 2 and assumes:

1. Oracle RAC running with cluster file system
2. You have basic knowledge about Oracle RAC



Test Server
:

OS : Red Hat Enterprise Linux Server release 5.4
Database Version : 10.2.0.4
File system: OCFS2



1. Stop database and CRS on both node

$ srvctl stop database -d mydb
# crsctl stop crs


2. Turn Off RAC

SQL> startup
ORA-29702 error occurred in Cluster Group Service operation



Relink with the RAC OFF.

$ cd $ORACLE_HOME/rdbms/lib
$ /usr/ccs/bin/make -f ins_rdbms.mk rac_off
Relinking oracle
$ make -f ins_rdbms.mk ioracle
## OR , both working fine
$ cd $ORACLE_HOME/bin
$ relink oracle



If ASM Instance Exist, run below command as root
# /oracle/product/10.2.0/db/bin/localconfig delete
# /oracle/product/10.2.0/db/bin/localconfig add


3.     Parameter(Pfile/spfile) & database changes

SQL> startup
SQL> alter database disable thread 2;
SQL> alter system set remote_listener='';



3a. Remove unwanted logfile

SQL> select thread#, group# from v$log;
SQL> alter database drop logfile group 3;
SQL> alter database drop logfile group 4;



3b. Remove unwanted tablespace

SQL> drop tablespace UNDOTBS2 including contents and datafiles;



3c.    Rename instance name.

SQL> alter system set instance_name=<new_name> scope=spfile;
SQL> shutdown immediate
SQL> startup
- Change your ORACLE_SID environment



4. Run $ORA_CRS_HOME/install/rootdelete.sh on both node
- This will stop and remove all CRS startup related file


5. Remove $ORA_CRS_HOME binary using Clusterware OUI installer
- Ignore any error if 2nd node already down
- rm -rf $ORA_CRS_HOME


6. Modify listener file
$ vi $ORACLE_HOME/network/admin/listener.ora


6a. Modify tnsname file
$ vi $ORACLE_HOME/network/admin/tnsnames.ora

 

반응형
Posted by [PineTree]