Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: A bit of Linux advice yet again??

Re: A bit of Linux advice yet again??

From: Noons <nsouto_at_optusnet.com.au.nospam>
Date: 01 Feb 2003 11:39:33 GMT
Message-ID: <Xns9315E41D1A091mineminemine@210.49.20.254>


"Howard J. Rogers" <howardjr2000_at_yahoo.com.au> wrote in news:0FK_9.38003$jM5.96462_at_newsfeeds.bigpond.com and I quote:

> Against all the odds, I've gotten 9.2 to run on Mandrake 9.0 (which, I
> have to say, is the first Linux distro I've seen that's persuaded me
> there are viable alternatives to Windows). I have a "DB9"

Hehehe! Not bad at all, eh? And dirt cheap too! Mind you, I've found a few minor probs. Still prefer Suse 8, but Mandrake is sooooo cool!

>
> But I want to log on as me. So, I create a .profile in my home directory
> that sets all the usual variables, including path.
>

Hmmm, I think you should look at using oraenv? That is probably what the Oracle user does. Unless things have majorly changed in 9ir2.

Warning: boring stuff follows, ignore if you're aware of it. Works like this, assuming any shell except "C":

1 - a script called "oraenv" exists in /usr/local/bin.

2- This path (/usr/local/bin) should be part of your PATH variable, set by "profile".

3- oraenv reads the /etc/oratab file looking for ORACLE_HOME and SID values. and a few other things I won't go into now.

4- If you set ORACLE_SID in your profile, then export it, then set ORAENV_ASK to NO, then export it, then call oraenv using exactly this syntax:
. oraenv<CR>
(note the space between the dot and the word!) then that should set you up to that SID automatically.

One of the good things of doing it thusly is that you don't have to worry about removing stuff from your PATH and setting it to others when changing SIDs: oraenv does all that magic for you.

> I reboot the machine, just because I'm a former Windows user and we're
> used to that sort of thing. I log on as me. I open a terminal window,
> and type 'sqlplus', and I get the error 'command not found'.
>
> I then type ". ./.profile", and the 'sqlplus' command works perfectly.

That is indeed strange. What have you got defined as your home directory in /etc/passwd? What is the contents of /etc/profile (global profile file run before yours)?

Do an "echo $PATH" just after login and after running your profile and see if any diffs.
Check out if /usr/local/bin is part of your PATH right at the top of your ".profile" script. And also check out if this path is accessible to you as a user (r-x in protection for world).

Make sure that ORACLE_HOME and all the stuff under it is accessible to world (r-x), otherwise there may be problems.

>
> Now, I realise I only know the backend of batch files, but I was rather
> under the impression that .profile would be invoked the moment I logged
> in. So why isn't it? What am I doing wrong (try and keep the list
> modestly short!).
>

Only if your login shell doesn't know about "profile". Which would be the case if it is the "C" shell. Or if your /etc/passwd file is seriously waco for your login id.

> Oh -one other thing. I know all about oratab, and I *do* get both my
> instances starting automatically at reboot. But how does one automate
> the intelligent agent and listener? oratab doesn't seem syntactically
> capable of doing these, so I guess I must look elsewhere. Am I deep into
> shell scripting at this point??

Yes, you are. The equivalent of Windows "Startup" folder in Unix is a reasonably complex thing called "rc" scripts and init() process. Scripts live in "/etc/rcnn" where "nn" may start at 0. They are directories that contain scripts for starting up groups of software depending on which run level you're going to.

Unix has this quaint concept of run levels. 5 is multi-user, 1 is single user, a lot of things in between. Each run level corresponds to one of the numbers in the rc(nn) directories. Each directory will contain the startup files for what you want to run in those levels. You put the corresponding startup scripts for Oracle stuff in those.

Those scripts you write yourself, or you stick to standards and use the "dbstart" and "dbshut" stuff from Oracle. For starting the listener, you add it to the top of dbstart for example, with something like "lsnrctl start" right at the top of that script.

Read all about it by looking at the "init()" man pages, that's the process that controls startup and run levels in Unix.

Shutdown is also handled by same mechanism, BTW.

HTH. Any probs, ping me offline.

-- 
Cheers
Nuno Souto
nsouto_at_optusnet.com.au.nospam
Received on Sat Feb 01 2003 - 05:39:33 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US