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: Tim X <timx_at_spamto.devnul.com>
Date: 02 Feb 2003 16:15:29 +1100
Message-ID: <871y2r5klq.fsf@tiger.rapttech.com.au>


>>>>> "Howard" == Howard J Rogers <howardjr2000_at_yahoo.com.au> writes:

 Howard> OK, maybe I should post this in a Linux newsgroup, but...
 Howard> Against all the odds, I've gotten 9.2 to run on Mandrake 9.0
 Howard> (which, I have to say, is the first Linux distro I've seen
 Howard> that's persuaded me there are viable alternatives to
 Howard> Windows). I have a "DB9" instance/database and an OEMREP
 Howard> instance/database. Log on as the Oracle user, and there's not
 Howard> a problem.

 Howard> But I want to log on as me. So, I create a .profile in my
 Howard> home directory that sets all the usual variables, including  Howard> path.
 Howard> I reboot the machine, just because I'm a former Windows user
 Howard> and we're used to that sort of thing. I log on as me. I open
 Howard> a terminal window, and type 'sqlplus', and I get the error
 Howard> 'command not found'.

 Howard> I then type ". ./.profile", and the 'sqlplus' command works  Howard> perfectly.

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

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

 Howard> Forebearance for a Windows user, please. I am at least  Howard> trying!!

 Howard> Regards HJR

Howard,

Good to hear your comming over to the dark side :-).

I bet your logging in using X windows?

I suspect what is happening is your X windows has been configured so that when you open an xtern it opens it as a non-login shell. The .profile (or .bash_profile - assuming you are using bash) is only sourced for login shells.

There are two solutions for this.

  1. Most terminal emulators like xterm have a swith which you can pass to it that will cause the shell it spawns to be a login shell - its probably something like -ln.
  2. What I like to do is edit the .xsession file (or whatever file on Mandrake sets up your X environment and add a swith to the shell line at the top to make it run as a login shell. I think for bash this is --login, so the top of your .xsession (or whatever it is called) will look like

#!/bin/sh --login

or

#!/bin/bash --login

I like the second approach because all your environment variables ar set in the parent shell of your X session, so all programs spawned from that shell, including other shells will have all your .profiel environment settings.

Tim

P.S. Once we hae you converted to linux, we will have to convince you of the wonders of emacs and sql-mode!

-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!
Received on Sat Feb 01 2003 - 23:15:29 CST

Original text of this message

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