Documentos de Académico
Documentos de Profesional
Documentos de Cultura
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
• 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
It will display 3 different scripts that can be run from this menu
> 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_diskgroup_compatibility
> asm_diskgroup
> set_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
Execute the asm_diskgroup by copying its name to the prompt and hit enter.
> asm_diskgroup_compatibility
> asm_diskgroup
> set_compatibility
3/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
Executing asm_diskgroup
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_diskgroup_compatibility
> asm_diskgroup
> set_compatibility
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 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
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:
-----------------------------------------------------------------
-----------------------------------------------------------------
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
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
On the disk group we select all ASM disks, choose edit and change the compatibility to 11.1.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.
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
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
22/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
Starting background process ARB0
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 ~]$
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
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)
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
On this test we will destroy metadata on one of the ASM disks while we run some load, then we will restore the disk.
We will use disk /dev/sdg1 of the FG2 failure group, to crash it.
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
As root we remove and recreate the failed disk with a new name
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
Status from v$asm_disk is as follows, VOL5 is the new ASM disk and VOLBLK2 the failed one
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
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
34/38
ASM HANDS-ON TRAINING
Lab 14 ASM 11g Compatibility Parameters and Resilience Test
echo
endif
clear
echo
echo Executing $scr
echo
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
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
@asm_diskgroup_compatibility.sql
-- ------------------------------------------------------------------------------
-- eof set_compatibility.sql
-- ------------------------------------------------------------------------------
End of Lab14
38/38