Why can't telnet to the database with SYS

Source: Internet
Author: User

Today through PL/SQL connection to a database, ordinary users can connect, but SYS is not connected, tell me the user name password error. You've actually had this problem before and then started looking for reasons. The whole process is recorded as follows, the result is the heart, the process is not fully understand. Write down the right to be a memo.

1. Check the server listener status.

1 $ lsnrctl Status2 3Lsnrctl forLinux:version11.2.0.1.0-Production on --September- .  -: -: $4 5Copyright (c)1991, the, Oracle. All rights reserved.6 7Connecting to (Description= (address= (protocol=tcp) (host=oa-db- on) (port=1521)))8 the STATUS of LISTENER9------------------------Ten alias LISTENER OneVersion Tnslsnr forLinux:version11.2.0.1.0-Production AStart date --September- .  -: -: in -Normal operating time0Days0Hours theScore of7seconds - Trace level off the Security on:local OS authentication - SNMP OFF -Listener parameter File/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/Listener.ora -Listener log File/oracle/app/diag/tnslsnr/oa-db- on/listener/alert/Log.xml + Listener Endpoint Summary ... -(Description= (address= (protocol=tcp) (host=oa-db- on) (port=1521))) + Service Summary: AService"Plsextproc"Contains1an instance.  atInstance"Plsextproc", state UNKNOWN, which contains this service.1a handler ... -Service"ORCL"Contains1an instance.  -Instance"ORCL", state ready, containing this service's1a handler ... -Service"Orclxdb"Contains1an instance.  -Instance"ORCL", state ready, containing this service's1a handler ... -Command execution succeeded
View Code

You can see that the listener is fine.

2, through the tnsping to see if connectivity.

Do it on the server

1 $ tnsping ORCL2 3TNS Ping Utility forLinux:version11.2.0.1.0-Production on --September- .  -: the: -4 5Copyright (c)1997, the, Oracle. All rights reserved.6 7 used parameter file:8/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/Sqlnet.ora9 Tentns-03505: Could not resolve name
View Code

This is because the configuration file is not tnsname.ora on the server and the name cannot be resolved.

Do it on the client

1 tnsping oaproddb2 3TNS Ping Utility for  +-bit windows:version11.2.0.4.0-Production on --September- .  -: One: to4 5Copyright (c)1997, -, Oracle. All rights reserved.6 7 used parameter file:8D:\app\JIAKAI\product\11.2.0\client_1\network\admin\sqlnet.ora9 Ten  One used the TNSNames adapter to resolve aliases AAttempt to connect (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = **.**.**.**) (PORT =1521)) (Connect_data = (SERVER = dedicated) (Service_Name =ORCL ))) -OK ( -milliseconds) -  theC:\users\jiakai>
View Code

No problem.

3. View database Parameters File

Log on to the server, and then log on to the database as a SYS user

1$ sqlplus/As sysdba2 3Sql*plus:release11.2.0.1.0Production on Wednesday September -  -: -: A  .4 5Copyright (c)1982, the, Oracle. All rights reserved.6 7 8 Connect to:9Oracle Database 11g Enterprise Edition Release11.2.0.1.0-64bit ProductionTen with the partitioning, OLAP, Data Mining and Real application testing options One  ASql>Show User -USER is"SYS" -Sql>
View Code

4. See if SPFile exists

1Sql>Show Parameter SPFile2 3 NAME TYPE VALUE4 ------------------------------------ ----------- ------------------------------5SPFile string/Oracle/App/Oracle/Product/11.2.0/Dbhome_1/Dbs/Spfileorcl.ora
View Code

No problem.

5. Then view the Remote_login_pass parameters

1 SQL>  show Parameter Remote_login_pass23NAME                                 TYPE        VALUE4---------------------------------------------------------------------------- -5 remote_login_passwordfile            string      EXCLUSIVE
View Code

There's no problem.

Have never doubted that the SYS password is incorrect because you can log on by using the following statement

1$ sqlplus SYS/1234  asSYSDBA2 3Sql*Plus:release11.2.0.1.0Production onWednesday September -  -: -: $  .4 5Copyright (c)1982, the, Oracle. Allrights reserved.6 7 8 Connect to:9OracleDatabase11g Enterprise Edition Release11.2.0.1.0 -64bitProductionTen  withThe partitioning, OLAP, Data Mining and RealApplication Testing Options
View Code

But still try to hug the attitude, I changed the sys password. And then actually logged in successfully. (Heart 10,000 Grass mud horse ran)

So the question is, why Sqlplus sys/1234 as sysdba be able to log in? I then tried the other Sqlplus ***/*** as SYSDBA can log in. (WTF)

This is because Sqlplus ***/*** as SYSDBA is logged on locally, which is the operating system login verification, and Oracle ignores the "/" two times user name and password. So logging in this way is a SYS user.

So this time the problem is that the SYS password is not written right, so PL/SQL login does not go up.

Reference:

http://blog.csdn.net/zdwzzu2006/article/details/6096322

Http://www.cnblogs.com/kerrycode/archive/2013/03/27/2984152.html

http://blog.csdn.net/ma1kong/article/details/38636965

Why can't telnet to the database with SYS

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.