Recently, due to business needs, I want to pass. net direct connection to the SAP background database, we use Oracle, and we have never touched on Oracle connections before, especially because SAP's Basis Implementation documentation is incomplete, for Oracle database users, the lack of listener ports and other information has caused many obstacles. Here, we will record some problems and solutions.
1. For. net connection to Oracle, see:
Http://www.oracle.com/technology/global/cn/pub/articles/cook_dotnet.html
2. When I installed the Oracle client (must be consistent with the server version) and wanted to connect to the background database, I encountered a problem. My existing information is that I only know the IP address of my Database Host.
192.168.1.11
After several failed attempts, I found that there are at least a few key data to connect to Oracle: Sid database instance, port database instance listening port, database username, and these are
This parameter is specified during SAP installation, but cannot be obtained because the implementer does not leave relevant documents.
Find basis to allow him to remotely log on to the SAP host (Aix system). At this time, he can connect to Oracle through sqlplus. It should have been the verification method specified during installation, and no user is required for local connection.
OK. You can connect to the database:
First, obtain the current database username command.: Show user
.
Obtain Sid, database column name: Select instance_name,
* From v $ instance
The rest is the listening port problem. Exit sqlplus to the AIX command mode. This can be obtained through the listener management tool LSNRCTL.
Command Line input LSNRCTL
Enter status again
The listener information is displayed.
Now several key information has been obtained. Retry the Oracle client connection and log on successfully.
Test the connection with sqlplus:
After successful registration through the above steps, a configuration tnsnames. ora file will be found in the Network/Admin directory under the Oracle client installation location. This file records all registered connection strings. The format is as follows:
Prd_192.168.1.12 =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = 192.168.1.12) (Port = 1522 ))
)
(CONNECT_DATA = (SID = PRD)
(Server = dedicated)
)
)
Therefore, we can use two methods to connect using sqlplus. One is to directly use a connection string, and the other is to use a connection string name (that is, the name of each string in the file). The two methods are as follows:
Sqlplussys/password @ (description = (address_list = (address = (Protocol = TCP) (host = 192.168.1.12) (Port = 1522) (CONNECT_DATA = (SID = PRD) (Server = dedicated) as sysdba
Sqlplussys/password@PRD_192.168.1.12 as sysdba
Additional:
Subsequent findings:(CONNECT_DATA = (SID = PRD)In addition to Sid, you can also use servcie_name (supported by the new version of Oracle), for example:(CONNECT_DATA = (SERVICE_NAME = hsoa. Hs-DB), Sid and servcie_name can both be passed through
Obtain the lsnrctl status Command