When execute ’sqlplus’ as a user outside of the dba or Oracle group, you get the following errors.
Error 6 initializing SQL*Plus
Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
Syntax:
$ sqlplus username/password
This problem did not occur in previous releases of Oracle.
Similar problems occur with other client tools, like IMP, EXP, etc.
Cause
The files that sqlplus needs to execute do not have read/execute permissions on the O/S level.
Solution
There is a one-off patch for the base bug 4516865, but this fixes the permissions problem only on the server side. Only for Linux, this patch includes fix for both server and client side (Bug 4747264). Patch 4516865 provides a script called changePerm.sh. Since 10.2.0.2, the changperm.sh script is included in all patchsets and is documented in the patchset README.
At the time this note was written, there was no patch for the client side for platforms other than Linux. However, there are a couple of workarounds:
I. Logged in as the Oracle user (or the user that installed the 10gR2 software), manually change the permissions on the client. For example:
chmod -R 755 <client_home>
In our case:
chmod -R 755 $ORACLE_HOME/sqlplus
II. If doing a recursive permissions command is not acceptable, then you will need to pinpoint exactly what files the client is reading at the time of execution, and manually change permissions only on those files. In our case, we need to pinpoint what files are being accessed by SQL*Plus. To implement this workaround, please execute the following steps:
1. As the non-Oracle user, run the truss utility to find out which files are being accessed. Sample command:
truss -aefo /tmp/truss_sqlplus.out sqlplus username/password
2. Use this truss_sqlplus.out trace file to see what files have error “EACCES” when attempting to access. In our case, the truss_sqlplus.out showed a problem accessing the following file:
$ORACLE_HOME/sqlplus/mesg/sp1us.msb
Another possible error to search for in the truss output is ENOENT. For example:
9775: open(“./sqlplus/mesg/sp1us.msb”, O_RDONLY) Err#2 ENOENT
3. Logged in as the Oracle user, change permissions on folders leading up to, and including sp1us.msb:
chmod 755 $ORACLE_HOME/sqlplus
chmod 755 $ORACLE_HOME/sqlplus/mesg
chmod 755 $ORACLE_HOME/sqlplus/mesg/sp1us.msb
4. After making above permission changes, a different error may appear when executing sqlplus as non-Oracle user, such as:
$ sqlplus username/password
SP2-1503: Unable to initialize Oracle call interface
SP2-0152: ORACLE may not be functioning properly
$
5. At this point, you need to re-run the truss (as non-Oracle) to see what other files are trying to be accessed. In our case, the following files were trying to get accessed, but showed “EACCES” failure:
$ORACLE_HOME/nls/data/lx1boot.nlb
$ORACLE_HOME/oracore/zoneinfo/timezlrg.dat
6. Logged in as the Oracle user, change permissions on these files and the directories leading up to these files.
chmod 755 $ORACLE_HOME/nls
chmod 755 $ORACLE_HOME/nls/data
chmod 755 $ORACLE_HOME/nls/data/lx1boot.nlb
chmod 755 $ORACLE_HOME/oracore
chmod 755 $ORACLE_HOME/oracore/zoneinfo
chmod 755 $ORACLE_HOME/oracore/zoneinfo/timezlrg.dat
7. Now, invoking sqlplus as a non-Oracle user was successful in our case.