PL/SQL remote connection to Oracle without client installation

Source: Internet
Author: User

The first time with PL/SQL developer This unofficial software, encountered a variety of difficulties, fortunately through the almighty Google has been all resolved, recorded down to be observed. The premise is to ensure that your remote Oracle server is all right. Microsoft Client SettingsUseOracleThe free Instant Client replaces the Oracle client, eliminating the hassle of installation, Download Instantclient-basiclite-nt-11.2.0.2.0.zip extract to any directory you want to put in, such as: D:\oracle\instantclient_11_2, Create a name tnsnames.ora files, put in this directory, you can first create a TXT document, save the following content and then the extension of. txt removed: MyDB =(DESCRIPTION =(address_list =(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.23) (PORT = 1521)))(Connect_data =(SERVER = dedicated)(service_name = testdb)))Note:MyDBto connect to a database aliasHOST = 192.168.7.23 The database IP that is connected to you PORT = 1521port for your dataservice_name = TestDBfor your DB instance name Right click on My Computer select " Properties "," Advanced " --" environment variable "-" system variable " Add the following two variablestns_admin D:\oracle\instantclient_11_2
Nls_lang simplified Chinese_china. Zhs16gbk settings on the software (version 8.0)In Plsql developer Select Tools > Preferences > Connection and fill in the following in the "Oracle Home" and "OCI Library" on the right: D:\oracle\ Instantclient_11_2d:\oracle\instantclient_11_2\oci.dll complete the above settings should be able to log into the database normally, if there are other problems, only Google again.

How to configure multiple listeners for a instance, and implement client load balancing and client load balancing.
Open NETCA, configure two listeners.
Lisenter, the default listener, all the way next, is configured, listening on port 1521.
Configure the LISENTER2, note that the listening port is changed to 1522, and the other is lisenter consistent.
At this time, Lisenter is ready to use.


but LISENTER2 is still not working, because Oracle will only register the service for the first default listener.
in $oracle_home/network/admin, edit the Lisenter.ora file as follows:
The red font is what you need to add
Sid_list_listener2 =
(Sid_list =
(Sid_desc =
(Sid_name = WWJ)
(Oracle_home = d:\oracle\product\10.2.0\db_1)
(Global_dbname = WWJ)
)
)

LISTENER2 =
(Description_list =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = Valen) (PORT = 1522))
)
)

Sid_list_listener =
(sid_list =
(Sid_desc =
(sid_name = plsextproc)
(oracle_home = d:\oracle\product\10.2.0\db_1)
(program = extproc)
  )
)
LISTENER =
(description_list =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = Valen) (PORT = 1521))
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC0))
  )
)
what needs to be explained is that Sid_list_<lisenter name> here <lisenter name> to be the same as the listener name.
Sid_desc Registers the name of the database instance to provide the service. So that LISTENER2 can provide services.
otherwise the tns-error will be reported.
to test the process, configure the local TNS name as follows:
1522 =
(DESCRIPTION =
(address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1522))
  )
(Connect_data =
(service_name = WWJ)
  )
)
1521 =
(DESCRIPTION =
(address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521))
  )
(Connect_data =
(service_name = WWJ)
  )
)

Local =
(DESCRIPTION =
(address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521))
(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1522))
  )
(Connect_data =
(service_name = WWJ)
  )
)
1522 and 1521 correspond to two listeners, and Local explains later:
Test:
sql> [email protected]
is connected.
sql> [email protected]
is connected.
OK, look at local again,
(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521))
(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1522))
This means that the name corresponds to two listening ports, and if one crash, it switches to the other one immediately.
and if more than one connection, the listener is randomly assigned.
Test
sql> Conn @local
is connected.
STOP Lisenter, connect again, this time, the connection is slower than the first time 1 seconds or so
sql> Conn @local
is connected.
success, then connected to the LISTENER2
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.