2. Windows:
P AR T III
Locate any large file, which is a multiple of 1024 bytes, and copy it twice to a
directory of your choice. In this example, the file happens to be an ISO image
of a compact disc:
copy \tmp\oel5\d1.iso \app\oracle\raw1.diskcopy \tmp\oel5\d1.iso \app\oracle\raw2.diskThe files created will be formatted by ASM when they are assigned to a disk
group. ASM will make some checks (it will not, for example, accept a copy of
an Oracle datafile) but pretty much any file should do as the source. If you
have a problem, try again with a different file.
Creating, Starting, and Stopping
an ASM Instance
An ASM instance is controlled by an instance parameter file, as is an RDBMS instance,
but there are strict limits on the parameters that can be included. Many will cause an
ASM instance to have errors on startup, so keep the parameter file as small as possible.
The parameters most likely to be needed (and often all that are required) are listed in
Table 20-1.
Parameter Required? Descriptioninstance_type Yes Must be ASM for an ASM instance. Default is RDBMS.instance_name No Must be prefixed with “+”. Defaults to the ORACLE_SID environment variable.asm_power_limit No Controls the number of ASMB processes to be used for rebalancing operations. Default is 1, the lowest.asm_diskstring Yes List of paths identifying the disks to be given to ASM.asm_diskgroups No Disk groups to be mounted on startup. Default is NULL.Table 20-1 Common ASM Initialization ParametersAn ASM parameter file for Windows might take this form:
instance_name='+asm'instance_type='asm'asm_diskstring='\\.\*:'asm_diskgroups=dgroupA,dgroupBThe instance name must be prefixed with a “+” symbol, on all platforms. On
Windows, this must also be specified when creating the Windows service for the instance.
The syntax for the ASM_DISKSTRING will be platform specific. In the example, Oracle
will find every device, as indicated by the “\\.\” characters, that includes the “:” character
in its name. All Windows disk devices that have been assigned a drive letter will have a
“:” in their name, so this string will find all devices that have been assigned a drive letter.
The two nominated disk groups, dgroupA and dgroupB, must exist; if this is the first
startup of the ASM instance, omit this parameter and set it only after the groups have
been created. Many databases will require only two disk groups: one for the live database
files, the other for the flash recovery area. Wildcard characters (such as the asterisk in the
preceding example) can be used to let ASM find a number of devices without having to
name them all individually.
A Linux parameter file might look like this:
asm_diskstring='/dev/md2','/dev/md3','/dev/md4','/dev/md5'remote_login_passwordfile=exclusiveThis time the disk string has four distinct values, rather than using wildcards, which
will let it find four named RAID devices. The two nominated disk groups must exist
and be composed of the RAID volumes named in diskstring. In this example,
there are no wildcards, but they could be used if desired. For example, if using Solaris
this would let ASM find all disks on the second and third controllers:
asm_disk_string='/dev/rdsk/c2*','/dev/rdsk/c3*'To start the instance, you must connect to it as SYSASM and issue a STARTUP
command. The connection can be made by setting the ORACLE_SID environment
variable to the instance name (not forgetting that it must be prefixed with a “+” symbol),
or if a password file has been created and enabled as in the preceding example, you
can connect with password file authentication. The startup will first go through
NOMOUNT, where the instance is built in memory and the disks identified by the
ASM_DISKSTRING parameter are discovered. Then the instance will mount the disk
groups specified by ASM_DISKGROUPS. There is no MOUNT or OPEN mode for an
ASM instance; disk groups can be mounted or unmounted.
TIP The size of an ASM instance can, as in the preceding examples, be left
completely on default. This will result in an instance of about 160MB. In most
circumstances this is both sufficient and necessary.
RDBMS instances use files in disk groups managed by the ASM instance. If the ASM
instance has not started and mounted the disk groups, then the RDBMS instances
cannot open. It is therefore necessary to ensure, through your operating system utilities,
that the ASM instance starts before the RDBMS instances that are dependent upon it.
If the ASM instance terminates, then the dependent RDBMS instances will terminate
also. If, when a SHUTDOWN command is issued to an ASM instance, one or more
RDBMS instances have opened files in one of its disk groups, then you will receive
this message:
ORA-15097: cannot SHUTDOWN ASM instance with connected RDBMS instanceThe exception is a SHUTDOWN ABORT, which will terminate the ASM instance
and thus cause the termination of the RDBMS instance(s).
TIP If an RDBMS instance fails, the ASM instance will not be affected. If an
ASM instance fails, the dependent RDBMS instances will abort.
Bạn đang xem 2. - OCA /OCP ORACLE DATABASE 11G A LL-IN-ONE EXAM GUIDE- P81 POT