Thursday, August 22, 2013

sh: /u01/app/oracle/product/11.2.0/db_1/bin/clsecho: No such file or directory

Another annoying error but it's not a big issue.
[oracle@rac1 ~]$ asmcmd
Connected to an idle instance.
sh: /u01/app/oracle/product/11.2.0/db_1/bin/clsecho: No such file or directory
ASMCMD> ls
Can't exec "/u01/app/oracle/product/11.2.0/db_1/bin/clsecho": No such file or directory at /u01/app/oracle/product/11.2.0/db_1/lib/asmcmdshare.pm line 493, <STDIN> line 1.
Use of uninitialized value $buf in string ne at /u01/app/oracle/product/11.2.0/db_1/lib/asmcmdshare.pm line 497, <STDIN> line 1.
ASMCMD> 
The reason behind this is that the env for ASM is not setup properly. To set the proper env do the following
[oracle@rac1 ~]$ cat /etc/oratab | grep ASM
# a database or ASM Configuration Assistant while creating ASM instance.
+ASM1:/u01/app/11.2.0/grid:N          # line added by Agent
[oracle@rac1 ~]$ 

The very first thing we must do is check if the environment variables are correct.
[oracle@rac1 ~]$ . oraenv
ORACLE_SID = [RAC1] ? +ASM1
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@rac1 ~]$ asmcmd
ASMCMD>
ASMCMD>
ASMCMD> ls
DATA/
ASMCMD> 

It is working for you, great!!!


Friday, August 16, 2013

unable to add disk using oracleasm and getting Instantiating disk: failed

Unable to create the disk on RHEL6 using oracleasm

[root@racdr1 ~]# oracleasm createdisk ASM1 /dev/sdb1
Writing disk header: done
Instantiating disk: failed
Clearing disk header: done
[root@racdr1 ~]#

The reason behind this is under /etc/selinux/config file

make sure that it have following value

SELINUX=permissive

If not then set it and restart the system then issue the command again and there will be success.

[root@racdr1 ~]# cat  /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

[root@racdr1 ~]# oracleasm createdisk ASM1 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@racdr1 ~]#