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:
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 statusIf it’s stopped, fire it up with:
lsnrctl startNext, 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 (or0.0.0.0to 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
localhostor127.0.0.1, update it, save the file, and restart the listener withlsnrctl 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 servicesLook for the
Service_nameentry 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_nameIf 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 sysdbaThen run
STARTUPif 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

