Oracle Database uses sqlplus connection error and direction key garbled solution, oraclesqlplus

Source: Internet
Author: User

Oracle Database uses sqlplus connection error and direction key garbled solution, oraclesqlplus

Connection Error
After the installation, I log on to the enterprise background (http: // ubuntu: 1158/em) and report an error when connecting to oracle with sqlplus.
1. the following error occurs:
1, ORA-12505: TNS: listener does not currently know of SID given in connect descriptor (dbd error: OCIServerAttach)
2, ORA-28547: connection to server failed, probable Oracle Net admin error (dbd error: OCISessionBegin)
3, sqlplus: error while loading shared libraries: libsqlplus. so: cannot open shared object file: No such file or directory
2. solution:
1. solution 1, ORA-12505: TNS: listener does not currently know of SID given in connect descriptor (dbd error: OCIServerAttach)
(1) locate tnsname. ora, listerner. ora

root@ubuntu:/opt/ora10/network/admin# ls
listener.ora samples shrept.lst sqlnet.ora tnsnames.ora

(2) modify the listerner. ora Configuration
Change (SID_NAME = PLSExtProc) to (SID_NAME = ora1). SID_NAME can be seen in the http: // ubuntu: 1158/em management background of oracle.
2. Problem 2: ORA-28547: connection to server failed, probable Oracle Net admin error (dbd error: OCISessionBegin)
After the problem is solved, this problem occurs. I checked it online and said it was useless.
(1). Modify the network configuration file of oracle. The specific method is to search for the sqlnet. ora file in the oracle Installation Directory, which is usually in the $ NETWORKADMIN directory,
Use NotePad to open a line in the file:

SQLNET_AUTHENTICATION_SERVICES= (NTS)

To:

SQLNET_AUTHENTICATION_SERVICES= (NONE)

I found that my sqlnet. ora does not have this project setting at all. There is only one sentence in my sqlnet. ora: NAMES. DIRECTORY_PATH = (TNSNAMES, EZCONNECT)
(2 ). modify the listener Configuration file at the same time. The specific method is to search for listener in the oracle installation directory. ora file, usually in the $ NETWORKADMIN directory, replace the HOST name with an ip address, for example (ADDRESS = (PROTOCOL = TCP) (HOST = HBONLINE1) (PORT = 1523 )) change to (ADDRESS = (PROTOCOL = TCP) (HOST = 168.168.168.42) (PORT = 1523 ))
I don't even know why I want to replace it with an ip address. The value corresponding to the HOST is mapped in/etc/hosts, and there is no need to replace it with an ip address.
The root cause is that the oracle service is not available at all. You can check it through ps-e | grep-I oracle. This problem does not occur when it is started.

SQL> startup
ORACLE instance started.

3. solution 3: sqlplus: error while loading shared libraries: libsqlplus. so: cannot open shared object file: No such file or directory
When I use zhangying @ ubuntu :~ When $ sqlplus/as sysdba logs on, the above error is prompted. The solution is as follows:
Chmod-R a + rX/opt/ora10/
Here, the/opt/ora10 is the $ ORACLE_HOME directory, which can be added.

Direction keys garbled
Use sqlplus to connect to oracle. The direction keys are always garbled. SQL> ^ [[A ^ [[A ^ [B ^ [B ^ [B ^ [D ^, for linux, the solution for ubuntu 10.10 is as follows:
1. Download and install readline

Apt-get install libreadline5-dev // ubuntu to install this wget ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz tar zxvf readline-6.2.tar.gz cd readline-6.2 wget ftp://ftp.gnu.org/gnu/readline/readline-6.2-patches/readline62-001 patch-p0 <ftp://ftp.gnu.org/gnu/readline/readline-6.2-patches/readline62-001.sig // patching./configure make & make install

Note:-p is followed by zero, not the letter o. If you do not install the apt-get install libreadline5-dev, install rlwrap,./configure always reports an error.
2. Install rlwrap

wget http://utopia.knoware.nl/~hlub/uck/rlwrap/rlwrap-0.37.tar.gz tar zxvf rlwrap-0.37.tar.gz cd rlwrap-0.37 ./configure make && make install 

Note: first install readline and then install rlwrap. Otherwise, an error will be reported during./configure, as shown below:

configure: error:You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/ ) to buildthis program!

3. Modify. bashrc in the root directory of the user.

# Some more ls aliases alias ll = 'LS-alf' alias la = 'LS-a' alias l = 'LS-CF 'alias sqlplus = 'rlwrap sqlplus' // Add this one row

Modify. bashrc to restart the computer. If no. bashrc exists, modify the. bash_profile or. profile file.

Articles you may be interested in:
  • Solve the Problem of invalid backspace and Del keys in Oracle sqlplus in Linux
  • Simple oracle Installation and SQLPLUS usage
  • Common oracle SQL plus commands

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.