'11gR2 RAC TEST'에 해당되는 글 1건

 

1.컨트롤 파일 mirror

   

1) srvctl stop database -d VIDEO 정지 후-> 1번 노드에서만 작업실시

2) Startup nomount; 현재상태 확인

   

SQL> startup nomount;

ORACLE instance started.

   

Total System Global Area 3674501120 bytes

Fixed Size 2233760 bytes

Variable Size 1157630560 bytes

Database Buffers 2499805184 bytes

Redo Buffers 14831616 bytes

SQL>

SQL>

SQL>

SQL> show parameter control_file

   

NAME TYPE

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

VALUE

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

control_file_record_keep_time integer

7

control_files string

+ORADATA/video/controlfile/cur

rent.260.786470645

SQL>

   

3) Su - oragrid -> asmcmd -> controlfile 복사 2~3개 후,

ASMCMD> ls

Current.260.789319007

ASMCMD>

ASMCMD> pwd

+ORADATA/video/controlfile

ASMCMD>

SQL> alter system set control_files='+ORADATA/video/controlfile/current.260.786470645', '+ORADATA/video/controlfile/current.mirror1', '+ORADATA/video/controlfile/current.mirror2' scope=spfile;

   

System altered.

   

SQL>

   

4) Shutdown immediate -> startup nomount -> mount -> open

SQL> startup nomount

ORACLE instance started.

   

Total System Global Area 3674501120 bytes

Fixed Size 2233760 bytes

Variable Size 1157630560 bytes

Database Buffers 2499805184 bytes

Redo Buffers 14831616 bytes

SQL>

SQL>

SQL> show parameter control_files

   

NAME TYPE

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

VALUE

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

control_files string

+ORADATA/video/controlfile/cur

rent.260.786470645, +ORADATA/v

ideo/controlfile/current.mirro

r1, +ORADATA/video/controlfile

/current.mirror2

SQL>

SQL> alter database mount;

   

Database altered.

   

SQL>

SQL>

SQL> select name, is_recovery_dest_file from v$controlfile;

   

NAME

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

IS_RECOVE

---------

+ORADATA/video/controlfile/current.260.786470645

NO

   

+ORADATA/video/controlfile/current.mirror1

NO

   

+ORADATA/video/controlfile/current.mirror2

NO

   

   

SQL>

SQL>

SQL> desc v$controlfile;

Name Null? Type

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

STATUS VARCHAR2(7)

NAME VARCHAR2(513)

IS_RECOVERY_DEST_FILE VARCHAR2(3)

BLOCK_SIZE NUMBER

FILE_SIZE_BLKS NUMBER

   

SQL>

SQL>

SQL> alter database open;

   

Database altered.

   

SQL>

SQL>

   

2.Redolog 변경

1) 잠시 옮겨둘 redolog 생성

SQL> ALTER DATABASE ADD LOGFILE THREAD 1

2 GROUP 10 '+ORADATA',

3 GROUP 20 '+ORADATA',

4 GROUP 30 '+ORADATA';

   

Database altered.

   

SQL>

SQL> ALTER DATABASE ADD LOGFILE THREAD 2

2 GROUP 40 '+ORADATA',

3 GROUP 50 '+ORADATA',

4 GROUP 60 '+ORADATA';

   

Database altered.

   

SQL>

   

2) 리두 로그 현재 상태변경

SQL> alter system switch logfile;

SQL> alter system checkpoint;

   

3) 기존의 리두로그 제거

SQL> alter database drop logfile group 1;

   

Database altered.

SQL>

SQL> alter database drop logfile group 2;

   

Database altered.

   

SQL> alter database drop logfile group 3;

   

Database altered.

   

SQL> alter database drop logfile group 4;

   

Database altered.

   

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

   

SQL> alter database drop logfile group 5;

alter database drop logfile group 5

*

ERROR at line 1:

ORA-01623: log 5 is current log for instance UNNAMED_INSTANCE_3 (thread 3) - cannot drop

ORA-00312: online log 5 thread 3: '+ORADATA/video/onlinelog/group_5.265.786470753'

   

SQL> alter database drop logfile group 6;

alter database drop logfile group 6

*

ERROR at line 1:

ORA-01567: dropping log 6 would leave less than 2 log files for instance UNNAMED_INSTANCE_3 (thread 3)

ORA-00312: online log 6 thread 3: '+ORADATA/video/onlinelog/group_6.266.786470753'

   

SQL> ALTER DATABASE DISABLE THREAD 3;

   

Database altered.

   

SQL>

SQL>

SQL> alter database drop logfile group 5;

   

Database altered.

   

SQL> alter database drop logfile group 6;

   

Database altered.

  

   

4) 새롭게 사용할 리두로그 추가

SQL>

SQL> ALTER DATABASE ADD LOGFILE THREAD 1

2 GROUP 1 ('+ORADATA','+ORADATA') SIZE 1024m,

3 GROUP 2 ('+ORADATA','+ORADATA') SIZE 1024m,

4 GROUP 3 ('+ORADATA','+ORADATA') SIZE 1024m;

 

Database altered.

   

SQL> ALTER DATABASE ADD LOGFILE THREAD 2

2 GROUP 4 ('+ORADATA','+ORADATA') SIZE 1024m,

3 GROUP 5 ('+ORADATA','+ORADATA') SIZE 1024m,

4 GROUP 6 ('+ORADATA','+ORADATA') SIZE 1024m;

   

Database altered.

   

SQL>

   

4) 리두 로그 현재 상태변경

SQL> alter system switch logfile;

SQL> alter system checkpoint;

   

6) 잠시 백업해둔 리두로그 삭제

SQL>

SQL> alter database drop logfile group 20;

   

Database altered.

   

SQL> alter database drop logfile group 30;

   

Database altered.

   

SQL> alter database drop logfile group 40;

   

Database altered.

   

SQL> alter database drop logfile group 50;

   

Database altered.

   

SQL> alter database drop logfile group 60;

   

Database altered.

   

3.기타

1) 로그정보확인(TEST서버)

- DB : /app/oracle/diag/rdbms/racdb/RACDB1/trace/alert_RACDB1.log

- ASM : /app/grid/app/oragrid/diag/asm/+asm/+ASM1/trace/alert_+ASM1.log

- Grid : /app/grid/11g/log/rac1/alertrac1.log

   

2) 자주 사용했던 명령어들..

- crsctl start crs(root) : crs를 노드1,2 동시에 올림

- crsctl stop crs -f(root) : 강제로 crs가 내려갈 경우, 꺠끗하게 내리고 시작하기 위해서 강제로 내림

- crs_stat -t -v : 현재 상태확인(crs 및 DB)

- ASM Check

 -> oracleasm scandisks

 -> oracleasm listdisks

 -> Asmcmd

 

 -> srvctl status database -d SID

 -> srvctl stop database -d SID

 -> srvctl start database -d SID

   

3) 11g 내부에서 사용되는 ip존재(HAIP)

   

노드1

eth1:1 Link encap:Ethernet HWaddr 00:E0:4C:68:00:B4

inet addr:169.254.124.85 Bcast:169.254.255.255 Mask:255.255.0.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Interrupt:58 Base address:0xc000

노드2

eth1:1 Link encap:Ethernet HWaddr 00:E0:4C:68:00:AB

inet addr:169.254.12.120 Bcast:169.254.255.255 Mask:255.255.0.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Interrupt:58 Base address:0xc000

블로그 이미지

운명을바꾸는자

IT와 함께 살아가는 삶

,