After Oracle is successfully installed in Linux, start the sqlplus problem set (detailed description) and oraclesqlplus

Source: Internet
Author: User

After Oracle is successfully installed in Linux, start the sqlplus problem set (detailed description) and oraclesqlplus

Note: The installation of Oracle cannot be performed by the root user, but must be performed by a new user.

1. The sqlplus command does not recognize the problem (bash: sqlplus command not found)

This may happen after you install oracle for the first time. It may be tricky for the first time and you don't know how to change it. In this case, you don't have to worry about how the commands in Linux run, such as adduser. We found that because there is such a file adduser in the/bin/folder, we also thought about it, copy the sqlplus file in the bin directory of the installed oracle database to the/binfile directory,

Cp/opt/oracle/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus/bin

The path name depends on the specific path of oracle installation.

After copying the file, run sqlplus on the terminal.

Note: After the copy operation, you are advised to grant the execution permission to all users. Otherwise, the new user cannot be used.

Chmod 777/bin/sqlplus

2. oracle service startup Problems

Different linux systems have different oracle boot files. For example, in Ubuntu, we need to create/etc/init. d/oracledb, and in the kylin system, the file is in/etc/init. d/dbora, but the location is roughly the same. We only need to look closely for such a startup service file. When running these files, pay attention to the variables in oracledb or dbora, such as ORACLE_HOME, ORACLE_SID, and PATH. These variables must be configured according to the oracle directory we have installed. During configuration, use the command export:

Export ORACLE_HOME =/opt/oracle/app/oracle/product/11.2.0/dbhome_1/

3. Recognition of commands such as lsnrctl and emctl (bash: lsnrctl/emctl command not found)

When running lsnrctl, the following error may occur: bash: lsnrctl/emctl command not found. Do not worry. This problem is similar to that not found in the first sqlplus command, we only need to copy the lsnrctl file under the $ ORACLE_HOME/bin directory to the/bin directory (remember to change the execution permission like Problem 1) to identify it.

When emctl is run on the terminal, the ORACLE_HOME is not defined. Environment variable ORACLE_SID not defined. Please define it. According to the prompts, we know where the problem is, so we thought, where can we let it identify the variable ORACLE_SID? There are several common specific files in Linux. For example ~ /. Profile ~ /. Bash_profile ~ /. Bashrc and so on ,~ This symbol represents the main directory of the current user. For example, if the current user is user ~ /Home/user. The above files are used to configure the user environment. If you want your running scripts to identify these problems, you must open them and add these variables later.

For the $ ORACLE_SID variable problem, the solution is to add ORACLE_SID to these files, but in which file is added, you can try to open the above files. If there is something in it, add it in. What is added to my system ~. /Bashrc, first open: vi ~. /Bashrc, and then add

Export ORACLE_SID = orcl ,. Then source ~. /Bashrc to make the file take effect again.

In this way, both lsnrctl and emctl can be successfully passed.

4. You cannot run any command when installing oracle for the first time.

After oracle is installed for the first time, it is found that sqlplus and lsnrctl cannot run, even if the path is under the $ ORACLE_HOME/bin directory. This is solved by running the dbstart command First (go to the bin directory of the installation directory and run it ).

5. The database must be started.

If you have successfully passed the above steps, but when you log in with sqlplus, there is always an error.

Default logon mode: sqlplus/as sysdba. This is the first time you log on to the oracle database, and the database cannot be used. Therefore, you must use the startup mount and startup open commands. In this way, you can use the entire database. If it fails to be opened, you can shut down and shut down before opening the database.

6. oracle usage for different users

When you create a new user, you will find that other commands such as emctl cannot be used. Why? When we look at the error, we find that there is a variable undefined, and then back to problem 2 and 3. Because these variables are undefined, they cannot be successfully executed. Each user provided by the Linux system has an environment file ,(. profile. bash_profile. bashrc) and so on. According to question 3, we only need to add the required variables to these files. The steps are the same as those in question 3.

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.