I have created an ATP database and I want to connect to it remotely from SQL Developer. When I tried to connect using the wallet files, I got this error:
我已经创建了一个ATP数据库,我想从SQL Developer远程连接到它。当我尝试使用Wallet文件进行连接时,收到以下错误:
Estado: Fallo:Fallo de la prueba: Listener refused the connection with the following error: ORA-12529, TNS:connect request rejected based on current filtering rules (CONNECTION_ID=DaiNx3GxQoKa7gYAEdsmwQ==)
Estado:Fallo:Fallo de la Prueba:侦听器拒绝连接,出现以下错误:ORA-12529,Tns:根据当前筛选规则拒绝连接请求(Connection_ID=DaiNx3GxQoKa7gYAEdsmwQ==)
This is how my ATP looks like
这是我的三磷酸腺苷的样子
And this is the error I got:
这是我得到的错误:
Any suggestions?
有什么建议吗?
更多回答
The most likely scenario is that you aren't using the right wallet, since it doesn't appear that you have any network access controls in place.
最有可能的情况是,您没有使用正确的钱包,因为您似乎没有设置任何网络访问控制。
优秀答案推荐
As soon as I select the wallet-zip-file I am able to connect from SQL Developer.
This is the script I use to download and unpack in order to utilize sqlplus.
一旦我选择了wallet-压缩文件,我就能够从SQL Developer进行连接。这是我用来下载和解压以利用SQLplus的脚本。
cat download-wallet-autonomous-database.sh
#!/bin/bash
set -euo pipefail
# set environment (password)
. env.sh
DBNAME=demodb
DB_WALLET_FILE=demodb_wallet.zip
# create directory where to download the wallet
mkdir -p connection/${DBNAME} || true
cd connection/${DBNAME}
# now, generate and retreive the wallet
oci db autonomous-database generate-wallet \
--generate-type all \
--autonomous-database-id $DBID \
--file ${DB_WALLET_FILE} \
--password "${ADMIN_PASSWORD}"
# unzip wallet file. All connection details are unpacked (sqlnet,tnsnames.ora,certificates)
unzip ${DB_WALLET_FILE}
# replace "?/network/admin" by current directory
sed -i '' 's:?/network/admin:'`pwd`':' sqlnet.ora
export TNS_ADMIN=$(pwd)
cat > env.sh <<EOF
#!/bin/bash
export ADMIN_PASSWORD=${ADMIN_PASSWORD}
export TNS_ADMIN=\$(pwd)
export TWO_TASK=${DBNAME}_high
EOF
# handy for later sqlplus connection
cat > connect.sh <<EOF
. env.sh
rlwrap sqlplus admin/\${ADMIN_PASSWORD}
EOF
I need the DBID (redacted)
我需要DBID(已编辑)
./list-autonomous-databases.sh
+--------+-----------+---------+-----------+----------------------------------------------------------------------------------------------------------+
| DBName | DBWorkoad | Display | Status | id |
+--------+-----------+---------+-----------+----------------------------------------------------------------------------------------------------------+
| DEMODB | OLTP | DEMODB | AVAILABLE | ocid1.autonomousdatabase.oc1.eu-frankfurt-1.xxxxxxxxxxxxxxxxxx |
+--------+-----------+---------+-----------+----------------------------------------------------------------------------------------------------------+
Now, download wallet
现在,下载钱包
./download-wallet-autonomous-database.sh ocid1.autonomousdatabase.oc1.eu-frankfurt-1.xxxxxxxxxxxxxxxxxxxxx
Both, sqlplus and SQL Developer works as expected.
SQLplus和SQL Developer都能按预期工作。
./connect.sh
SQL*Plus: Release 19.0.0.0.0 - Production on Sun Aug 7 11:25:56 2022
Version 19.8.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Last Successful login time: Sun Aug 07 2022 11:14:14 +02:00
Connected to:
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0
admin@MNYYI81SOQCUDNG_DEMODB> col authentication_type for a20
admin@MNYYI81SOQCUDNG_DEMODB> select SYS_CONTEXT('USERENV','NETWORK_PROTOCOL') authentication_type from dual;
AUTHENTICATION_TYPE
--------------------
tcps
Make sure you have connectivity (look into tnsnames.ora for host and port)
确保您有连接(查看tnsnames.ora中的主机和端口)
nc -vz adb.eu-frankfurt-1.oraclecloud.com 1522
Connection to adb.eu-frankfurt-1.oraclecloud.com port 1522 [tcp/ricardo-lm] succeeded!
Best of luck!
祝你好运!
I found an answer:
我找到了答案:
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=59298716467964&parent=EXTERNAL_SEARCH&sourceId=PROBLEM&id=2474071.1&_afrWindowMode=0&_adf.ctrl-state=nvpxdkgyy_4
Https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=59298716467964&parent=EXTERNAL_SEARCH&sourceId=PROBLEM&id=2474071.1&_afrWindowMode=0&_adf.ctrl-state=nvpxdkgyy_4
TNS_ADMIN was set as environment variable at SO level, I just removed. Is not the best solution, but it worked.
TNS_ADMIN被设置为SO级别的环境变量,我刚刚删除了。不是最好的解决方案,但它奏效了。
更多回答
我是一名优秀的程序员,十分优秀!