PLSQL remote database access addressed ora-12541: TNS: no listeners

Source: Internet
Author: User

The local machine is a Windows 7 32-bit system. In order to learn Oracle, A vbox virtual machine is installed, a Windows 7 virtual machine is installed, and Oracle 11g is installed. (If Windows 7 is to be installed with 10g, You need to select the Vista version, an error is reported when Windows is installed ). an error was reported after the oracle11g was installed. I didn't pay attention to it at the time. Now I forgot something wrong, but it does not affect the use. later, I wanted to install PLSQL on the local machine to remotely connect to Oracle on Windows 7. the steps are as follows:

1. Download and install PLSQL.

2. Download the Instant Client, click Download, and download the first basic. After downloading and decompressing it, put it in the root directory of the main win7 D Drive, for example: D: \ instantclient_11_2

3. Create tnsnames. ora in D: \ instantclient_11_2 and edit it in notepad.

4. Find the Oracle installation directory on Windows 7... Open \ app \ admin \ product \ 11.2.0 \ dbhome_1 \ Network \ admin \ tnsnames. ora. For example, if the database instance is orcl, find the followingCode, Copy to Local MachineD: \ instantclient_11_2 \ tnsnames. oraLi
Orcl =
(Description =
(Address = (Protocol = TCP) (host = Virtual Machine IP) (Port = 1521 ))
(CONNECT_DATA =
(Server = dedicated)
(SERVICE_NAME =Orcl)
)
)

5. Add an environment variable named tns_admin with the value D: \ instantclient_11_2 \ tnsnames. ora in the path of the tnsnames. ora file. PLSQL finds the orcl connection string through this

6. Add an environment variable nls_lang = simplified chinese_china.zhs16gbk.

7. Open PLSQL without logging in. Choose tool-preference-Oracle-connection:
Check connection
Oracle main directory: D: \ instantclient_11_2
OCI Library: D: \ instantclient_11_2 \ OCI. dll

After completing the preceding steps, restart PLSQL. the following error occurs:Ora-12541: TNS: No listenerProgramPing can be pinged, and the listening on virtual win7 is also on. After unremitting efforts, the following solutions are finally solved:

1. Select Bridging for the Virtual Machine network, and set static IP addresses for IPv4 connections in the Virtual Machine network.
IP Address: 192.168.1.111 (111 can be changed to your own 1-255)
Subnet Mask: 255.255.255.0
Default limelight: 192.168.1.1
Preferred DNS server: 192.168.1.1
After modification, remember to go to main win7.Ping 192.168.1.111 PingContinue later.

2. Modify .. \ app \ admin \ product \ 11.2.0 \ dbhome_1 \ Network \ admin \ listener. ora
Sid_name = clrextproc to sid_name = orcl is the Instance name
Change host = localhost to host = 192.168.1.111

3. Modify .. \ app \ admin \ product \ 11.2.0 \ dbhome_1 \ Network \ admin \ tnsnames. ora
Change host = localhost to host = 192.168.1.111.
SID = clrextproc to SID = orcl

okay. Restart Oracle and listen. PLSQL on Windows 7 can remotely connect to the database on the VM.

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.