Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Configuration Of Oracle ASM 10g using Vmware linux

In this tutorial i explained about How to configure Oracle 10g ASM  On Vmware Linux Machine and also explained how to create manual DB creation on ASM instance.
1)Go to Vmware Virtual Machine then create the  four disk for ASM here i specified disk size is 5GB You can give the disk size whatever do you want.
vm-->setting-->hard disk-->add-->create virual disk-->click independent-->5gb-->finish

2) After created ASM disk on Virtual machine then restart the server .
  #init 6

3)create the disk partition on four disk using following command
#fdisk /dev/sdb
#fdisk /dev/sdc
#fdisk /dev/sdd
#fdisk /dev/sde 
#n-->p-->1-->w   Here n- for number p for partition w for write

4)List the partition Disk
#fdisk -l

5)Create the Raw directory and assign the partitions disk to raw devices.
mkdir raw
vi /etc/sysconfig/rawdevices
/dev/raw/raw1  /dev/sdb1
/dev/raw/raw2  /dev/sdc1
/dev/raw/raw3  /dev/sdd1
/dev/raw/raw4  /dev/sde1

6)Restart the raw devices and assign the owner permission to oracle user
#service rawdevices restart
chown oracle:oinstall /dev/raw/raw*
chmod 755 /dev/raw/raw*

7)Assign the owner permission permanantly to oracle user.
vi /etc/rc.local
chown oracle:oinstall /dev/raw/raw*
chmod 755 /dev/raw/raw*

8)Check raw devices for owner permission are successfully whether set or not
[root@teng raw]# ls -lrt /dev/raw
total 0
crwxr-xr-x 1 oracle oinstall 162, 1 May 15 07:18 raw1
crwxr-xr-x 1 oracle oinstall 162, 2 May 15 07:18 raw2
crwxr-xr-x 1 oracle oinstall 162, 3 May 15 07:18 raw3
crwxr-xr-x 1 oracle oinstall 162, 3 May 15 07:18 raw4

9) Download the oracleasm rpm and run the rpm following method
vm->setting->option->shared_folder ->ok      ---share the rpm folder

#cp  -r /mnt/hgfs/ASMLib/ /home/oracle/       --copy the rpms from host to vmware machoine
#cd /home/oracle/ASMLib/
#cd /media/Enterprise\ Linux\ dvd\ 20100405/Server/

rpm -Uvh oracleasm-support-2.1.3-1.el5.i386.rpm
rpm -Uvh oracleasmlib-2.0.4-1.el5.i386.rpm
rpm -Uvh oracleasm-2.6.18-194.el5-2.0.5-1.el5.i686.rpm
10)Configure the oracle asm using following method.
/etc/init.d/oracleasm configure

Default user to own the driver interface []: oracle
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Dropping Oracle ASMLib disks:                              [  OK  ]
Shutting down the Oracle ASMLib driver:                    [  OK  ]

[root@teng raw]# ps -ef|grep oracleasm
root     27230  4673  0 12:58 pts/1    00:00:00 grep oracleasm
This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.
[root@teng raw]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

Default user to own the driver interface [oracle]: oracle
Default group to own the driver interface [oinstall]:
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]
#init 6
 11)create the oracle asm disk using partioned disk and list the oracle asm disk using "listdisk"
/etc/init.d/oracleasm createdisk disk1 /dev/sdb1
/etc/init.d/oracleasm createdisk disk2 /dev/sdc1
/etc/init.d/oracleasm createdisk disk3 /dev/sdd1
/etc/init.d/oracleasm createdisk disk4 /dev/sde1

   
Marking disk "disk1" as an ASM disk:                       [  OK  ]


[root@teng raw]# /etc/init.d/oracleasm listdisks
DISK1
DISK2
DISK3
DISK4

12) Initialize the CSS
[root@teng ~]# cd /u01/app/oracle/product/10.2.0/db_1/bin
[root@teng bin]# ./localconfig add
13)check the status of css
[root@teng bin]# ps -ef |grep css
14) Restart the server
#init 6

15)10g asm initialization file creation
[oracle@teng ~]$ cd $ORACLE_HOME/dbs
[oracle@teng ~]$ vi init+ASM.ora

instance_name=+ASM
instance_type=asm
asm_diskgroups='DG1'

16) startup the 10g asm instance
[oracle@teng ~]$ export ORACLE_SID=+ASM
[oracle@teng ~]$ sqlplus / as sysdba
SQL>startup
ASM instance started

Total System Global Area   79691776 bytes
Fixed Size                  1217812 bytes
Variable Size              53308140 bytes
ASM Cache                  25165824 bytes
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DG1"
solution:-
SQL> create diskgroup DG1 external redundancy disk '/dev/raw/raw1' size 5114m;

Diskgroup created.
--FOR NORMAL
SQL>create diskgroup DG1 normal redundancy
failgroup FG1 disk '/dev/raw/raw1','/dev/raw/raw2' size 5114m
failgroup FG2 disk '/dev/raw/raw3','/dev/raw/raw4' size 5114m;

Diskgroup created.

17)Restart the server 
SQL> shut immediate;
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup;
ASM instance started
Total System Global Area   79691776 bytes
Fixed Size                  1217812 bytes
Variable Size              53308140 bytes
ASM Cache                  25165824 bytes
ASM diskgroups mounted

18)Check the asm Disk group and create tablespace for testing purposes
SQL> select name, state, type, total_mb, free_mb from v$asm_diskgroup;

NAME                           STATE       TYPE     TOTAL_MB    FREE_MB
------------------------------ ----------- ------ ---------- ----------
DG1                            MOUNTED     NORMAL      20456      20350

SQL> create tablespace tbs datafile '+dg1' size 10m;

Tablespace created.

19)Listing client databases
The following command shows all the database instances connected to the ASM instance.
SQL> select INSTANCE_NAME,STATUS,SOFTWARE_VERSION,COMPATIBLE_VERSION from v$asm_client;


INSTANCE_NAME        STATUS       SOFTWARE_VERSION     COMPATIBLE_VERSION
-------------------- ------------ -------------------- --------------------
kfc                  CONNECTED    10.2.0.1.0           10.2.0.0.0




SQL>  select name, path, mode_status, state, disk_number from v$asm_disk;

NAME                 PATH                           MODE_ST STATE    DISK_NUMBER
-------------------- ------------------------------ ------- -------- -----------
                     ORCL:DISK1                     ONLINE  NORMAL             4
                     ORCL:DISK2                     ONLINE  NORMAL             5
                     ORCL:DISK3                     ONLINE  NORMAL             6
                     ORCL:DISK4                     ONLINE  NORMAL             7
DG1_0000             /dev/raw/raw1                  ONLINE  NORMAL             0
DG1_0001             /dev/raw/raw2                  ONLINE  NORMAL             1
FG12_0001            /dev/raw/raw4                  ONLINE  NORMAL             1
FG12_0000            /dev/raw/raw3                  ONLINE  NORMAL             0

8 rows selected.


20) SCRIPT MODE 10G ASM MANUAL DB CREATTION

[oracle@teng ~]$ vi db.sh
mkdir kfc
cd kfc
mkdir admin oradata
cd admin
mkdir pfile adump bdump cdump udump
cd ..  
cd oradata
mkdir control log archive data
cd        
cp /home/oracle/pf /home/oracle/kfc/admin/pfile/initkfc.ora
cd
export ORACLE_SID=kfc
sqlplus / as sysdba <<eof
startup pfile='/home/oracle/kfc/admin/pfile/initkfc.ora' nomount;
create database kfc
datafile '+DG1' size 400m
sysaux datafile '+DG1' size 300m
logfile group 1 '+DG1' size 10m,
        group 2 '+DG1' size 10m;
@?/rdbms/admin/catalog.sql;
@?/rdbms/admin/catproc.sql;
create spfile from pfile='/home/oracle/kfc/admin/pfile/initkfc.ora'; 
[oracle@teng ~]$ vi pf
db_name=kfc
sga_target=600m
compatible=10.2.0
control_files='+DG1'
audit_file_dest='/home/oracle/kfc/admin/adump'
core_dump_dest='/home/oracle/kfc/admin/cdump'
background_dump_dest='/home/oracle/kfc/admin/bdump'
user_dump_dest='/home/oracle/kfc/admin/udump'


21)run the db.sh file  this will create manual DB.
[oracle@teng ~]$ sh db.sh

22)Check the control file path when you restart the asm you may get error this is why you need to note the controlfile path 
SQL> show parameter control_file

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      +DG1/kfc1/controlfile/current.
                                                 271.913266591, +DG1/kfc1/contr
                                                 olfile/current.270.913266593

SQL> create spfile from pfile='/home/oracle/kfc/admin/pfile/initkfc.ora';

File created.

SQL> create pfile from spfile;

File created.
23) restart the asm instance you  will get the following  error if you not set control file parameter
SQL> startup force;
ORACLE instance started.

Total System Global Area  629145600 bytes
Fixed Size                  1220964 bytes
Variable Size             171970204 bytes
Database Buffers          452984832 bytes
Redo Buffers                2969600 bytes
ORA-00205: error in identifying control file, check alert log for more info
solution:-
SQL> alter system set control_files='+DG1/kfc/controlfile/current.257.913439613' scope=spfile;

System altered.

SQL> startup force;
ORACLE instance started.

Total System Global Area  629145600 bytes
Fixed Size                  1220964 bytes
Variable Size             171970204 bytes
Database Buffers          452984832 bytes
Redo Buffers                2969600 bytes
Database mounted.
Database opened.

24) when restart the server you need to  start the CSS
[root@teng ~]# cd /u01/app/oracle/product/10.2.0/db_1/bin/
[root@teng bin]# ./localconfig add
ASM Commands:
[oracle@teng ~]$ . .bash_profile
[oracle@teng ~]$ export ORACLE_SID=+ASM
[oracle@teng ~]$ asmcmd
ASMCMD> ls
DG1/
ASMCMD> DG1
        commands:
        --------
        cd
        du
        find
        help
        ls
        lsct
        lsdg
        mkalias
        mkdir
        pwd
        rm
        rmalias
ASMCMD> cd DG1
ASMCMD> ls
KFC/
ASMCMD> cd kfc
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
ASMCMD> cd controlfile
ASMCMD> ls
Current.256.917583353
Current.262.918355715
Current.267.918358463
Current.272.918365263
Current.276.918365369
ASMCMD>







Comments

Popular posts from this blog

PostgreSQL Pgbadger Installation On Linux

PostgreSQL pgBadger

How to configure Replication Manager (repmgr) ?

7 Steps to configure BDR replication in postgresql

PostgreSQL Sequence