Custom Search . . .

Monday, April 6, 2009

SSH without password.


For RAC Environmemnt; We need to configure ssh to connect another node with out password.

http://remysharp.com/2007/01/22/ssh-without-a-password/

Using the above link; we can able to configrue ssh setting.

Babu


Wednesday, April 1, 2009

How to create ASM Instance


1. Before creating ASM instance you need to create asm disk using raw disk or using ASMLib disk.

For RAW disk - > 1. http://babudba.blogspot.com/2009/04/how-to-crate-asm-disk-in-linux.html

For ASMLib Disk - > 2. http://babudba.blogspot.com/2009/03/marking-disk-vol1-as-asm-disk-failed.html

2. Create Init. Parameter using ORACLE_HOME/dbs/init+ASM.ora

*.asm_diskstring='/dev/raw/*'
*.background_dump_dest='/dbbackup/u01/oracle/admin/+ASM/bdump'
*.core_dump_dest='/dbbackup/u01/oracle/admin/+ASM/cdump'
*.instance_type='asm'
*.remote_login_passwordfile='exclusive'
*.sga_max_size=256m
*.user_dump_dest='/dbbackup/u01/oracle/admin/+ASM/udump'


[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$
[oracle@localhost ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 27 05:00:03 2009

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

Connected to an idle instance.

SQL> startup nomount
ASM instance started

Total System Global Area 268435456 bytes
Fixed Size 1218920 bytes
Variable Size 242050712 bytes
ASM Cache 25165824 bytes
SQL>
SQL> create diskgroup dgroup1 normal redundancy
2 failgroup cont1 disk '/dev/raw/raw1','/dev/raw/raw2'
3 failgroup cont2 disk '/dev/raw/raw3'
4 /

Diskgroup created.

SQL> shutdown immediate
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup
ASM instance started

Total System Global Area 268435456 bytes
Fixed Size 1218920 bytes
Variable Size 242050712 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted



SQL> select free_mb,total_mb,name,group_number from v$asm_disk;

FREE_MB TOTAL_MB NAME GROUP_NUMBER
---------- ---------- ------------------------------ ------------
0 2682 0
144 195 DGROUP1_0003 1
950 976 DGROUP1_0000 1
949 976 DGROUP1_0001 1
925 976 DGROUP1_0002 1

How to crate ASM disk in linux


1. Creating files using "dd" command

[oracle@localhost asmdisks]$ su - root
Password:
[root@localhost ~]# mkdir /dbbackup/asmdiks


[root@localhost ~]# chown oracle:oinstall /dbbackup/asmdiks/
[root@localhost ~]#
[root@localhost ~]# su - oracle



[oracle@localhost ~]$ dd if=/dev/zero of=/dbbackup/asmdiks/_file_disk1 bs=1k count=1000000
1000000+0 records in
1000000+0 records out

[oracle@localhost ~]$ dd if=/dev/zero of=/dbbackup/asmdiks/_file_disk2 bs=1k count=1000000
1000000+0 records in
1000000+0 records out

[oracle@localhost ~]$ dd if=/dev/zero of=/dbbackup/asmdiks/_file_disk3 bs=1k count=1000000
1000000+0 records in
1000000+0 records out

[oracle@localhost ~]$ cd /dbbackup/asmdiks/

[oracle@localhost asmdiks]$ ls -lrt
total 3002964
-rw-r--r-- 1 oracle oinstall 1024000000 Mar 27 04:45 _file_disk1
-rw-r--r-- 1 oracle oinstall 1024000000 Mar 27 04:48 _file_disk2
-rw-r--r-- 1 oracle oinstall 1024000000 Mar 27 04:52 _file_disk3


2. Makeing RAW disk using "losetup" command


[oracle@localhost asmdiks]$ su - root
Password:


[root@localhost ~]# losetup /dev/loop1 /dbbackup/asmdiks/_file_disk1

[root@localhost ~]# losetup /dev/loop2 /dbbackup/asmdiks/_file_disk2

[root@localhost ~]# losetup /dev/loop3 /dbbackup/asmdiks/_file_disk3

[root@localhost ~]## raw /dev/raw/raw1 /dev/loop1
/dev/raw/raw1: bound to major 7, minor 1

[root@localhost ~]## raw /dev/raw/raw2 /dev/loop2
/dev/raw/raw2: bound to major 7, minor 2

[root@localhost ~]## raw /dev/raw/raw3 /dev/loop3
/dev/raw/raw3: bound to major 7, minor 3


4. Change Ownership of RAW Devices


Finally, let's change the ownership of all four RAW devices:

# chown oracle:dba /dev/raw/raw1
# chown oracle:dba /dev/raw/raw2
# chown oracle:dba /dev/raw/raw3
# chown oracle:dba /dev/raw/raw4

# chmod 775 /dev/raw/raw1
# chmod 775 /dev/raw/raw2
# chmod 775 /dev/raw/raw3
# chmod 775 /dev/raw/raw4


5. Startup Script


Before restarting your OS you need to write small script for enable your raw disk in /etc/init.d/


/sbin/losetup /dev/loop1 /asmdisks/_file_disk1; sleep 2

/sbin/losetup /dev/loop2 /asmdisks/_file_disk2; sleep 2
/sbin/losetup /dev/loop3 /asmdisks/_file_disk3; sleep 2
/sbin/losetup /dev/loop4 /asmdisks/_file_disk4; sleep 2

/usr/bin/raw /dev/raw/raw1 /dev/loop1; sleep 2
/usr/bin/raw /dev/raw/raw2 /dev/loop2; sleep 2
/usr/bin/raw /dev/raw/raw3 /dev/loop3; sleep 2
/usr/bin/raw /dev/raw/raw4 /dev/loop4; sleep 2

/bin/chown oracle:dba /dev/raw/raw1
/bin/chown oracle:dba /dev/raw/raw2
/bin/chown oracle:dba /dev/raw/raw3
/bin/chown oracle:dba /dev/raw/raw4

/bin/chmod 660 /dev/raw/raw1
/bin/chmod 660 /dev/raw/raw2
/bin/chmod 660 /dev/raw/raw3
/bin/chmod 660 /dev/raw/raw4

sleep 120

su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart"

su - $ORACLE_OWNER -c "lsnrctl start listener"

Automatic Storage Management

What is the ASM (Automatic Storage Management)


- Intrgrated file system and volume manager expressly build for oracle database files.


- ASM Provide performance of raw I/O with easy management of file system.


ASM – Extends the power of oracle managed files. ASM files created and managed automatically by YOU.


One additional feature Mirroring and Striping.



ASM Mirroring more flexible than operating system mirrored disks because ASM mirroring enables the redundancy level.


ASM Mirroring Options


Mirroring Option Description

2-way mirroring Each extent has 1 mirrored copy.

3-way mirroring Each extent has 2 mirrored copies.

Unprotected ASM provides no mirroring. Used when mirroring is provided by the disk subsystem itself.


Dynamic Storage Configuration

- ASM enable you have to change storage configuration without having to take the database offline.


- It’s Automatically rebalance


- If disk failure error occur; ASM automatically rebalance to restore full redundancy



Failure Groups

Failure Groups determine ASM disk that share common potential failure mechanism.