Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: A bit of Linux advice yet again??
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:
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 ZawinskiReceived on Sat Feb 01 2003 - 04:17:45 CST
![]() |
![]() |