Oracle Connection Database prompt: Package receive failed: Ora-12637__python

Source: Internet
Author: User
Tags dedicated server sqlplus

Problem Description: When landing Oracle database, whether from SQL Plus or from Toad Landing, there will be no landing on the phenomenon. Prompt for package receive failed: ORA-12637 appears.

Workaround: Modify the Sqlnet.ora file, sqlnet.authentication_services = (NTS) comment off on it.

The following is a reprinted article on Oracle network Configuration Listener.ora, Sqlnet.ora, Tnsnames.ora. is an explanation of the problem.

Three profiles Listener.ora, Sqlnet.ora, Tnsnames.ora, are placed in the $oracle_home\network\admin directory.

1. The Sqlnet.ora-----function is similar to Linux or other Unix nsswitch.conf files to determine how to find a connection string that appears in a connection.
such as our client input
If my sqlnet.ora is like this
Sqlnet. Authentication_services= (NTS)
NAMES. Directory_path= (Tnsnames,hostname)
Then the client will first find the ORCL record in the Tnsnames.ora file. If there is no corresponding record, try to use ORCL as a host name, through the network to resolve its IP address and then to connect the IP GLOBAL_DBNAME=ORCL this instance, Of course I'm here ORCL is not a host name
If I were this way
NAMES. Directory_path= (TNSNAMES)
The client will only look for ORCL records from Tnsnames.ora, and there are other options in parentheses, such as LDAP, which are not commonly used.
2. Tnsnames.ora------This file is similar to the Hosts file for UNIX, providing tnsname to host name or IP correspondence, only if Sqlnet.ora is similar
NAMES. Directory_path= (TNSNAMES) This means that the client resolves the connection string in the order in which it is TNSNAMES to try to use the file.
PROTOCOL: Client and server-side communication protocol, generally TCP, this content generally do not have to change.
Host: The machine name or IP address on which the database listens, and the database listens on the same machine as the database, so when I say that the machine on which the database is listening is generally the machine where the database is located. Under UNIX or WINDOWS, you can get the machine name by using the hostname command at the command prompt of the machine on which the database is listening, or the IP address through the ipconfig (for WINDOWS) or ifconfig (for UNIX) command. Note that, regardless of the machine name or IP address, in the client must ping the database to listen to the machine name, otherwise need to be in the hosts file to listen to the machine's machine name resolution.
Port: The database listens on the port you are listening on, either by looking at the server-side Listener.ora file or by the LNSRCTL status [listener name] command at the command prompt on the machine where the database is listening. The value of the port here must be the same as the database listening on the port it is listening on.
SERVICE_NAME: On the server side, with the system user Login,sqlplus> Show parameter service_name command view.
ORCL corresponding to the local, sales corresponding to another IP address, which also defines the use of the main server or shared server mode to connect

(Address_list =
#下面是这个TNSNAME对应的主机, Port, protocol
(address = (PROTOCOL = TCP) (HOST = (PORT = 1521))
(Connect_data =
#使用专用服务器模式去连接需要跟服务器的模式匹配, if not, automatically adjust according to the server's mode
(SERVER = dedicated)
#对应service_name, sqlplus>;show parameter service_name; To view
(service_name = ORCL)
(Address_list =
(address = (PROTOCOL = TCP) (HOST = (PORT = 1521))
(Connect_data =
(SERVER = dedicated)
(service_name = sales)
Note: If the database server uses MTS, the client program needs to explicitly indicate that the client is using the dedicated direct connection, or else it will encounter many Oracle bugs related to the distributed environment. In general, the database server with a direct connection will be better, unless your real-time database connection number is close to 1000.

3. Listener.ora------Listener Listener Process configuration file
There is little to say about the listener process, accepting remote access to the database and handing it over to Oracle's server process. So if you are not using a remote connection, the listener process is not required, and if you close the listener process, it will not affect the existing database connection.
Examples of Listener.ora files
#listener. Ora network Configuration File: #E: \oracle\product\10.1.0\db_2\network\admin\listener.ora
# Generated by Oracle configuration tools.
#下面定义LISTENER进程为哪个实例提供服务 here is ORCL, and it corresponds to Oracle_home and Global_dbname, where global_dbname is not required unless

Sid_list_listener =
(Sid_list =
(Sid_desc =
(Global_dbname = Boway)
(Oracle_home = E:\oracle\product\10.1.0\Db_2)
(Sid_name = ORCL)
#监听器的名字, a single database can have more than one listener
#再向下面是监听器监听的协议, IP, port, and so on, the tcp1521 port used here, and make the # with the host name
(address = (PROTOCOL = TCP) (HOST = Boway) (PORT = 1521))
The above example is one of the simplest examples, but it is also the most common. A listener process provides services to a instance (SID).
Action commands for listeners
$ORACLE _home/bin/lsnrctl Start, others such as Stop,status. After a specific knock on a lsnrctl to see Help.
The three files mentioned above can be configured using the graphical configuration tool
$ORACLE The _HOME/NETCA Wizard form
$ORACLE _home/netmgr
I am more accustomed to netmgr,
Profile is configured with Sqlnet.ora, which means name resolution.
Service name is configured with the Tnsnames.ora file
Listeners is configured with the Listener.ora file, that is, the listener process
A specific configuration can be tried and then look at the configuration file.
So the overall structure is there, is
When you enter Sqlplus SYS/ORACLE@ORCL,
1. Query Sqlnet.ora look at the way the name of the resolution, found to be tnsname
2. Query Tnsnames.ora files, find ORCL records from inside, and find host names, ports, and Service_Name
3. If the listener process is not a problem, establish a connection to the listener process.
4. Depending on the server model, such as dedicated server mode or shared server mode, listener take the next action. The default is dedicated server mode, and if there is no problem, the client connects to the database's server process.
5. This time the network connection has been established, the historical mission of the listener process is completed.
Forms of command used in several connections
1.sqlplus/as SYSDBA This is a typical operating system authentication and does not require listener processes
2.sqlplus Sys/oracle This connection can only be connected to the native database, but also does not require the listener process
3.sqlplus SYS/ORACLE@ORCL This approach requires the listener process to be in a usable state. The most common connection is through the network.
The above connection methods using the SYS user or other authenticated users of the password file do not require the database to be available, the operating system authentication does not require the database to be available, and the normal user is the database authentication, so the database must be in open state.
The impact of Remote_login_passwordfile on authentication in Init.ora
Three optional values:
NONE: Default value indicating that the Oracle system does not use a password file, and that privileged users who authenticate through the operating system have Sysora and Sysoper permissions
1. Indicates that only one instance of the database can use the password file
2. Allow Sysora and Sysoper permissions to be assigned to users other than Sys
1. Indicates that you can have multiple database instances to use a password file
2. Sysora and Sysoper permissions are not allowed to be assigned to users other than Sys
Therefore, if you want to log on as an operating system, Remote_login_passwordfile should be set to none
When the logged-on user is not a member of the ORA_DBA and ora_oper groups, the logon database needs to create the same user name as the current operating system user in Oracle, and if the current user is a domain user, the name is: Domainname\yourname, if it is a local computer user, The name is: Computername\yourname
To create a method:
Create "domainname\yourname" identified externally;
Operating system, modify HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0 add Auth_prefix_domain below, the value is set to False, you can ignore domain name when creating ORACLE user
In this way, a parameter in Init.ora will affect how the database matches a Windows user and an Oracle user Os_authent_prefix = ""
The default is null, oracle8i previously, without this parameter, and using ops$ as the username prefix. (Maximum Oracle username length is 30 characters)

About domain name (host name) resolution
/etc/hosts (UNIX)
or windows\hosts (WIN98) winnt\system32\drivers\etc\hosts (WIN2000)
The client needs to write to the database server IP address and host name correspondence. localhost OracleDB OracleDB Tomcat Tomcat bj_db bj_db

Sometimes when we configure the first step, the Tnsping database server alias display is successful,
But Sqlplus username/password@servicename, jdbc thin link also does not pass the time,
Do not forget to do this step on the client, possibly because the DNS server does not set the server IP address and host name of the corresponding relationship.
If you have both private IP and the public IP on the Internet, the private IP is written in front, and the public IP is written in the back.
It is best to leave a backup before editing, and it is best to copy and paste when adding a row, to avoid editing the hosts space or tab character errors.

Oracle Multi-database environment under UNIX, OS client needs to configure two environment variables
Oracle_sid=appdb;export Oracle_sid
Two_task=appdb;export Two_task
To specify the default target database

You might be able to use the wrong schedule.
1. Lsnrctl Status View the state of the server-side listener process
lsnrctl>; Help
The following operations are available
An asterisk (*) denotes a modifier or extended command:
Start Stop status
Services version Reload
Save_config Trace Change_password
Quit Exit set*
lsnrctl>; Status
: Em11:
2. Tnsping View the configuration of the client Sqlnet.ora and Tnsname.ora files correctly, and the status of the listener process for the corresponding server.
C:\>tnsping ORCL
TNS Ping Utility for 32-bit windows:version on 1 June-August-
2005 09:36:08
Copyright (c) 1997, 2003, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES Adapter to resolve the alias
Attempting to contacts (DESCRIPTION = (Address_list = (address = (PROTOCOL = TCP)
(HOST = (PORT = 1521)) (Connect_data = (SERVER = dedicated) (Service_
OK (msec)
Sql>;show SGA To see if instance has started
sql>; Select Open_mode from V$database; View whether the database is open or mount.

Example of using hostname to access a database instead of a tnsname
Using Tnsname to access the database is the default, but it also poses a problem, which is that clients need to configure Tnsnames.ora files. If your database server address has changed, you will need to edit the client file again. Access to the database via hostname is not a problem.
Need to modify
Server-Side Listener.ora
#监听器的配置文件listener. Ora
#使用host naming no longer need Tnsname.ora file for local resolution
# Listener.ora Network Configuration File:d:\oracle\product\10.1.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
Sid_list_listener =
(Sid_list =
(Sid_desc =
# (Sid_name = Plsextproc)
(Sid_name = ORCL)
(Global_dbname = Boway)
(Oracle_home = d:\oracle\product\10.1.0\db_1)
# (program = Extproc)
(Description_list =
(address = (PROTOCOL = IPC) (KEY = Extproc))
(address = (PROTOCOL = TCP) (HOST = Boway) (PORT = 1521))
Client Sqlnet.ora You can remove tnsnames if you are sure that you will not use tnsname access.
# Sqlnet.ora Network Configuration File:d:\oracle\product\10.1.0\db_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
Sqlnet. Authentication_services= (NTS)
NAMES. Directory_path= (HOSTNAME)
Tnsnames.ora file does not need to be configured, delete also does not matter.
Here is the network and operating system configuration issues, how to resolve my host name problem
Can be connected in the following way
Sqlplus Sys/oracle@boway
In this case, the server will be connected to Boway and listener to determine the service_name you want to connect to
Common Troubleshooting Solutions:
TNS-12154 (ORA-12154): Tns:could not resolve service name
This error indicates that the network service name used for the connection does not exist in the Tnsnames.ora file, such as the network service name in the Tnsnames.ora above is test only, if the user is connected with Sqlplus system/ Manager@test1 will give a TNS-12154 error.
Note that sometimes even if there is a corresponding network service name in the Tnsnames.ora file, there will be an error connecting with the network service name, which is typically configured as follows (on the client's machine):
Sqlnet.ora file:
NAMES. Directory_path = (TNSNAMES, ...)
NAMES. Default_domain =
Tnsnames.ora file:
Test =
(Address_list= (address= (protocol=tcp) (Host=testserver) (port=1521))
(Connect_data= (
Basic mechanism of sql*plus operation:
After the user enters Sqlplus system/manager@test, the Sqlplus program automatically takes the Names.default_domain parameter to the Sqlnet.ora file and, if it exists, takes the value out of the parameter. Add to the back of the network service name, in this case your input is automatically changed from Sqlplus system/manager@test to Sqlplus system/, Then go to the Tnsnames.ora file to find the Network service name, which of course cannot be found, because the file is only the test network service name, so the error. The solution is to comment out the names.default_domain parameters in the Sqlnet.ora file, such as #NAMES. Default_domain = If the Names.default_domain parameter does not exist, the Sqlplus program will go directly to the Tnsnames.ora file to find the test network service name, and then remove the host,port,tcp,service_name. Use this information to send a connection request to the correct database server.
In addition, in principle, the configuration in Tnsnames.ora is case-insensitive, but I do experience case sensitivity, so it is best to use the same network services that are configured in Tnsnames.ora.
Ora-12514:tns:listener could not resolve service_name given in Connect descriptor.
This error indicates that the network service name can be found in Tnsnames.ora, but the service_name specified in Tnsnames.ora is inconsistent with the server-side service_name. The solution is to modify the service_name in the Tnsnames.ora.
Easy to confuse terminology introduction:
Db_name: Unique identification of a database (Oracle database), which is Oracle database. This representation is sufficient for a single database, but with the spread of distributed databases made up of multiple databases, the method of this command database poses a certain burden to the management of the database, as the names of each database may be the same, resulting in management confusion. In order to solve this situation, the Db_domain parameter is introduced, so that the identity of the database is determined by db_name and db_domain two parameters, which avoids the confusion of management because of the duplicate database. This is similar to the management of machine names on the Internet. We will db_name and db_domain two parameters using '. ' Connects to represent a database, and the name of the database is called Global_name, that is, it extends the db_name. The db_name parameter can only consist of letters, numbers, ' _ ', ' # ', ' $ ', and up to 8 characters.
Db_domain: Defines the domain in which the database is located, and the name of the domain has nothing to do with the ' domain ' of the Internet, but the database administrator decides on the basis of the actual situation to better manage the distributed database. Of course, in order to manage conveniently, it can be equal to the domain of the Internet.
Global_name: The unique identification of a database (Oracle database), Oracle recommends that you use this method to command the database. The value is determined when the database is created, and the default value is Db_name. Db_domain. Any subsequent modification of the db_name and Db_domain parameters in the parameter file does not affect the Global_name value, and if the global_name is to be modified, it can only be modified with the ALTER DATABASE RENAME to command, then modify the corresponding parameters.
SERVICE_NAME: This parameter is newly introduced by Oracle8i. Before 8i, we used SIDS to represent an instance of the identity database, but in Oracle's parallel environment, one database corresponded to multiple instances, requiring multiple network service names and cumbersome settings. To facilitate settings in a parallel environment, the SERVICE_NAME parameter is introduced, which corresponds to a database rather than an instance, and has many other benefits. The default value for this parameter is db_name. Db_domain is equal to Global_name. A database can correspond to multiple service_name in order to achieve a more flexible configuration. This parameter is not directly related to the SID, which means that the service name must be the same as the SID.
NET Service Name: The network services names, which can also be called database aliases. is the client program access to the database needs, shielding the client how to connect to the server side of the details, to achieve the location of the database transparent characteristics.
How to connect to a database by using the configured network service name:
Test the Network service name with the Sqlplus program, such as Sqlplus system/manager@test. If you cannot connect to the database, the test Network service name (NET services) in the Tnsname.ora file is followed by the Db_domain parameter value of the Oracle database, by using the sqlplus> show parameter db_ Domain Command view. Here the Db_domain parameter value is and added to the network service name, and the modified Tnsname.ora contains the name of the network service:

should read:
How to connect to a database by using the configured network service name:
Test the Network service name with the Sqlplus program, such as Sqlplus system/manager@test. If you cannot connect to the database, add the value of the Names.default_domain parameter in the Sqlnet.ora file after the test network service name in the Tnsname.ora file, where my parameter value is, add it to the network service name, and in the modified Tnsname.ora the name of the network service is as follows:

Under what circumstances will cause Oracle to automatically set the Names.default_domain parameter.
The typical environment in which this happens is for Windows clients ' My computer à properties à the computer name à change à other ... à set the ' primary DNS suffix ' in the primary DNS suffix of this computer, because in this case the client is installed in Sqlnet. The Names.default_domain parameter is automatically set in the Ora file, which may also occur when the computer is joined to a domain to install an Oracle client, and you can try if you have a condition.

I usually manually modify the Tnsnames.ora file when I set up Oracle clients, but there are many people who prefer the graphical tool configuration, which eventually modifies the Tnsnames.ora file, but it sometimes causes other problems:
When configuring the network service name with the Oracle graphics configuration software ' net Assistant ' or ' Net Configuration assistant ', if you have set the ' primary DNS Suffix ', but there is no ' primary DNS suffix ' in the name of the network service name written in the graphics configuration software, and if you just write test, the graphics configuration software will automatically add ' primary DNS suffix ' to the test., and exist in Tnsnames.ora, regardless of whether there is NAMES in your Sqlnet.ora file. Default_domain parameter. At this point, the graphical tool to test the connection is passed, but if there is no NAMES in the Sqlnet.ora file at this time. Default_domain parameter, you should use the Network service name in the in Tnsnames.ora instead of the test you typed in the graphics configuration software. The solution is:
You can set up names.default_domain= in the Sqlnet.ora file, where you can connect to the database with test or
Names.default_domain parameters are not set in the Sqlnet.ora file, and in the Tnsnames.ora file removed, you can connect to the database with test

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: 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.