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

From: ted y <teddyyyy123_at_gmail.com>
Date: Tue, 23 Sep 2014 09:43:13 -0700 (PDT)
Message-ID: <d58104f2-342c-446a-86ad-2ff34976d228_at_googlegroups.com>


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 )

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

+ /home/myuser/tools/oracle/install/u01/app/oracle//product/11.2.0/xe/bin/sqlplus -s /nolog _at_/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_at_yyang15-VirtualBox:~/tools/oracle/install$ /home/yyang15/tools/oracle/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:
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:

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

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:
>
> > 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.
>
> >
>
> >
>
> >
>
> > I downloaded the Oracle package, untarred to local, changed a bunch of settings 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 _at_/home/myuser/oracle/install//u01/app/oracle/product/11.2.0/xe/config/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:
>
> >
>
> >
>
> >
>
> > _at_devbox-114942 install]$ cat ./u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
>
> >
>
> > # listener.ora Network Configuration File:
>
> >
>
> >
>
> >
>
> > SID_LIST_LISTENER =
>
> >
>
> > (SID_LIST =
>
> >
>
> > (SID_DESC =
>
> >
>
> > (SID_NAME = PLSExtProc)
>
> >
>
> > (ORACLE_HOME = /home/myuser/oracle/install/u01/app/oracle/product/11.2.0/xe)
>
> >
>
> > (PROGRAM = extproc)
>
> >
>
> > )
>
> >
>
> > )
>
> >
>
> >
>
> >
>
> > LISTENER =
>
> >
>
> > (DESCRIPTION_LIST =
>
> >
>
> > (DESCRIPTION =
>
> >
>
> > (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
>
> >
>
> > (ADDRESS = (PROTOCOL = TCP)(HOST = devbox-114942)(PORT = 1521))
>
> >
>
> > )
>
> >
>
> > )
>
> >
>
> >
>
> >
>
> > DEFAULT_SERVICE_LISTENER = (XE)
>
> >
>
> >
>
> >
>
> > TRACE_LEVEL_LISTENER = SUPPORT
>
> >
>
> > 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 alarming 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 file
>
>
>
> 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 with 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 with xe on Windows. There is an XE space on forums.oracle.com that may give better advice).
>
>
>
> Did you follow all the setup instructions? Did you need to create a user and group?
>
>
>
> When you connect to a database non-locally, you make a statement like username/password_at_xe. The xe there is defined in a tnsnames.ora. A local connection 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 path, with a command something like sqlplus / as sysdba (not having a username password means use operating system authentication), then entering the word 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 set up interprocess communication (ipcs |grep oracle should show memory segments). 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 sure 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 system switch logfile; to see if messages appear in the alert log.
>
>
>
> jg
>
> --
>
> _at_home.com is bogus.
>
> http://www.forbes.com/sites/oracle/2014/09/23/the-economics-of-the-real-time-enterprise/
Received on Tue Sep 23 2014 - 18:43:13 CEST

Original text of this message