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: Peter J. Holzer <hjp-usenet_at_hjp.at>
Date: Sat, 1 Feb 2003 11:17:45 +0100
Message-ID: <slrnb3n7m8.kj6.hjp-usenet@teal.hjp.at>


On 2003-02-01 07:36, Howard J. Rogers <howardjr2000_at_yahoo.com.au> wrote:
> 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.
>
> 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.
>
> 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!).

I am assuming that you are using the bash - some other shells (personally I use and recommend the zsh) use other startup files.

The .profile is only read by a "login shell", i.e. a shell which is started with the first character of the command name set to "-". The login program invokes the shell this way, but terminal emulators like xterm generally do not (there is an option for this, though). So you may not have the same environment in the GUI as on the console or when you login remotely.

There are two ways to fix this:

  1. Invoke xterm (or kterm, or gnome-terminal, or whatever Mandrake uses) with the option to start a login shell.
  2. Source the profile in your .Xsession file (Newer versions of Redhat use a login shell to execute the session file, so there this will happen automatically, which is "The Right Thing", IMHO, but it seems that Mandrake doesn't do this).

How to do these things depends on what display manager and desktop environment you use and probably also on some distribution-specific scripts.

You could also set the environment variables in the .bashrc instead of the .profile. This is read by every interactive shell, not just login shells.

Oh, and you could check whether you have a .bash_profile. If you have, the bash will read that and ignore your .profile.

> 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?

The installer creates a startup and stop script (called "oracle") in the "local directory" you specify at some point during installation (at least with Oracle 8.x, haven't installed 9.x yet). You can just add the commands to start and stop the listener to that (Although I was quite sure that this script normally does start both the database and the listener, so I find it quite odd that you get running instances but no listener).

        hp

-- 
   _  | Peter J. Holzer    | To a database person,
|_|_) | Sysadmin WSR       | every nail looks like a thumb.
| |   | hjp_at_hjp.at         |
__/   | http://www.hjp.at/ |     -- Jamie Zawinski
Received on Sat Feb 01 2003 - 04:17:45 CST

Original text of this message

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