当我尝试从Oracle SQL Developer连接到在AWS中运行的OracleDB 12c RHEL实例时遇到以下错误。
状态:失败-测试失败:IO错误:网络适配器无法建立连接
我也不能远程登录到端口,但是听起来端口是开放的,只是没有任何监听。
$ telnet 10.20.10.215 1521
Trying 10.20.10.215...
telnet: connect to address 10.20.10.215: Connection refused
我一直在寻找其他答案,似乎每个人的情况都非常具体,因此我决定提出一个新问题。另一个询问者被要求列出以下命令的输出,因此我这样做是为了协助诊断。
[oracle@ip-10-20-10-215 ec2-user]$ lsnrctl stop
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 09-JUL-2018 19:46:21
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora)(PORT=1521)))
The command completed successfully
[oracle@ip-10-20-10-215 ec2-user]$ lsnrctl start
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 09-JUL-2018 19:46:25
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Starting /ora01/app/oracle/product/12.1.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /ora01/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
Log messages written to /ora01/app/oracle/diag/tnslsnr/ip-10-20-10-215/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 09-JUL-2018 19:46:25
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /ora01/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
Listener Log File /ora01/app/oracle/diag/tnslsnr/ip-10-20-10-215/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@ip-10-20-10-215 ec2-user]$ lsnrctl status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 09-JUL-2018 19:46:27
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 09-JUL-2018 19:46:25
Uptime 0 days 0 hr. 0 min. 2 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /ora01/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
Listener Log File /ora01/app/oracle/diag/tnslsnr/ip-10-20-10-215/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@ip-10-20-10-215 ec2-user]$ lsnrctl service
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 09-JUL-2018 19:46:31
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@ip-10-20-10-215 ec2-user]$ set
BASH=/bin/bash
BASHOPTS=checkwinsize:cmdhist:expand_aliases:extquote:force_fignore:histappend:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="4" [1]="2" [2]="46" [3]="2" [4]="release" [5]="x86_64-redhat-linux-gnu")
BASH_VERSION='4.2.46(2)-release'
CLASSPATH=ORACLE_HOME/jlib:ORACLE_HOME/rdbms/jlib
COLUMNS=99
DIRSTACK=()
EUID=54321
GROUPS=()
HISTFILE=/home/oracle/.bash_history
HISTFILESIZE=1000
HISTSIZE=1000
HOME=/home/oracle
HOSTNAME=ip-10-20-10-215.us-gov-west-1.compute.internal
HOSTTYPE=x86_64
IFS=$' \t\n'
LANG=en_US.UTF-8
LD_LIBRARY_PATH=/ora01/app/oracle/product/12.1.0/db_1/lib:
LESSOPEN='||/usr/bin/lesspipe.sh %s'
LINES=27
LOGNAME=oracle
LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:'
MACHTYPE=x86_64-redhat-linux-gnu
MAIL=/var/spool/mail/ec2-user
MAILCHECK=60
OPTERR=1
OPTIND=1
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOME=/ora01/app/oracle/product/12.1.0/db_1
ORACLE_HOSTNAME=ora
ORACLE_SID=ORA12C
ORACLE_UNQNAME=ORA12C
OSTYPE=linux-gnu
PATH=/ora01/app/oracle/product/12.1.0/db_1/bin:/sbin:/bin:/usr/sbin:/usr/bin
PIPESTATUS=([0]="0")
PPID=11863
PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
PS1='[\u@\h \W]\$ '
PS2='> '
PS4='+ '
PWD=/home/ec2-user
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=1
SUDO_COMMAND='/bin/su oracle'
SUDO_GID=1000
SUDO_UID=1000
SUDO_USER=ec2-user
TERM=xterm
TMP=/tmp
UID=54321
USER=oracle
USERNAME=root
XDG_SESSION_ID=42
_=service
colors=/home/oracle/.dircolors
[oracle@ip-10-20-10-215 ec2-user]$
答案 0 :(得分:1)
Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
您的监听者(仅)在localhost
(127.0.0.1)上监听。
您正尝试连接到10.20.10.215,并且您怀疑该地址的端口1521没有监听。 (您可以使用netstat
来检查哪些pirt和地址实际上正在侦听整个OS上的连接。)
如果SQL开发人员在同一RHEL服务器中运行,则只需更改连接设置即可连接到127.0.0.1。
否则,you can change the listener改为(或同样)监听10.20.10.215地址;或(取决于您的访问方式)设置某种隧道或NAT访问。