You are on page 1of 7

CREATE A FOLDER NAME +ASM IN THAT CREATE THE FOLLOWING FOLDERS WITH THEIR

DIRECTORIES
----------------------------------------------------------------------------------
------------------
this following is optional that is it automatically creates the details but i did
long procedure by creating it manually
mkdir %ORACLE_BASE%\admin\+ASM\bdump
mkdir %ORACLE_BASE%\admin\+ASM\cdump
mkdir %ORACLE_BASE%\admin\+ASM\hdump
mkdir %ORACLE_BASE%\admin\+ASM\pfile
mkdir %ORACLE_BASE%\admin\+ASM\udump
----------------------------------------------------------------------------------
------------------
THAN GO TO D:\ DRIVE CREATE DIRECTORY FOR MAKING THE DISKS

D:\>mkdir asmdisks

D:\>cd asmdisks

D:\asmdisks>asmtool -create d:\asmdisks\disk1 512

D:\asmdisks>asmtool -create d:\asmdisks\disk2 512

D:\asmdisks>asmtool -create d:\asmdisks\disk3 512

AFTER THAT CREATE A PFILE NAME init+ASM.ora AND INCLUDE FOLLOWING DETAILS

INSTANCE_TYPE=ASM
DB_UNIQUE_NAME=+ASM
LARGE_POOL_SIZE=8M
ASM_DISKSTRING='d:\asmdisks\*'
_ASM_ALLOW_ONLY_RAW_DISKS=FALSE

THEN:-

Create service and password file


oradim will create an ASM instance and start it automatically.
D:\> orapwd file=D:\oracle\product\10.2.0\db_1\database\PWD1+ASM.ora password=asm
D:\> oradim -NEW -ASMSID +ASM -STARTMODE auto

CREAETING THE INSTANCE

D:\>SET ORACLE_SID=+ASM

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

I WAS GETTING AN ERROR IT SAYS ORA-29701: unable to connect to Cluster Manager

WITH THE HELP OF THE FOLLOWING PROCEDURE I RESOLVED THE ERROR

THE FOLLOWING WILL DELETE THE LOCAL CONFIGURATION:-


D:\>%ORACLE_HOME%\bin\localconfig delete
Step 1: stopping local CSS stack
Step 2: deleting OCR repository
failed to open the OCR subkey, err(0)
failed to cleanup local OCR repository
successfully deleted local CSS setup
THE FOLLOWING WILL ADD THE NEW LOCAL CONFIGURATION WHICH IS NEEDED FOR ASM:-
D:\>%ORACLE_HOME%\bin\localconfig add
Step 1: creating new OCR repository
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'administrator', privgrp ''..
Operation successful.
Step 2: creating new CSS service
successfully created local CSS service
successfully added CSS to home

D:\>set oracle_sid=+ASM

D:\>sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Aug 27 01:16:08 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup pfile='D:\oracle\product\10.2.0\admin\+ASM\pfile\init+ASM.ora';


ASM instance started

Total System Global Area 79691776 bytes


Fixed Size 1247396 bytes
Variable Size 53278556 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted

SQL> create spfile from pfile='D:\oracle\product\10.2.0\admin\


+ASM\pfile\init+ASM.ora';

File created.

SQL> select path, mount_status from v$asm_disk;


PATH MOUNT_S
------------ --------- --------- --
D:\ASMDISKS\ DISK1 CLOSED
D:\ASMDISKS\ DISK3 CLOSED
D:\ASMDISKS\ DISK2 CLOSED

SO NOW WE CAN SEE THREE DISK FILES SO NOW WE CAN CREATE GROUPS

SQL>create diskgroup data external redundancy disk


2 'd:\ASMDISKS\DISK1',
3 'd:\ASMDISKS\DISK2',
4*'d:\ASMDISKS\DISK3';

Diskgroup created.

AFTER THAT CREATE PFILE FROM SPFILE SO CHANGES ARE DONE IN PFILE ACCORDINGLY TO
SPFILE

SQL> create pfile from spfile;

File created.
SQL> alter system set asm_diskgroups= data scope=spfile;

System altered.

SQL> startup force


SP2-0714: invalid combination of STARTUP options
SQL> startup force
ASM instance started

Total System Global Area 79691776 bytes


Fixed Size 1247396 bytes
Variable Size 53278556 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL>

Now you can go ahead and use your DBCA and create a database and on step 6 of 13,
you can use Automatic Storage management as your Filesystem.

File Types Supported by Automatic Storage Management

File Type
1)Control files (CONTROLFILE)

2)Datafiles (DATAFILE)

3)Redo log files (ONLINELOG)

4)Archive log files (ARCHIVELOG)

5)Temporary files (TEMPFILE)

6)Datafile backup pieces (BACKUPSET)

7)Datafile incremental backup pieces (BACKUPSET)

8)Archive log backup piece (BACKUPSET)

9)Datafile copy (DATAFILE)

10)Persistent initialization parameter file[SPFILE] (PARAMETERFILE)

11)Disaster recovery configurations (DATAGUARDCONFIG)

12)Flashback logs (FLASHBACK)

13)Change tracking file (CHANGETRACKING)

14)Data Pump dumpset (DUMPSET)

15)Automatically generated control file backup (AUTOBACKUP)

16)Cross-platform transportable datafiles (XTRANSPORT)


==================================================================================
==================

Creating Control file in asm :-


-----------------------------------
CREATE CONTROLFILE REUSE DATABASE "SAMPLE" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 2
MAXDATAFILES 30
MAXINSTANCES 1
MAXLOGHISTORY 226
LOGFILE
GROUP 1 (
'+DATA',
'+DATA'
) SIZE 100M,
GROUP 2 (
'+DATA',
'+DATA'
) SIZE 100M
DATAFILE
'+DATA',
'+DATA'
CHARACTER SET US7ASCII
==================================================================================
==================

Creating datafile in asm :-


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

SQL>CREATE TABLESPACE sampleasm DATAFILE '+Data';

==================================================================================
==================

Adding Derictories in ASM :-


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

SQL> ALTER DISKGROUP data ADD DIRECTORY '+data/my_dir';

Rename a directory.

SQL>ALTER DISKGROUP data RENAME DIRECTORY '+data/my_dir' TO '+data/my_dir_2';

Delete a directory and all its contents.

SQL>ALTER DISKGROUP data DROP DIRECTORY '+data/my_dir_2' FORCE;


==================================================================================
==================

Create an alias using the fully qualified filename :-


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

SQL>ALTER DISKGROUP data ADD ALIAS '+data/my_dir/my_file.dbf'


FOR '+data/mydb/datafile/my_ts.342.3';

Create an alias using the numeric form filename.


SQL>ALTER DISKGROUP data ADD ALIAS '+data/my_dir/my_file.dbf'
FOR '+data.342.3';

Rename an alias.

SQL>ALTER DISKGROUP data RENAME ALIAS '+data/my_dir/my_file.dbf'


TO '+data/my_dir/my_file2.dbf';

Delete an alias.

SQL>ALTER DISKGROUP data DELETE ALIAS '+data/my_dir/my_file.dbf';


==================================================================================
==================

Create a new template :-


-------------------------------
SQL>ALTER DISKGROUP data ADD TEMPLATE my_template ATTRIBUTES (MIRROR FINE);

Modify template.

SQL>ALTER DISKGROUP data ALTER TEMPLATE my_template ATTRIBUTES (COARSE);

Drop template.

SQL>ALTER DISKGROUP data DROP TEMPLATE my_template;


==================================================================================
==================

Create an alias using the fully qualified filename :-


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

SQL>ALTER DISKGROUP data ADD ALIAS '+data/my_dir/my_file.dbf'


FOR '+data/mydb/datafile/my_ts.342.3';

Create an alias using the numeric form filename.

SQL>ALTER DISKGROUP data ADD ALIAS '+data/my_dir/my_file.dbf'


FOR '+data.342.3';

Rename an alias.

SQL>ALTER DISKGROUP data RENAME ALIAS '+data/my_dir/my_file.dbf'


TO '+data/my_dir/my_file2.dbf';

Delete an alias.

SQL>ALTER DISKGROUP data DELETE ALIAS '+data/my_dir/my_file.dbf';


==================================================================================
==================

ASM Views

The ASM configuration can be viewed using the V$ASM_% views, which often contain
different information depending on whether they are queried from the ASM instance,
or a dependant database instance.

----------------------------------------------------------------------------------
------------------
VIEW ASM Instance DB Instance
----------------------------------------------------------------------------------
------------------

1)V$ASM_ALIAS Displays a row for each alias Returns no rows


present in every disk group
mounted by the ASM instance.
----------------------------------------------------------------------------------
------------------

2)V$ASM_CLIENT Displays a row for each database Displays a row for the
ASM instance if the database
has open ASM files.
instance using a disk group managed
by the ASM instance.
----------------------------------------------------------------------------------
------------------

3)V$ASM_DISK Displays a row for each disk Displays a row for each
disk in disk groups use by the
database instance
discovered by the ASM instance,
including disks which are not
part of any disk group.
----------------------------------------------------------------------------------
------------------

4)V$ASM_DISKGROUP Displays a row for each disk Displays a row for each disk
group mounted by the local ASM
instance.
group discovered by the ASM instance.

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

5)V$ASM_FILE Displays a row for each file for each Displays no rows.
disk group mounted by the ASM instance.
----------------------------------------------------------------------------------
------------------

6)V$ASM_OPERATION Displays a row for each file for each Displays no rows.
long running operation executing in
the ASM instance.
----------------------------------------------------------------------------------
------------------

7)V$ASM_TEMPLATE Displays a row for each template Displays a row for each
template Present in each disk
group mountedby the ASM instance with
which the database instance
communicates.
present in each disk group mounted
by the ASM instance.
==================================================================================
==================

ASM Filenames
There are several ways to reference ASM file. Some forms are used during creation
and some for referencing ASM files. The forms for file creation are incomplete,
relying on ASM to create the fully qualified name, which can be retrieved from the
supporting views. The forms of the ASM filenames are summarised below.
----------------------------------------------------------------------------------
------------------
Filename Type Format
----------------------------------------------------------------------------------
------------------
Fully Qualified ASM Filename
+dgroup/dbname/file_type/file_type_tag.file.incarnation
Numeric ASM Filename +dgroup.file.incarnation
Alias ASM Filenames +dgroup/directory/filename
Alias ASM Filename with Template +dgroup(template)/alias
Incomplete ASM Filename +dgroup
Incomplete ASM Filename with Template +dgroup(template)
==================================================================================
==================

You might also like