Solve the Problem of invalid Oracle environment variables in Linux

Source: Internet
Author: User

Solve the Problem of invalid Oracle environment variables in Linux

When you maintain the Oracle database in Linux today, view the listener status and execute

# Lsnrctl status

Error:-bash: lsnrctl: command not found. This is not the case in the past. I thought about it for a moment and found the problem. I remotely log on to the server as the root user. When maintaining oracle, I directly su oracle. Although the user switches to oracle, however, the environment variable is still the root environment variable, so an environment variable error will be reported. The correct command is su-oracle, so that the environment variable will be switched to the oracle environment variable.
Let's 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 valid tive user id and group id to that
USER.

-,-L, -- login
Make the shell a login shell, clears all envvars
Before t for TERM, initializes HOME, SHELL, USER,
LOGNAME and PATH

...

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

After the-option is added, the environment variables except the term are cleared and the HOME, SHELL, USER, LOGNAME, and PATH are reinitialized.

So pay more attention to the details, especially in Linux. A little difference may lead to completely different results.

Related Article

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.