ASM 11g New Features
Disk Group, Striping used 128Kb, automatic rebalance
+ Failure group, only for Normal o High Redundancy disk group
+ Disk
+ ASM File, max size 140 petabyes(11g), 35 terabytes(10g)
+ File Extent(1,4,16,32,64Mb), resides on single disk, a small extent extend to next size before creating the next extent reducing shared pool
+ AU Allocation Unit
#basic allocation unit
#[compatible.rdbms=11.1 size may be (1,2,4,8,16,32,64Mb)]
#[compatible.rdbms=10.2 size may be (1,2,4,8Mb)]
Db will automatically defragment on problems allocating/extending extents. Manual disk group rebalance avoid external fragmentation
Fast Mirror Resync
Requires compatible.rdbms=11.1
DISK_REPAIR_TIME(def. 3.6h) enable Fast Mirror Resync, if the disk is offline is not dropped until value specified. Default unit is hours.
alter diskgroup dgroupA set attribute 'disk_reair_time'="2D6H30M"
#change is effective only for online disks of the group
If no disk content is damaged or modified, temporary failure, resynchronize only changed extents
10g:
1) Take disk offline: alter disk group dgroup1 disk data_00001 drop after 0 h; # override disk_repair_time
2) Wipe out the disk headers: dd if=/dev/zero of=asm_disk1 bs=1024 count=100
3) Add disk back to group: alter diskgroup dgroup1 add disk '/dev/raw/raw1' size 100M;
11g:
alter diskgroup dA online disks all;
#takes online all disks for given diskgroup
alter diskgroup dgroupA online;
#Disk opened write only, stale extents only are copied, disk read/write
alter diskgroup dA offline disks in failuregroup f1 DROP AFTER 4h;
# override disk_repair_time. Keep disk offline not dropping for until the time specified. Remember that a disk group may have more failuregroups
alter diskgroup dA online disks in failuregroup f1 POWER 2 WAIT;
#wait 2 hours before bring dA online again. Remember that a disk group may have more failuregroups
alter diskgroup dA drop disks in failuregroup f1 FORCE;
#use to drop a disk group that you are unable to repair. Remember that a disk group may have more failuregroups
* Mirroring *
2 way, 3 way , external redundancy
Normal redundancy: 2 failure groups, 2 way mirroring, all local disk belong to same failure group, only 1 preferred failure group for group
High redundancy: 3 failure groups, 3 way mirroring, maximum of 2 failure groups for site with local disks,up to 2 preferred failure group for group
External redundancy: No failure groups
* ASM Preferred Mirror Read *
Requires compatible.rdbms=11.1
Once you configure a preferred mirror read (see asm_preferred_read_failure_groups), every node can read from its local disks, only local
create diskgroup dg6 external redundancy disk '/dev/raw/raw1' attribute 'au_size'='8M'; attribute 'compatible.asm'='11.1';
* OS User *
SYSASM instead of SYSDBA, member of OSASM group
grant sysasm to aldo;
Variable Size Extents
The extent size is automatically increased based on file size. Extent size can vary in a single file or across files. No manual configuration required.
Performances increased when opening files. Less memory to manage the extent map. Fewer extent pointers required
Compatibility Params
Compatibility can only be advanced
ASM 11g supports both 11g and 10g, compatible.asm and compatible.rdbms must be manually advanced since default values are 10.1
* Attributes *
compatible.rdbms #Default 10.1. The minimum db version to mount a disk group, once increased cannot be lowered. Must be advanced after advancing compatible.asm
#11.1 enable ASM Preferred Mirror Read, Fast Mirror Resync, Variable Size Extents, different Allocation Unit sizes(see AU Allocation Uint)
compatible.asm #Default 10.1. Control ASM data structure, cannot be lower than compatible.rdbms.
#Must be advanced before advancing compatible.rdbms
template.redundancy: unprotect, mirror, high
template.tname.striping: coarse, fine
* Check command *
Verify ASM disk group metadata directories, cross check files extent maps and allocation tables, check link between metadata directory and file directory,
check the link of the alias directory, check for unreachable blocks on metadata directories, repair[def.]/norepair, disk consistency if verified
10g: check all, file, disk, disks in failgroup; -> 11g: check;
Mount
alter diskgroup t dismount;
alter diskgroup t mount RESTRICT; or startup retrict;
#clients wont be able to access disk group, if you add a disk a rebalance is performed
alter diskgroup t dismount;
alter diskgroup t mount [NOFORCE(def.) | FORCE];
#NOFORCE wont mount an incomplete disk group.
#FORCE you must restore missing disk before disk_repair_time, FORCE requires at least one disk offline, FORCE fails if all disk are online
drop diskgroup g1 force include contents;
#Command fail if disk in use, must specify with
ASMCMD
cp +DATA/.../TBSFV.223.333 +DATA/.../pippo.bak #copy a file locally
cp +DATA/.../TBSFV.223.333 /home/.../pippo.bak #copy a file to the OS and viceversa
cp +DATA/.../TBSFV.223.333 +DATA/.../pippo.bak \sys@mydb . +ASM2 : +D2/jj/.../pippo.dbf #Copy to a remote ASM instance
lsdsk <-d><-i><-[l]k><-[l]s><-p>;
#list visible disk. In connected mode(default) reads V$... and GV$..., in non-connected scans disk headers after a warning message.
<-I> force non-connected mode
<-k> detailed infos
<-s> shows I/O stats
<-p> status
<-t> repair related infos
<-d> limits to disk group
read from headers
remap dg5 d1 5000-7500;
#remap a range of unreadable bad disk sectors with correct content. Repair blocks that have I/O errors. EM may also be used
md_backup [-b backup_file(def. ambr_backup_intermediate_file)] [-g 'diskgroup_name,diskgroup_name,...'];
#backup into a text file metadata infos
mkdir +DGROUP1/abc
mkalias TBSF.23.1222 +DGROUP1/abc/users.dbf
MD_RESTORE command
recreate diskgroups and restore its metadata only from the previously backed up file. Cannot recover corrupted data
md_restore [-b backup_file(def. ambr_backup_intermediate_file)]
<-t[FULL(create diskgroups and restore its metadata), NODG(restore metadata for an existing diskgroup), NEWDG(new diskgroup and restore metadata)]>;
<-f> write commands to a file
<-g> select diskgroups, all if undefined
<-o> rename diskgroup
<-i> ignore errors
md_restore -t newdg -o 'DGNAME=dg3:dg4' -b your_file
#restore dg3 giving a different name dg4
|