Sie sind auf Seite 1von 77

ASM on Windows 10gR2

Automatic Storage Management


November 2007 Industry's first and only database file system

Author: Esteban Bernal


ASM on Windows

INTRODUCTION

Automatic Storage Management (ASM) is a high-


performance storage management solution for Oracle
database files that is consistent across all supported
platforms. Designed specifically to simplify the job of
the database administrator (DBA), Automatic Storage
Management provides you with a flexible storage
solution that simplifies the management of a dynamic
database environment. Automatic Storage
Management makes most manual I/O performance
tuning tasks unnecessary.

ASM on Windows

I) HARDWARE REQUIREMENTS

 RAM: 256 MB minimum, 512 MB recommended

 Virtual memory: double the amount of RAM

 Hard disk space: 2.78 GB (10gR2 Software)

 Hard disk(s) space: Raw Devices (ASM/Database(s))

 Temp disk space: 125 MB

 Video adapter: 256 color

 Processor: 200 MHz minimum


3

ASM on Windows

II) OS REQUIREMENTS

 Windows 2000 with service pack 1 or higher. All editions,


including Terminal Services and Windows 2000 MultiLanguage
Edition (MLE), are supported.

 Windows Server 2003 - all editions.

 Windows XP Professional

 ASM is not supported on Windows NT

ASM on Windows

III) ORACLE REQUIREMENTS

 Oracle 10gR2 (10.2) Enterprise/Standard Edition .

 Oracle Cluster Synchronization Services (CSS).

ASM on Windows

IV) Cluster Synchronization Services


(CSS)

 CSS (OracleCSService) is required to setup ASM .

 The first time you install Oracle Database on a system, Oracle


Universal Installer configures and starts a single-node version of the
Oracle Cluster Synchronization Services (CSS) service. The CSS
service is required to enable synchronization between an Automatic
Storage Management (ASM) instance and the database instances that
rely on it for database file storage. It is configured and started even if
you do not choose Automatic Storage Management as a storage
mechanism for database files. Because it must be running before any
Automatic Storage Management instance or database instance starts,
Oracle Universal Installer configures it to start automatically when the
system starts.
6

ASM on Windows

IV) Cluster Synchronization Services


(Continuation)

 For Oracle Real Application Clusters installations, the CSS


service is installed with Oracle Cluster Ready Services (CRS) on
a separated Oracle home directory (also called the CRS home
directory). For single-node installations, the CSS service is
installed in and runs from the same Oracle home as Oracle
Database.

ASM on Windows

IV) Cluster Synchronization Services


(Continuation)

 Also, CSS can be manually configured as follow:


A) C:\> sc create OracleCSService start= auto binPath= "Oracle
Home\bin\ocssd.exe service"
 Example:
C:\>sc create OracleCSService start= auto binPath=
"D:\oracle\orag10\bin\ocssd.exe service"
Or
B) C:\> <Oracle_Home>\bin\ localconfig add

ASM on Windows

V) Detecting Available Disks

 The available disks need to be discovered through the Disk


Management (GUI):

 The graphical user interface Disk Management snap-in to manage


disks.

 To access this tool, type diskmgmt.msc at the command prompt.


Alternatively, from the Start menu, select Programs, then Administrative
Tools, then Computer Management. Then select the Disk Management
node in the Storage tree.

ASM on Windows

V) Detecting Available Disks


(continuation)

10

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.

 In order to setup ASM on Windows we need to create Raw Devices


using the DISKPART OS command.

 Raw devices are disk partitions (Primary Partition) or logical volumes


(Logical Partition) that have not been formatted and they are not
currently being used by a filesystem.

 diskpart.exe is a command line tool , which lets you create primary


partitions, extended partitions, and logical drives.

 diskpart.exe is supported on Windows 2000, Windows 2003, and


Windows XP, but it is not part of the Windows 2000 operating system.
You can download it from the Microsoft Windows 2000 Resource Kit.

11

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

 To access this tool, enter diskpart.exe at the command prompt.

Syntax:
DISKPART> list disk

Disk ### Status Size Free Dyn Gpt


-------- ---------- ------- ------- --- ---
Disk 0 Online 149 GB 47 GB

DISKPART> select disk #


DISKPART> select disk 0
DISKPART> create partition {Primary | Logical} size=#MB
DISKPART> create partition logical size=4096

12

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

Note: On Windows Server 2003, in order to configure partitions or


logical drives, you must enable the Disk Automounting feature
first.

Please enable Disk Automounting when using:

=)> Disk partitions on both single-instance and Oracle Real


Application Clusters (RAC) installations
=)> Cluster file system for Oracle Real Application Clusters
=)> Oracle Clusterware
=)> Raw partitions for a single-node database installation
=)> Primary or logical partitions for Automatic Storage Management
(ASM)

13

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

To enable automounting:

a) Enter the following commands at a command prompt:

C:\> diskpart
DISKPART> automount enable
DISKPART> exit

b) Restart your computer.

14

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

15

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

16

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

17

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

18

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

19

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

20

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

21

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

22

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

23

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

24

ASM on Windows

VI) Creating Raw Devices with the


DISKPART OS Command.
(continuation)

25

ASM on Windows

VII) Stamping the Raw Devices with


the asmtoolg (GUI).

 To use Automatic Storage Management with direct attached storage


(DAS) or storage area network (SAN) storage, the disks (raw devices)
must be stamped with a header by asmtool or asmtoolg (GUI version).

 asmtoolg is a graphical interface to create device names. Use


asmtoolg to add, change, delete, and examine the devices available for
use in Automatic Storage Management.

 asmtool is a command-line interface for manually stamping disks.

26

ASM on Windows

VII) Stamping the Raw Devices with


the asmtoolg. (continuation)

27

ASM on Windows

VII) Stamping the Raw Devices with


the asmtoolg. (continuation)

28

ASM on Windows

VII) Stamping the Raw Devices with


the asmtoolg. (continuation)

29

ASM on Windows

VII) Stamping the Raw Devices with


the asmtoolg. (continuation)

30

ASM on Windows

VII) Stamping the Raw Devices with


the asmtoolg. (continuation)

31

ASM on Windows

VII) Stamping the Raw Devices with


the asmtoolg. (continuation)

32

ASM on Windows

VII) Stamping the Raw Devices with


the asmtoolg. (continuation)

33

ASM on Windows

VII) Stamping the Raw Devices with


the asmtoolg. (continuation)

34

ASM on Windows

VII) Stamping the Raw Devices with


the asmtoolg. (continuation)

35

ASM on Windows

VII) Stamping the Raw Devices with


the asmtoolg. (continuation)

36

ASM on Windows

VII) Stamping the Raw Devices with


the asmtoolg. (continuation)

37

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA
 In order to create an ASM Instance, the OracleCSService must
be running:

38

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

39

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

10gR1

40

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

10gR2

41

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

42

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

43

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

44

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

45

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

46

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

47

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

48

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

49

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

50

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

51

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

52

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

53

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

54

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

55

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

56

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

57

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

58

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

59

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

60

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

61

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

62

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

63

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

64

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

65

ASM on Windows

VIII) Creating an ASM Instance and


Database using the DBCA.
(continuation)

66

ASM on Windows

IX) Detecting an existing ASM


configuration.
To determine whether an existing ASM disk group exists, or to determine
whether there is sufficient disk space in a disk group, you can use
Oracle Enterprise Manager Grid Control or Database Control.
Alternatively, you can use the following procedure:

 1) In the Services Control Panel, make sure that the


OracleASMService+ASM service has started.

 2) Open a Windows command prompt and temporarily set the


ORACLE_SID environment variable to specify the appropriate value for
the ASM instance that you want to use.

For example:
C:\> set ORACLE_SID = +ASM

67

ASM on Windows

IX) Detecting an existing ASM


configuration. (continuation)

 3) Connect to the ASM instance as the SYS user with the SYSDBA
privilege and start the instance if necessary:
C:\> sqlplus sys/SYS_password as sysdba

SQL> STARTUP

 4) Enter the following command to view the existing disk groups, their
redundancy level, and the amount of free disk space in each one:
SQL> SELECT NAME,TYPE,TOTAL_MB,FREE_MB FROM V$ASM_DISKGROUP;

 5) From the output, identify a disk group with the appropriate


redundancy level and note the free space that it contains.

68

ASM on Windows

X) Upgrade an ASM Instance and CSS


from 10.1 to 10.2

 In order to upgrade an ASM instance from Oracle 10.1 to 10.2 release


the next steps needs to be accomplished:
1) Install the Oracle Server 10.2

2) Oracle cluster Synchronization Services (CSS) needs to be upgraded as follow:

C:\> D:\oracle\product\10.2.0\db_1\BIN\localconfig reset

3) Start the DBUA from the 10.2 Oracle Home.

4) DBUA will show 2 options:

=)> upgrade ASM instance.


=)> upgrade the database

5) Select [upgrade ASM instance] option.

69

ASM on Windows

XI) ASMCMD OS command.

 ASMCMD is a command-line utility that you can use to easily view


and manipulate files and directories within Automatic Storage
Management (ASM) disk groups. It can list the contents of disk
groups, perform searches, create and remove directories and
aliases, display space utilization, and more.

 ASMCMD command can be executed as follow:


C:\>set ORACLE_HOME=D:\oracle\product\10.2.0\db_1

C:\>set ORACLE_SID=+ASM

C:\>asmcmd

ASMCMD> ls
DGW_DATA1/

ASMCMD> du DGW_DATA1/
Used_MB Mirror_used_MB
1485 2983
70

ASM on Windows

XI) ASMCMD OS command.


(continuation)
ASMCMD> cd DGW_DATA1/

ASMCMD> ls
V10gASM/

ASMCMD> cd V10gASM/

ASMCMD> ls
ARCHIVELOG/
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/

ASMCMD> lsct
DB_Name Status Software_Version Compatible_version Instance_Name
V10gASM CONNECTED 10.2.0.2.0 10.2.0.2.0 V10gASM

71

ASM on Windows

XI) ASMCMD OS command.


(continuation)
ASMCMD> lsdg
State Type Rebal Unbal Sector Block AU Total_MB Free_MB
Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED NORMAL N N 512 4096 1048576 8220 5079
2055 1512 0 DGW_DATA1/

ASMCMD> pwd
+DGW_DATA1/
ASMCMD> rm arc00026_0589132382.001

 Additional ASMCMD commands:


-------------------------------------------------------------
cd lsdg
du mkalias
find mkdir
help pwd
ls rm
lsct rmalias
72

ASM on Windows

XII) References

 Oracle Database Installation Guide


10g Release 2 (10.2) for Microsoft Windows (32-Bit)
Part Number B14316-02

 Oracle Database Administrator's Guide


10g Release 2 (10.2)
Part Number B14231-02

 http://asm.us.oracle.com/

73

ASM on Windows

QUESTIONS?

74

ASM on Windows

Workshop

This workshop explains steps by step How to setup ASM on Windows


and it includes:

1) How to identify the disk partitions.

2) How to create RAW devices on Windows.

3) How to stamp the RAW devices through the ASMtoolg graphical


application.

4) Validate the CSS service is up and running.

5) How to create an +ASM Instance through DBCA.

6) And finally how to create a regular database on ASM.


75

ASM on Windows

LAB

Requirements:

a) At least 8GB of un-partitioned disk space.


b) Windows 2003, XP or 2000.
c) Oracle Server 10gR2.
d) CSS is installed.

76

ASM on Windows

LAB
(Continuation)

1) Identify the available disk partitions (free space) through the


Windows Disk Management GUI.

2) Create 4 RAW devices (2GB each) using the DISKPART


command.

3) Stamp those 4 RAW devices through the ASMtoolg graphical


application.

4) Validate CSS is up and running.

5) Create an +ASM Instance through DBCA.

6) Create a regular database on ASM.

7) Connect to the +ASM Instance through SQL*Plus and check the


available diskgroup(s) and their disks.
77

Das könnte Ihnen auch gefallen