Network Connection configurations of Oracle databases and solutions to common errors

Source: Internet
Author: User
Errors in the Oralce database often occur. We see all the wrong code. As to the cause of the error, it is still difficult to answer at half past one, so we sorted out some common errors, it may be helpful to you.
Oracle Database is a network database. When learning, we need to have an idea that it is a database software running on the server. It is network-based, unlike access, it is just a database file. With such an understanding, it is easy to understand. To access the oracle database on the network, you must configure the server and client so that the client can access the server data through the network. Of course, the server and client are logically divided. During our learning process, these two ends are all installed on our own computer, network, this is simulated by the virtual loop of the OS. However, you still need to configure the network to meet the requirements of oracle logically! Next we will introduce these configurations in detail, and take out some errors and solutions to make a summary.
Because most of my colleagues use 9i databases and I have installed 9i, the following paths are based on 9i, and the operating system is windows xp sp2. Let's start with the server.

1. Oracle server network configuration:
As a server, it must start database routines so that others can connect to it. Before using oracle, its own listener must be opened. The Listener is a process on the server that receives and responds to client connection requests to the database, just like mysql database, mysql services must be enabled to do other things. After the listener opens, attach the database, open the database, and open the routine so that others can connect. If the server listening process is not started, the following error message is displayed:
ERROR: ORA-12651: TNS: No listener
This information indicates that the listening process Listener is not started on the server to be connected. The process is an operating system process on the Oracle server. When the listening process is not started, the server can proceed normally, however, the client cannot connect to the server. In this case, you can run the operating system command lsnrctl on the server to start the listening process normally. The specific method is as follows:
C:> lsnrctl start
Method for stopping a listener:
C:> lsnrctl stop
You can also go to the service and click to open the listener service.
When a listener starts, it monitors client connections. Therefore, you must configure the listener process configuration file on the server. Its name is listener. ora, which is in the "oracle installation directory" networkadmin "directory. The configuration of this file is generally automatically written during the database creation process. That is to say, it is generally correct, but after the host name is modified, modify the HOST in the listening process. Otherwise, the listening program will encounter the following error (if you start the service in SQL plus ):
Tns-12545: the connection failed because the target host or object does not exist
Tns-12560: tns: protocol adapter error.
Tns-00515: the connection failed because the target host or object does not exist
Error: 1001: unknow error
If you start the listener. ora service in the service list of the operating system, the same error message is displayed (dialog box. In this case, you can modify the listener. HOST name in the next column of information in ora: (ADDRESS = (PROTOCOL = TCP) (HOST = water-dragon) (PORT = 1521) This name must be consistent with the actual name, restart the listener. Note: In the listener. ora file, IP addresses are allowed for the HOST. Therefore, modifying the HOST name will not cause the listener to fail to start.

In addition, in the server and listener. the ora file contains a file named tnsnames in the unified directory. ora file, which is also under the "oracle installation directory main directory" networkadmin "directory. What is its role? Please refer to the following!

2. Oracle client Network Configuration:The role of tnsnames. ora is to describe the connection information between the client and the server, including the connection protocol and service name. The oracle server uses the information in it to determine whether a connection is legal or not. A very important thing here is the listener. ora is very similar, "ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = water-dragon) (PORT = 1521 ))", the host described here indicates the host Name of the oracle database, that is, in the server, tnsnames. by default, ora uses the server name for configuration. Therefore, if the machine name is modified, the file must be modified at the same time. Otherwise, the following error occurs:
Error:
ORA:-12545: connection failed because the target host and object do not exist.
The error code ORA-12545 represents the network connection string (tnsnames. the machine name and ip address used in the HOST in the ora file do not exist. Modify and edit the file again to change the HOST Name (ip address) of the database to the correct one, and then reconnect. If the tnsnames. ora file is incorrectly configured, the error information is recorded in the connection log information file. The error information is as follows:
The error strutct:
Nr err code: 0
Ns main err code: 12560
TNS-12560: TNS: protocol adapter Error
Ns secondary err code: 0
Nt main err code: 530
Tns-00530: protocol adapter Error
Nt secondary err code: 2
Nt OS err code: 0

3. graphical configuration of oracle network connection:The method described above is to configure the text configuration methods for the server and client respectively. Of course, oracle has developed many useful graphical interface tools, we can use these tools to easily complete the configuration.

Oracle 9i Net Configuration Assistant: You can use it to create, modify, delete, or rename a listener. On the client, A client with the same Protocol address configured with a connection descriptor can send a connection request to the listener. You can also use it to configure the service name (Content in tnsname. ora ).
Oracle9i net Manager: You can define simple names to represent the service location, such as a database. These simple names are mapped to connection descriptors. They contain the network ID and location of the service. There may be errors at this point, and the error message ORA-12560 means that the defined instance is not found in the operating system, and in Oracle9i, if this type of error occurs, there are generally two causes of the error, first, the Instance name is incorrectly modified, and second, the Oracle service is not started properly.

4. Analysis and Solution of common Oracle error codes
4.1 ORA-00600: internal error code, arguments: [num], [?], [?], [?], [?] Cause:
This error is usually an internal ORACLE error and is only useful for OSS and ORACLE development. ORA-600 errors are often accompanied by a State dump of the trace file (system and process state) where system state storage will include information about the current object held by oracle rdbms, the Process status dump displays the objects held by the special process. When the process meets an error condition, it is often because some information is taken from a block held by the process, if we know the blocks held by these error processes, it is easy to track the source of the problem.
Solution:
In general, this error cannot be solved. We only need to improve the system itself to solve this internal problem, such as adding hardware devices and adjusting system performance, using OPS (of course, OPS is not a good solution in a sense. The first variable of the ORA-600 error is used to mark the location of the error in the Code (the first variable in each part of the code is different), from the second to the fifth variables display additional information, tell the OSS code where an error occurs.
An example of an error is as follows:
ORA-00600: internal error code, arguments: [1237], [], [], [], [], [], [], []
The corresponding English is as follows:
Cause: This is a catchall internal error message for Oracle program exceptions. It indicates that a process has met a low-level, unexpected condition. varous causes of this message include:
Time-outs (timeout)
File Upload uption (the File is too old)
Failed data checks in memory (memory retrieval Failed)
Hardware, memory, or I/O errors (Hardware, memory, or disk error)
Incorrectly restored files (incorrect reconstruction file)

4.2, ORA-03113: end-of-file on communication channel
Cause:
The communication ends abnormally, resulting in the termination of the communication channel.
Solution:
1>. Check whether the server process is abnormal or not. You can find out from alert. log.
2>. Check whether the SQL * Net Driver is connected to the ORACLE executable program.
3>. Check whether the server network is normal, for example, the network is disconnected or unstable.
4>. check whether there are two nodes with the same name on the same network.
5>. Check whether duplicate IP addresses exist on the same network.
The corresponding English is as follows:
Cause: An unexpected end-of-file was processed on the communication channel. the problem cocould not be handled by the Net8, two task, software. this message cocould occur if the shadow two-task process associated with a Net8 connect has terminated abnormally, or if there is a physical failure of the interprocess communication hicle, that is, the network or server machine went down.
Action: If this message occurs during a commection attempt, check the setup files for the appropriate Net8 driver and confirm Net8 software is correctly installed on the server. if the message occurs after a connection is well established, and the error is not due to a physical failure, check if a trace file was generated on the server at failure time. existence of a trace file may suggest an Oracle internal error that requires the balance of customer support.

4.3, ORA-00942: table or view does not exist
Cause:
This is because the mounted table or view does not exist. Most of the results are that CATEXP. SQL is not running and the Export view cannot be executed. If CATEXP. SQL is already running, it may be a version error.
Solution:
Because Import and Export share some views by running CATEXP. SQL to load (they have the same view) and do not generate a separate CATEXP. so that the view and Export code is not synchronized, it is difficult to maintain compatibility between each other, the user must establish their own Export application, so as to avoid ORA-00942 errors.
The corresponding English is as follows:
Cause: The table or view entered does not exist, a synonym that is jnot allowed here was used, or a view was referenced where a table is required. existing user tables and views can be listed by querying the data dictionary. certain privileges may required to access the table. if an application returned this message, the table the application tried to access does not exist in the database, or the application does not have access to it.
Action: Check each of the following:
The spelling of the table or view name.
That a view is not specified where a table is required
That an existing table or view name exists.
Contact the database administrator if the table needs to be created or if user or application priviledes are required to access the table.
Also, if attempting to access a table or view in another schema, make certain thecorrect schema is referenced and that access to the object is granted.

4.4, ORA-12560: TNS: protocol adapter Error
1>. Check the Terminal Service to see if the Remote Desktop is the cause.
2>. environment variable set oracle_sid = required service name
3>. Is the machine name or IP address in listener. ora or tnsnames. ora correct?
4>. Check whether the port is occupied by netstat-.
5>. Check the Registry HKEY_LOCAL_MACHINESoftwareOracleHome0 to add the string USE_SHARED_SOCKET = TRUE and restart the service ERROR:

4.5, ORA-01031: insufficient privileges
Cause: insufficient Permissions
Solution: Modify the corresponding permissions.

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.