How to access Oracle database over network?

偶尔善良 提交于 2019-12-06 07:09:35

问题


I am trying to accessing my Oracle database over Network. I have Google a lot and found many solutions, but those doesn't work for me.

The problem is that, I want to access my Oracle Database from One Computer to another Computer over my Local Network.

What I did is....

  1. I found a Solution to modify listener.ora file with

(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbp.devProject.com)(PORT=1521)))

When I modify this file and tried to run and access the Database nothing will happens, and it throws an Error, the port number you have specified is used by another listener, so i have changed port Number but I am not able to access Database. 2. I have configure a new listener with the help of oracle's tool Net Manager, which made a Listener for me, but it does not make accessible database over Network.

Here Some required results.

  1. lsnrctl status : Listener using listener name LISTENER has already been started.
  2. Connection String : jdbc:oracle:thin:@dbp.devProject.com:4541:myDB
  3. Database Version :
    1. Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    2. PL/SQL Release 11.2.0.1.0 - Production
    3. CORE 11.2.0.1.0 Production
    4. TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    5. NLSRTL Version 11.2.0.1.0 - Production

status shows me this.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

STATUS of the LISTENER

Alias : LISTENER

Version : TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production

Start Date : 14-MAY-2015 11:58:05

Uptime : 0 days 2 hr. 29 min. 50 sec

Trace Level : off

Security : ON: Local OS Authentication

SNMP : OFF

Listener Parameter File : product\11.2.0\dbhome_1\network\admin\listener.ora

Listener Log File : \listener\alert\log.xml

Listening Endpoints Summary...

1. (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
2. (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))

Someone please Help me. Thanks for your Help..


回答1:


Whenever you are sufering with this kind of errors while creating remote access for you database, do following things before.

  1. Create a Listener using Net Manager tool of Oracle or create it Manually.
  2. After generating Listener, check out "listener.ora" [Located : ORACLE_INSTALLED_DIR\product\11.2.0\dbhome_1\NETWORK\ADMIN] file, for your entry. (is there any Entry for the Listener which you have created just before. If you found your Entry than and than do next steps otherwise do it from FIRST step.)
  3. If you found the Entry for your Listener, Open Command Prompt and fire command lsnrctl status. This will give you all currently running Listeners List, find out the one which you created just before.
  4. Check out the Host Name and Port Number for your Listener.
  5. Generate the Connection String as per the details you found in lsnrctl status
  6. Connect with Database, and You can access the Database from anywhere in your Network.

Enjoy the Things, Some challenges needs Afforts, Once you fall back from it, it will be never solved.

I am really thankful to those all Guys who answered and Commented to this Question, this all Material made my Challenge easy..

Thank You @Alex, @ Lalit, @TenG and @S.Krishna Thank You so Much Guys.




回答2:


If your host name and port number is listener then You could try this option by enabling port number in firewall settings.

Opening Ports in Windows Firewall

  • Open the Control Panel. ...
  • Open Windows Firewall. ...
  • Click the Advanced Settings link. ...
  • Select "Inbound Rules". ...
  • Create "New Rule" under "Inbound Rules". ...
  • Select "Port" from the first screen of the wizard. ...
  • Choose TCP or UDP. ...
  • Enter in the port range. ...
  • Finish the wizard.



回答3:


Create an entry in TNSNAMES.ORA file on the system from which you are trying to connect to the database. (TNSNAMES.ORA is located in ORACLE_INSTALLATION_PATH/Network/Admin/ folder)

Sample entry:

DB_HOST_NAME =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = DB_HOST_NAME)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = XE)

    )

  )

If you have more than one Oracle clients installed, you might need to update this in all those TNSNAMES.ORA



来源:https://stackoverflow.com/questions/30232665/how-to-access-oracle-database-over-network

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!