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

From: joel garry <joel-garry_at_home.com>
Date: Tue, 23 Sep 2014 09:00:38 -0700 (PDT)
Message-ID: <e496a101-d217-42cd-9de1-29b08539868b_at_googlegroups.com>


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:00:38 CEST

Original text of this message