Join this Blog for direct reference of any post into your inbox. To join just click on "Join this Site" under "Follower" then Login with your Email.*** DECLARATION: I Maintain this Blog for Helping Myself While at Work and Welcome any body Needing Help!!!.*** CAUTION: Using any of the script from this Blog may contain at Own Risk. These scripts May or May not have been Tested.***

Wednesday, 11 July 2012

Step by Step Configuring ASM in Oracle 10g on Windows

Database:              Oracle
OS:                         Windows 2000
Methodology: Raw/Logical Disk
Interface:              DBCA (Creating instance + DiskGroup)
Scenario: On your database server, there is no ASM instance running. You decide to create one, as well as a disk group. Consider the disk group disk is in form of existing unformatted partitions of same size. Before a disk can be used by a disk group, its header has to be stamped. Then you decide to create a test tablespace in SQL*Plus, to confirm that you have access to the +ASM instance. You also want to use Enterprise Manger as a tool to manage ASM, so you need to reconfigure it.
The DBCA can also be used to create or remove ASM instances too. You can create the ASM instance at any time, regardless if a database already exists or not. If you are beginner and you want to know more about ASM, Click on the Link: Introduction to ASM
In this Example we will create the ASM instance as well as Diskgroup creation step by step through the use of DBCA.
1. Start the Oracle DBCA. The DBCA will present a list of options to you (see the sample screen) to choose from. Select “Configure Automatic Storage Management” and click Next.

2. Here you may see a warning window “In order to use ASM, CSS must be configured and started” including a path other then your oracle home. For more about the CSS please check this link: CSS

3. Open a command prompt window and enter the following command with the path from the previous window: E:\oracle\ora10g\bin\localconfig add
Once the CSS service is added successfully close the command prompt.

4. Now click OK on the “DBCA warning window” and return to the operation windows and click next.
5. The DBCA will then prompt you for the SYS password for the new ASM instance to be created. Enter the passwords as seen in this screen output:

6. Oracle will then create the ASM instance. A new window will appear giving you the option to create new disk groups. Here you will choose to create a disk group or add disks to an existing disk group.

7. On the Create Disk Group page, enter Disk Group Name. If you are using disks, which have never been used for ASM, click Stamp Disks. Alternatively if your have been previously used for ASM, you do not need to stamp their header.
Important: If you do not see the disk which you believe should be available, you may need to change the disk discovery path.
8. On the asmtool operation page (for stamping new disk), select Add or change label and click next

Note: With click and Shift+click, you will able to select partitions on the Select disks page. If your partitions are stamped for the first time, they appear with the Status "Candidate device". If they have been previously stamped, and the label has been deleted, they appear with the status "Unstamped ASM device".
9. Click “Finish” on the message ASM page and wait until the disks appear on the Create Disk Group page. Finally you will notice they have the Header Status “PROVISIONED” because they are not yet assigned to a disk group. Already assigned header status shows “FORMER

10. On the Create disk group page, select show all then check mark the disk with the path and select the proper redundancy (Follow the link to know about DiskGroup Redundancy: DiskGroup Redundancy ) press OK.
12. Now the disk group is created and mounted. Finally click Finish on the ASM disk group page. It will ask you “Do you want to perform another operation” click NO.
Testing the ASM installation:
Viewing Windows Services
To view Windows Services, select Start > Settings > Control Panel > Administrative Tools > Services. Scroll down to the Oracle services and confirm that the following services are started; if not, use Actions > Start, to start them: OracleASMService+ASM, OracleCSService, OracleDBConsoleshaan, OracleOraDb10g_homeTNSListener and OracleServiceshaan.
Querying on SQLP*Plus
sqlplus sys/**** as sysdba
SQL> Select instance_name from v$instance;
SQL> Select name, state, type, total_mb, free_mb from v$asm_diskgroup;
Creating a Tablespace and a Table
To use your ASM installation, create a tablespace and a table with one row in the SHAAN instance. Perform the following steps:
sqlplus sys/oracle as sysdba
Create tablespace inst1 datafile '+ SHAAN_DATA1' size 300M;
Create table inst_tab1 (inst number) tablespace inst1;
insert into inst_tab1 values (-22);
Reconfiguring Enterprise Manager:
If this is the first time, that you are creating an ASM instance, you need to reconfigure dbcontrol with the Enterprise Manager Configuration Utility (emca) untility. This reconfiguration allows you to access ASM information from Enterprise Manager Database Control. Perform the following steps:
emctl stop dbconsole
emca -repos recreate
Provide parameters for the repository re-creation. Enter at the appropriate value:
Database SID: shaan
Listener port number: 1521
Password for SYS user: ****
Password for SYSMAN user: ****
Do you wish to continue? [Yes(Y)/ no(N)]: y
Then wait. The re-creation of the Enterprise Manager repository may take some time (about 15 minutes depending on your system setup).
Deconfigure dbcontrol:
emca -deconfig dbcontrol db
Enter the following values when prompted:
Database SID: shaan
Do you wish to continue? [Yes(Y)/No(N)]: y
Reconfigure dbcontrol:
emca -config dbcontrol db
Provide parameters for the reconfiguration. Enter the following values when prompted:
Database SID: shaan
Listener port number: 1521
Password for SYS user: ****
Password for DBSNMP user: ****
Password for SYSMAN user: ****
Enter nothing for the next questions (just press the Enter key):
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [E:\oracle\product\10.2.0\db_1 ]:
ASM PORT [ 1521 ]:
ASM user role [ SYSDBA ]:
ASM username [ SYS ]:
Enter at the prompt:
ASM user password: oracle
ASM user password: oracle
Do you wish to continue? [Yes(Y)/No (N)]: y
Note: The actual time for the reconfiguration depends on your system setup.
Testing the Reconfigured Enterprise Manager
Open your browser and enter the following URL (Replace <hostname> with your own host name or IP address): http://<hostname>:1158/em
Enter sys as User Name, oracle as Password, SYSDBA in the Connect As field, and click Login.
The Database home page appears with the ASM link in the General section.


Post a Comment