Invalid Oracle environment variable under Linux

Source: Internet
Author: User

Today, while maintaining the Oracle database, view the status of the listener and execute

#lsnrctl status

Error:-bash:lsnrctl:command not found. Not before, think carefully, the problem found, I was rooted telnet to the server, the maintenance of Oracle, direct Su Oracle, so that although the user switch to Oracle, environment variables are still root environment variables, it will be reported environment variable error, The correct command is su-oracle, so the environment variable is also switched to the environment variable of Oracle.
Take a look at the man page of the SU command

NAME
Su-run a shell with substitute user and group IDs

Synopsis
Su [OPTION] ... [-] [USER [ARG] ...]

DESCRIPTION
Change the effective User ID and group ID.
USER.

-,-L,--login
Make the shell a login shell, clears all envvars
Except for term, initializes HOME, SHELL, USER,
LOGNAME and PATH

...

A mere-implies-l. If USER not given, assume root.

As you can see, the Add-option will empty the environment variables except for the term and reinitialize home, SHELL, USER, logname, and path.

So pay attention to details, especially under Linux, a little bit differently, all of which can lead to completely different results.

Invalid Oracle environment variable under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.