f



is it possible to run oracle server as non-root, non-system process?

I'm trying to setup a small oracle server as part of my java junit test pro=
cess, because the commonly-used hsqldb lacks many oracle features, and it's=
 very hard to mock out all those little operations in my ORM library.

I downloaded the Oracle package, untarred to local, changed a bunch of sett=
ings in the .ora, .sh scripts to point to my local dir.

I started the server by

bash -x ./etc/init.d/oracle-xe configure
when it tries to run the startdb.sql , it gave me some errors:

/home/myuser/oracle/install//u01/app/oracle/product/11.2.0/xe/bin/sqlplus -=
s /nolog @/home/myuser/oracle/install//u01/app/oracle/product/11.2.0/xe/con=
fig/scripts/startdb.sql
ERROR:
ORA-01031: insufficient privileges
if I run as root, this step gave errors:

ERROR:
ORA-12162: TNS:net service name is incorrectly specified
my listener.ora is:

@devbox-114942 install]$ cat ./u01/app/oracle/product/11.2.0/xe/network/adm=
in/listener.ora
# listener.ora Network Configuration File:

SID_LIST_LISTENER =3D
  (SID_LIST =3D
    (SID_DESC =3D
      (SID_NAME =3D PLSExtProc)
      (ORACLE_HOME =3D /home/myuser/oracle/install/u01/app/oracle/product/1=
1.2.0/xe)
      (PROGRAM =3D extproc)
    )
  )

LISTENER =3D
  (DESCRIPTION_LIST =3D
    (DESCRIPTION =3D
      (ADDRESS =3D (PROTOCOL =3D IPC)(KEY =3D EXTPROC0))
      (ADDRESS =3D (PROTOCOL =3D TCP)(HOST =3D devbox-114942)(PORT =3D 1521=
))
    )
  )

DEFAULT_SERVICE_LISTENER =3D (XE)

TRACE_LEVEL_LISTENER =3D SUPPORT
overall, I am able to start the listener, and I can see the oradata/ dir ge=
nerated, and a bunch of trace files generated. but don't see apparently ala=
rming things in the trace file. in fact when I do sqlplus and connect to th=
e listener (?? ) , I don't see any more logging come out in the trace file
0
teddyyyy123
9/22/2014 11:43:06 PM
comp.databases.oracle.server 22978 articles. 1 followers. Post Follow

10 Replies
302 Views

Similar Articles

[PageSpeed] 10

On Monday, September 22, 2014 5:43:06 PM UTC-6, ted y wrote:
> I'm trying to setup a small oracle server as part of my java junit test p=
rocess, because the commonly-used hsqldb lacks many oracle features, and it=
's very hard to mock out all those little operations in my ORM library.
>=20
>=20
>=20
> I downloaded the Oracle package, untarred to local, changed a bunch of se=
ttings in the .ora, .sh scripts to point to my local dir.
>=20
>=20
>=20
> I started the server by
>=20
>=20
>=20
> bash -x ./etc/init.d/oracle-xe configure
>=20
> when it tries to run the startdb.sql , it gave me some errors:
>=20
>=20
>=20
> /home/myuser/oracle/install//u01/app/oracle/product/11.2.0/xe/bin/sqlplus=
 -s /nolog @/home/myuser/oracle/install//u01/app/oracle/product/11.2.0/xe/c=
onfig/scripts/startdb.sql
>=20
> ERROR:
>=20
> ORA-01031: insufficient privileges
>=20
> if I run as root, this step gave errors:
>=20

You are not supposed to install or run the Oracle database as 'root'.  Ther=
e should be an 'oracle' account used to install, and run, the database.  Yo=
u need to login as the 'oracle' user, run the installer, install the softwa=
re then use 'root' ONLY when requested to run any root.sh scripts.  Oracle =
never runs as 'root'.

>=20
>=20
> ERROR:
>=20
> ORA-12162: TNS:net service name is incorrectly specified
>=20
> my listener.ora is:
>=20
>=20
>=20
> @devbox-114942 install]$ cat ./u01/app/oracle/product/11.2.0/xe/network/a=
dmin/listener.ora
>=20
> # listener.ora Network Configuration File:
>=20
>=20
>=20
> SID_LIST_LISTENER =3D
>=20
>   (SID_LIST =3D
>=20
>     (SID_DESC =3D
>=20
>       (SID_NAME =3D PLSExtProc)
>=20
>       (ORACLE_HOME =3D /home/myuser/oracle/install/u01/app/oracle/product=
/11.2.0/xe)
>=20
>       (PROGRAM =3D extproc)
>=20
>     )
>=20
>   )
>=20
>=20
>=20
> LISTENER =3D
>=20
>   (DESCRIPTION_LIST =3D
>=20
>     (DESCRIPTION =3D
>=20
>       (ADDRESS =3D (PROTOCOL =3D IPC)(KEY =3D EXTPROC0))
>=20
>       (ADDRESS =3D (PROTOCOL =3D TCP)(HOST =3D devbox-114942)(PORT =3D 15=
21))
>=20
>     )
>=20
>   )
>=20
>=20
>=20
> DEFAULT_SERVICE_LISTENER =3D (XE)
>=20
>=20
>=20
> TRACE_LEVEL_LISTENER =3D SUPPORT
>

The problem isn't the listener.ora, it's not setting ORACLE_SID correctly. =
 Oracle is looking for the ORACLE_SID so it can connect to the local databa=
se.  If your database is named ORCL then the ORACLE_SID will also be ORCL. =
 To set this in your environment (presuming you're running bash or ksh) you=
 need to do this:

export ORACLE_SID=3DORCL

After the Oracle software is correctly installed and you set the ORACLE_SID=
 correctly you should not see that error on login to the database.

> overall, I am able to start the listener, and I can see the oradata/ dir =
generated, and a bunch of trace files generated. but don't see apparently a=
larming things in the trace file. in fact when I do sqlplus and connect to =
the listener (?? ) , I don't see any more logging come out in the trace fil=
e

You don't connect to the listener with SQL*Plus.  The listener  is there to=
 provide remote access to the database from application servers and remote =
desktop or laptop computers.  It allows the database server to 'listen' for=
 remote connection requests and service them appropriately. =20

If you have installed the Oracle software as 'root' you need to uninstall i=
t, as 'root', then use the 'oracle' user account for installation and datab=
ase creation/management (on the database server).  When the software is cor=
rectly installed using the correct user account you will see Oracle databas=
e processes running, and you will have a running, functional Oracle databas=
e.

You need to read here:

http://www.linuxjournal.com/article/3572

to understand how to install the software and how to pre-configure the serv=
er to prepare for that installation.


David Fitzjarrell
0
ddf
9/23/2014 3:54:57 PM
On Monday, September 22, 2014 4:43:06 PM UTC-7, ted y wrote:
> I'm trying to setup a small oracle server as part of my java junit test p=
rocess, because the commonly-used hsqldb lacks many oracle features, and it=
's very hard to mock out all those little operations in my ORM library.
>=20
>=20
>=20
> I downloaded the Oracle package, untarred to local, changed a bunch of se=
ttings in the .ora, .sh scripts to point to my local dir.
>=20
>=20
>=20
> I started the server by
>=20
>=20
>=20
> bash -x ./etc/init.d/oracle-xe configure
>=20
> when it tries to run the startdb.sql , it gave me some errors:
>=20
>=20
>=20
> /home/myuser/oracle/install//u01/app/oracle/product/11.2.0/xe/bin/sqlplus=
 -s /nolog @/home/myuser/oracle/install//u01/app/oracle/product/11.2.0/xe/c=
onfig/scripts/startdb.sql
>=20
> ERROR:
>=20
> ORA-01031: insufficient privileges
>=20
> if I run as root, this step gave errors:
>=20
>=20
>=20
> ERROR:
>=20
> ORA-12162: TNS:net service name is incorrectly specified
>=20
> my listener.ora is:
>=20
>=20
>=20
> @devbox-114942 install]$ cat ./u01/app/oracle/product/11.2.0/xe/network/a=
dmin/listener.ora
>=20
> # listener.ora Network Configuration File:
>=20
>=20
>=20
> SID_LIST_LISTENER =3D
>=20
>   (SID_LIST =3D
>=20
>     (SID_DESC =3D
>=20
>       (SID_NAME =3D PLSExtProc)
>=20
>       (ORACLE_HOME =3D /home/myuser/oracle/install/u01/app/oracle/product=
/11.2.0/xe)
>=20
>       (PROGRAM =3D extproc)
>=20
>     )
>=20
>   )
>=20
>=20
>=20
> LISTENER =3D
>=20
>   (DESCRIPTION_LIST =3D
>=20
>     (DESCRIPTION =3D
>=20
>       (ADDRESS =3D (PROTOCOL =3D IPC)(KEY =3D EXTPROC0))
>=20
>       (ADDRESS =3D (PROTOCOL =3D TCP)(HOST =3D devbox-114942)(PORT =3D 15=
21))
>=20
>     )
>=20
>   )
>=20
>=20
>=20
> DEFAULT_SERVICE_LISTENER =3D (XE)
>=20
>=20
>=20
> TRACE_LEVEL_LISTENER =3D SUPPORT
>=20
> overall, I am able to start the listener, and I can see the oradata/ dir =
generated, and a bunch of trace files generated. but don't see apparently a=
larming things in the trace file. in fact when I do sqlplus and connect to =
the listener (?? ) , I don't see any more logging come out in the trace fil=
e

The listener is just a broker, it handles non-local connection requests to =
the db.  You don't need a listener.ora, oracle databases will negotiate wit=
h a listener a minute or so after startup.  You do need a listener if you a=
re going to use client tools to startup and shutdown.  (I'm very familiar w=
ith oracle on unix, but not with xe on unix.  I'm moderately familiar with =
xe on Windows.  There is an XE space on forums.oracle.com that may give bet=
ter advice).

Did you follow all the setup instructions?  Did you need to create a user a=
nd group?

When you connect to a database non-locally, you make a statement like usern=
ame/password@xe.  The xe there is defined in a tnsnames.ora.  A local conne=
ction doesn't have the @ part, and so you would normally startup by setting=
 ORACLE_SID and ORACLE_HOME and a reference to $ORACLE_HOME/bin on your pat=
h, with a command something like sqlplus / as sysdba (not having a username=
 password means use operating system authentication), then entering the wor=
d startup.  You can condition your environment with a dot command, . oraenv=
 (if xe on unix does it like most oracle databases).

Oracle runs setuid, so it can spawn processes owned by users, as well as se=
t up interprocess communication (ipcs |grep oracle should show memory segme=
nts).  It should not be run as root.  When you install, it should be as an =
oracle administrator, with some root commands run later (again, I'm not sur=
e how xe handles that).

Your startdb process should start the listener and start the database.  You=
 shouldn't see anything in the alert log unless something happens.  So you =
should see a bunch of startup messages, followed by the occasional redo log=
 switch message.  You can connect / as sysdba and give the command alter sy=
stem switch logfile; to see if messages appear in the alert log.

jg
--=20
@home.com is bogus.
http://www.forbes.com/sites/oracle/2014/09/23/the-economics-of-the-real-tim=
e-enterprise/
0
joel
9/23/2014 4:00:38 PM
Thanks guys.

I did NOT create the new user accounts and groups , since my very goal is t=
o run this server as normal user , when the user wants to run a junit (whic=
h needs an oracle instance)

this way, most of the setup instructions do not apply for my case. I did se=
t the ORACLE_HOME and ORACLE_SID env variables (either when I ran sqlplus m=
anually, or as part of init.d/oracle-xe configure , since the latter automa=
tically sets it )



I tried it again, somehow maybe I changed something, now with the "configur=
e" process , it gave me this error:


+ /home/myuser/tools/oracle/install/u01/app/oracle//product/11.2.0/xe/bin/s=
qlplus -s /nolog @/home/myuser/tools/oracle/install/u01/app/oracle//product=
/11.2.0/xe/config/scripts/startdb.sql
ERROR:
ORA-01031: insufficient privileges



this seems to be due to wrong username/password, because if I manually run =
sqlplus, it gave me a different error

yyang15@yyang15-VirtualBox:~/tools/oracle/install$ /home/yyang15/tools/orac=
le/install/u01/app/oracle//product/11.2.0/xe/bin/sqlplus

SQL*Plus: Release 11.2.0.2.0 Production on Tue Sep 23 09:41:41 2014

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

Enter user-name: sysdba
Enter password:=20
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0


Enter user-name:=20





my question is, where is this password for sysdba stored ? I set it as "123=
45" as part of the configure process.=20

my listener.ora is given earlier in this thread.

Thanks!
yang





On Tuesday, September 23, 2014 9:00:38 AM UTC-7, joel garry wrote:
> On Monday, September 22, 2014 4:43:06 PM UTC-7, ted y wrote:
>=20
> > I'm trying to setup a small oracle server as part of my java junit test=
 process, because the commonly-used hsqldb lacks many oracle features, and =
it's very hard to mock out all those little operations in my ORM library.
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > I downloaded the Oracle package, untarred to local, changed a bunch of =
settings in the .ora, .sh scripts to point to my local dir.
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > I started the server by
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > bash -x ./etc/init.d/oracle-xe configure
>=20
> >=20
>=20
> > when it tries to run the startdb.sql , it gave me some errors:
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > /home/myuser/oracle/install//u01/app/oracle/product/11.2.0/xe/bin/sqlpl=
us -s /nolog @/home/myuser/oracle/install//u01/app/oracle/product/11.2.0/xe=
/config/scripts/startdb.sql
>=20
> >=20
>=20
> > ERROR:
>=20
> >=20
>=20
> > ORA-01031: insufficient privileges
>=20
> >=20
>=20
> > if I run as root, this step gave errors:
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > ERROR:
>=20
> >=20
>=20
> > ORA-12162: TNS:net service name is incorrectly specified
>=20
> >=20
>=20
> > my listener.ora is:
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > @devbox-114942 install]$ cat ./u01/app/oracle/product/11.2.0/xe/network=
/admin/listener.ora
>=20
> >=20
>=20
> > # listener.ora Network Configuration File:
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > SID_LIST_LISTENER =3D
>=20
> >=20
>=20
> >   (SID_LIST =3D
>=20
> >=20
>=20
> >     (SID_DESC =3D
>=20
> >=20
>=20
> >       (SID_NAME =3D PLSExtProc)
>=20
> >=20
>=20
> >       (ORACLE_HOME =3D /home/myuser/oracle/install/u01/app/oracle/produ=
ct/11.2.0/xe)
>=20
> >=20
>=20
> >       (PROGRAM =3D extproc)
>=20
> >=20
>=20
> >     )
>=20
> >=20
>=20
> >   )
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > LISTENER =3D
>=20
> >=20
>=20
> >   (DESCRIPTION_LIST =3D
>=20
> >=20
>=20
> >     (DESCRIPTION =3D
>=20
> >=20
>=20
> >       (ADDRESS =3D (PROTOCOL =3D IPC)(KEY =3D EXTPROC0))
>=20
> >=20
>=20
> >       (ADDRESS =3D (PROTOCOL =3D TCP)(HOST =3D devbox-114942)(PORT =3D =
1521))
>=20
> >=20
>=20
> >     )
>=20
> >=20
>=20
> >   )
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > DEFAULT_SERVICE_LISTENER =3D (XE)
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > TRACE_LEVEL_LISTENER =3D SUPPORT
>=20
> >=20
>=20
> > overall, I am able to start the listener, and I can see the oradata/ di=
r generated, and a bunch of trace files generated. but don't see apparently=
 alarming things in the trace file. in fact when I do sqlplus and connect t=
o the listener (?? ) , I don't see any more logging come out in the trace f=
ile
>=20
>=20
>=20
> The listener is just a broker, it handles non-local connection requests t=
o the db.  You don't need a listener.ora, oracle databases will negotiate w=
ith a listener a minute or so after startup.  You do need a listener if you=
 are going to use client tools to startup and shutdown.  (I'm very familiar=
 with oracle on unix, but not with xe on unix.  I'm moderately familiar wit=
h xe on Windows.  There is an XE space on forums.oracle.com that may give b=
etter advice).
>=20
>=20
>=20
> Did you follow all the setup instructions?  Did you need to create a user=
 and group?
>=20
>=20
>=20
> When you connect to a database non-locally, you make a statement like use=
rname/password@xe.  The xe there is defined in a tnsnames.ora.  A local con=
nection doesn't have the @ part, and so you would normally startup by setti=
ng ORACLE_SID and ORACLE_HOME and a reference to $ORACLE_HOME/bin on your p=
ath, with a command something like sqlplus / as sysdba (not having a userna=
me password means use operating system authentication), then entering the w=
ord startup.  You can condition your environment with a dot command, . orae=
nv (if xe on unix does it like most oracle databases).
>=20
>=20
>=20
> Oracle runs setuid, so it can spawn processes owned by users, as well as =
set up interprocess communication (ipcs |grep oracle should show memory seg=
ments).  It should not be run as root.  When you install, it should be as a=
n oracle administrator, with some root commands run later (again, I'm not s=
ure how xe handles that).
>=20
>=20
>=20
> Your startdb process should start the listener and start the database.  Y=
ou shouldn't see anything in the alert log unless something happens.  So yo=
u should see a bunch of startup messages, followed by the occasional redo l=
og switch message.  You can connect / as sysdba and give the command alter =
system switch logfile; to see if messages appear in the alert log.
>=20
>=20
>=20
> jg
>=20
> --=20
>=20
> @home.com is bogus.
>=20
> http://www.forbes.com/sites/oracle/2014/09/23/the-economics-of-the-real-t=
ime-enterprise/

0
ted
9/23/2014 4:43:13 PM
On Tuesday, September 23, 2014 9:43:13 AM UTC-7, ted y wrote:
> Thanks guys.
> 
> 
> 
> I did NOT create the new user accounts and groups , since my very goal is to run this server as normal user , when the user wants to run a junit (which needs an oracle instance)
> 
> 
> 
> this way, most of the setup instructions do not apply for my case. I did set the ORACLE_HOME and ORACLE_SID env variables (either when I ran sqlplus manually, or as part of init.d/oracle-xe configure , since the latter automatically sets it )
> 

You must follow the directions.  Computers are dumb, you should be smart.  Shared memory realm errors usually mean environment wrong (it's trying to attach to shared memory that hasn't been declared).

I don't quite understand what the junit means.  

jg
-- 
@home.com is bogus.
http://www.infoworld.com/article/2686953/cloud-computing/ellisons-exit-oracle-finally-do-the-cloud-right.html
0
joel
9/23/2014 6:11:12 PM
On 23.09.2014 18:43, ted y wrote:

> I did NOT create the new user accounts and groups , since my very
> goal is to run this server as normal user , when the user wants to
> run a junit (which needs an oracle instance)

That is a very bad idea(TM).  The overhead to start an Oracle instance 
per unit test is much too high.  Plus, you would want a private instance 
for each test to avoid interference with each other.  So that would mean 
to not only _start_ an instance on the fly but also to configure it on 
the fly.

I think a more successful approach is to look into using different 
schemas for that.  Even that is still a bit costly but more manageable 
than the original approach.

Kind regards

	robert
0
Robert
9/24/2014 6:50:07 AM
On Tue, 23 Sep 2014 08:54:57 -0700, ddf wrote:


> You are not supposed to install or run the Oracle database as 'root'. 
> There should be an 'oracle' account used to install, and run, the
> database.  You need to login as the 'oracle' user, run the installer,
> install the software then use 'root' ONLY when requested to run any
> root.sh scripts.  Oracle never runs as 'root'.

Actually, the newer versions are packaged as RPM packages and should be 
installed by user root. The user is probably trying to install on a non-
supported Debian distribution.



-- 
Mladen Gogala
The Oracle Whisperer
http://mgogala.byethost5.com
0
Mladen
9/24/2014 7:05:32 AM
Thanks Robert. your comments are very right. I'm glad you understood my app=
roach.

yes, the start up time would be high. but with  a bit of careful coding in =
my wrapper class for my custom base class that uses this oracle setup, I ca=
n let all the junit cases share the same oracle instance, and not starting =
a new one every time. that way the cost is tolerable, I'm not terribly conc=
erned with the speed to run my junit.=20

compared to the headache to cope with the difference between oracle sql fla=
vor / features and that of hsqldb/sqlite3, the time cost is much less of a =
concern. if I could setup oracle for my test, I don't need to worry about o=
ur QA "runway" oracle boxes going down or network cut off. hsqldb offers a =
"Oracle flavor/mode" but it's far from even a satisfactory emulation, it la=
cks many oracle functions.

granted , testing db-related java code is a pain, I tried to search around =
for an established, systematic,  sound approach, but haven't seen any on th=
e web or through my work.

thanks
yang

On Tuesday, September 23, 2014 11:50:07 PM UTC-7, Robert Klemme wrote:
> On 23.09.2014 18:43, ted y wrote:
>=20
>=20
>=20
> > I did NOT create the new user accounts and groups , since my very
>=20
> > goal is to run this server as normal user , when the user wants to
>=20
> > run a junit (which needs an oracle instance)
>=20
>=20
>=20
> That is a very bad idea(TM).  The overhead to start an Oracle instance=20
>=20
> per unit test is much too high.  Plus, you would want a private instance=
=20
>=20
> for each test to avoid interference with each other.  So that would mean=
=20
>=20
> to not only _start_ an instance on the fly but also to configure it on=20
>=20
> the fly.
>=20
>=20
>=20
> I think a more successful approach is to look into using different=20
>=20
> schemas for that.  Even that is still a bit costly but more manageable=20
>=20
> than the original approach.
>=20
>=20
>=20
> Kind regards
>=20
>=20
>=20
> 	robert

0
ted
9/24/2014 7:59:07 AM
another case where we absolutely can't use mock is the case of very complex=
 production schemas and data. in such cases, the only way you could prepare=
 the data and schema for test, is to grab a snapshot from production, so yo=
u need an oracle db for testing. but a single "QA runway box" golden datase=
t is susceptible to being modified unintendedly, or losing network connecti=
on. so the only surefire way to junit test, is to pack the golden dataset a=
s part of the source code, and ship the oracle db, together with the golden=
 data, as part of the test code


=20
On Wednesday, September 24, 2014 12:59:07 AM UTC-7, ted y wrote:
> Thanks Robert. your comments are very right. I'm glad you understood my a=
pproach.
>=20
>=20
>=20
> yes, the start up time would be high. but with  a bit of careful coding i=
n my wrapper class for my custom base class that uses this oracle setup, I =
can let all the junit cases share the same oracle instance, and not startin=
g a new one every time. that way the cost is tolerable, I'm not terribly co=
ncerned with the speed to run my junit.=20
>=20
>=20
>=20
> compared to the headache to cope with the difference between oracle sql f=
lavor / features and that of hsqldb/sqlite3, the time cost is much less of =
a concern. if I could setup oracle for my test, I don't need to worry about=
 our QA "runway" oracle boxes going down or network cut off. hsqldb offers =
a "Oracle flavor/mode" but it's far from even a satisfactory emulation, it =
lacks many oracle functions.
>=20
>=20
>=20
> granted , testing db-related java code is a pain, I tried to search aroun=
d for an established, systematic,  sound approach, but haven't seen any on =
the web or through my work.
>=20
>=20
>=20
> thanks
>=20
> yang
>=20
>=20
>=20
> On Tuesday, September 23, 2014 11:50:07 PM UTC-7, Robert Klemme wrote:
>=20
> > On 23.09.2014 18:43, ted y wrote:
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > > I did NOT create the new user accounts and groups , since my very
>=20
> >=20
>=20
> > > goal is to run this server as normal user , when the user wants to
>=20
> >=20
>=20
> > > run a junit (which needs an oracle instance)
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > That is a very bad idea(TM).  The overhead to start an Oracle instance=
=20
>=20
> >=20
>=20
> > per unit test is much too high.  Plus, you would want a private instanc=
e=20
>=20
> >=20
>=20
> > for each test to avoid interference with each other.  So that would mea=
n=20
>=20
> >=20
>=20
> > to not only _start_ an instance on the fly but also to configure it on=
=20
>=20
> >=20
>=20
> > the fly.
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > I think a more successful approach is to look into using different=20
>=20
> >=20
>=20
> > schemas for that.  Even that is still a bit costly but more manageable=
=20
>=20
> >=20
>=20
> > than the original approach.
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > Kind regards
>=20
> >=20
>=20
> >=20
>=20
> >=20
>=20
> > 	robert

0
ted
9/24/2014 8:05:56 AM
On 24.09.2014 09:59, ted y wrote:
> Thanks Robert. your comments are very right. I'm glad you understood
> my approach.

:-)

> yes, the start up time would be high. but with  a bit of careful
> coding in my wrapper class for my custom base class that uses this
> oracle setup, I can let all the junit cases share the same oracle
> instance, and not starting a new one every time. that way the cost is
> tolerable, I'm not terribly concerned with the speed to run my
> junit.

But that way you have created dependencies between your junit test cases 
via the state in the database.

> compared to the headache to cope with the difference between oracle
> sql flavor / features and that of hsqldb/sqlite3, the time cost is
> much less of a concern.

Why don't you use JPA to handle SQL flavors?

> if I could setup oracle for my test, I don't
> need to worry about our QA "runway" oracle boxes going down or
> network cut off. hsqldb offers a "Oracle flavor/mode" but it's far
> from even a satisfactory emulation, it lacks many oracle functions.

Yeah, you need the real thing for testing for sure.

> granted , testing db-related java code is a pain, I tried to search
> around for an established, systematic,  sound approach, but haven't
> seen any on the web or through my work.

I think testing code that needs a database is always a pain - especially 
for large schemas.  Nowadays I tend to think that this is not a unit 
test topic.  This is rather an integration test.

Another idea would be to use some kind of virtualization solution and 
create a snapshot of the running database with a particular state.  Then 
you start always from that snapshot.  You may even be able to create 
multiple instances by cloning the snapshot but that would be a complex 
task in itself as you then need to convince Oracle to listen on 
different IPs etc.  Or you use localhost and inject the test code on the 
machine.

Cheers

	robert
0
Robert
9/24/2014 4:55:12 PM
Thanks Robert.

regarding the JPA note, we are using a company-proprietory framework, so don't have much choice

On Wednesday, September 24, 2014 9:55:12 AM UTC-7, Robert Klemme wrote:
> On 24.09.2014 09:59, ted y wrote:
> 
> > Thanks Robert. your comments are very right. I'm glad you understood
> 
> > my approach.
> 
> 
> 
> :-)
> 
> 
> 
> > yes, the start up time would be high. but with  a bit of careful
> 
> > coding in my wrapper class for my custom base class that uses this
> 
> > oracle setup, I can let all the junit cases share the same oracle
> 
> > instance, and not starting a new one every time. that way the cost is
> 
> > tolerable, I'm not terribly concerned with the speed to run my
> 
> > junit.
> 
> 
> 
> But that way you have created dependencies between your junit test cases 
> 
> via the state in the database.
> 
> 
> 
> > compared to the headache to cope with the difference between oracle
> 
> > sql flavor / features and that of hsqldb/sqlite3, the time cost is
> 
> > much less of a concern.
> 
> 
> 
> Why don't you use JPA to handle SQL flavors?
> 
> 
> 
> > if I could setup oracle for my test, I don't
> 
> > need to worry about our QA "runway" oracle boxes going down or
> 
> > network cut off. hsqldb offers a "Oracle flavor/mode" but it's far
> 
> > from even a satisfactory emulation, it lacks many oracle functions.
> 
> 
> 
> Yeah, you need the real thing for testing for sure.
> 
> 
> 
> > granted , testing db-related java code is a pain, I tried to search
> 
> > around for an established, systematic,  sound approach, but haven't
> 
> > seen any on the web or through my work.
> 
> 
> 
> I think testing code that needs a database is always a pain - especially 
> 
> for large schemas.  Nowadays I tend to think that this is not a unit 
> 
> test topic.  This is rather an integration test.
> 
> 
> 
> Another idea would be to use some kind of virtualization solution and 
> 
> create a snapshot of the running database with a particular state.  Then 
> 
> you start always from that snapshot.  You may even be able to create 
> 
> multiple instances by cloning the snapshot but that would be a complex 
> 
> task in itself as you then need to convince Oracle to listen on 
> 
> different IPs etc.  Or you use localhost and inject the test code on the 
> 
> machine.
> 
> 
> 
> Cheers
> 
> 
> 
> 	robert

0
ted
9/24/2014 5:13:57 PM
Reply:

Similar Artilces:

it's compatible oracle 8i client, compatible whith oracle 9i server (or oracle 10g server)
Hi all, I have a client/server application that work on the client with oracle 8i client connected to oracle 8i server, Im going to upgrade the server to oracle 9i (or oracle10g) , and I wonder if the client will work fine without upgrade version. Thanks Angel R. wrote: > Hi all, > I have a client/server application that work on the client with oracle 8i > client connected to > oracle 8i server, Im going to upgrade the server to oracle 9i (or oracle10g) > , and > I wonder if the client will work fine without upgrade version. > > Thanks If...

moving oracle database server into a new server
Hi all I will be moving oracle from one Solaris server into another Solaris server, the IP address and box name will be changed. Oracle version is 8.1.7 and O/S is 5.8 on both servers ( just different O/S patch). Does any one know what I need to do in order to get oracle up and running again on the new server. I know that I will need to change the tnsnames.ora and listner.ora, but is there anything else that I need to do? Thanks Teresa Teresa wrote: > Hi all > > I will be moving oracle from one Solaris server into another Solaris > server, the IP address and box name will...

Question on Oracle Server 10g Install (.../oracle/oracle/.....
I am in the last stages of installing Oracle Server 10gR2 Enterprise Edition on a UNIX AIX server. When window "Execute Configuration Scripts" comes up it tells me to execute "/u01/app/oracle/oracle/product/10.2.0/db_1/root.sh". The ".../oracle/oracle/..." stops me cold. I look back in my notes and everything I wrote suggests I had entered ".../oracle/product/....." for my ORACLE_HOME. I look at the install log in /u01/app/oracle/oraInventory/logs and see: "INFO: Setting variable 'ORACLE_HOME' to '/u01/app/oracle/oracle/product/10.2.0/d...

SQL server replication from non-clustered database servers
Hello, Being a bit of a SQL Server novice, need some advice with the following situation. Server A and Server B have SQLServer 2000 based databases. The vendor of the application/system has implemented their own replication process to ensure the 2 databases are in sync. However, there is no clustering with virtual IP addresses implemented. So to an external client/db, it is 2 identical databases with the same name on 2 distinct servers. We need to develop an application that will reside on a networked server C and with SQLServer 2000 as well. While most of the tables in this database are se...

How do I check which Oracle Patches are appplied to an Oracle DataBase Server
I would like to know if someone could help me with this topic, I'm traying to analize and chek which Oracle Patches are appplied to an Oracle DataBase Server >chek which Oracle Patches are appplied to an Oracle DataBase Server If they were applied with oPatch, then "opatch lsinventory" should show you what's there. If you did not use oPatch, then I have no clue. ;-) BD wrote: > >chek which Oracle Patches are appplied to an Oracle DataBase Server > > If they were applied with oPatch, then "opatch lsinventory" should show > you what's ther...

Oracle 9i Database Server on Windows 2003 Server
I am wondering if we can install this Server on Windows 2003 Server without any problems. Is there anybody that did that before? Thanks in advance if someone know the answer. Yvon Bouchard, B. Sc. Computer Science Teacher http://info.cegepat.qc.ca/siteyvon I've installed it on windows 2003 enterprise ed. about 1 month ago without any problem. I've installed the version 9.2.0.1 with the patch to 9.2.0.3. 9.2.0.3 is the only version certified by oracle for win 2003. Ciao "Yvon Bouchard" <yvon.bouchard@cablevision.qc.ca> ha scritto nel messaggio n...

Running Oracle Reports (Web) from Oracle Forms (Client Server)
I am trying to run an Oracle report successfully deployed to the Web based reports services architecture, from a Forms 6i client server based application. I tried something like the following in the WHEN-BUTTON-PRESSED trigger: host('iexplore.exe '||v_url); This works fine, except that the report in the web browser has to be dismissed closed before I can get back to the form. Is there any way to asynchronously spawn the web browser from the form ? I would highly appreciate advice from those that have actually implemented this solution. Thanks. Petr. Petr (e...

WINODS NT SERVER Oracle
I have Oracle database running on a Windows NT server. I am accessing the server using Remote Desktop ( A Microsoft Terminal Service Client). Somone told me that there are limitations in remote desktop, i.e., one cannot start Oracle. I want to know why as well as the workarounds. Instead of running everything from the WINDOWS NT server console wjhich is painful, what are the workraounds. Do same problem exist with pcAnywhere, VNC desktop, Citrix client. Thanks, Prem On 19 Feb 2004 18:38:10 -0800, premmehrotra@hotmail.com (Prem K Mehrotra) wrote: >I have Oracle database running on a Wi...

Running Oracle 8.1.x and Oracle 9i on same Windows 2000 Server
I'm attempting to run an Oracle 8.1.7 database and and Oracle 9i database on the same Windows 2000 Server. Before doing this has anyone ran this configuration and are there any things I must watch out for prior to installing the Oracle 9i software? Thanks for the assistance. David David wrote: > I'm attempting to run an Oracle 8.1.7 database and and Oracle 9i database > on the same Windows 2000 Server. > > Before doing this has anyone ran this configuration and are there any > things I must watch out for prior to installing the Oracle 9i software? >...

Running ORACLE 8.1.7 & ORACLE 9.2 on the same UNIX server
Hi, I have recently installed ORACLE 9.2 Database on a UNIX server (2.8) which already has ORACLE 8.1.7. They have both a different SID and ORACLE_BASE. However I am having to use the ORACLE 8 listener for both ORACLE databases. Is it possible to run separate ORACLE 8 and ORACLE 9 listeners? Hello, There are no difficulty to use 2 listeners on the same machine. The point is that default listener used to listen on port 1521 (or 1526). You will have to change your listener configuration( netasst or by hand) in order to use a different port number, a different listener name...

SqlSpec
Do you wish you had comprehensive, easily navigable documentation for your SQL Server, Oracle, Analysis Server, MySQL, and Access databases? Are you a SQL Developer or DBA that just inherited a huge, complex database with no supporting docs and don't know where to start learning how it's put together? Are you an independent contractor working with SQL Server, Oracle, Analysis Server, MySQL, or Access? Your clients would LOVE you if you could provide comprehensive documentation about the databases you build. Are you a Project Manager who is tired of developers making chan...

Server to server = Server client to server?
For a server to server connection, is the connecting server considered as a client of the accepting server or is it not? I have the following classes: Connection <--- base class of the following two ClientConnection <--- client ServerConnection <--- server ServerClientConnection <--- server as a client of another server. But then I came across something that states "A client is anything connected to a server that is not another client". Comments please... Just remember! Server ( programm ) is always listening a connections!!! - wrote: &g...

[News] Servers Running GNU/Linux Could Get Boost from Oracle, OS X Server Disappoints
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oracle's Linux Server Slant ,----[ Quote ] | Based on Oracle's recent actions, it seems the | company is hell-bent on driving as many of its | potential customers as possible away from the | UNIX offerings it acquired from Sun and into | the arms of Red Hat and other enterprise Linux | vendors. `---- http://www.serverwatch.com/trends/article.php/3873696/Oracles-Linux-Server-Slant.htm A Sys Admin's Guide to the Server OS of Your Dreams ,----[ Quote ] | What's startlingly clear from this little | exercise though is how dism...

SN#11477 Oracle Application Server 10g Running on Sun Servers Sets World Record
SYSTEM NEWS FOR SUN USERS Vol 69 Issue 1 2003-11-03 Article 11477 from section "News" First Benchmark Record Set on Heterogeneous Chip Architecture Sun solutions have achieved another world record, this time with Oracle Application Server 10g running on a heterogeneous Sun configuration in the SPECjAppServer 2002 benchmark. The multi-tier operating system and processor architecture included a seven-node Sun Fire[TM] V65x server cluster, each equipped with two Intel Xeon 3.06 GHz processors running Red Hat Enterprise Li...

Web resources about - is it possible to run oracle server as non-root, non-system process? - comp.databases.oracle.server

The Day Care Non-System
... despite the fact that work and family life has changed profoundly in recent decades, we lack anything resembling an actual child care system. ...

Resources last updated: 1/26/2016 11:55:04 AM