You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Cloud VPS部署的Oracle Database 11g远程连接失败排查求助

Hey there, let’s work through this Oracle 11g remote connection problem together. Since you can ping your GCP VPS but SQL Developer throws that "Network Adapter could not establish the connection" error, we can narrow this down to a few key areas—listener settings, firewall rules, or service name mismatches. Here’s what to check step by step:

Troubleshooting Steps for Oracle Remote Connection Failure
  • First, confirm the Oracle Listener is running and configured correctly
    SSH into your GCP VPS and run this command to check the listener status:

    lsnrctl status
    

    If it’s stopped, fire it up with:

    lsnrctl start
    

    Next, head to the listener config file at $ORACLE_HOME/network/admin/listener.ora (path might vary depending on your install). Make sure the listener is set to listen on your VPS’s public IP (or 0.0.0.0 to accept connections from any interface) instead of just localhost. You’re looking for a section like this:

    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
        )
      )
    

    If it’s set to localhost or 127.0.0.1, update it, save the file, and restart the listener with lsnrctl stop && lsnrctl start.

  • Check GCP Firewall Rules (this is a super common culprit)
    Ping uses ICMP, which doesn’t mean TCP port 1521 is open. Hop into your GCP Console:

    • Go to VPC Network > Firewall
    • Create a new ingress rule (or tweak an existing one) that allows TCP traffic on port 1521. For testing, you can allow traffic from your local IP or temporarily use 0.0.0.0/0 (but remember to restrict this later for security).
    • Make sure the rule applies to your VPS instance—either match its target tags or select "All instances in the network".
  • Double-check the Service Name in SQL Developer
    Sometimes the service name you’re using doesn’t match what the listener has registered. On the VPS, run:

    lsnrctl services
    

    Look for the Service_name entry in the output—it needs to exactly match what you’re typing into SQL Developer. (Pro tip: It’s usually not case-sensitive, but better to copy-paste to avoid typos.)

  • Test the connection locally on the VPS first
    To rule out Oracle database issues, connect locally using SQL*Plus:

    sqlplus your_username/your_password@localhost:1521/your_service_name
    

    If this works, the problem is definitely network-related. If it fails, log into the database as sysdba and check if the instance is running:

    sqlplus / as sysdba
    

    Then run STARTUP if it’s stopped.

  • Check your local machine’s firewall
    Your own computer might be blocking outbound traffic to port 1521. Temporarily disable your local firewall (or add an outbound rule allowing port 1521) to test if that fixes the issue.

After going through these checks, try reconnecting with SQL Developer. In most cases, it’s either the listener not listening on the right interface, GCP blocking port 1521, or a mismatched service name. Let me know if any of these steps resolve it!

内容的提问来源于stack exchange,提问作者Annel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.30 09:22:41