1. LISTENER TEST

       

    1. srvctl stop listener -n rac1 -l LISTENER
      1. rac1@+ASM1 : /app/grid/11g/log/rac1> tail -f alertrac1.log

2012-07-31 10:08:54.011

[/app/grid/11g/bin/oraagent.bin(4026)]CRS-5016:Process "/app/grid/11g/bin/lsnrctl" spawned by agent "/app/grid/11g/bin/oraagent.bin" for action "check" failed: details at "(:CLSN00010:)" in "/app/grid/11g/log/rac1/agent/crsd/oraagent_oragrid/oraagent_oragrid.log"

   

  1. crs_stat -v -t

rac1@+ASM1 : /app/grid> crs_stat -v -t

Name Type R/RA F/FT Target State Host

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

ora.CRSDATA.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1

ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE rac2

ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac2

ora.ORADB.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1

ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac1

ora.cvu ora.cvu.type 0/5 0/0 ONLINE ONLINE rac2

ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE

ora....network ora....rk.type 0/5 0/ ONLINE ONLINE rac1

ora.oc4j ora.oc4j.type 0/1 0/2 OFFLINE OFFLINE

ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac1

ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1

ora....C1.lsnr application 0/5 0/0 OFFLINE OFFLINE

ora.rac1.gsd application 0/5 0/0 OFFLINE OFFLINE

ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1

ora.rac1.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac1

ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac2

ora....C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2

ora.rac2.gsd application 0/5 0/0 OFFLINE OFFLINE

ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2

ora.rac2.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac2

ora.racdb.db ora....se.type 0/2 0/1 ONLINE ONLINE rac1

ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac2

rac1@+ASM1 : /app/grid>

   

   

  1. lsnrctl status

rac1@RACDB1 : /app/oracle> lsnrctl status

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 31-JUL-2012 10:11:08

   

Copyright (c) 1991, 2011, Oracle. All rights reserved.

   

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

TNS-12541: TNS:no listener

TNS-12560: TNS:protocol adapter error

TNS-00511: No listener

Linux Error: 111: Connection refused

rac1@RACDB1 : /app/oracle>

   

   

  1. srvctl start listener -n rac1 -l LISTENER 올라오는데 시간이 걸림

       

   

  1. 한쪽 DB 내리기
    1. <oracle/ oragrid>srvctl status instance -d RACDB -i RACDB2
    2. <oracle/ oragrid>srvctl stop instance -d RACDB -i RACDB2

rac2@RACDB2 : /app/oracle> srvctl stop instance -d RACDB -i RACDB2

rac2@RACDB2 : /app/oracle>

rac2@RACDB2 : /app/oracle>

rac2@RACDB2 : /app/oracle> ss

   

SQL*Plus: Release 11.2.0.3.0 Production on Tue Jul 31 10:22:09 2012

   

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

   

Connected to an idle instance.

  1. <root> crsctl stop crs / crsctl stop crs -f(강제)

[root@rac2 bin]# ./crsctl stop crs

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac2'

CRS-2673: Attempting to stop 'ora.crsd' on 'rac2'

CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac2'

CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac2'

CRS-2673: Attempting to stop 'ora.cvu' on 'rac2'

CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac2'

CRS-2673: Attempting to stop 'ora.CRSDATA.dg' on 'rac2'

CRS-2673: Attempting to stop 'ora.ORADB.dg' on 'rac2'

CRS-2677: Stop of 'ora.cvu' on 'rac2' succeeded

CRS-2672: Attempting to start 'ora.cvu' on 'rac1'

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac2' has completed

CRS-4133: Oracle High Availability Services has been stopped.

[root@rac2 bin]#

  

  1. 확인

rac1@+ASM1 : /app/grid> crs_stat -v -t

Name Type R/RA F/FT Target State Host

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

ora.CRSDATA.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1

ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE rac1

ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac1

ora.ORADB.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1

ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac1

ora.cvu ora.cvu.type 0/5 0/0 ONLINE ONLINE rac1

ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE

ora....network ora....rk.type 0/5 0/ ONLINE ONLINE rac1

ora.oc4j ora.oc4j.type 0/1 0/2 OFFLINE OFFLINE

ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac1

ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1

ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1

ora.rac1.gsd application 0/5 0/0 OFFLINE OFFLINE

ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1

ora.rac1.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac1

ora.rac2.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac1

ora.racdb.db ora....se.type 0/2 0/1 ONLINE ONLINE rac1

ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac1

rac1@+ASM1 : /app/grid>

   

  1. 한쪽 DB 올리기
    1. ./crsctl start crs --올라오는데 시간이 걸림

[root@rac2 bin]# ./crsctl start crs

CRS-4123: Oracle High Availability Services has been started.

  1. 확인
    1. rac2@+ASM2 : /app/grid/11g/log/rac2> tail -f alertrac2.log
    2. rac2@+ASM2 : /app/grid/app/oragrid/diag/asm/+asm/+ASM2/trace> tail -f alert_+ASM2.log

rac2@+ASM2 : /app/grid> crs_stat -t -v

Name Type R/RA F/FT Target State Host

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

ora.CRSDATA.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1

ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE rac1

ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac1

ora.ORADB.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1

ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac1

ora.cvu ora.cvu.type 0/5 0/0 ONLINE ONLINE rac1

ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE

ora....network ora....rk.type 0/5 0/ ONLINE ONLINE rac1

ora.oc4j ora.oc4j.type 0/1 0/2 OFFLINE OFFLINE

ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac1

ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1

ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1

ora.rac1.gsd application 0/5 0/0 OFFLINE OFFLINE

ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1

ora.rac1.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac1

ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac2

ora....C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2

ora.rac2.gsd application 0/5 0/0 OFFLINE OFFLINE

ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2

ora.rac2.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac2

ora.racdb.db ora....se.type 0/2 0/1 ONLINE ONLINE rac1

ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac1

rac2@+ASM2 : /app/grid>

  1. 한쪽 DB 올리기
    1. rac2@RACDB2 : /app/oracle> srvctl start instance -d RACDB -i RACDB2
    2. rac2@RACDB2 : /app/oracle/diag/rdbms/racdb/RACDB2/trace> tail -f alert_RACDB2.log

       

  1. Archive log list 설정

       

    1. 1 번과 2번노드에 동일한 위치에 디렉토리 생성

       

       

    1. 한쪽노드에서 명령어 입력

SQL> ALTER SYSTEM SET

2 LOG_ARCHIVE_START=TRUE SCOPE=SPFILE;

   

System altered.

   

SQL> ALTER SYSTEM SET

2 LOG_ARCHIVE_DEST='/data/archive'

3 SCOPE=SPFILE;

   

System altered.

   

SQL> ALTER SYSTEM SET

2 LOG_ARCHIVE_FORMAT='%S.ARC' SCOPE=SPFILE; -- 잘못된 입력-> 추후에 변경

   

System altered.

   

  1. 1번 2번 노드 DB shutdown

srvctl stop database -d RACDB

   

  1. 초기 아카이브 설정 형식을 잘못 입력하여 에러발행

SQL> startup mount;

ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance

ORA-19905: log_archive_format must contain %s, %t and %r

SQL>

SQL> create pfile from spfile='+ORADB/RACDB/spfileRACDB.ora'

2 ;

   

File created.

   

Pfile 생성후 해당 포맷변경

   

*.log_archive_dest='/data/archive'

*.log_archive_format=orcl_%s_%t_%r.arc

#*.log_archive_format='%S.ARC'

*.log_archive_start=TRUE

*.memory_target=1616904192

   

<원복> 1번 노드와 2번노드가 같이 바라보고 있음

Create spfile='+ORADB/RACDB/spfileRACDB.ora' from pfile

   

  1. 아카이브로그 설정 진행

SQL> startup mount;

ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance

ORACLE instance started.

   

Total System Global Area 1620115456 bytes

Fixed Size 2228824 bytes

Variable Size 1207963048 bytes

Database Buffers 402653184 bytes

Redo Buffers 7270400 bytes

Database mounted.

SQL> ALTER DATABASE ARCHIVELOG;

   

Database altered.

   

SQL> ALTER DATABASE OPEN;

   

Database altered.

   

SQL> archive log list

Database log mode Archive Mode

Automatic archival Enabled

Archive destination /data/archive

Oldest online log sequence 43

Next log sequence to archive 44

Current log sequence 44

   

SQL> shutdown immediate

Database closed.

Database dismounted.

  

   

  1. 1번, 2번노드 내린 뒤, 동시에 올려줌.

rac1@+ASM1 : /app/grid> srvctl start database -d RACDB

   

  1. VOTE/ OCR 백업 및 복구하기
    1. Vote

: 노드들의 출석부

: 1초에 한번씩 노드들이 살아있나 죽어있나를 체크해서 적어 놓는다.

: 다른 노드들이 살았나 죽었나 관리하는 디스크 = vote disk

   

※ halt bit : 모든 노드들에게 핑 날려봄

crs가 halt bit를 날려 각 노드들의 생사(?) 여부를 조사한다. 특정 노드에서 반응이 없으면 바로 죽었다고

판단하는 것이 아니라 vote disk로 가본다. 이곳에 해당 노드가 적혀 있다면, 다른업무때문에 바빠서 반응이 없었다고 판단한다.

문제는 vote 디스크를 뒤졌는데 해당노드가 없다. crs는 해당노드가 죽었다고 판단하고 재부팅시켜버린다.

   

# crsctl add css votedisk <new voting disk path> -force

# crsctl delete css votedisk <old voting disk path> -force

  

  1. OCR

 : RAC 상의 모든 노드들에 대한 정보와 모든 자원들에 대한 정보 저장 - 에러나면 RAC전체 중단

 : 윈도우의 레지스트리 역할 

 : OCR 정보를 잘 관리하여야 한다.

rac1@+ASM1 : /app/grid> ocrcheck

Status of Oracle Cluster Registry is as follows :

Version : 3

Total space (kbytes) : 262120

Used space (kbytes) : 2864

Available space (kbytes) : 259256

ID : 678271056

Device/File Name : +CRSDATA

Device/File integrity check succeeded

   

Device/File not configured

   

Device/File not configured

   

Device/File not configured

   

Device/File not configured

   

Cluster registry integrity check succeeded

   

Logical corruption check bypassed due to non-privileged user

   

rac1@+ASM1 : /app/grid> '

   

rac1@+ASM1 : /app/grid> ocrconfig -showbackup

   

rac1 2012/07/31 06:12:16 /app/grid/11g/cdata/rac-cluster/backup00.ocr

   

rac1 2012/07/31 02:12:15 /app/grid/11g/cdata/rac-cluster/backup01.ocr

   

rac1 2012/07/30 22:12:13 /app/grid/11g/cdata/rac-cluster/backup02.ocr

   

rac1 2012/07/30 14:12:10 /app/grid/11g/cdata/rac-cluster/day.ocr

   

rac2 2012/07/24 13:07:55 /app/grid/11g/cdata/rac-cluster/week.ocr

PROT-25: Manual backups for the Oracle Cluster Registry are not available

rac1@+ASM1 : /app/grid>

   

Recovery OCR Disk using Export Backup

• CRS Stop 후 OCR Disk Import

# ocrconfig –import /shared/export/ocrback.dmp

   

cluvfy 명령어를 이용하여 복원이 잘 되었나 확인

 [root@rac1]# cluvfy comp ocr –n all

   

Recovery OCR Disk using Automatic Backup

• CRS Stop 후 OCR Backup Restore

# ocrconfig –restore $ORA_CRS_HOME/cdata/crs/day.ocr

  

   

[참고문헌]

http://dinggur.tistory.com/219

블로그 이미지

운명을바꾸는자

IT와 함께 살아가는 삶

,