Oracle 10g R2 RAC - 윈디하나의 솔라나라

목차

개요

준비

설치와 설정

소프트웨어 설치 및 패치

  1. clusterware 설치

    인스톨러를 실행하기에 앞서서 각 노드마다 rootpre.sh를 실행해본다. 솔라리스에서는 SunCluster 가 있는지 확인해야 하기 때문이다.
    root@wl,wl2 /export/rac/orainst/clusterware/rootpre # ./rootpre.sh
    No SunCluster running
    
    실행했다면 아래와 같이 인스톨러를 실행한다.
    root@wl ~ # xhost +
    root@wl ~ # su - oracle
    oracle@wl ~ $ cd /export/rac/orainst/clusterware
    oracle@wl /export/rac/orainst/clusterware $ ./runInstaller
    ...
    Has 'rootpre.sh' been run by root? [y/n] (n)
    y
    ...
    oracle@wl /export/rac/orainst/clusterware $ 
    
    [다음]를 클릭한다.
    인벤토리 설정 화면이다. [다음]을 클릭한다.
    CRS의 홈 디렉토리를 설정한다. [다음]을 클릭한다.
    필요조건을 모두 만족시켜야 한다. [다음]을 클릭한다.
    클러스터 구성을 설정한다.
    wl만 설정 되어있는데, [추가]를 클릭해 아래와 같이 입력한 후 확인을 누르면 된다.
    두 인터페이스 모두 [전용]으로 설정 되어있다. [e1000g0]을 선택한 후 [편집]을 클릭하면 아래와 같은 창이 뜬다. [인터페이스 유형]을 [공용]으로 변경한 후 확인을 클릭한다.
    CRS의 Registry로 사용될 디스크를 정의한다. [외부 중복성]을 선택한 후 [/export/rac/oracrs/ocr_disk]를 입력한다. /export/rac/oracrs/ocr_disk가 저장된 장치는 매우 안정적이어야 한다. (다운되거나, 디스크가 고장나면 절대 안된다. 그렇게 되는 경우 클러스터를 더이상 사용할 수 없을 것이다) 여기서는 설치 편의상 한개만 설정했다. 실무에서는 이중화된 저장 장치를 사용하거나, 여의치 않다면 [보통의 중복성]을 선택해 이중화해야 한다.
    [선호 디스크]란 voting disk를 의미한다. [외부 중복성]을 선택 한 후 [/export/rac/oracrs/voting_disk]를 입력한다. 역시 매우 안정적이어야 한다. [보통의 중복성]을 선택하는 경우, 3중화까지 해야한다.
    [설치]를 클릭한다.
    설치 진행중이다. 화면을 보면 4번째 스텝에 [원격 작업 보류중]이라 되어있을 것이다. scp와 tar를 이용해 원격 노드에도 자동으로 설치 파일을 전송한다.
    루트로 두가지 스크립트를 실행한다. 동시에 실행시켜서는 안된다.
    root@wl2 /export/home/oracle/oraInventory # ./orainstRoot.sh
    다음 권한 변경 중/export/home/oracle/oraInventory 대상 770.
    그룹 이름 변경 중 /export/home/oracle/oraInventory 대상 oinstall.
    스크립트 실행이 완료되었습니다.
    root@wl2 /export/home/oracle/oraInventory # 
    
    root@wl2 /export/home/oracle/product/10.2.0/crs # ./root.sh
    WARNING: directory '/export/home/oracle/product/10.2.0' is not owned by root
    WARNING: directory '/export/home/oracle/product' is not owned by root
    WARNING: directory '/export/home/oracle' is not owned by root
    Checking to see if Oracle CRS stack is already configured
    
    Setting the permissions on OCR backup directory
    Setting up NS directories
    Oracle Cluster Registry configuration upgraded successfully
    WARNING: directory '/export/home/oracle/product/10.2.0' is not owned by root
    WARNING: directory '/export/home/oracle/product' is not owned by root
    WARNING: directory '/export/home/oracle' is not owned by root
    Successfully accumulated necessary OCR keys.
    Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
    node <nodenumber>: <nodename> <private interconnect name> <hostname>
    node 1: wl wl-priv wl
    node 2: wl2 wl2-priv wl2
    Creating OCR keys for user 'root', privgrp 'root'..
    Operation successful.
    Now formatting voting device: /export/rac/oracrs/voting_disk
    Format of 1 voting devices complete.
    Startup will be queued to init within 30 seconds.
    Adding daemons to inittab
    Expecting the CRS daemons to be up within 600 seconds.
    CSS is active on these nodes.
            wl2
    CSS is inactive on these nodes.
            wl
    Local node checking complete.
    Run root.sh on remaining nodes to start CRS daemons.
    root@wl2 /export/home/oracle/product/10.2.0/crs #
    
    root@wl /export/home/oracle/oraInventory # ./orainstRoot.sh
    다음 권한 변경 중/export/home/oracle/oraInventory 대상 770.
    그룹 이름 변경 중 /export/home/oracle/oraInventory 대상 oinstall.
    스크립트 실행이 완료되었습니다.
    root@wl /export/home/oracle/oraInventory # 
    
    root@wl /export/home/oracle/product/10.2.0/crs # ./root.sh
    WARNING: directory '/export/home/oracle/product/10.2.0' is not owned by root
    WARNING: directory '/export/home/oracle/product' is not owned by root
    WARNING: directory '/export/home/oracle' is not owned by root
    Checking to see if Oracle CRS stack is already configured
    
    Setting the permissions on OCR backup directory
    Setting up NS directories
    Oracle Cluster Registry configuration upgraded successfully
    WARNING: directory '/export/home/oracle/product/10.2.0' is not owned by root
    WARNING: directory '/export/home/oracle/product' is not owned by root
    WARNING: directory '/export/home/oracle' is not owned by root
    clscfg: EXISTING configuration version 3 detected.
    clscfg: version 3 is 10G Release 2.
    Successfully accumulated necessary OCR keys.
    Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
    node <nodenumber>: <nodename> <private interconnect name> <hostname>
    node 1: wl wl-priv wl
    node 2: wl2 wl2-priv wl2
    clscfg: Arguments check out successfully.
    
    NO KEYS WERE WRITTEN. Supply -force parameter to override.
    -force is destructive and will destroy any previous cluster
    configuration.
    Oracle Cluster Registry for cluster has already been initialized
    Startup will be queued to init within 30 seconds.
    Adding daemons to inittab
    Expecting the CRS daemons to be up within 600 seconds.
    CSS is active on these nodes.
            wl
            wl2
    CSS is active on all nodes.
    Waiting for the Oracle CRSD and EVMD to start
    Oracle CRS stack installed and running under init(1M)
    Running vipca(silent) for configuring nodeapps
    
    (2) 노드에 VIP 응용 프로그램 리소스 생성...
    (2) 노드에 GSD 응용 프로그램 리소스 생성...
    (2) 노드에 ONS 응용 프로그램 리소스 생성...
    (2) 노드에서 VIP 응용 프로그램 리소스 시작...
    (2) 노드에서 GSD 응용 프로그램 리소스 시작...
    (2) 노드에서 ONS 응용 프로그램 리소스 시작...
    
    
    Done.
    root@wl /export/home/oracle/product/10.2.0/crs #
    
    구성을 확인하고 클러스터를 실행시킨다.
    종료를 클릭해 마친다.

    설치가 완료되면 아래와 같이 클러스터 설치 내용을 확인할 수 있다. VIP가 e1000g0에 설정되었다.
    root@wl /export/home/oracle/product/10.2.0/crs/bin # ./oifcfg iflist
    e1000g0  192.168.0.0
    e1000g1  192.168.1.0
    root@wl /export/home/oracle/product/10.2.0/crs/bin # ifconfig -a
    lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
            inet 127.0.0.1 netmask ff000000
    e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
            inet 192.168.0.101 netmask ffffff00 broadcast 192.168.0.255
            ether 8:0:27:52:1b:41
    e1000g0:1: flags=1040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4> mtu 1500 index 2
            inet 192.168.0.151 netmask ffffff00 broadcast 192.168.0.255
    e1000g1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
            inet 192.168.1.101 netmask ffffff00 broadcast 192.168.1.255
            ether 8:0:27:6d:94:22
    root@wl /export/home/oracle/product/10.2.0/crs/bin # ./crsctl check crs
    CSS appears healthy
    CRS appears healthy
    EVM appears healthy
    root@wl /export/home/oracle/product/10.2.0/crs/bin # ./crs_stat -t
    Name           Type           Target    State     Host
    ------------------------------------------------------------
    ora.wl.gsd     application    ONLINE    ONLINE    wl
    ora.wl.ons     application    ONLINE    ONLINE    wl
    ora.wl.vip     application    ONLINE    ONLINE    wl
    ora.wl2.gsd    application    ONLINE    ONLINE    wl2
    ora.wl2.ons    application    ONLINE    ONLINE    wl2
    ora.wl2.vip    application    ONLINE    ONLINE    wl2
    
  2. clusterware 패치

    이 문서의 내용을 따라하기 위해 반드시 해야하는건 아니다.
    [다음]을 클릭한다.
    [OraCrs10g_Home]을 선택하고 [다음]을 클릭한다.
    [다음]을 클릭한다.
    [다음]을 클릭한다.
    [설치]를 클릭한다.
    설치가 끝날때까지 기다린다.
    [종료]를 클릭한다.

    클러스터웨어 패치 설치를 마쳤으면, CRS 데몬을 종료한 후, 라이브러리를 패치하고 다시 시작해야 한다.
    root@wl /export/home/oracle/product/10.2.0/crs/bin # ./crsctl stop crs
    Stopping resources.
    Successfully stopped CRS resources
    Stopping CSSD.
    Shutting down CSS daemon.
    Shutdown request successfully issued.
    root@wl /export/home/oracle/product/10.2.0/crs/bin # cd ../install
    root@wl /export/home/oracle/product/10.2.0/crs/install # ./root102.sh
    Creating pre-patch directory for saving pre-patch clusterware files
    Completed patching clusterware files to /export/home/oracle/product/10.2.0/crs
    Relinking some shared libraries.
    ar: /export/home/oracle/product/10.2.0/crs/lib32/libn10.a을(를) 쓰는 중
    ar: /export/home/oracle/product/10.2.0/crs/lib/libn10.a을(를) 쓰는 중
    ar: /export/home/oracle/product/10.2.0/crs/lib32/libn10.a을(를) 쓰는 중
    ar: /export/home/oracle/product/10.2.0/crs/lib/libn10.a을(를) 쓰는 중
    Relinking of patched files is complete.
    Preparing to recopy patched init and RC scripts.
    Recopying init and RC scripts.
    Startup will be queued to init within 30 seconds.
    Starting up the CRS daemons.
    Waiting for the patched CRS daemons to start.
      This may take a while on some systems.
    .
    10204 patch successfully applied.
    clscfg: EXISTING configuration version 3 detected.
    clscfg: version 3 is 10G Release 2.
    Successfully accumulated necessary OCR keys.
    Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
    node <nodenumber>: <nodename> <private interconnect name> <hostname>
    node 1: wl wl-priv wl
    Creating OCR keys for user 'root', privgrp 'root'..
    Operation successful.
    clscfg -upgrade completed successfully
    root@wl /export/home/oracle/product/10.2.0/crs/install #
    
    root@wl2 /export/home/oracle/product/10.2.0/crs/bin # ./crsctl stop crs
    Stopping resources.
    Successfully stopped CRS resources
    Stopping CSSD.
    Shutting down CSS daemon.
    Shutdown request successfully issued.
    root@wl2 /export/home/oracle/product/10.2.0/crs/bin # cd ../install
    root@wl2 /export/home/oracle/product/10.2.0/crs/install # ./root102.sh
    Creating pre-patch directory for saving pre-patch clusterware files
    Completed patching clusterware files to /export/home/oracle/product/10.2.0/crs
    Relinking some shared libraries.
    ar: /export/home/oracle/product/10.2.0/crs/lib32/libn10.a을(를) 쓰는 중
    ar: /export/home/oracle/product/10.2.0/crs/lib/libn10.a을(를) 쓰는 중
    ar: /export/home/oracle/product/10.2.0/crs/lib32/libn10.a을(를) 쓰는 중
    ar: /export/home/oracle/product/10.2.0/crs/lib/libn10.a을(를) 쓰는 중
    Relinking of patched files is complete.
    Preparing to recopy patched init and RC scripts.
    Recopying init and RC scripts.
    Startup will be queued to init within 30 seconds.
    Starting up the CRS daemons.
    Waiting for the patched CRS daemons to start.
      This may take a while on some systems.
    .
    10204 patch successfully applied.
    clscfg: EXISTING configuration version 3 detected.
    clscfg: version 3 is 10G Release 2.
    Successfully accumulated necessary OCR keys.
    Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
    node <nodenumber>: <nodename> <private interconnect name> <hostname>
    node 2: wl2 wl2-priv wl2
    Creating OCR keys for user 'root', privgrp 'root'..
    Operation successful.
    clscfg -upgrade completed successfully
    root@wl2 /export/home/oracle/product/10.2.0/crs/install #
    
    [WARNING: directory 'xxx' is not owned by root], [Warning: Absolute relocation is used for symbol~] 메시지는 무시한다. (표기하지 않았다)
  3. database 설치

    root@wl ~ # xhost +
    root@wl ~ # su - oracle
    oracle@wl ~ $ cd /export/rac/orainst/database
    oracle@wl /export/rac/orainst/database $ ./runInstaller
    
    [다음]을 클릭한다.
    [다음]을 클릭한다.
    이름과 경로를 화면과 같이 설정하고 [다음]을 클릭한다.
    두 노드를 모두 선택한다. [다음]을 클릭한다.
    경고는 1개만 발생해야 한다. project를 사용했기 때문이다. [다음]을 클릭한다.
    [데이터베이스 소프트웨어만 설치]를 선택하고 [다음]을 클릭한다.
    [설치]을 클릭한다.
    설치가 완료될때까지 기다린다. 시간이 꽤 걸린다.
    각 노드에서 루트 계정으로 root.sh를 실행한 후 [확인]을 클릭한다.
    root@wl,wl2 /export/home/oracle/product/10.2.0/db_1 # ./root.sh
    Running Oracle10 root.sh script...
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /export/home/oracle/product/10.2.0/db_1
    
    Enter the full pathname of the local bin directory: [/usr/local/bin]:
       Copying dbhome to /usr/local/bin ...
       Copying oraenv to /usr/local/bin ...
       Copying coraenv to /usr/local/bin ...
    
    
    Creating /var/opt/oracle/oratab file...
    Entries will be added to the /var/opt/oracle/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root.sh script.
    Now product-specific root actions will be performed.
    
    설치가 완료되었다. [종료]을 클릭한다.

  4. database 패치

    [다음]을 클릭한다.
    [OraDb10g_home1]을 선택하고 [다음]을 클릭한다.
    [다음]을 클릭한다.
    [다음]을 클릭한다.
    [설치]을 클릭한다.
    설치가 완료될때까지 기다린다.
    각 노드에서 루트 계정으로 root.sh를 실행한 후 [확인]을 클릭한다.
    root@wl,wl2 /export/home/oracle/product/10.2.0/db_1 # ./root.sh
    Running Oracle10 root.sh script...
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /export/home/oracle/product/10.2.0/db_1
    
    Enter the full pathname of the local bin directory: [/usr/local/bin]:
    The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y
       Copying dbhome to /usr/local/bin ...
    The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y
       Copying oraenv to /usr/local/bin ...
    The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y
       Copying coraenv to /usr/local/bin ...
    
    Entries will be added to the /var/opt/oracle/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root.sh script.
    Now product-specific root actions will be performed.
    
    [종료]를 클릭한다.

소프트웨어 설정

  1. netca

    root@wl ~ # xhost +
    root@wl ~ # su - oracle
    oracle@wl ~ $ netca
    
    [클러스터 구성]을 선택하고 [다음]을 클릭한다.
    [모든 노드 선택]을 클릭하고 [다음]을 클릭한다.
    [리스너 구성]을 선택하고 [다음]을 클릭한다.
    [추가]를 선택하고 [다음]을 클릭한다.
    리스너명을 입력한 후 [다음]을 클릭한다.
    [TCPS]도 추가한 후 [다음]을 클릭한다.
    [다음]을 클릭한다.
    [다음]을 클릭한다.
    [다음]을 클릭한다. 잠시 기다리고 있으면 다음 화면이 나온다.
    [다음]을 클릭한다.
    [완료]을 클릭한다.

    아래와 같이 각각의 노드에 LISTENER 도 실행된 것을 확인할 수 있다.
    root@wl ~ # crsstat
    HA Resource                                   Target     State
    -----------                                   ------     -----
    ora.wl.LISTENER_WL.lsnr                       ONLINE     ONLINE on wl
    ora.wl.gsd                                    ONLINE     ONLINE on wl
    ora.wl.ons                                    ONLINE     ONLINE on wl
    ora.wl.vip                                    ONLINE     ONLINE on wl
    ora.wl2.LISTENER_WL2.lsnr                     ONLINE     ONLINE on wl2
    ora.wl2.gsd                                   ONLINE     ONLINE on wl2
    ora.wl2.ons                                   ONLINE     ONLINE on wl2
    ora.wl2.vip                                   ONLINE     ONLINE on wl2
    root@wl ~ #
    
  2. dbca - ASM

    ASM(Automatic Storage Management)은 오라클에서 제공하는 저장장치 관리자이다. 하지만 솔라리스에서는 다른 유닉스와는 달리 RAC에서도 NFS를 이용해 데이터베이스 파일을 생성할 수 있기 때문에, ASM을 반드시 사용해야하는건 아니다. (솔라리스 외에 리눅스도 NFS를 사용해 생성할 수 있다) ASM을 소개하는 정도로만 생각하면 된다.
    root@wl ~ # xhost +
    root@wl ~ # su - oracle
    oracle@wl ~ $ dbca
    
    [Oracle Real Application Clusters 데이터 베이스]를 선택하고 [다음]을 클릭한다.
    [Automatic Storage Management 구성]을 선택하고 [다음]을 클릭한다.
    두 노드를 선택하고 [다음]을 클릭한다.
    암호와 [서버 매개변수 파일 이름]을 입력한 후 [다음]을 클릭한다.

    [확인]을 클릭하면 ASM 인스턴스를 생성한다. 잠시 기다리면 다음으로 넘어간다.
    [새로 만들기]를 클릭한다.
    멤버 디스크 후보를 지정하기 위해 [디스크 검색경로 변경]을 클릭하고 아래와 같이 입력한다.
    왼쪽 화면과 같이 입력한다. 디스크 그룹 이름에는 orcldiskgroup1을, 중복은 외부를 선택하고, 두개의 디스크를 모두 선택한다. [확인]을 클릭하면 아래와 같이 그룹을 생성하는 화면이 나온다. 잠시 기다리면 다음으로 넘어간다.
    디스크 그룹이 추가된것을 확인할 수 있다.[완료]를 클릭한다.
    [아니오]를 클릭해 dbca를 종료한다.

    아래와 같이 각각의 노드에서 ASM이 실행된 것을 확인할 수 있다.
    root@wl ~ # crsstat
    HA Resource                                   Target     State
    -----------                                   ------     -----
    ora.wl.ASM1.asm                               ONLINE     ONLINE on wl
    ora.wl.LISTENER_WL.lsnr                       ONLINE     ONLINE on wl
    ora.wl.gsd                                    ONLINE     ONLINE on wl
    ora.wl.ons                                    ONLINE     ONLINE on wl
    ora.wl.vip                                    ONLINE     ONLINE on wl
    ora.wl2.ASM2.asm                              ONLINE     ONLINE on wl2
    ora.wl2.LISTENER_WL2.lsnr                     ONLINE     ONLINE on wl2
    ora.wl2.gsd                                   ONLINE     ONLINE on wl2
    ora.wl2.ons                                   ONLINE     ONLINE on wl2
    ora.wl2.vip                                   ONLINE     ONLINE on wl2
    root@wl ~ #
    
  3. dbca - 데이터베이스 생성

    마지막으로 데이터 베이스를 생성할 차례이다.
    root@wl ~ # xhost +
    root@wl ~ # su - oracle
    oracle@wl ~ $ dbca
    
    [Oracle Real Application Clusters 데이터베이스]를 선택한 후 [다음]을 클릭한다.
    [데이터베이스 생성]을 선택한 후 [다음]을 클릭한다.
    노드를 선택한 후 [다음]을 클릭한다.
    [범용]을 선택한 후 [다음]을 클릭한다. 만약 이후 데이터베이스 생성 단계에서 오류가 발생하면 [사용자 정의 데이터베이스]를 선택한다.
    [orcl]을 입력한 후 [다음]을 클릭한다.
    [다음]을 클릭한다.
    암호를 입력한 후 [다음]을 클릭한다.
    [ASM(자동 저장 영역 관리)]를 선택한 후 [다음]을 클릭한다.
    디스크 그룹을 선택한 후 [다음]을 클릭한다.
    [다음]을 클릭한다.
    [다음]을 클릭한다.
    [다음]을 클릭한다.
    [다음]을 클릭한다. TAF는 별도로 다룰 것이다.
    메모리와 캐릭터 셋을 선택한 후 [다음]을 클릭한다.
    [다음]을 클릭한다.
    [완료]을 클릭한다.
    [확인]을 클릭한다.
    데이터베이스를 생성하는 중이다.
    [종료]을 클릭한다.
    종료를 클릭하면 데이터베이스를 시작할 것이다.

    아래와 같이 db가 생성되었고, 각각의 노드에 인스턴스가 생성된 것을 확인 할 수 있다.
    root@wl ~ # crsstat
    HA Resource                                   Target     State
    -----------                                   ------     -----
    ora.orcl.db                                   ONLINE     ONLINE on wl
    ora.orcl.orcl1.inst                           ONLINE     ONLINE on wl
    ora.orcl.orcl2.inst                           ONLINE     ONLINE on wl2
    ora.wl.ASM1.asm                               ONLINE     ONLINE on wl
    ora.wl.LISTENER_WL.lsnr                       ONLINE     ONLINE on wl
    ora.wl.gsd                                    ONLINE     ONLINE on wl
    ora.wl.ons                                    ONLINE     ONLINE on wl
    ora.wl.vip                                    ONLINE     ONLINE on wl
    ora.wl2.ASM2.asm                              ONLINE     ONLINE on wl2
    ora.wl2.LISTENER_WL2.lsnr                     ONLINE     ONLINE on wl2
    ora.wl2.gsd                                   ONLINE     ONLINE on wl2
    ora.wl2.ons                                   ONLINE     ONLINE on wl2
    ora.wl2.vip                                   ONLINE     ONLINE on wl2
    root@wl ~ #
    
  4. 설정확인

    설정확인은 system 계정으로 아래와 같이 할 수 있다.
    oracle@wl ~ $ sqlplus system
    
    SQL*Plus: Release 10.2.0.4.0 - Production on 토 1월 9 21:33:53 2010
    
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    
    암호 입력:
    
    다음에 접속됨:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    
    SQL> select * from v$active_instances;
    
    INST_NUMBER
    -----------
    INST_NAME
    --------------------------------------------------------------------------------
              1
    wl:orcl1
    
              2
    wl2:orcl2
    
    
    SQL> SELECT NAME,STATE,TYPE FROM V$ASM_DISKGROUP;
    
    NAME
    --------------------------------------------------------------------------------
    STATE                             TYPE
    --------------------------------- ------------------
    ORCLDISKGROUP1
    CONNECTED                         EXTERN
    
    
    SQL>
    SQL> SELECT NAME FROM V$DATAFILE;
    
    NAME
    --------------------------------------------------------------------------------
    +ORCLDISKGROUP1/orcl/datafile/system.266.707852873
    +ORCLDISKGROUP1/orcl/datafile/undotbs1.262.707852999
    +ORCLDISKGROUP1/orcl/datafile/sysaux.261.707853055
    +ORCLDISKGROUP1/orcl/datafile/undotbs2.264.707853113
    +ORCLDISKGROUP1/orcl/datafile/users.259.707853189
    
    SQL> exit
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options에서 분리되었습니다.
    oracle@wl ~ $
    

실행 및 운용

  1. 종료

    서비스 종료는 아래와 같이 할 수 있다.
    oracle@wl ~ $ srvctl stop database -d orcl
    oracle@wl ~ $ srvctl stop asm -n wl
    oracle@wl ~ $ srvctl stop asm -n wl2
    oracle@wl ~ $ srvctl stop nodeapps -n wl
    oracle@wl ~ $ srvctl stop nodeapps -n wl2
    
  2. 시작

    시스템 시작시 보통 CRS와 함께 모든 서비스가 실행된다. 실행되지 않았을 경우 아래와 같이 재시작할 수 있다. /etc/init.d/init.crs start가 실행되어있는 상태에서 아래와 같이 실행한다.
    oracle@wl ~ $ srvctl start nodeapps -n wl
    oracle@wl ~ $ srvctl start nodeapps -n wl2
    oracle@wl ~ $ srvctl start asm -n wl
    oracle@wl ~ $ srvctl start asm -n wl2
    oracle@wl ~ $ srvctl start database -d orcl
    
    $ORA_CRS_HOME/bin/crs_start resource-name -all를 사용해도 된다.
  3. 네트워크 관련

    oracle@wl ~ $ oifcfg iflist
    e1000g0  192.168.0.0
    e1000g1  192.168.1.0
    oracle@wl ~ $
    
  4. 클라이언트 세팅

    tnsnames.ora 에 아래와 같이 추가해준다. ORCL로 접속할 수 있다.
    ORCL =
    (DESCRIPTION =
    	(ADDRESS = (PROTOCOL = TCP)(HOST = wl-vip)(PORT = 1521))
    	(ADDRESS = (PROTOCOL = TCP)(HOST = wl2-vip)(PORT = 1521))
    	(LOAD_BALANCE = yes)
    	(CONNECT_DATA =
    		(SERVER = DEDICATED)
    		(SERVICE_NAME = ORCL)
    	)
    ) 
    
  5. crsstat

    crs_stat -t명령이 좋긴 하지만 자원 명이 잘리는 문제가 있다. 이를 보완한 스크립트다. 출처는 소스에 명시되어있다.
    crsstat
    (812 바이트)
    #!/bin/bash
    # [crsstat -t]
    # Source: http://www.dbspecialists.com/specialists/specialist2007-05.html
    # Requirements:
    #   - $ORA_CRS_HOME should be set in your environment 
    
    if [ "x$ORA_CRS_HOME" == "x" ]; then
    	ORA_CRS_HOME=/export/home/oracle/product/10.2.0/crs
    fi
    
    RSC_KEY=$1
    QSTAT=-u
    AWK=/usr/xpg4/bin/awk
    
    $AWK \
      'BEGIN {printf "%-45s %-10s %-18s\n", "HA Resource", "Target", "State";
              printf "%-45s %-10s %-18s\n", "-----------", "------", "-----";}'
    
    $ORA_CRS_HOME/bin/crs_stat $QSTAT | $AWK \
     'BEGIN { FS="="; state = 0; }
      $1~/NAME/ && $2~/'$RSC_KEY'/ {appname = $2; state=1};
      state == 0 {next;}
      $1~/TARGET/ && state == 1 {apptarget = $2; state=2;}
      $1~/STATE/ && state == 2 {appstate = $2; state=3;}
      state == 3 {printf "%-45s %-10s %-18s\n", appname, apptarget, appstate; state=0;}'
    

마치며

RSS ATOM XHTML 5 CSS3