Oracle 11g ASM On Windows XP Sandpit

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Author : Chris Drawater

Date : Mar 2008


Version : 1.0

Oracle 11g ASM on Windows XP sandpit

Abstract

As an R&D alternative to Unix or Linux setups, deployment of 11g ASM onto Windows XP can provide a
useful sandpit for experimental purposes.

Document Status

This document is Copyright © 2008 by Chris Drawater.

This document is freely distributable under the license terms of the GNU Free Documentation License
(http://www.gnu.org/copyleft/fdl.html). It is provided for educational purposes only and is NOT supported
– use at your own risk !

Introduction

11g ASM has a number of new features , notably :


Fast mirror resyncs – a must when mirroring across hardware disk arrays
Preferred read plexes – very useful in RAC situations, particularly where instances and disc arrays
are deployed across WAN
Variable ASM extent sizes – useful for VLDB
Back support for Oracle 10g database instances

This note documents a basic overview of deploying a very simple ( and non-resilient) Oracle 11g ASM
installation onto Windows XP for R&D (ie play) purposes.

Much of this technique ( although obviously not any of the new 11g features) is also applicable to Oracle
10g, so where appropriate, Oracle 10g notes/hints have also been included.

It is based upon experience with the following configurations :

Databases 
Oracle 11.1 – distribution : win32_11gR1_database.zip
Oracle 10.2

Abbreviations & Definitions

ASM  Automatic Storage Management – Oracle’s disk volume manager


VLDB  Very Large Database
WAN  Wide Area Network
CSS  Oracle Cluster Synchronization Services

© Chris Drawater, 2008 Oracle 11g ASM on Windows XP, v1.0 p1/6
Prerequisites

Download the software distribution


win32_11gR1_database.zip
from http://www.oracle.com/technology/software/products/database/index.html
and extract into c:\temp.

The following directories will be required 


C:\oracleASM
C:\oracle\product\11.1.0

Using the GUI, install the Enterprise Edition software as a ‘software installation only’ into 

ORACLE_HOME=C:\oracle\product\11.1.0

Run all the commands etc with local Windows administrator privilege.

Cooked Files

Create a number of ‘cooked files’ for use as pseudo ASM disks , (using a shell script or Java program etc)

C:\oracleASM\db9data01
C:\oracleASM\db9data02
C:\oracleASM\db9data01m
C:\oracleASM\db9data02m

C:\oracleASM\db9str01
C:\oracleASM\db9trans01

Make them each of say 1000 Mb. Additional or larger ‘disks’ can always be created later.

ASM Directories and PFILE(init.ora)

First create the ASM admin directories, noting the change between 10g and 11g 

set ORACLE_HOME=C:\oracle\product\11.1.0
set ORACLE_BASE=%ORACLE_HOME%

For 10g and 11g 


mkdir %ORACLE_BASE%\admin\ASM\bdump
mkdir %ORACLE_BASE%\admin\ASM\pfile

In addition, for 10g only -->


mkdir %ORACLE_BASE%\admin\ASM\cdump
mkdir %ORACLE_BASE%\admin\ASM\hdump
mkdir %ORACLE_BASE%\admin\ASM\udump

© Chris Drawater, 2008 Oracle 11g ASM on Windows XP, v1.0 p2/6
Next create the ASM instance pfile 

-------------------------------------------------------------------------

INSTANCE_TYPE = ASM

DB_UNIQUE_NAME = ASM # default

#compatible=11.1

######################################
# Allows FS files for testing
######################################

_asm_allow_only_raw_disks=false

######################################
# Use specifically located raw LUNs/devices/files
######################################

ASM_DISKSTRING='c:\oracleASM\db9*'

########################################
# DISC GROUPS to BE MOUNTED
# - add as required else use spfile
########################################

#ASM_DISKGROUPS = 'db9_data01' etc

#######################################
# OTHERS
#######################################

ASM_POWER_LIMIT = 1 # default

#event="27094 TRACE NAME ERRORSTACK LEVEL 12"

#######################################
# Logs etc
#######################################

#background_dump_dest = C:\oracle\product\11.1.0\admin\ASM\bdump # 10g only, deprecated in 11g


#core_dump_dest = C:\oracle\product\11.1.0\admin\ASM\bdump
#user_dump_dest = C:\oracle\product\11.1.0\admin\ASM\udump # 10g only,
deprecated in 11g
max_dump_file_size = 100000

DIAGNOSTIC_DEST = C:\oracle\product\11.1.0\admin\ASM\bdump

---------------------------------------------------------------------------------------------------

© Chris Drawater, 2008 Oracle 11g ASM on Windows XP, v1.0 p3/6
ASM Service set up

ASM requires the use of Oracle Cluster Synchronization Services (CSS), even for a standalone database,
but CSS is not automatically installed if RAC is not be used, so it needs to be deployed 

%ORACLE_HOME%\bin\localconfig add

Now create the Windows service for the ASM instance 

oradim -new -asmsid ASM -syspwd oracle -pfile C:\oracle\product\11.1.0\admin\ASM\pfile\initASM.ora


-startmode manual -shutmode immediate

Next , use the GUI network configuration utility to startup the Oracle listener service.

ASM Diskgroup Configuration

Start up the ASM instance 

set ORACLE_SID=ASM
sqlplus /nolog
connect / as sysdba;

SQL> startup nomount pfile=C:\oracle\product\11.1.0\admin\ASM\pfile\initASM.ora

and verify that all 6 ‘ASM disks’ are available to the ASM instance 

SELECT group_number, disk_number, mount_status, header_status, state, path FROM v$asm_disk ;


Should be able to see all 6 ASM disks !

Now create a ‘mirrored’ disk group for the data – this would be the main experimental disc group for
taking discs online, offline and checking fast mirror resync etc etc

CREATE DISKGROUP db9_data01


NORMAL REDUNDANCY
FAILGROUP mirror1 DISK 'C:\oracleASM\db9data01','c:\oracleASM\db9data02'
FAILGROUP mirror2 DISK 'C:\oracleASM\db9data01m','c:\oracleASM\db9data02m';
In addition, for 11g only 
ALTER DISKGROUP db9_data01 SET ATTRIBUTE 'compatible.asm' = '11.1' ;
ALTER DISKGROUP db9_data01 SET ATTRIBUTE 'compatible.rdbms' = '11.1' ;
ALTER DISKGROUP db9_data01 SET ATTRIBUTE 'disk_repair_time' = '1.0h' ;

ALTER DISKGROUP db9_data01 CHECK ALL; -- checks metadata

Note the ‘disk_repair_time’ at diskgroup level – this sets the time limit during which fast mirror resyncs will
be available.

© Chris Drawater, 2008 Oracle 11g ASM on Windows XP, v1.0 p4/6
Create other diskgroups for logs, temp, undo, archived logfiles, RMAN tracking files etc 

CREATE DISKGROUP db9_str01


external REDUNDANCY
DISK 'C:\oracleASM\db9str01';

CREATE DISKGROUP db9_transient01


external REDUNDANCY
DISK 'C:\oracleASM\db9trans01';

Finally a little verification 

SQL>
select group_number, name, total_mb, free_mb, state, type from v$asm_diskgroup;

select group_number, disk_number, mount_status, header_status, state, path, failgroup from v$asm_disk;

SELECT dg.name AS diskgroup, SUBSTR(a.name,1,24) AS name, SUBSTR(a.value,1,24) AS value FROM


V$ASM_DISKGROUP dg, V$ASM_ATTRIBUTE a
WHERE dg.group_number = a.group_number;

Automate the ASM Windows Service

Uncomment the ASM_DISKGROUPS parameter in the pfile/init.ora and bounce the ASM instance.

Modify the Windows service for automatic startup 


oradim -edit -asmsid ASM -startmode a

Bounce the Windows Oracle ASM service to verify – the service should restart but not the ASM instance!

To have the service sucessfully autostart the ASM instance itself , connect as sysdba and create an spfile 

shutdown;
create spfile from pfile='C:\oracle\product\11.1.0\admin\ASM\pfile\initASM.ora';
startup;

Bounce the Windows Oracle ASM service to verify – now both the service and the ASM instance should
start up!

© Chris Drawater, 2008 Oracle 11g ASM on Windows XP, v1.0 p5/6
Concluding Remarks

This brief paper demonstrates, for R&D/information purposes, the deployment of Oracle 11g ASM onto
Windows XP.

DO NOT use this type of deployment for production use.

Chris Drawater has been working with RDBMSs since 1987 and the JDBC API since late 1996, and can
be contacted at [email protected] .

© Chris Drawater, 2008 Oracle 11g ASM on Windows XP, v1.0 p6/6

You might also like