Sunday, January 6, 2013

0 ASM operations

SYSASM role privilege is required to manage and maintain the ASM instance and ASM disks.

 

Parameter file

The ASM instance parameter file is under $ORACLE_HOME.

image

show parameter spfile

image

 

SELECT
  NAME,
  VALUE,
  DESCRIPTION
FROM
  v$parameter

image

Start up/shutdown

startup/shutdwon require the sysasm privilege . SYSDBA would get the ORA-01031 insufficient privileges error.

image

  • NORMAL: The ASM instance waits for all connected ASM client and SQL sessions to exit then shuts down.
  • IMMEDIATE/TRANSACTIONAL: The ASM instance waits for any SQL transactions to complete then shuts down. It doesn't wait for sessions to exit. All the client needs to disconnect first.
  • ABORT - The ASM instance shuts down instantly.

Before shutdown ASM instance, all the connected client needs to disconnect first .

Below screenshot shows the ASM instance still have connected client therefore fail to shutdown with ORA-15097 cannot SHUTDOWN ASM instance with connected client error.

image

After all the client has been disconnected, we can shutdown the ASM instance.

image

shutdown abort does not needs to wait the ASM client to shutdown.

image

ASM instance only has 2 startup stages: MOUNT and NOMOUNT.

  • MOUNT: Starts the ASM instance and mounts the disk groups specified by the ASM_DISKGROUPS parameter.
  • NOMOUNT : Starts the ASM instance without mounting any disk groups.

image

Startup nomount, then we have to mount the disk manually.

 

image

startup force

Startup force would shutdown abort first than bring up the instance to mount.

image

Add disk to the disk group

  alter diskgroup DATA add disk 'ORCL:ASM3';

image

We can see the the diskgroup data has additional failover group.

SELECT
  group_number,label,name,path,mount_status,header_status, OS_MB,failgroup
FROM
  v$asm_disk;

image

From v$asm_operation, we can see the REBAL process is balance the allocation uint to the new failover group.

image

Remove disk form the disk group

alter diskgroup DATA drop disk ASM2;

image

 

Create disk group

 

CREATE diskgroup DATA2 NORMAL REDUNDANCY FAILGROUP FG1 DISK 'ORCL:ASM3' NAME
  ASM3 FAILGROUP FG2 DISK 'ORCL:ASM4' NAME ASM4
  ATTRIBUTE 'au_size' = '1M', 'compatible.asm'='11.2';

image

SELECT
  group_number,
  name,
  allocation_unit_size,
  state,
  total_MB,
  free_MB,
  compatibility
FROM
  v$asm_diskgroup;

image

drop disk group

drop diskgroup DATA2;

image

After the disk is being removed from diskgroup, we need to bounce the ASM instance in order to release the disk. 

Before the bounce.

image

After the bounce

image

In the “NORMAL REDUNDANCY” mode, we need to have at least 2 failgroups in the disk group.

If only has one failover group, we would see the ORA-15041 in the V$asm_operation.

image

Check disk

alter diskgroup data check all;

 

image

0 comments:

Post a Comment

 

SQL Panda Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates