- ASM 디스크의 상태 확인 / 설명

 

               SQL>select group_number as "GRP#", name, mount_status as "MOUNT", header_status as "HEADER", mode_status as "MODE", state, free_mb from v$asm_disk where header_status='MEMBER' order by group_number, name;

 

1) MOUNT_STATUS: GROUP MOUNT에 관련된 인스턴스별 디스크의 상태 정보

 

⊙  MISSING:  ASM 메타데이터에는 디스크가 ASM diskgroup의 일부로 표기되어 있으나, 실제로는 스토리지 시스템 내에 표기된 이름의 디스크가 존재 하지 않는 상태

⊙  CLOSED: 스토리지상에 디스크는 존재하나 ASM에서 디스크로의 ACCESS가 불가한 상태

⊙  OPENED: 스토리지상에 디스크가 존재하고 ASM에서 디스크로의 ACCESS 되고 있는 상태로 현재 데이터베이스 인스턴스가 사용중인 DISKGROUP에 속한 디스크

⊙  CACHED: 스토리지상에 디스크가 존재하고 ASM에서 ACCESS 되고 있는 상태로, 마운트된 DISKGROUP에 속한 디스크

⊙  IGNORED: 시스템상에 디스크가 존재하나, ASM으로부터 무시되고 있는 상태

  CLOSING: 종료중인 디스크

 

2) HEADER_STATUS: DISCOVERY에 의해 보여지는 인스턴스별 디스크의 상태 정보

 

  UNKNOWN: ASM 디스크 헤더가 읽혀진 적이 없음

⊙  CANDIDATE: 디스크가 아직 DISKGROUP의 멤버가 아니며, ALTER DISKGROUP 문으로 DISKGROUP에 추가될 수 있음

  INCOMPATIBLE: 디스크 헤더의 버전이 ASM 소프트웨어 버전과 호환되지 않음

  PROVISIONED: 디스크가 아직 DISKGROUP의 멤버가 아니며, ALTER DISKGROUP 문으로 DISKGROUP에 추가될 수 있음. CANDIDATE 상태와는 다르며, 관리자가 ASM에 적합한 디스크로 만들기 위해 플랫폼에 기반한 특정 액션이 가해짐

  MEMBER: 현재 존재하는 DISKGROUP의 일원임

  FORMER: 디스크가 한때 DISKGROUP의 멤버였다가, 해당 DISKGROUP에서 완전히 DROP

  CONFLICT: 충돌이 발생해 ASM 디스크에 마운트 되지 못함

  FOREIGN: ASM이 아닌 다른 오라클 제품에 의해 생성된 데이터를 포함하고 있는 디스크. ( datafile, logfile, ocr disk)

 

3) MODE: 디스크에 어떤 종류의 I/O 요청이 허용되고 있는가에 대한 전반적인 상태

 

 ONLINE: 디스크가 ONLINE 이며 정상적으로 동작함

OFFLINE: 디스크가 OFFLINE이며 정상적으로 ACCESS 되지 않음

 

4) STATE: DISKGROUP에 대한 DISK의 전반적인 상태

 

  UNKNOWN: 알려지지 않음 (대게 아직 mount 되지 않은 경우의 디스크)

  NORMAL: 디스크가 온라인이고 정상적으로 동작함

  ADDING: 디스크가 디스크그룹에 추가됨

  DROPPING: 디스크가 수동으로 OFFLINE이 되었고, 데이터를 DISKGROUP내의 다른 디스크로 옮기기 위해 rebalance가 실행 될 것이다.

  HUNG: DROP될 디스크로부터 데이터를 relocate할 공간이 불충분하여 drop 오퍼레이션을 수행할 수 없는 상태

  FORCING: 디스크가 데이터를 offload 하지 않고 DISKGROUP으로부터 제거되고 있는 상태. 데이터는 redundant 카피로부터 recover 된다

  DROPPED: 디스크가 DISKGROUP으로부터 완전하게 제거된 상태

 ⊙

Posted by pat98

ASM에서 다음과 같은 view 들을 참조하여 정보를 확인할수 있다.

 

V$ASM_ALIAS
V$ASM_CLIENT
V$ASM_DISK
V$ASM_DISK_IOSTAT
V$ASM_DISK_STAT
V$ASM_DISKGROUP
V$ASM_DISKGROUP_STAT
V$ASM_FILE
V$ASM_TEMPLATE
V$ASM_USER
V$ASM_USERGROUP
V$ASM_USERGROUP_MEMBER

 

1. DISK GROUP 속성보기 (V$ASM_ATTRIBUTE)

 

SQL> SELECT dg.name AS diskgroup, SUBSTR(a.name,1,18) AS name,
     SUBSTR(a.value,1,24) AS value, read_only FROM V$ASM_DISKGROUP dg,
     V$ASM_ATTRIBUTE a WHERE dg.name = 'DATA'
     AND dg.group_number = a.group_number;

 

2. DISK GROUP 호환성 보기 (V$ASM_DISKGROUP)

 

SQL> SELECT name AS diskgroup, compatibility AS asm_compat,
     database_compatibility AS db_compat FROM V$ASM_DISKGROUP;

 

3. DISK GROUP 내 디스크 보기 (V$ASM_DISK)

 

SQL> SELECT SUBSTR(d.name,1,16) AS asmdisk, d.mount_status, d.state,
     dg.name AS diskgroup FROM V$ASM_DISKGROUP dg, V$ASM_DISK d
     WHERE dg.group_number = d.group_number;

 

4. DISK GROUP Client 보기 (V$ASM_CLIENT)

 

SQL> SELECT dg.name AS diskgroup, SUBSTR(c.instance_name,1,12) AS instance,
    SUBSTR(c.db_name,1,12) AS dbname, SUBSTR(c.SOFTWARE_VERSION,1,12) AS software,
    SUBSTR(c.COMPATIBLE_VERSION,1,12) AS compatible
    FROM V$ASM_DISKGROUP dg, V$ASM_CLIENT c 
    WHERE dg.group_number = c.group_number;

 

5. ASM FILE Access Control 정보 보기 (V$ASM_USER)

 

SQL> SELECT dg.name AS diskgroup, u.group_number, u.user_number, u.os_id, u.os_name
     FROM V$ASM_DISKGROUP dg, V$ASM_USER u
     WHERE dg.group_number = u.group_number AND dg.name = 'DATA';

 

6. ASM FILE Access Control 정보 보기 (V$ASM_USERGROUP)

 

SQL>  SELECT dg.name AS diskgroup, ug.group_number, ug.owner_number, u.os_name,
      ug.usergroup_number, ug.name FROM V$ASM_DISKGROUP dg, V$ASM_USER u, V$ASM_USERGROUP ug
      WHERE dg.group_number = ug.group_number AND dg.name = 'DATA'
      AND ug.owner_number = u.user_number;

 

7. ASM FILE Access Control 정보 보기 (V$ASM_USERGROUP_MEMBER)


SQL> SELECT dg.name AS diskgroup, um.group_number, um.member_number, u.os_name,
     um.usergroup_number, ug.name FROM V$ASM_DISKGROUP dg, V$ASM_USER u, V$ASM_USERGROUP_MEMBER um,
     V$ASM_USERGROUP ug WHERE dg.group_number = um.group_number AND
     dg.group_number = ug.group_number AND dg.group_number = u.group_number AND dg.name = 'DATA'
     AND um.member_number = u.user_number AND um.usergroup_number = ug.usergroup_number;

 

8. ASM FILE Access Control 정보 보기 (V$ASM_FILE)

 

SQL> SELECT dg.name AS diskgroup, a.name, f.permissions, f.user_number, u.os_name,
     f.usergroup_number, ug.NAME FROM V$ASM_DISKGROUP dg, V$ASM_USER u, V$ASM_USERGROUP ug,
     V$ASM_FILE f, V$ASM_ALIAS a WHERE dg.group_number = f.group_number AND
     dg.group_number = u.group_number AND dg.group_number = ug.group_number AND
     dg.name = 'FRA' AND f.usergroup_number = ug.usergroup_number AND f.user_number = u.user_number
     AND f.file_number = a.file_number;

 

9. Intelligent Data Placement 정보 (V$ASM_FILE)

 

SQL> SELECT dg.name AS diskgroup, f.file_number, f.primary_region, f.mirror_region, f.hot_reads,
       f.hot_writes,  f.cold_reads, f.cold_writes
       FROM V$ASM_DISKGROUP dg, V$ASM_FILE f
       WHERE dg.group_number = f.group_number and dg.name = 'DATA';

 

10. Intelligent Data Placement 정보 (V$ASM_TEMPLATE)

 

SQL> SELECT dg.name AS diskgroup, t.name, t.stripe, t.redundancy, t.primary_region, t.mirror_region
       FROM V$ASM_DISKGROUP dg, V$ASM_TEMPLATE t
       WHERE dg.group_number = t.group_number and dg.name = 'DATA' ORDER BY t.name;

Posted by pat98



Applies to:

Oracle Server - Enterprise Edition - Version: 11.1.0.6 to 11.2.0.2 - Release: 11.1 to 11.2
Information in this document applies to any platform.
Oracle Server Enterprise Edition - Version: 11.1 to 11.1
***Checked for relevance on 14-Jan-2011***

Goal

The purpose of this document is to provide information about the Copy the asm files between remote instances and local instances using ASMCMD.

Solution

11g new feature,you can use asmcmd to copy files between remote instances
Enables you to copy files between ASM disk groups on local instances and remote instances. You can also use this command to copy files from ASM disk groups to the operating system.

cp -ifr <source file name> <user_name>@<host_name>.<Port Number>.<SID>:<targer path>/<target file name>

user_name@host_name.<Port Number>.<SID>

The user_name, host_name, and SID are required. The default port number is 1521.


Example :-

asmcmd>cp -ifr +DATA/RAC/PARAMETERFILE/spfile.257.678975489 sys@stgrac1.1521.+ASM2:+FRA/RAC/ARCHIVELOG/spfile



Troubleshooting-ASMCMD remote copy

asmcmd remote copy works through listener connection.

ASMCMD remote connection can fail with below generic error.

ASMCMD-08202: internal error: [asmcmdshare_error_msg_05] [8201]

[8201] means unable to connect remote ASM Instance.

It could be due to following reason.

* not able to reach remote host.
* Remote host listener is down.
* Remote ASM Instance is not registered with listener and running non-default port.
* sysasm remote connection does not work.
* Incorrect password given for sys user.
* Remote ASM Instance password file missing.


We need to enable additional tracing for asmcmd connection to get a exact failure message.

++ set DBI_TRACE environment variable for asmcmd perl tracing.

export DBI_TRACE=1

++ Now connect using asmcmd and re-produce the issue.

Example 1:-

asmcmd>cp +data/spfileorcl.ora.289.686235413 sys@stgrac1.1521.+ASM1:+test

-> DBI->connect(dbi:Oracle:host=stgrac1;port=1521;sid=+ASM1, sys, ****, HASH (0x8b2b044))
connect using '(DESCRIPTION=(ADDRESS=(HOST=stgrac1)(PROTOCOL=tcp)(PORT=1521))(CONNECT_DATA=(SID=+ASM1)))'
ERROR: '1031' 'ORA-01031: insufficient privileges

(DBD ERROR: OCISessionBegin)'
<- DESTROY= undef at DBI.pm line 591
DBI connect('host=stgrac1;port=1521;sid=+ASM1','sys',...) failed: ORA-01031: insufficient privileges (DBD ERROR: OCISessionBegin)
KK FROM HERE A
ASMCMD-08202: internal error: [asmcmdshare_error_msg_05] [8201]


Here we can see that asmcmd copy failed due to ORA-01031.

ASMCMD uses SYSASM by default if -a option is not used.

Here the problem is sysasm privelege was not given to sys user on remote ASM Instance.

Given the SYSASM privilege to SYS ( or the user trying to connect ). When you grant a system privilege, the password file is updated.


SQL> grant sysasm to sys;
Grant succeeded.

SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS TRUE TRUE TRUE

Now the remote asmcmd copy works fine

For more detals,please go through the below notes

Note.730067.1 - Troubleshooting ORA-1031 Insufficient Privilege
Note.578796.1 - ORA-01031 While Connecting as SYSASM

Example 2:-

ASMCMD> cp -ifr thread_2_seq_5.264.678983423 sys@bderac2-vip.1521.+ASM2:+FRA/RAC/ARCHIVELOG/
Enter password: ***
ASMCMD-08016: copy source->'+FRA/RAC/ARCHIVELOG/2009_02_16/thread_2_seq_5.264.678983423' and target->'+FRA/RAC/ARCHIVELOG/thread_2_seq_5.264.678983423' failed
ORA-17628: Oracle error 19505 returned by remote Oracle server
ORA-06512: at "SYS.X$DBMS_DISKGROUP", line 258
ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute)
ASMCMD>


Solution:-

The cp command failed because the target ASM file name was not specified  or File name should not contain the file number/incarnation.We can not copy OMF form files without specifying file name

cp -ifr thread_2_seq_5.264.678983423 sys@bderac2-vip.1521.+ASM2:+FRA/RAC/ARCHIVELOG/thread_2_seq_5

The file number/incarnation will be created automatically during the copy.

Posted by pat98
이전버튼 1 이전버튼

05-09 18:52
Flag Counter
Yesterday
Today
Total

글 보관함

최근에 올라온 글

달력

 « |  » 2024.5
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

최근에 달린 댓글