Use Instant Client, and use sqlplus to connect to a remote database without installing the Oracle client

Source: Internet
Author: User
I. Software Download and environment configuration 1. download the software to http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html download the following three packages: Current address: Copy to c: \ instantclient_10_2 in which ociuldr.exe is a text export tool, specific parameters can refer to export nls_lang = xxxx (such as simplified chinese_china.zhs16gbk) 3. if you develop a Java application Program And configure some environment variables, such as classpath and java_home. classes12.jar files are required, and others are added as needed. 4. if the following error occurs when sqlplus is started: ORA-12545: connect failed because target host or object does not exist try to put tnsnames. change the host in Ora to an IP address. 2. Run cmdc:> sqlplus/nologsql:> conn system/Oracle @ orc10g to connect to the remote server. You can also connect to conn system/Oracle @ // 192.168.1.179: 1521/orc10g connection c: \ instantclient_10_2> sqlplus/nologsql * Plus: Release 10.2.0.4.0-production on Thu Nov 27 14:45:51 2008 copyright (c) 1982,200 7, Oracle. all rights reserved. SQL> conn system/Oracle @ // 192.168.1.179: 1521/orc10gconnected. the following describes how to use ociuldr: C: \ instantclient_10_2> ociuldr user = s Ystem/Oracle @ orc10g query = "select username from dba_users" Limit 1550 bytes allocated for column username (1) 0 rows exported: 44 output file dba_users.txt closed at 29 rows.the result is output to the dba_user.txt file. Configure tnsnames. ora and sqlnet. ora .. If the local machine cannot find the sample file, copy one from another machine with Oracle installed. I copied each of the 10g and 9i versions: 10g tnsnames. ora content # tnsnames. ora network configuration file: C: \ oracle \ product \ 10.1.0 \ db_1 \ Network \ admin \ tnsnames. ora # generated by Oracle configuration tools. orc10g = (description = (address = (Protocol = TCP) (host = database007) (Port = 1521) (CONNECT_DATA = (Server = dedicated) (SERVICE_NAME = orc10g ))) extproc_connection_data = (description = (address_list = (address = (Protocol = IPC) (Key = EXTPROC) (CONNECT_DATA = (SID = plsextproc) (Presentation = Ro ))) 10 Gb sqlnet. ora content # sqlnet. ora network configuration file: C: \ oracle \ product \ 10.1.0 \ db_1 \ Network \ admin \ sqlnet. ora # generated by Oracle configuration tools. sqlnet. authentication_services = (ETS) names. directory_path = (tnsnames, ezconnect) content in 9i # tnsnames. ora network configuration file: D: \ oracle \ ora92 \ Network \ admin \ tnsnames. ora # generated by Oracle configuration tools. ora9i_192.168.2.206 = (description = (address_list = (address = (Protocol = TCP) (host = 192.168.2.206) (Port = 1521) (CONNECT_DATA = (SID = ora9i) (Server = dedicated) ws_192.168.1.101 = (description = (address_list = (address = (Protocol = TCP) (host = 192.168.1.101) (Port = 1521 ))) (CONNECT_DATA = (SID = ws) (Server = dedicated) ora9i_192.168.2.50 = (description = (address_list = (address = (Protocol = TCP) (host = 192.168.2.50) (Port = 1521) (CONNECT_DATA = (SID = ora9i) (Server = dedicated) 9 sqlnet. ora content # sqlnet. ora network configuration file: D: \ oracle \ ora92 \ Network \ admin \ sqlnet. ora # generated by Oracle configuration tools. sqlnet. authentication_services = (ETS) names. directory_path = (tnsnames, onames, hostname)
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.