버전 비교

  • 이 줄이 추가되었습니다.
  • 이 줄이 삭제되었습니다.
  • 서식이 변경되었습니다.

ASM 구성


ASM 인스턴스 및 디스크 그룹 생성

코드 블럭
languagebash
titleASM 인스턴스 및 디스크 그룹 생성
linenumberstrue
grid_env
asmca -silent -configureASM -sysAsmPassword <SYSASM 암호> -asmsnmpPassword <ASMSNMP 암호> -diskString 'ORCL:*' -diskGroupName CRS -diskList 'ORCL:CRS1,ORCL:CRS2,ORCL:CRS3' -redundancy NORMAL


펼치기


서식 미적용
[racdb1:/home/oracle]> grid_env

[+ASM1:/home/oracle]> asmca -silent -configureASM -sysAsmPassword oracle_4U -asmsnmpPassword oracle_4U -diskString 'ORCL:*' -diskGroupName CRS -diskList 'ORCL:CRS1,ORCL:CRS2,ORCL:CRS3' -redundancy NORMAL

ASM이 성공적으로 생성되고 시작되었습니다.

디스크 그룹 CRS이(가) 성공적으로 생성되었습니다.

[root@rac1 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
NAME+ASM1:/home/oracle]> asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576      3069     TARGET2764  STATE        SERVER   1023                STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------870              0             N  CRS/





코드 블럭
languagebash
titleDATA 및 FRA 디스크 그룹 추가 생성
linenumberstrue
asmca -silent -createDiskGroup -diskString 'ORCL:*' -diskGroupName DATA -disk 'ORCL:DATA' -redundancy EXTERNAL
asmca -silent -createDiskGroup -diskString 'ORCL:*' -diskGroupName FRA -disk 'ORCL:FRA' -redundancy EXTERNAL


펼치기


서식 미적용
[+ASM1:/home/oracle]> asmca -silent -createDiskGroup -diskString 'ORCL:*' -diskGroupName DATA -disk 'ORCL:DATA' -redundancy EXTERNAL

디스크 그룹 DATA이(가) 성공적으로 생성되었습니다.

[+ASM1:/home/oracle]> asmca -silent -createDiskGroup -diskString 'ORCL:*' -diskGroupName FRA -disk 'ORCL:FRA' -redundancy EXTERNAL

디스크 그룹 FRA이(가) 성공적으로 생성되었습니다.

[+ASM1:/home/oracle]> asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576      3069     2764             1023------------------------------------------
ora.CRS.dg
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac1
               ONLINE870  ONLINE       rac2
ora.asm
     0          ONLINE  ONLINE N  CRS/
MOUNTED  EXTERN  rac1N         512   4096  1048576     30719  Started
  30624             ONLINE  ONLINE 0      rac2     30624              0  Started
ora.gsd
           N  DATA/
MOUNTED  OFFLINEEXTERN OFFLINE N     rac1
    512   4096  1048576     20479 OFFLINE OFFLINE  20384    rac2
ora.net1.network
            0   ONLINE  ONLINE      20384 rac1
             0  ONLINE  ONLINE         N  FRA/




CRS 및 Vote 영역 ASM으로 이관

코드 블럭
languagebash
titleASM으로 OCR 영역 이관
linenumberstrue
ocrconfig -add +CRS
ocrconfig -delete /dev/raw/raw1
ocrconfig -delete /dev/raw/raw2
ocrcheck


펼치기


서식 미적용
[root@rac1 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version    rac2
ora.ons
               ONLINE  ONLINE       rac1
              : ONLINE  ONLINE       rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
3
         Total space (kbytes)     :     262120
       1  Used space (kbytes)    ONLINE  ONLINE:       rac2
ora.LISTENER_SCAN2.lsnr
3020
        1 Available space (kbytes) :    ONLINE 259100
 ONLINE       rac1
ora.LISTENER_SCAN3.lsnr
  ID     1        ONLINE  ONLINE       rac1
ora.cvu
 :  934357259
   1      Device/File Name ONLINE  ONLINE       rac1
ora.oc4j
: /dev/raw/raw1
      1        ONLINE  ONLINE       rac1
ora.rac1.vip
      1       Device/File ONLINEintegrity check ONLINEsucceeded
       rac1
ora.rac2.vip
  Device/File Name   1        ONLINE  ONLINE: /dev/raw/raw2
                   rac2
ora.racdb.db
      1        ONLINE  ONLINE Device/File integrity check succeeded

   rac1                     Open
      2      Device/File not ONLINEconfigured

  ONLINE       rac2                     Open
ora.scan1.vip
      1Device/File not configured

      ONLINE  ONLINE       rac2
ora.scan2.vip
      1        ONLINE  ONLINE     Device/File not rac1configured
ora.scan3.vip
      1   Cluster registry integrity check succeeded

  ONLINE  ONLINE     Logical  rac1
코드 블럭
languagebash
titleDATA 및 FRA 디스크 그룹 추가 생성
linenumberstrue
asmca -silent -createDiskGroup -diskString 'ORCL:*' -diskGroupName DATA -disk 'ORCL:DATA' -redundancy EXTERNAL
asmca -silent -createDiskGroup -diskString 'ORCL:*' -diskGroupName FRA -disk 'ORCL:FRA' -redundancy EXTERNAL
펼치기
서식 미적용
[+ASM1:/home/oracle]> asmca -silent -createDiskGroup -diskString 'ORCL:*' -diskGroupName DATA -disk 'ORCL:DATA' -redundancy EXTERNAL

디스크 그룹 DATA이(가) 성공적으로 생성되었습니다.

[+ASM1:/home/oracle]> asmca -silent -createDiskGroup -diskString 'ORCL:*' -diskGroupName FRA -disk 'ORCL:FRA' -redundancy EXTERNAL

디스크 그룹 FRA이(가) 성공적으로 생성되었습니다.

[root@rac2 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVERcorruption check succeeded

[root@rac1 ~]# ocrconfig -add +CRS

[root@rac1 ~]# ocrconfig -delete /dev/raw/raw1

[root@rac1 ~]# ocrconfig -delete /dev/raw/raw2

[root@rac1 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       3020
         Available space (kbytes) :     259100
         ID                       STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS.dg
 :  934357259
         Device/File Name         :     ONLINE  ONLINE+CRS
       rac1
               ONLINE  ONLINE       rac2
ora.DATA.dg
     Device/File integrity check succeeded

       ONLINE  ONLINE       rac1
               ONLINE  ONLINE   Device/File not   rac2
ora.FRA.dg
  configured

             ONLINE  ONLINE       rac1
              Device/File ONLINE  ONLINE       rac2
ora.LISTENER.lsnrnot configured

               ONLINE  ONLINE       rac1
            Device/File   ONLINE  ONLINE       rac2
ora.asmnot configured

               ONLINE  ONLINE       rac1            Device/File not configured

       Started
  Cluster registry integrity check succeeded

         ONLINELogical corruption ONLINE       rac2        check succeeded





코드 블럭
languagebash
titleASM으로 Vote 영역 이관
linenumberstrue
crsctl replace votedisk +CRS
crsctl query css votedisk


펼치기


서식 미적용
[root@rac1 ~]# crsctl query css votedisk
##  STATE    File Universal Id       Started
ora.gsd
         File Name Disk group
--  ----- OFFLINE OFFLINE  -----------------    rac1
               OFFLINE OFFLINE      rac2
ora.net1.network
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.ons
               ONLINE  ONLINE       rac1
        --------- ---------
 1. ONLINE   a4c3ccb126b64f4dbf3d89ae84d163a2 (/dev/raw/raw3) []
 2. ONLINE   31693ea2d7774f83bfd26b71d8173078 (/dev/raw/raw4) []
 3. ONLINE   7527b0194b634f7abfbc3c3501a8a6f4 (/dev/raw/raw5) []
Located 3 voting disk(s).

[root@rac1 ~]# crsctl replace votedisk +CRS
CRS-4256: Updating the profile
Successful addition of voting disk d10cbc0b84bb4fa1bf868c98b6cb9463.
Successful addition of voting disk 6d485ec847b34f48bf3cd1462e0ba114.
Successful addition of voting disk e42528b7cab34f88bf51951976a27e4a.
Successful deletion of voting disk a4c3ccb126b64f4dbf3d89ae84d163a2.
Successful deletion of voting disk 31693ea2d7774f83bfd26b71d8173078.
Successful deletion of voting disk 7527b0194b634f7abfbc3c3501a8a6f4.
Successfully replaced voting disk group with +CRS.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced

[root@rac1 ~]# crsctl query css votedisk
##  STATE    File Universal Id       ONLINE  ONLINE       rac2File Name Disk group
--  -----    -----------------                ---------------------- ---------
 1. ONLINE   d10cbc0b84bb4fa1bf868c98b6cb9463 (ORCL:CRS1) [CRS]
 2. ONLINE   6d485ec847b34f48bf3cd1462e0ba114 (ORCL:CRS2) [CRS]
 3. ONLINE   e42528b7cab34f88bf51951976a27e4a (ORCL:CRS3) [CRS]
Located 3 voting disk(s).




ASM 호환성 변경

코드 블럭
languagebash
titleASM 호환성 변경
linenumberstrue
asmcmd setattr -G CRS compatible.asm 11.2.0.2.0
asmcmd setattr -G DATA compatible.asm 11.2.0.2.0
asmcmd setattr -G FRA compatible.asm 11.2.0.2.0
asmcmd lsattr -G CRS -lm compatible.asm
asmcmd lsattr -G DATA -lm compatible.asm
asmcmd lsattr -G FRA -lm compatible.asm


펼치기


서식 미적용
[+ASM1:/home/oracle]> asmcmd lsattr -G CRS -lm compatible.asm
Group_Name  Name            Value       RO  Sys
CRS         compatible.asm  11.2.0.0.0  N   Y

[+ASM1:/home/oracle]> asmcmd lsattr -G DATA -lm compatible.asm
Group_Name  Name            Value       RO  Sys
DATA        compatible.asm  11.2.0.0.0  N   Y

[+ASM1:/home/oracle]> asmcmd lsattr -G FRA -lm compatible.asm
Group_Name  Name            Value       RO  Sys
FRA         compatible.asm  11.2.0.0.0  N   Y

[+ASM1:/home/oracle]> asmcmd setattr -G CRS compatible.asm 11.2.0.2.0
[+ASM1:/home/oracle]> asmcmd setattr -G DATA compatible.asm 11.2.0.2.0
[+ASM1:/home/oracle]> asmcmd setattr -G FRA compatible.asm 11.2.0.2.0

[+ASM1:/home/oracle]> asmcmd lsattr -G CRS -lm compatible.asm
Group_Name  Name            Value       RO  Sys
CRS         compatible.asm  11.2.0.2.0  N   Y

[+ASM1:/home/oracle]> asmcmd lsattr -G DATA -lm compatible.asm
Group_Name  Name            Value       RO  Sys
DATA        compatible.asm  11.2.0.2.0  N   Y

[+ASM1:/home/oracle]> asmcmd lsattr -G FRA -lm compatible.asm
Group_Name  Name            Value       RO  Sys
FRA         compatible.asm  11.2.0.2.0  N   Y



11g R2의 ASM을 19c로 업그레이드 하기 위해서는 ASM의 최소 호환성은 11.2.0.2 이상이어야 합니다.

ASM으로 Database 이관

사전 현황 조사

코드 블럭
title데이터 파일 현황 조사
linenumberstrue
select TABLESPACE_NAME, FILE_NAME, BYTES/1024/1024 MB 
from DBA_DATA_FILES;


펼치기


서식 미적용
SQL> col TABLESPACE_NAME form a20
SQL> col FILE_NAME form a20
SQL> col MB form 999,999

SQL> select TABLESPACE_NAME, FILE_NAME, BYTES/1024/1024 MB from DBA_DATA_FILES;

TABLESPACE FILE_NAME                  MB
---------- -------------------- --------
SYSTEM     /dev/raw/raw6           1,000
SYSAUX     /dev/raw/raw7           1,000
UNDOTBS1   /dev/raw/raw10          1,000
UNDOTBS2   /dev/raw/raw11          1,000
USERS      /dev/raw/raw8             500





코드 블럭
title임시 파일 현황 조사
linenumberstrue
select NAME, BYTES/1024/1024 MB 
from V$TEMPFILE;


펼치기


서식 미적용
SQL> col NAME form a20
SQL> col MB form 999,999

SQL> select NAME, BYTES/1024/1024 MB from V$TEMPFILE;

NAME                       MB
-------------------- --------
/dev/raw/raw9             699





코드 블럭
title컨트롤 파일 현황 조사
linenumberstrue
select NAME
from V$CONTROLFILE;


펼치기


서식 미적용
SQL> col NAME form a20

SQL> select NAME from V$CONTROLFILE;

NAME
--------------------
/dev/raw/raw12
/dev/raw/raw13





코드 블럭
titleRedo Log 현황 조사
linenumberstrue
select GROUP#, MEMBER 
from V$LOGFILE;


펼치기


서식 미적용
SQL> col MEMBER form a20

SQL> select GROUP#, MEMBER from V$LOGFILE;

    GROUP# MEMBER
---------- --------------------
         1 /dev/raw/raw14
         2 /dev/raw/raw15
         3 /dev/raw/raw16
         4 /dev/raw/raw17
         5 /dev/raw/raw18
         6 /dev/raw/raw19

6 rows selected.




Archive 모드 확인

코드 블럭
title운영 모드 현황 조사
linenumberstrue
archive log list;


펼치기


서식 미적용
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     18
Next log sequence to archive   20
Current log sequence           20




Data File 이관 준비

코드 블럭
titleRMAN으로 Database를 ASM 영역으로 복사
linenumberstrue
backup as copy database format '+DATA';


펼치기


서식 미적용
[racdb1:/home/oracle]> rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Apr 16 11:32:09 2020

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: RACDB (DBID=1035336379)

RMAN> backup as copy database format '+DATA';

Starting backup at 20/04/16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=23 instance=racdb1 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/dev/raw/raw6
output file name=+DATA/racdb/datafile/system.256.1037878345 tag=TAG20200416T113220 RECID=1 STAMP=1037878349
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/dev/raw/raw7
output file name=+DATA/racdb/datafile/sysaux.257.1037878355 tag=TAG20200416T113220 RECID=2 STAMP=1037878361
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/dev/raw/raw10
output file name=+DATA/racdb/datafile/undotbs1.258.1037878363 tag=TAG20200416T113220 RECID=3 STAMP=1037878368
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/dev/raw/raw11
output file name=+DATA/racdb/datafile/undotbs2.259.1037878371 tag=TAG20200416T113220 RECID=4 STAMP=1037878376
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/dev/raw/raw8
output file name=+DATA/racdb/datafile/users.260.1037878377 tag=TAG20200416T113220 RECID=5 STAMP=1037878380
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=+DATA/racdb/controlfile/backup.261.1037878385 tag=TAG20200416T113220 RECID=6 STAMP=1037878385
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 20/04/16
channel ORA_DISK_1: finished piece 1 at 20/04/16
piece handle=+DATA/racdb/backupset/2020_04_16/nnsnf0_tag20200416t113220_0.262.1037878387 tag=TAG20200416T113220 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 20/04/16

RMAN> exit


Recovery Manager complete.





코드 블럭
titleASM 사용을 위한 Database 파라미터 변경
linenumberstrue
alter system set db_recovery_file_dest='+FRA' sid='*';
alter system set db_create_file_dest='+DATA' sid='*';


펼치기


서식 미적용
SQL> alter system set db_recovery_file_dest='+FRA' sid='*';

System altered.

SQL> alter system set db_create_file_dest='+DATA' sid='*';

System altered.




파라미터 파일 ASM으로 이관

코드 블럭
title파라미터 파일 ASM 영역으로 이관
linenumberstrue
create pfile='$ORACLE_HOME/dbs/initracdb.ora' from spfile;
create spfile='+DATA/RACDB/spfileracdb.ora' from pfile='$ORACLE_HOME/dbs/initracdb.ora';


펼치기


서식 미적용
SQL> create pfile='$ORACLE_HOME/dbs/initracdb.ora' from spfile;

File created.

SQL> create spfile='+DATA/RACDB/spfileracdb.ora' from pfile='$ORACLE_HOME/dbs/initracdb.ora';

File created.





코드 블럭
languagebash
title파라미터 파일 변경 및 1번 노드 파일 수정
linenumberstrue
srvctl modify database -d racdb -p +DATA/RACDB/spfileracdb.ora
mv $DB_HOME/dbs/initracdb1.ora $DB_HOME/dbs/initracdb1.ora.raw
echo "spfile='+DATA/RACDB/spfileracdb.ora'" > $DB_HOME/dbs/initracdb1.ora


펼치기


서식 미적용
[racdb1:/home/oracle]> srvctl modify database -d racdb -p +DATA/RACDB/spfileracdb.ora

[racdb1:/home/oracle]> mv $DB_HOME/dbs/initracdb1.ora $DB_HOME/dbs/initracdb1.ora.raw

[racdb1:/home/oracle]> echo "spfile='+DATA/RACDB/spfileracdb.ora'" > $DB_HOME/dbs/initracdb1.ora

[racdb1:/home/oracle]> cat $DB_HOME/dbs/initracdb1.ora
spfile='+DATA/RACDB/spfileracdb.ora'





코드 블럭
languagebash
title2번 노드 파라미터 파일 수정
linenumberstrue
mv $DB_HOME/dbs/initracdb2.ora $DB_HOME/dbs/initracdb2.ora.raw
echo "spfile='+DATA/RACDB/spfileracdb.ora'" > $DB_HOME/dbs/initracdb2.ora


펼치기


서식 미적용
[racdb2:/home/oracle]> mv $DB_HOME/dbs/initracdb2.ora $DB_HOME/dbs/initracdb2.ora.raw

[racdb2:/home/oracle]> echo "spfile='+DATA/RACDB/spfileracdb.ora'" > $DB_HOME/dbs/initracdb2.ora

[racdb2:/home/oracle]> cat $DB_HOME/dbs/initracdb2.ora
spfile='+DATA/RACDB/spfileracdb.ora'





코드 블럭
title모든 노드 중지 후 1번 노드만 기동
linenumberstrue
srvctl stop database -d racdb -o immediate
srvctl start instance -d racdb -i racdb1 -o mount


펼치기


서식 미적용
[racdb1:/home/oracle]> srvctl stop database -d racdb -o immediate

[racdb1:/home/oracle]> srvctl start instance -d racdb -i racdb1 -o mount

[racdb1:/home/oracle]> crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.gsd
               OFFLINE OFFLINE      rac1
               OFFLINE OFFLINE      rac2
ora.net1.network
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.ons
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac2
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       rac1
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       rac1
ora.cvu
      1        ONLINE  ONLINE       rac1
ora.oc4j
      1        ONLINE  ONLINE       rac1
ora.rac1.vip
      1        ONLINE  ONLINE       rac1
ora.rac2.vip
      1        ONLINE  ONLINE       rac2
ora.racdb.db
      1        ONLINE  INTERMEDIATE rac1                     Mounted (Closed)
      2        OFFLINE OFFLINE                               Instance Shutdown
ora.scan1.vip
      1        ONLINE  ONLINE       rac2
ora.scan2.vip
      1        ONLINE  ONLINE       rac1
ora.scan3.vip
      1        ONLINE  ONLINE       rac1



ASM 영역으로 이관된 파라미터 파일을 적용하기 위해 데이터베이스를 재기동해야 합니다.

우선은 다른 파일들도 이관을 해야 하므로 1번 노드의 데이터베이스만 기동합니다.

컨트롤 파일 ASM으로 이관

코드 블럭
title콘트롤 파일 위치 변경 및 No Mount 모드로 기동
linenumberstrue
alter system set control_files='+DATA','+FRA' sid='*' scope=spfile;
startup force nomount;


펼치기


서식 미적용
SQL> alter system set control_files='+DATA','+FRA' sid='*' scope=spfile;

System altered.

SQL> startup force nomount;
ORACLE instance started.

Total System Global Area 3206836224 bytes
Fixed Size                  2257520 bytes
Variable Size             721423760 bytes
Database Buffers         2466250752 bytes
Redo Buffers               16904192 bytes



Raw Device에 있는 컨트롤 파일을 이관하기 위해 컨트롤 파일의 위치 파라미터를 수정하고, 데이터베이스를 No Mount 모드로 전환합니다.


코드 블럭
languagebash
titleASM 영역으로 컨트롤 파일 이관 및 적용
linenumberstrue
restore controlfile from '/dev/raw/raw12';
alter database mount;


펼치기


서식 미적용
[oracle@rac1 ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Apr 16 11:37:55 2020

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: RACDB (not mounted)

RMAN> restore controlfile from '/dev/raw/raw12';

Starting restore at 20/04/16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=141 instance=racdb1 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=+DATA/racdb/controlfile/current.264.1037878683
output file name=+FRA/racdb/controlfile/current.256.1037878683
Finished restore at 20/04/16

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1




데이터 파일 ASM 복제본으로 이관

코드 블럭
titleASM 영역의 데이터 파일로 이관
linenumberstrue
switch database to copy;
recover database;
alter database open;
shutdown immediate


펼치기


서식 미적용
RMAN> switch database to copy;

datafile 1 switched to datafile copy "+DATA/racdb/datafile/system.256.1037878345"
datafile 2 switched to datafile copy "+DATA/racdb/datafile/sysaux.257.1037878355"
datafile 3 switched to datafile copy "+DATA/racdb/datafile/undotbs1.258.1037878363"
datafile 4 switched to datafile copy "+DATA/racdb/datafile/undotbs2.259.1037878371"
datafile 5 switched to datafile copy "+DATA/racdb/datafile/users.260.1037878377"

RMAN> recover database;

Starting recover at 20/04/16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=141 instance=racdb1 device type=DISK

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 20/04/16

RMAN> alter database open;

database opened

RMAN> shutdown immediate

using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down

RMAN> exit


Recovery Manager complete.





코드 블럭
languagebash
title전체 노드 대상으로 데이터베이스 기동
linenumberstrue
srvctl start database -d racdb


펼치기


서식 미적용
[racdb1:/home/oracle]> srvctl start database -d racdb

[racdb1:/home/oracle]> crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS.dg
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.DATA.dg
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.FRA.dg
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.asm
               ONLINE  ONLINE       rac1                     Started
               ONLINE  ONLINE       rac2                     Started
ora.gsd
               OFFLINE OFFLINE      rac1
               OFFLINE OFFLINE      rac2
ora.net1.network
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
ora.ons
               ONLINE  ONLINE       rac1
               ONLINE  ONLINE       rac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac2
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       rac1
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       rac1
ora.cvu
      1        ONLINE  ONLINE       rac1
ora.oc4j
      1        ONLINE  ONLINE       rac1
ora.rac1.vip
      1        ONLINE  ONLINE       rac1
ora.rac2.vip
      1        ONLINE  ONLINE       rac2
ora.racdb.db
      1        ONLINE  ONLINE       rac1                     Open
      2        ONLINE  ONLINE       rac2                     Open
ora.scan1.vip
      1        ONLINE  ONLINE       rac2
ora.scan2.vip
      1        ONLINE  ONLINE       rac1
ora.scan3.vip
      1        ONLINE  ONLINE       rac1





코드 블럭
title임시 파일 ASM 영역으로 재생성
linenumberstrue
alter database tempfile '/dev/raw/raw9' drop;
alter tablespace TEMP add tempfile size 100m autoextend on maxsize 1G;


펼치기


서식 미적용
SQL> alter database tempfile '/dev/raw/raw9' drop;

Database altered.

SQL> alter tablespace TEMP add tempfile size 100m autoextend on maxsize 1G;

Tablespace altered.

SQL> col NAME form a50
SQL> select NAME from V$TEMPFILE;

NAME
--------------------------------------------------
+DATA/racdb/tempfile/temp.265.1037878839




ASM 영역으로 Redo Log 이관

코드 블럭
titleASM 영역으로 Redo Log 맴버 추가
linenumberstrue
alter database add logfile member '+DATA' to group 1;
alter database add logfile member '+DATA' to group 2;
alter database add logfile member '+DATA' to group 3;
alter database add logfile member '+DATA' to group 4;
alter database add logfile member '+DATA' to group 5;
alter database add logfile member '+DATA' to group 6;
alter database add logfile member '+FRA' to group 1;
alter database add logfile member '+FRA' to group 2;
alter database add logfile member '+FRA' to group 3;
alter database add logfile member '+FRA' to group 4;
alter database add logfile member '+FRA' to group 5;
alter database add logfile member '+FRA' to group 6;


펼치기


서식 미적용
SQL> alter database add logfile member '+DATA' to group 1;

Database altered.

SQL> alter database add logfile member '+DATA' to group 2;

Database altered.

SQL> alter database add logfile member '+DATA' to group 3;

Database altered.

SQL> alter database add logfile member '+DATA' to group 4;

Database altered.

SQL> alter database add logfile member '+DATA' to group 5;

Database altered.

SQL> alter database add logfile member '+DATA' to group 6;

Database altered.

SQL> alter database add logfile member '+FRA' to group 1;

Database altered.

SQL> alter database add logfile member '+FRA' to group 2;

Database altered.

SQL> alter database add logfile member '+FRA' to group 3;

Database altered.

SQL> alter database add logfile member '+FRA' to group 4;

Database altered.

SQL> alter database add logfile member '+FRA' to group 5;

Database altered.

SQL> alter database add logfile member '+FRA' to group 6;

Database altered.

SQL> set lines 200
SQL> set pages 100
SQL> col MEMBER form a50
SQL> col MEMBER form a50
SQL> col LOG_STATUS form a12
SQL> col FILE_STATUS form a12
SQL> select a.GROUP#, THREAD#, a.STATUS file_status, b.STATUS log_status, MEMBER
  2   from V$LOGFILE a, V$LOG b
  3   where a.GROUP# = b.GROUP#
  4   order by GROUP#, MEMBER;

    GROUP#    THREAD# FILE_STATUS  LOG_STATUS   MEMBER
---------- ---------- ------------ ------------ --------------------------------------------------
         1          1 INVALID      INACTIVE     +DATA/racdb/onlinelog/group_1.266.1037879561
         1          1 INVALID      INACTIVE     +FRA/racdb/onlinelog/group_1.257.1037879581
         1          1              INACTIVE     /dev/raw/raw14
         2          1 INVALID      CURRENT      +DATA/racdb/onlinelog/group_2.267.1037879565
         2          1 INVALID      CURRENT      +FRA/racdb/onlinelog/group_2.258.1037879585
         2          1              CURRENT      /dev/raw/raw15
         3          1 INVALID      INACTIVE     +DATA/racdb/onlinelog/group_3.268.1037879569
         3          1 INVALID      INACTIVE     +FRA/racdb/onlinelog/group_3.259.1037879587
         3          1              INACTIVE     /dev/raw/raw16
         4          2 INVALID      INACTIVE     +DATA/racdb/onlinelog/group_4.269.1037879571
         4          2 INVALID      INACTIVE     +FRA/racdb/onlinelog/group_4.260.1037879591
         4          2              INACTIVE     /dev/raw/raw17
         5          2 INVALID      INACTIVE     +DATA/racdb/onlinelog/group_5.270.1037879575
         5          2 INVALID      INACTIVE     +FRA/racdb/onlinelog/group_5.261.1037879593
         5          2              INACTIVE     /dev/raw/raw18
         6          2 INVALID      CURRENT      +DATA/racdb/onlinelog/group_6.271.1037879579
         6          2 INVALID      CURRENT      +FRA/racdb/onlinelog/group_6.262.1037879597
         6          2              CURRENT      /dev/raw/raw19

18 rows selected.





코드 블럭
title1번 노드 Raw Device 영역의 Redo Log 맴버 제거
linenumberstrue
alter database drop logfile member '/dev/raw/raw14';
alter database drop logfile member '/dev/raw/raw15';
alter database drop logfile member '/dev/raw/raw16';


펼치기


서식 미적용
SQL> alter database drop logfile member '/dev/raw/raw14';
alter database drop logfile member '/dev/raw/raw14'
*
ERROR at line 1:
ORA-00362: member is required to form a valid logfile in group 1
ORA-01517: log member: '/dev/raw/raw14'

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> select a.GROUP#, THREAD#, a.STATUS file_status, b.STATUS log_status, MEMBER
  2    from V$LOGFILE a, V$LOG b
  3   where a.GROUP# = b.GROUP#
  4   order by GROUP#, MEMBER;

    GROUP#    THREAD# FILE_STATUS  LOG_STATUS   MEMBER
---------- ---------- ------------ ------------ --------------------------------------------------
         1          1              CURRENT      +DATA/racdb/onlinelog/group_1.266.1037879561
         1          1              CURRENT      +FRA/racdb/onlinelog/group_1.257.1037879581
         1          1              CURRENT      /dev/raw/raw14
         2          1 INVALID      ACTIVE       +DATA/racdb/onlinelog/group_2.267.1037879565
         2          1 INVALID      ACTIVE       +FRA/racdb/onlinelog/group_2.258.1037879585
         2          1              ACTIVE       /dev/raw/raw15
         3          1              ACTIVE       +DATA/racdb/onlinelog/group_3.268.1037879569
         3          1              ACTIVE       +FRA/racdb/onlinelog/group_3.259.1037879587
         3          1              ACTIVE       /dev/raw/raw16
         4          2 INVALID      INACTIVE     +DATA/racdb/onlinelog/group_4.269.1037879571
         4          2 INVALID      INACTIVE     +FRA/racdb/onlinelog/group_4.260.1037879591
         4          2              INACTIVE     /dev/raw/raw17
         5          2 INVALID      INACTIVE     +DATA/racdb/onlinelog/group_5.270.1037879575
         5          2 INVALID      INACTIVE     +FRA/racdb/onlinelog/group_5.261.1037879593
         5-------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac2
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       rac1
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       rac1
ora.cvu
      1        ONLINE  ONLINE       rac1
ora.oc4j
      1        ONLINE  ONLINE       rac1
ora.rac1.vip
      1        ONLINE  ONLINE       rac1
ora.rac2.vip
      1        ONLINE  ONLINE       rac2
ora.racdb.db
      1        ONLINE  ONLINE       rac1           2          Open
    INACTIVE  2   /dev/raw/raw18
     ONLINE  ONLINE  6     rac2     2 INVALID      CURRENT         Open
ora.scan1.vip+DATA/racdb/onlinelog/group_6.271.1037879579
      1   6     ONLINE  ONLINE   2 INVALID   rac2
ora.scan2.vip
   CURRENT   1   +FRA/racdb/onlinelog/group_6.262.1037879597
     ONLINE  ONLINE  6     rac1
ora.scan3.vip
     2 1        ONLINE  ONLINE   CURRENT    rac1

CRS 및 Vote 영역 ASM으로 이관

코드 블럭
languagebash
titleASM으로 OCR 영역 이관
linenumberstrue
ocrconfig
 
-add
 
+CRS ocrconfig -delete
/dev/raw/
raw1 ocrconfig -delete /dev/raw/raw2 ocrcheck
펼치기
서식 미적용
[root@rac1 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       3020
         Available space (kbytes) :     259100
         ID                       :  934357259
         Device/File Name         : /dev/raw/raw1raw19

18 rows selected.

SQL> alter database drop logfile member '/dev/raw/raw14';
alter database drop logfile member '/dev/raw/raw14'
*
ERROR at line 1:
ORA-01609: log 1 is the current log for thread 1 - cannot drop members
ORA-00312: online log 1 thread 1: '/dev/raw/raw14'
ORA-00312: online log 1 thread 1: '+DATA/racdb/onlinelog/group_1.266.1037879561'
ORA-00312: online log 1 thread 1: '+FRA/racdb/onlinelog/group_1.257.1037879581'

SQL> alter system switch logfile;

System altered.

SQL> alter database drop logfile member '/dev/raw/raw14';

Database altered.

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> alter database drop logfile member '/dev/raw/raw15';

Database altered.

SQL> alter database drop logfile member '/dev/raw/raw16';

Database altered.

SQL> select a.GROUP#, THREAD#, a.STATUS file_status, b.STATUS log_status, MEMBER
  2    from V$LOGFILE a, V$LOG b
  3   where a.GROUP# = b.GROUP#
  4    order by GROUP#, MEMBER;

    GROUP#    THREAD# FILE_STATUS  LOG_STATUS   MEMBER
---------- ---------- ------------ ------------ --------------------------------------------------
         1          1              CURRENT   Device/File integrity check succeeded
         Device/File Name         : /dev/raw/raw2 +DATA/racdb/onlinelog/group_1.266.1037879561
         1          1              CURRENT   Device/File integrity check succeeded
 +FRA/racdb/onlinelog/group_1.257.1037879581
         2          1              ACTIVE   Device/File not configured

  +DATA/racdb/onlinelog/group_2.267.1037879565
         2          1              ACTIVE Device/File not configured

    +FRA/racdb/onlinelog/group_2.258.1037879585
         3          1             Device/File notACTIVE configured

         Cluster registry integrity check succeeded

  +DATA/racdb/onlinelog/group_3.268.1037879569
       Logical corruption check succeeded

[root@rac1 ~]# ocrconfig -add +CRS

[root@rac1 ~]# ocrconfig -delete /dev/raw/raw1

[root@rac1 ~]# ocrconfig -delete /dev/raw/raw2

[root@rac1 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
      3          1              ACTIVE     Version  +FRA/racdb/onlinelog/group_3.259.1037879587
         4       :   2 INVALID      3
INACTIVE     +DATA/racdb/onlinelog/group_4.269.1037879571
    Total space (kbytes)   4  :     262120
   2 INVALID     Used spaceINACTIVE (kbytes)    +FRA/racdb/onlinelog/group_4.260.1037879591
  :       3020
4         Available space2 (kbytes) :     259100
       INACTIVE  ID   /dev/raw/raw17
         5          2 :INVALID  934357259
    INACTIVE     Device/File Name+DATA/racdb/onlinelog/group_5.270.1037879575
         5  :       +CRS
 2 INVALID      INACTIVE     +FRA/racdb/onlinelog/group_5.261.1037879593
         5          2    Device/File integrity check succeeded

       INACTIVE     /dev/raw/raw18
         6          2 INVALID    Device/File not configured

CURRENT      +DATA/racdb/onlinelog/group_6.271.1037879579
         6          2 INVALID      CURRENT    Device/File not configured

 +FRA/racdb/onlinelog/group_6.262.1037879597
         6          2              CURRENT    Device/File not configured /dev/raw/raw19

15 rows selected.





코드 블럭
title2번 노드 Raw Device 영역의 Redo Log 맴버 제거
linenumberstrue
alter database drop logfile member '/dev/raw/raw17';
alter database drop logfile member '/dev/raw/raw18';
alter database drop logfile member '/dev/raw/raw19';


펼치기


서식 미적용
SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> alter database drop logfile member '/dev/raw/raw17';

Database altered.

SQL> alter  Device/File not configuredsystem switch logfile;

System altered.

SQL> alter database drop logfile member '/dev/raw/raw18';

Database altered.

SQL> Clusteralter registrysystem integrity check succeededswitch logfile;

System altered.

SQL> alter database drop logfile member '/dev/raw/raw19';

Database altered.

SQL> select Logical corruption check succeeded
코드 블럭
languagebash
titleASM으로 Vote 영역 이관
linenumberstrue
crsctl replace votedisk +CRS
crsctl query css votedisk
펼치기
서식 미적용
[root@rac1 ~]# crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    a.GROUP#, THREAD#, a.STATUS file_status, b.STATUS log_status, MEMBER
  2    from V$LOGFILE a, V$LOG b
  3   where a.GROUP# = b.GROUP#
  4   order by GROUP#, MEMBER;

    GROUP#    THREAD# FILE_STATUS  LOG_STATUS   MEMBER
---------- ---------- ------------ ------------ --------------------------------                --------- ---------
 1. ONLINE   a4c3ccb126b64f4dbf3d89ae84d163a2 (/dev/raw/raw3) []
 2. ONLINE1   31693ea2d7774f83bfd26b71d8173078 (/dev/raw/raw4) []
 3. ONLINE   7527b0194b634f7abfbc3c3501a8a6f4 (/dev/raw/raw5) []
Located 3 voting disk(s).

[root@rac1 ~]# crsctl replace votedisk +CRS
CRS-4256: Updating the profile
Successful addition of voting disk d10cbc0b84bb4fa1bf868c98b6cb9463.
Successful addition of voting disk 6d485ec847b34f48bf3cd1462e0ba114.
Successful addition of voting disk e42528b7cab34f88bf51951976a27e4a.
Successful deletion of voting disk a4c3ccb126b64f4dbf3d89ae84d163a2.
Successful deletion of voting disk 31693ea2d7774f83bfd26b71d8173078.
Successful deletion of voting disk 7527b0194b634f7abfbc3c3501a8a6f4.
Successfully replaced voting disk group with +CRS.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced

[root@rac1 ~]# crsctl query css votedisk
##  STATE    File Universal Id       1              CURRENT      +DATA/racdb/onlinelog/group_1.266.1037879561
         1          1              CURRENT      +FRA/racdb/onlinelog/group_1.257.1037879581
         2          1     File Name Disk group
--  -----    -----------------INACTIVE      +DATA/racdb/onlinelog/group_2.267.1037879565
          --------- ---------
 1. ONLINE2       d10cbc0b84bb4fa1bf868c98b6cb9463 (ORCL:CRS1) [CRS]
 2. ONLINE 1    6d485ec847b34f48bf3cd1462e0ba114 (ORCL:CRS2) [CRS]
 3. ONLINE   e42528b7cab34f88bf51951976a27e4a (ORCL:CRS3) [CRS]
Located 3 voting disk(s).

ASM 호환성 변경

코드 블럭
languagebash
titleASM 호환성 변경
linenumberstrue
asmcmd setattr
 
-G
 
CRS
 
compatible.asm 11.2.0.2.0 asmcmd setattr -G DATA compatible.asm 11.2.0.2.0 asmcmd setattr -G FRA compatible.asm 11.2.0.2.0 asmcmd lsattr -G CRS -lm compatible.asm asmcmd lsattr -G DATA -lm compatible.asm asmcmd lsattr -G FRA -lm compatible.asm
펼치기
서식 미적용
[+ASM1:/home/oracle]> asmcmd lsattr -G CRS -lm compatible.asm
Group_Name  Name      INACTIVE     +FRA/racdb/onlinelog/group_2.258.1037879585
         3          1              INACTIVE     +DATA/racdb/onlinelog/group_3.268.1037879569
       Value  3     RO  Sys
CRS   1      compatible.asm  11.2.0.0.0  N   Y

[+ASM1:/home/oracle]> asmcmd lsattr -G DATA -lm compatible.asm
Group_Name  Name INACTIVE     +FRA/racdb/onlinelog/group_3.259.1037879587
         4      Value    2   RO  Sys
DATA        compatible.asm  11.2.0.0.0CURRENT   N   Y

[+ASM1:/home/oracle]> asmcmd lsattr -G FRA -lm compatible.asm
Group_Name  Name+DATA/racdb/onlinelog/group_4.269.1037879571
         4     Value     2  RO  Sys
FRA         compatible.asm  11.2.0.0.0CURRENT   N   Y

[+ASM1:/home/oracle]> asmcmd setattr -G CRS compatible.asm 11.2.0.2.0
[+ASM1:/home/oracle]> asmcmd setattr -G DATA compatible.asm 11.2.0.2.0
[+ASM1:/home/oracle]> asmcmd setattr -G FRA compatible.asm 11.2.0.2.0

[+ASM1:/home/oracle]> asmcmd lsattr -G CRS -lm compatible.asm
Group_Name  Name     +FRA/racdb/onlinelog/group_4.260.1037879591
         5          2              INACTIVE     +DATA/racdb/onlinelog/group_5.270.1037879575
       Value  5     RO  Sys
CRS   2      compatible.asm  11.2.0.2.0  N   Y

[+ASM1:/home/oracle]> asmcmd lsattr -G DATA -lm compatible.asm
Group_Name  Name INACTIVE     +FRA/racdb/onlinelog/group_5.261.1037879593
         6       Value   2    RO  Sys
DATA        compatible.asmACTIVE  11.2.0.2.0  N   Y

[+ASM1:/home/oracle]> asmcmd lsattr -G FRA -lm compatible.asm
Group_Name  Name +DATA/racdb/onlinelog/group_6.271.1037879579
         6          2 Value       RO  Sys
FRA    ACTIVE     compatible.asm  11.2.0.2.0  N   Y

11g R2의 ASM을 19c로 업그레이드 하기 위해서는 ASM의 최소 호환성은 11.2.0.2 이상이어야 합니다.

ASM으로 Database 이관

code
+FRA/racdb/onlinelog/group_6.262.1037879597

12 rows selected.