All tests fail for any other than user "oracle"

All tests fail for any other than user "oracle"

am 15.01.2008 23:29:39 von mikemuratet

Greetings

I installed the Oracle Instant Client packages by rpm back in
December. Because of the install or more likely coincidentally I had
problems with corruption of the system files of the database. The
database was empty at the time and I simply rebuilt it.

I am trying now to get DBD::Oracle working. The DBI install came off
without a hitch. The DBD perl build and the make worked OK (logs are
at the end). The first attempt at testing failed. I recalled something
I had read about file permissions and the user 'oracle'. I logged in
as oracle and all the tests were successful. sqlplus works but only
for user oracle.

Is this normal? If the user is 'nobody' or 'daemon' as in a web
application, it seems doomed to fail. Should I be looking for problems
with the client installation? (I am aware of the security issues
surround access to the executables.) I've found nothing the
documentation that seems to fit.

Thanks

Mike


[root@humboldt DBD-Oracle-1.19]# perl Makefile.PL
Multiple copies of Driver.xst found in: /usr/lib64/perl5/site_perl/
5.8.0/auto/DBI/ /usr/lib64/perl5/vendor_perl/5.8.0/x86_64-linux-thread-
multi/auto/DBI/ at Makefile.PL line 35
Using DBI 1.59 (for perl 5.008 on x86_64-linux-thread-multi) installed
in /usr/lib64/perl5/site_perl/5.8.0/auto/DBI/

Configuring DBD::Oracle for perl 5.008 on linux (x86_64-linux-thread-
multi)

Remember to actually *READ* the README file! Especially if you have
any problems.

Using Oracle in /oracle/oracle/product/10.2.0/db_1
DEFINE _SQLPLUS_RELEASE = "1002000300" (CHAR)
Oracle version 10.2.0.3 (10.2)
Found /oracle/oracle/product/10.2.0/db_1/rdbms/demo/demo_rdbms.mk
Using /oracle/oracle/product/10.2.0/db_1/rdbms/demo/demo_rdbms.mk
Your LD_LIBRARY_PATH env var is set to '/oracle/oracle/product/10.2.0/
db_1/lib'
Reading /oracle/oracle/product/10.2.0/db_1/rdbms/demo/demo_rdbms.mk
Reading /oracle/oracle/product/10.2.0/db_1/rdbms/lib/env_rdbms.mk

Attempting to discover Oracle OCI build rules
gcc -c -I/oracle/oracle/product/10.2.0/db_1/rdbms/public -I/oracle/
oracle/product/10.2.0/db_1/rdbms/demo -I/oracle/oracle/product/10.2.0/
db_1/rdbms/public -I/oracle/oracle/product/10.2.0/db_1/plsql/public -I/
oracle/oracle/product/10.2.0/db_1/network/public -I/usr/lib64/perl5/
site_perl/5.8.0/auto/DBI -D_REENTRANT -D_GNU_SOURCE -
DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/
include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm
-O2 -g -pipe -DVERSION=\"1.19\" -DXS_VERSION=\"1.19\" -fPIC "-I/usr/
lib64/perl5/5.8.0/x86_64-linux-thread-multi/CORE" -Wall -Wno-comment -
DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.2.0.3\"
DBD_ORA_OBJ.c
by executing: [make -f /oracle/oracle/product/10.2.0/db_1/rdbms/demo/
demo_rdbms.mk build ECHODO=echo ECHO=echo GENCLNTSH='echo genclntsh'
CC=true OPTIMIZE= CCFLAGS= EXE=DBD_ORA_EXE OBJS=DBD_ORA_OBJ.o]
Oracle oci build command:
[true -L/oracle/oracle/product/10.2.0/db_1/lib/ -L/oracle/
oracle/product/10.2.0/db_1/rdbms/lib/ -o DBD_ORA_EXE DBD_ORA_OBJ.o -
lclntsh `cat /oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl
-lm -lpthread]

Found header files in /oracle/oracle/product/10.2.0/db_1/rdbms/public.

Checking for functioning wait.ph


System: perl5.008 linux thor.perf.redhat.com 2.4.21-27.elsmp #1 smp
wed dec 1 21:53:57 est 2004 x86_64 x86_64 x86_64 gnulinux
Compiler: gcc -O2 -g -pipe -D_REENTRANT -D_GNU_SOURCE -
DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/
include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm
Linker: /usr/bin/ld
Sysliblist: -ldl -lm -lpthread -lnsl -lirc
Oracle makefiles would have used these definitions but we override them:
CC: cc
CFLAGS: $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(PFLAGS)\
$(SHARED_CFLAG) $(USRFLAGS)
[$(GFLAG) -O3 $(CDEBUG) -m32 $(TRIGRAPHS_CCFLAGS) -fPIC -I/
oracle/oracle/product/10.2.0/db_1/rdbms/demo -I/oracle/oracle/product/
10.2.0/db_1/rdbms/public -I/oracle/oracle/product/10.2.0/db_1/plsql/
public -I/oracle/oracle/product/10.2.0/db_1/network/public -DLINUX -
D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -
DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS -fno-strict-
aliasing $(LPFLAGS) $(USRFLAGS)]
LDFLAGS: $(LDFLAGS32)
[-m32 -o $@ -L/oracle/oracle/product/10.2.0/db_1/rdbms//
lib32/ -L/oracle/oracle/product/10.2.0/db_1/lib32/ -L/oracle/oracle/
product/10.2.0/db_1/lib32/stubs/]
Linking with OTHERLDFLAGS = -L/oracle/oracle/product/10.2.0/db_1/lib/ -
L/oracle/oracle/product/10.2.0/db_1/rdbms/lib/ -lclntsh `cat /
oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm -lpthread
[from 'build' rule]

LD_RUN_PATH=/oracle/oracle/product/10.2.0/db_1/lib:/oracle/o racle/
product/10.2.0/db_1/rdbms/lib
Using DBD::Oracle 1.19.
Using DBD::Oracle 1.19.
Multiple copies of Driver.xst found in: /usr/lib64/perl5/site_perl/
5.8.0/auto/DBI/ /usr/lib64/perl5/vendor_perl/5.8.0/x86_64-linux-thread-
multi/auto/DBI/ at Makefile.PL line 1635
Using DBI 1.59 (for perl 5.008 on x86_64-linux-thread-multi) installed
in /usr/lib64/perl5/site_perl/5.8.0/auto/DBI/
Writing Makefile for DBD::Oracle

*** If you have problems...
read all the log printed above, and the README and
README.help.txt files.
(Of course, you have read README by now anyway, haven't you?)


[root@humboldt DBD-Oracle-1.19]# make
Skip blib/lib/DBD/Oracle.pm (unchanged)
Skip blib/arch/auto/DBD/Oracle/dbdimp.h (unchanged)
Skip blib/lib/oraperl.ph (unchanged)
Skip blib/lib/DBD/mkta.pl (unchanged)
Skip blib/arch/auto/DBD/Oracle/ocitrace.h (unchanged)
Skip blib/arch/auto/DBD/Oracle/Oracle.h (unchanged)
Skip blib/lib/Oraperl.pm (unchanged)
Skip blib/arch/auto/DBD/Oracle/mk.pm (unchanged)
Skip blib/lib/DBD/Oracle/GetInfo.pm (unchanged)
gcc -c -I/oracle/oracle/product/10.2.0/db_1/rdbms/public -I/oracle/
oracle/product/10.2.0/db_1/rdbms/demo -I/oracle/oracle/product/10.2.0/
db_1/rdbms/public -I/oracle/oracle/product/10.2.0/db_1/plsql/public -I/
oracle/oracle/product/10.2.0/db_1/network/public -I/usr/lib64/perl5/
site_perl/5.8.0/auto/DBI -D_REENTRANT -D_GNU_SOURCE -
DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/
include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm
-O2 -g -pipe -DVERSION=\"1.19\" -DXS_VERSION=\"1.19\" -fPIC "-I/usr/
lib64/perl5/5.8.0/x86_64-linux-thread-multi/CORE" -Wall -Wno-comment -
DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.2.0.3\" Oracle.c
gcc -c -I/oracle/oracle/product/10.2.0/db_1/rdbms/public -I/oracle/
oracle/product/10.2.0/db_1/rdbms/demo -I/oracle/oracle/product/10.2.0/
db_1/rdbms/public -I/oracle/oracle/product/10.2.0/db_1/plsql/public -I/
oracle/oracle/product/10.2.0/db_1/network/public -I/usr/lib64/perl5/
site_perl/5.8.0/auto/DBI -D_REENTRANT -D_GNU_SOURCE -
DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/
include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm
-O2 -g -pipe -DVERSION=\"1.19\" -DXS_VERSION=\"1.19\" -fPIC "-I/usr/
lib64/perl5/5.8.0/x86_64-linux-thread-multi/CORE" -Wall -Wno-comment -
DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.2.0.3\" dbdimp.c
dbdimp.c: In function `ora_db_login6':
dbdimp.c:463: warning: int format, different type arg (arg 8)
dbdimp.c:470: warning: int format, different type arg (arg 8)
dbdimp.c:645: warning: int format, different type arg (arg 7)
gcc -c -I/oracle/oracle/product/10.2.0/db_1/rdbms/public -I/oracle/
oracle/product/10.2.0/db_1/rdbms/demo -I/oracle/oracle/product/10.2.0/
db_1/rdbms/public -I/oracle/oracle/product/10.2.0/db_1/plsql/public -I/
oracle/oracle/product/10.2.0/db_1/network/public -I/usr/lib64/perl5/
site_perl/5.8.0/auto/DBI -D_REENTRANT -D_GNU_SOURCE -
DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/
include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm
-O2 -g -pipe -DVERSION=\"1.19\" -DXS_VERSION=\"1.19\" -fPIC "-I/usr/
lib64/perl5/5.8.0/x86_64-linux-thread-multi/CORE" -Wall -Wno-comment -
DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.2.0.3\" oci8.c
Running Mkbootstrap for DBD::Oracle ()
chmod 644 Oracle.bs
rm -f blib/arch/auto/DBD/Oracle/Oracle.so
LD_RUN_PATH="/oracle/oracle/product/10.2.0/db_1/lib:/oracle/ oracle/
product/10.2.0/db_1/rdbms/lib" gcc -shared Oracle.o dbdimp.o oci8.o -
L/oracle/oracle/product/10.2.0/db_1/lib/ -L/oracle/oracle/product/
10.2.0/db_1/rdbms/lib/ -lclntsh `cat /oracle/oracle/product/10.2.0/
db_1/lib/sysliblist` -ldl -lm -lpthread -o blib/arch/auto/DBD/Oracle/
Oracle.so
chmod 755 blib/arch/auto/DBD/Oracle/Oracle.so
cp Oracle.bs blib/arch/auto/DBD/Oracle/Oracle.bs
chmod 644 blib/arch/auto/DBD/Oracle/Oracle.bs
cp ora_explain blib/script/ora_explain
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/
ora_explain
Manifying blib/man3/DBD::Oracle.3pm
Manifying blib/man1/ora_explain.1
Manifying blib/man3/DBD::Oraperl.3pm

Re: All tests fail for any other than user "oracle"

am 16.01.2008 17:29:01 von jkstill

On Tue, 2008-01-15 at 16:29 -0600, Michael Muratet wrote:

> I am trying now to get DBD::Oracle working. The DBI install came off
> without a hitch. The DBD perl build and the make worked OK (logs are
> at the end). The first attempt at testing failed. I recalled something
> I had read about file permissions and the user 'oracle'. I logged in
> as oracle and all the tests were successful. sqlplus works but only
> for user oracle.
>

Installing Oracle by RPM? Not familiar with that.

Also not too familiar with instant client.

The problem you are experiencing is likely due to a lack of SGID
on the oracle binary.

In ORACLE_HOME there is likely a shell script named 'root.sh'.

Shut down oracle and run root.sh, as root.
It sets a number of permisions.

That should take care of it.

RE: All tests fail for any other than user "oracle"

am 16.01.2008 20:02:12 von scarville

> -----Original Message-----
> From: Michael Muratet [mailto:mikemuratet@mac.com]
> Sent: Tuesday, January 15, 2008 2:30 PM
> To: dbi-users@perl.org
> Subject: All tests fail for any other than user 'oracle'
>=20
> Greetings
>=20
> I installed the Oracle Instant Client packages by rpm back in
> December. Because of the install or more likely coincidentally I had
> problems with corruption of the system files of the database. The
> database was empty at the time and I simply rebuilt it.

Did you install all three packages?

oracle-instantclient-devel-10.2.0.3-1
oracle-instantclient-basic-10.2.0.3-1
oracle-instantclient-sqlplus-10.2.0.3-1

> I am trying now to get DBD::Oracle working. The DBI install came off
> without a hitch. The DBD perl build and the make worked OK (logs are
> at the end). The first attempt at testing failed. I recalled something
> I had read about file permissions and the user 'oracle'. I logged in
> as oracle and all the tests were successful. sqlplus works but only
> for user oracle.

I find something like this helps a lot:

cd /usr/lib
sudo ln -sf /usr/lib/oracle/10.2.0.3/client/lib/libclntsh.so.10.1 .
sudo ln -sf /usr/lib/oracle/10.2.0.3/client/lib/libclntsh.so .
sudo ln -sf /usr/lib/oracle/10.2.0.3/client/lib/libnzz10.so .


> Is this normal? If the user is 'nobody' or 'daemon' as in a web
> application, it seems doomed to fail. Should I be looking for problems
> with the client installation? (I am aware of the security issues
> surround access to the executables.) I've found nothing the
> documentation that seems to fit.
>=20
> Thanks
>=20
> Mike
>=20

--
Stephen

Re: All tests fail for any other than user "oracle"

am 16.01.2008 20:11:33 von mgainty

also make sure the Oracle listener is listening on e.g.
netstat -a | grep 1521

M--
----- Original Message -----
From: "Jared Still"
To: "Michael Muratet"
Cc:
Sent: Wednesday, January 16, 2008 11:29 AM
Subject: Re: All tests fail for any other than user 'oracle'


> On Tue, 2008-01-15 at 16:29 -0600, Michael Muratet wrote:
>
> > I am trying now to get DBD::Oracle working. The DBI install came off
> > without a hitch. The DBD perl build and the make worked OK (logs are
> > at the end). The first attempt at testing failed. I recalled something
> > I had read about file permissions and the user 'oracle'. I logged in
> > as oracle and all the tests were successful. sqlplus works but only
> > for user oracle.
> >
>
> Installing Oracle by RPM? Not familiar with that.
>
> Also not too familiar with instant client.
>
> The problem you are experiencing is likely due to a lack of SGID
> on the oracle binary.
>
> In ORACLE_HOME there is likely a shell script named 'root.sh'.
>
> Shut down oracle and run root.sh, as root.
> It sets a number of permisions.
>
> That should take care of it.
>
>
>

Re: All tests fail for any other than user "oracle"

am 17.01.2008 12:42:22 von jkstill

------=_Part_17844_30628558.1200570142773
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

even better, make sure it's working.

tnsping


On Jan 16, 2008 11:11 AM, Martin Gainty wrote:

> also make sure the Oracle listener is listening on e.g
> .
> netstat -a | grep 1521
>
> M--
> ----- Original Message -----
> From: "Jared Still"
> To: "Michael Muratet"
> Cc:
> Sent: Wednesday, January 16, 2008 11:29 AM
> Subject: Re: All tests fail for any other than user 'oracle'
>
>
> > On Tue, 2008-01-15 at 16:29 -0600, Michael Muratet wrote:
> >
> > > I am trying now to get DBD::Oracle working. The DBI install came off
> > > without a hitch. The DBD perl build and the make worked OK (logs are
> > > at the end). The first attempt at testing failed. I recalled something
> > > I had read about file permissions and the user 'oracle'. I logged in
> > > as oracle and all the tests were successful. sqlplus works but only
> > > for user oracle.
> > >
> >
> > Installing Oracle by RPM? Not familiar with that.
> >
> > Also not too familiar with instant client.
> >
> > The problem you are experiencing is likely due to a lack of SGID
> > on the oracle binary.
> >
> > In ORACLE_HOME there is likely a shell script named 'root.sh'.
> >
> > Shut down oracle and run root.sh, as root.
> > It sets a number of permisions.
> >
> > That should take care of it.
> >
> >
> >
>
>


--
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist

------=_Part_17844_30628558.1200570142773--

Re: All tests fail for any other than user "oracle"

am 17.01.2008 13:23:36 von hjp

--0OAP2g/MAC+5xKAE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2008-01-15 16:29:39 -0600, Michael Muratet wrote:
> I installed the Oracle Instant Client packages by rpm back in December. B=
ecause=20
> of the install or more likely coincidentally I had problems with corrupti=
on of=20
> the system files of the database. The database was empty at the time and =
I=20
> simply rebuilt it.
>=20
> I am trying now to get DBD::Oracle working. The DBI install came off with=
out a=20
> hitch. The DBD perl build and the make worked OK (logs are at the end). T=
he=20
> first attempt at testing failed. I recalled something I had read about fi=
le=20
> permissions and the user 'oracle'. I logged in as oracle and all the test=
s were=20
> successful. sqlplus works but only for user oracle.

Are you sure you are using the instant client and not an oracle server
installation on the same machine? I am asking for two reasons:

1) For some time now an Oracle database *server* installation includes
all the client libraries and tools (sqlplus, etc.), but the
permissions are set so that only the oracle user (or maybe the dba
group) can use them. This sounds exactly like your problem.=20
(I am not sure why Oracle did this - maybe they want to encourage
people to separate server and client installations even if they are
on the same machine - anyway, there is a script to "soften" the
permissions).

2) You said you corrupted the system files of the database and rebuilt
it. Since it is extremely unlikely that installing a software on=20
one host will damage software on a different host, I conclude that
your database and the Instant Client packages are installed on the
same machine - so you need to be careful to set the environment to
point to the right installation.

hp

--=20
_ | Peter J. Holzer | If I wanted to be "academically correct",
|_|_) | Sysadmin WSR | I'd be programming in Java.
| | | hjp@wsr.ac.at | I don't, and I'm not.
__/ | http://www.hjp.at/ | -- Jesse Erlbaum on dbi-users

--0OAP2g/MAC+5xKAE
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHj0jIMdFfQa64PCwRAmjTAJ46tb5mBS2ljIz740MBDQBoH2gqpwCe PfmH
DF5EY+aYXl6oQ79S+bFKWPM=
=0DOd
-----END PGP SIGNATURE-----

--0OAP2g/MAC+5xKAE--

Re: All tests fail for any other than user "oracle"

am 17.01.2008 22:11:03 von mikemuratet

Greetings

I finally got it to work. For the benefit of anyone who might find
this in the archive:

Installed Instant Client from zip files (forget the rpms)
Set ORACLE_HOME and LD_LIBRARY_PATH to the new Instant Client directory
Build DBD::Oracle
Set ORACLE_HOME back to the Oracle tree
Make sure there is o+r access down the ORACLE_HOME tree to
tnsnames.ora file
Set ORACLE_SID to dbname
Set ORACLE_USERID to usr/****@dbname (may be redundant)
make test now works

Thanks to all for the replies and suggestions.

Mike

On Jan 17, 2008, at 9:55 AM, Jared Still wrote:

> On Jan 17, 2008 7:55 AM, Michael Muratet wrote:
> I
> On Jan 17, 2008, at 5:42 AM, Jared Still wrote:
>
> > even better, make sure it's working.
> >
> > tnsping
>
> It works. sqlplus user/**** works for all users, but only if the unix
> user is oracle. The problem is more subtle.
>
> connecting as 'sqlplus user/****' does not tell you anything about tns
> connecting as 'sqlplus user/****@$ORACLE_SID" will tell you something.
>
>
>
>
> I found some documentation for the Instant Client (my candidate for
> the world's poorest documented application) that mentions TNS_ADMIN
> which I tried with the same result. I've also found recommendations to
> change ORACLE_HOME to where ever Instant Client reside but since I
> installed by rpm I'm not sure exactly where that is. I may just
> uninstall the rpms and reinstall from source.
>
> I don't remember where the files are located.
>
> If you still have the rpm's try 'rpm -qpl to see where
> they may go.
>
>
> -
> Jared Still
> Certifiable Oracle DBA and Part Time Perl Evangelist