Está en la página 1de 38

ASM HANDS-ON TRAINING

Lab 14 ASM 11g Compatibility Parameters and Resilience Test


Alejandro Vargas | Principal Support Consultant
Oracle Advanced Customer Services

INDEX

Summary.......................................................................................................................................................................2
Changing ASM Compatibility Parameters.....................................................................................................................2
Resilience Tests............................................................................................................................................................5
Configure Enterprise Manager......................................................................................................................................6
Enterprise Manager Quick Tour....................................................................................................................................9
Change Compatibility of FRADG using EM................................................................................................................20
Remove ASM Disk And Crash The ASM Instance On The Middle Of The Operation...............................................21
Add ASM Disks And Bring Down The ASM Instance On The Middle Of The Operation...........................................24
Destroy And Restore An ASM Disk In A Normal Redundancy Disk Group................................................................27
Reread from mirror side 'VOL5FG2' returns corrupted data.............................................................................................................30
Reread from mirror side 'VOL1FG1' succeeded................................................................................................................................30
Scripts..........................................................................................................................................................................33
run ..............................................................................................................................................................................33
asm_diskgroup_compatibility.sql................................................................................................................................36
asm_diskgroup.sql......................................................................................................................................................37
set_compatibility.sql....................................................................................................................................................38

1/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test

Summary

On this lab we will make a review of the 11g Compatibility Parameters and 3 Resilience Tests

The compatibility parameters compatible.asm and compatible.rdbms define the minimum ASM and database versions that
will be able to connect to a disk group. These parameters can be advanced only

On the resilience probe we will do the following tests

• Add ASM disks and bring down the ASM instance on the middle of the operation
• Remove ASM disks and bring down the ASM instance on the middle of the operation
• Destroy the ASM metadata and restore the disk

Changing ASM Compatibility Parameters

Move to directory /home/oracle/ASM-SCRIPTS/11gCOMPATIBILITY and execute the script named “run”

It will display 3 different scripts that can be run from this menu

oracle@asmxpt ~]$ cd /home/oracle/ASM-SCRIPTS/11gCOMPATIBILITY


[oracle@asmxpt 11gCOMPATIBILITY]$ ./run

ASM checkup scripts :

> asm_diskgroup_compatibility
> asm_diskgroup
> set_compatibility

2/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
type a name ...

Execute the asm_diskgroup_compatibility by copying its name to the prompt and hit enter.
The compatibility parameters are displayed

ASM checkup scripts :

> asm_diskgroup_compatibility
> asm_diskgroup
> set_compatibility

type a name ... asm_diskgroup_compatibility

Executing asm_diskgroup_compatibility

INS ASM CMP DB CMP NUM NAME SECTOR BLK AU SZ STATE TYPE TOT MB FREE MB MINSPC USABLE OFFLN
---- ------------ ------------ ---- ---------- ------ ------ ---------- ---------- ---------- ------ ------- ------- ------- -------
1 10.1.0.0.0 10.1.0.0.0 1 DATADGNR 512 4096 1048576 MOUNTED NORMAL 8188 3962 2047 957 0
1 10.1.0.0.0 10.1.0.0.0 2 FRADG 512 4096 1048576 MOUNTED EXTERN 6141 4339 0 4339 0

press enter to continue...

Execute the asm_diskgroup by copying its name to the prompt and hit enter.

ASM checkup scripts :

> asm_diskgroup_compatibility
> asm_diskgroup
> set_compatibility

type a name ... asm_diskgroup

3/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
Executing asm_diskgroup

DISK_GROUP TOTAL_MB FREE_MB TYPE USABLE_FREE_MB REQ_MIRROR_FREE REDUNDANCY_FACTOR


---------- -------- -------- ---------- -------------- --------------- -----------------
DATADGNR 8,188 3,962 NORMAL 957 2,047 2
FRADG 6,141 4,339 EXTERN 4,339 0 1

press enter to continue...

Execute the set_compatibility script by copying its name to the prompt and hit enter.
The script will request the name of the diskgroup to change the compatibility parameters

ASM checkup scripts :

> asm_diskgroup_compatibility
> asm_diskgroup
> set_compatibility

type a name ... set_compatibility

Enter Disk Group name to set compatibility: datadgnr

The script display the original setting and after the change

Executing set_compatibility

INS ASM CMP DB CMP NUM NAME SECTOR BLK AU SZ STATE TYPE TOT MB FREE MB MINSPC USABLE OFFLN
---- ------------ ------------ ---- ---------- ------ ------ ---------- ---------- ---------- ------ ------- ------- ------- -------
1 10.1.0.0.0 10.1.0.0.0 1 DATADGNR 512 4096 1048576 MOUNTED NORMAL 8188 3962 2047 957 0
1 10.1.0.0.0 10.1.0.0.0 2 FRADG 512 4096 1048576 MOUNTED EXTERN 6141 4339 0 4339 0

4/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test

INS ASM CMP DB CMP NUM NAME SECTOR BLK AU SZ STATE TYPE TOT MB FREE MB MINSPC USABLE OFFLN
---- ------------ ------------ ---- ---------- ------ ------ ---------- ---------- ---------- ------ ------- ------- ------- -------
1 11.1.0.0.0 11.1.0.0.0 1 DATADGNR 512 4096 1048576 MOUNTED NORMAL 8188 3960 2047 956 0
1 10.1.0.0.0 10.1.0.0.0 2 FRADG 512 4096 1048576 MOUNTED EXTERN 6141 4339 0 4339 0

Resilience Tests

Before implementing the resilience test we will configure Enterprise Manager so that we can monitor using the ASM
graphic interface. The first thing to do that is to raise up the available memory for the VM to 2GB if not already set

The following snapshot show how the memory utilization goes up when we start ASM, DB and EM

ASM and Database down

[oracle@asmxpt ~]$ free


total used free shared buffers cached
Mem: 2230192 702064 1528128 0 26260 377708
-/+ buffers/cache: 298096 1932096
Swap: 2040244 0 2040244

ASM UP

[oracle@asmxpt ~]$ free


total used free shared buffers cached
Mem: 2230192 1188428 1041764 0 27088 788388
-/+ buffers/cache: 372952 1857240
Swap: 2040244 0 2040244

ASM and Database UP

5/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
[oracle@asmxpt ~]$ free
total used free shared buffers cached
Mem: 2230192 1233476 996716 0 27316 800892
-/+ buffers/cache: 405268 1824924
Swap: 2040244 0 2040244

ASM, Database and EM UP

[oracle@asmxpt ~]$ free


total used free shared buffers cached
Mem: 2230192 1636776 593416 0 31584 972544
-/+ buffers/cache: 632648 1597544
Swap: 2040244 0 2040244

Configure Enterprise Manager


This part of the lab will be done with the help of enterprise manager, it will provide us also some time to review the main
features of ASM management using the GUI

[oracle@asmxpt 11g_db]$ emca -config dbcontrol db

STARTED EMCA at Feb 16, 2009 11:10:36 PM


EM Configuration Assistant, Version 11.1.0.7.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:


Database SID: sati11
Database Control is already configured for the database sati11
You have chosen to configure Database Control for managing the database sati11
This will remove the existing configuration and the default settings and perform a fresh
configuration
Do you wish to continue? [yes(Y)/no(N)]: Y

6/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Password for SYSMAN user: Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [ /u01/app/oracle/11g_db ]:
ASM SID [ +ASM ]:
ASM port [ 1521 ]:
ASM user role [ SYSDBA ]:
ASM username [ SYS ]:
ASM user password:
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/11g_db

Local hostname ................ localhost.localdomain


Listener port number ................ 1521
Database SID ................ sati11
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
ASM ORACLE_HOME ................ /u01/app/oracle/11g_db
ASM SID ................ +ASM
ASM port ................ 1521
ASM user role ................ SYSDBA
ASM username ................ SYS

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Feb 16, 2009 11:11:49 PM oracle.sysman.emcp.EMConfig perform

7/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
INFO: This operation is being logged at
/u01/app/oracle/cfgtoollogs/emca/sati11/emca_2009_02_16_23_10_36.log.
Feb 16, 2009 11:11:53 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Feb 16, 2009 11:12:10 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Feb 16, 2009 11:14:22 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Feb 16, 2009 11:14:39 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library is already configured.
Feb 16, 2009 11:14:39 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: EM_SWLIB_STAGE_LOC (value) will be ignored.
Feb 16, 2009 11:14:39 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Feb 16, 2009 11:14:53 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Feb 16, 2009 11:14:53 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Feb 16, 2009 11:15:09 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Feb 16, 2009 11:15:09 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Feb 16, 2009 11:17:13 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Feb 16, 2009 11:17:13 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://localhost.localdomain:1158/em <<<<<<<<<<<
Feb 16, 2009 11:17:33 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************ WARNING ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will

8/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
be encrypted. The encryption key has been placed in the file:
/u01/app/oracle/11g_db/localhost.localdomain_sati11/sysman/config/emkey.ora. Please
ensure this file is backed up as the encrypted data will become unusable if this file is
lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Feb 16, 2009 11:17:33 PM

Enterprise Manager Quick Tour

9/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
On the database main page we use the ASM link to get into the ASM Main page

10/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
The ASM main Page provide a general overview of space usage and links to the management areas

11/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
On the performance page we have four metrics displayed.

At the left side of the bottom of the page we have a link to IO cumulative statistics that are very useful to have feedback
about how well is the storage performing :

12/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
On the IO cumulative statistics page we can get response time per LUN, throughput and volume of reads and writes, that
is very useful

13/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
On the disk groups page we see information at a glance of configuration and space usage

14/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
The datadgnr disk group page open this information at the level of ASM disks and provides management options

15/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
On the fradg disk group page we can see the configuration information, their disk compatibility is still set to 10g

16/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test

From the disk group page we can drill down throug the files link and see the directory structure and on the directories the
ASM files

17/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
This is the templates management page

18/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
This is the users management page

19/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test

Change Compatibility of FRADG using EM

On the disk group we select all ASM disks, choose edit and change the compatibility to 11.1.0

ALTER DISKGROUP FRADG SET ATTRIBUTE 'compatible.asm' = '11.1.0.0.0'


ALTER DISKGROUP FRADG SET ATTRIBUTE 'compatible.rdbms' = '11.1.0.0.0'

20/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test

Remove ASM Disk And Crash The ASM Instance On The Middle Of The Operation

This test checks ASM resilience in the event of a crash when removing an ASM disk.

We select one of the disks of the FRADG disk group and click on remove.

ALTER DISKGROUP FRADG DROP DISK FRADG_0002

We check that the rebalance process is running and on a shell window we do kill -9 to all ASM processes, before the
rebalance completes

[oracle@asmxpt ~]$ ps -efa | grep asm_ | grep -v grep | awk '{print $2}' | xargs kill -9
[oracle@asmxpt ~]$ ps -efa | grep asm_
oracle 23718 13896 0 10:55 pts/3 00:00:00 grep asm_

21/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test

On Enterprise manager we get this error when refreshing the screen

On ASM alert log we see these errors

ASM/incident/incdir_4801/+ASM_ora_14684_i4801.trc
Errors in file /u01/app/oracle/diag/asm/+ASM/trace/diag/asm/+asm/
+ASM/incident/incdir_4801/
+ASM_ora_14684_i4801.trc:
ORA-00603: ORACLE server session terminated by fatal error
ORA-00488: RBAL process terminated with error
ORA-00488: RBAL process terminated with error
ORA-00488: RBAL process terminated with error
Instance terminated by USER, pid = 8613

We do restart to the ASM instance and Database, when ASM comes up we see on the alert log that rebalance of FRADG
continues

NOTE: Instance updated compatible.asm to 11.1.0.0.0 for grp 2


SUCCESS: diskgroup FRADG was mounted
SUCCESS: ALTER DISKGROUP ALL MOUNT
NOTE: ASM did COD recovery for group 2/0xd2c11cba (FRADG)
NOTE: starting rebalance of group 2/0xd2c11cba (FRADG) at power 1

22/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
Starting background process ARB0

After a while the rebalance process completed successfully

NOTE: stopping process ARB0


SUCCESS: rebalance completed for group 2/0xd2c11cba (FRADG)
Tue Feb 17 11:07:00 2009
NOTE: requesting all-instance membership refresh for group=2
NOTE: initiating PST update: grp = 2
kfdp_update(): 9
Tue Feb 17 11:07:03 2009
kfdp_updateBg(): 9
NOTE: PST update grp = 2 completed successfully
SUCCESS: grp 2 disk FRADG_0002 emptied
WARNING: initiating offline of disk 2.3914460245 (FRADG_0002) with mask 0xa

To restore EM we do stop and start to dbconsole, once restarted we go to the FRADG disk group page and see that the
3rd disk was cleared

23/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test

Add ASM Disks And Bring Down The ASM Instance On The Middle Of The Operation

This test checks ASM resilience in the event of a crash when adding an ASM disk.

On the ASM disk group page we click on add to add the disk we removed from FRADG on the previous step

On the add disk page we set the name and failure group of the new ASM disk for this normal redundancy disk group

ALTER DISKGROUP DATADGNR ADD FAILGROUP FG2 DISK 'ORCL:VOLBLK2' NAME VOL5FG2 SIZE 2047 M

Before executing the add disk we prepare the command to crash the ASM instance on a shell window

24/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test

Once we execute the add disk we check that the rebalance process is running

And immediately on the shell window we do kill -9 to all ASM processes, before the rebalance completes, as we did on
the previous test

[oracle@asmxpt ~]$ ps -efa | grep asm_ | grep -v grep | awk '{print $2}' | xargs kill -9
[oracle@asmxpt ~]$ ps -efa | grep asm_ | grep -v grep
[oracle@asmxpt ~]$

On ASM alert log we see

SUCCESS: ALTER DISKGROUP DATADGNR ADD FAILGROUP FG2 DISK 'ORCL:VOLBLK2' NAME VOL5FG2 SIZE
2047 M
Tue Feb 17 11:31:28 2009
ARB0 started with pid=16, OS id=3978
NOTE: assigning ARB0 to group 1/0xd2c11cb9 (DATADGNR)
Tue Feb 17 11:33:19 2009
USER (ospid: 27637): terminating the instance due to error 472
Instance terminated by USER, pid = 27637

We do restart to the ASM instance and Database, when ASM comes up we see on the alert log that rebalance of
DATADGNR continues

SUCCESS: diskgroup DATADGNR was mounted

25/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
NOTE: ASM did COD recovery for group 1/0x73b436cb (DATADGNR)
NOTE: starting rebalance of group 1/0x73b436cb (DATADGNR) at power 1
Starting background process ARB0
Tue Feb 17 11:40:08 2009
ARB0 started with pid=15, OS id=8150
NOTE: assigning ARB0 to group 1/0x73b436cb (DATADGNR)

After a while the rebalance process on disk group DATADGNR finish

SUCCESS: rebalance completed for group 1/0x73b436cb (DATADGNR)


Tue Feb 17 11:45:21 2009
NOTE: requesting all-instance membership refresh for group=1
NOTE: initiating PST update: grp = 1
kfdp_update(): 9
Tue Feb 17 11:45:24 2009
kfdp_updateBg(): 9
NOTE: PST update grp = 1 completed successfully

The disk group has the new disk on FG2 well balanced with the other disks

26/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test

Destroy And Restore An ASM Disk In A Normal Redundancy Disk Group

On this test we will destroy metadata on one of the ASM disks while we run some load, then we will restore the disk.

First we will refresh our backups.

[oracle@asmxpt ~]$ cd /home/oracle/RMAN-SCRIPTS


[oracle@asmxpt ~/RMAN-SCRIPTS]$ rman target / @backup-incr-lev0-plus-recover.rmn
... ... ...
[oracle@asmxpt ~/RMAN-SCRIPTS]$ rman target / @backup-controlfile
... ... ...
[oracle@asmxpt ~/RMAN-SCRIPTS]$ rman target / @rman-maintenance.rmn
... ... ...

We will use disk /dev/sdg1 of the FG2 failure group, to crash it.

[oracle@asmxpt ~/ASM-SH-SCRIPTS]$ ./chkasmmapf

ASM disk based on Minor,Major Size (Mb)


=============== ============= =========== =========
VOL1 /dev/sdb1 [8, 17] 2,047
VOL2 /dev/sdc1 [8, 33] 2,047
VOL3B /dev/sdd1 [8, 49] 2,047
VOL4 /dev/sde1 [8, 65] 2,047
VOLBLK1 /dev/sdf1 [8, 81] 2,047
VOLBLK2 /dev/sdg1 [8, 97] 2,047
VOLBLK3 /dev/sdh1 [8, 113] 2,047

On a shell window we will prepare the command to wipe out metadata on disk

27/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
[oracle@asmxpt ~/ASM-SH-SCRIPTS]$ su -
Password:
[root@asmxpt ~]# dd if=/dev/zero of=/dev/sdg1 bs=1024k count=55

We have monitoring on the database and ASM alert logs and the DATADGNR disk group page on Enterprise Manager

28/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
Now we run some load and remove the ASM disk metadata

[oracle@asmxpt ~/ASM-SH-SCRIPTS]$ su -
Password:
[root@asmxpt ~]# dd if=/dev/zero of=/dev/sdg1 bs=1024k count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.846672 seconds, 124 MB/s
[root@asmxpt ~]# exit
logout

On EM we see the header status changed to candidate

As root we remove and recreate the failed disk with a new name

[root@asmxpt ~]# oracleasm deletedisk VOLBLK2


Removing ASM disk "VOLBLK2": [ OK ]
[root@asmxpt ~]# oracleasm createdisk VOL5 /dev/sdg1
Marking disk "/dev/sdg1" as an ASM disk: [ OK ]
[root@asmxpt ~]# oracleasm scandisks
Scanning system for ASM disks: [ OK ]

Meantime the Database noticed the problem and reports it on the alert log. Remember that is the database that read and
write directly to disk while ASM only maintains metada, so far it succeed to read from the failure group

29/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test

Reread from mirror side 'VOL5FG2' returns corrupted data


Reread from mirror side 'VOL1FG1' succeeded
Reread from mirror side 'VOL5FG2' returns corrupted data
Reread from mirror side 'VOL1FG1' succeeded

Status from v$asm_disk is as follows, VOL5 is the new ASM disk and VOLBLK2 the failed one

PATH HEADER_STATU NAME CREATE_DATE MOUNT_DATE


--------------- ------------ ------------------------- ----------------- -----------------
ORCL:VOL5 PROVISIONED
ORCL:VOL1 MEMBER VOL1FG1 17/02/09 15:22:47 17/02/09 15:23:00
ORCL:VOL2 MEMBER VOL2FG1 17/02/09 15:22:47 17/02/09 15:23:00
ORCL:VOL3B MEMBER VOL3FG2 17/02/09 15:22:47 17/02/09 15:23:00
ORCL:VOLBLK1 MEMBER FRADG_0000 12/02/09 01:25:07 17/02/09 13:43:09
ORCL:VOL4 MEMBER VOL4FG2 17/02/09 15:22:47 17/02/09 15:23:00
ORCL:VOLBLK3 MEMBER FRADG_0001 12/02/09 01:25:07 17/02/09 13:43:09
ORCL:VOLBLK2 PROVISIONED VOL5FG2 17/02/09 16:25:04 17/02/09 16:25:04

Now we will add the new disk to the DATADGBR disk group again

ALTER DISKGROUP DATADGNR ADD FAILGROUP FG2 DISK 'ORCL:VOL5' NAME VOL5FG2 SIZE 2047 M REBALANCE POWER 1

The disk was successfully added and the rebalance process of FG2 started

30/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test

Once the new Disk is successfully added the old disk is automatically removed

SUCCESS: disk VOL5FG2 (4.3915289406) renamed to _DROPPED_0004_DATADGNR in diskgroup DATADGNR


Tue Feb 17 17:34:24 2009
SUCCESS: disk _DROPPED_0004_DATADGNR (4.3915289406) dropped from diskgroup DATADGNR

Check the mapping

[oracle@asmxpt ~/ASM-SH-SCRIPTS]$ ./chkasmmapf

ASM disk based on Minor,Major Size (Mb)


=============== ============= =========== =========
VOL1 /dev/sdb1 [8, 17] 2,047
VOL2 /dev/sdc1 [8, 33] 2,047
VOL3B /dev/sdd1 [8, 49] 2,047
VOL4 /dev/sde1 [8, 65] 2,047
VOL5 /dev/sdg1 [8, 97] 2,047
VOLBLK1 /dev/sdf1 [8, 81] 2,047
VOLBLK3 /dev/sdh1 [8, 113] 2,047

31/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
The diskgroup once the rebalance finished

32/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test

Scripts

run

This script is located on the /home/oracle/ASM-SCRIPTS/11gCOMPATIBILITY directory and provide a mean to execute
the set comptability script it uses a parameter file set-environment to configure to which asm instance to connect

#!/bin/tcsh
# ----------------
# set-environement
# ----------------
# Provide variable setings for the execution of the local sql scripts
# -------------------------------------------------------------------
setenv ORACLE_HOME /u01/app/oracle/11g_db
setenv PATH ${ORACLE_HOME}/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:
/usr/java/jre1.5.0_10/bin:/home/oracle/bin:/sbin:/usr/sbin:/etc/init.d
setenv ORACLE_SID +ASM
setenv dbauser sys
setenv dbapwd oracle
setenv datadb sati11
setenv sqlpath /home/oracle/ASM-SCRIPTS/ASM/11gCOMPAT
clear
echo
# --------------------
# eof set-environement
# --------------------

#!/bin/tcsh
# run
# ---

33/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
# This script read the sql scripts on the current directory and executes them when requested
# ------------------------------------------------------------------------------------------
source ./set-environment
clear

if ( $#argv == 0 ) then
echo
echo "ASM checkup scripts :"
echo
foreach scr (`ls *sql | grep -v env | awk -F\. '{print $1}'`)
echo " > $scr"
end
echo
echo -n "type a name ... "
set scr = $<
else if ( $#argv > 0 ) then
set scr=$1
endif

if ( $scr == "" ) then


clear
exit
endif

if ( $scr == "set_compatibility" ) then


echo
echo -n "Enter Disk Group name to set compatibility : "
set v_dg = $<
clear
echo
echo Executing $scr

34/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
echo

sqlplus -s $dbauser/$dbapwd@+ASM as sysasm <<eof


@@sqlenv
@@$scr $v_dg
eof
echo
echo
exit

endif

clear
echo
echo Executing $scr
echo

sqlplus -s $dbauser/$dbapwd@+ASM as sysasm <<eof


@@sqlenv
@@$scr
eof
echo
echo -n "press enter to continue... "
set scr = $<
./run
echo
# -------
# eof run
# -------

35/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
asm_diskgroup_compatibility.sql

-- asm_diskgroup_compatibility.sql
-- -------------------------------
-- -----------------------------------------------
-- Display ASM diskgroup compatibility information
-- -----------------------------------------------
set pages 50000 lines 200
col inst_id for 999 head INS
col number_kfgrp for 999 head NUM
col name_kfgrp for a10 head NAME
col sector_kfgrp for 9999 head SECTOR
col blksize_kfgrp for 99999 head BLK
col ausize_kfgrp head 999999 head "AU SZ"
col state for a10
col type for a10
col totmb_kfgrp for 99999 head "TOT MB"
col freemb_kfgrp for 999999 head "FREE MB"
col minspc_kfgrp for 999999 head MINSPC
col usable_kfgrp for 999999 head USABLE
col offline_kfgrp for 999999 head OFFLN
col compat_kfgrp for a12 head "ASM CMP"
col dbcompat_kfgrp for a12 head "DB CMP"

select g.inst_id,
g.compat_kfgrp,
g.dbcompat_kfgrp,
g.number_kfgrp,
g.name_kfgrp,
g.sector_kfgrp,
g.blksize_kfgrp,
g.ausize_kfgrp,
decode(g.state_kfgrp, 0, 'INVALID', 1, 'UNKNOWN', 2, 'DISMOUNTED', 3, 'CREATING', 4,

36/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
'MOUNTING', 5, 'MOUNTED', 6, 'DISMOUNTING', 7, 'CONNECTED', 8, 'BROKEN', 9, 'CONNECTING', 10,
'BREAKING', 11, 'DROPPING' , 12, 'DROPPING', 255, 'RESTRICTED') STATE,
decode(g.type_kfgrp, 1, 'EXTERN', 2, 'NORMAL', 3, 'HIGH') TYPE,
g.totmb_kfgrp,
g.freemb_kfgrp,
g.minspc_kfgrp,
g.usable_kfgrp,
g.offline_kfgrp
from x$kfgrp g
where state_kfgrp != 0
/
-- -----------------------------------
-- eof asm_diskgroup_compatibility.sql
-- -----------------------------------

asm_diskgroup.sql

-- asm_diskgroup.sql
-- -----------------
-- ---------------------------------
-- Display ASM diskgroup information
-- ---------------------------------
set pages 50000 lines 200
col Disk_Group_Name for a10
col Total_MB for 999,999
col Free_MB for 999,999
col Type for a10
col Usable_Free_MB for 999,999
col Req_Mirror_Free for 999,999
col redundancy_factor for 999,999

select dg.name Disk_Group_Name,


NVL(dg.total_mb,0) Total_MB,

37/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
NVL(dg.free_mb, 0) Free_MB,
type Type,
NVL(dg.usable_file_mb, 0) Usable_Free_MB,
NVL(dg.required_mirror_free_mb, 0) Req_Mirror_Free,
decode(type,'EXTERN',1,'NORMAL',2,'HIGH',3,1) redundancy_factor
from V$ASM_DISKGROUP_STAT dg
where state = 'MOUNTED' ;
-- ---------------------------------
-- asm_diskgroup.sql
-- ---------------------------------

set_compatibility.sql

-- ------------------------------------------------------------------------------
-- set_compatibility.sql
-- ------------------------------------------------------------------------------
-- ------------------------------------------------------------------------------
-- This script change the asm and rdbms compatibility of an ASM diskgroup to 11.1
-- ------------------------------------------------------------------------------
set pages 50000 lines 200 echo on
@asm_diskgroup_compatibility.sql

alter diskgroup &1 set attribute 'compatible.asm'='11.1';


alter diskgroup &1 set attribute 'compatible.rdbms'='11.1';

@asm_diskgroup_compatibility.sql
-- ------------------------------------------------------------------------------
-- eof set_compatibility.sql
-- ------------------------------------------------------------------------------

End of Lab14

38/38

También podría gustarte