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.
show parameter spfile
SELECT
NAME,
VALUE,
DESCRIPTION
FROM
v$parameter
Start up/shutdown
startup/shutdwon require the sysasm privilege . SYSDBA would get the ORA-01031 insufficient privileges error.
NORMAL:
The ASM instance waits for all connected ASM client and SQL sessions to exit then shuts down.IMMEDIATE/
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.TRANSACTIONAL:
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.
After all the client has been disconnected, we can shutdown the ASM instance.
shutdown abort does not needs to wait the ASM client to shutdown.
ASM instance only has 2 startup stages: MOUNT and NOMOUNT.
MOUNT:
Starts the ASM instance and mounts the disk groups specified by theASM_DISKGROUPS
parameter.NOMOUNT
: Starts the ASM instance without mounting any disk groups.
Startup nomount, then we have to mount the disk manually.
startup force
Startup force would shutdown abort first than bring up the instance to mount.
Add disk to the disk group
alter diskgroup DATA add disk 'ORCL:ASM3';
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;
From v$asm_operation, we can see the REBAL process is balance the allocation uint to the new failover group.
Remove disk form the disk group
alter diskgroup DATA drop disk ASM2;
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';
SELECT
group_number,
name,
allocation_unit_size,
state,
total_MB,
free_MB,
compatibility
FROM
v$asm_diskgroup;
drop disk group
drop diskgroup DATA2;
After the disk is being removed from diskgroup, we need to bounce the ASM instance in order to release the disk.
Before the bounce.
After the bounce
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.
Check disk
alter diskgroup data check all;
0 comments:
Post a Comment