ORA-12529用于连接到Oracle ATP数据库

sxissh06  于 2023-10-16  发布在  Oracle
关注(0)|答案(2)|浏览(125)

我已经创建了一个ATP数据库,我想从SQL Developer远程连接到它。当我尝试使用钱包文件连接时,我得到了这个错误:
州:Fallo:价格:侦听器拒绝连接,错误如下:ORA-12529,TNS:根据当前过滤规则拒绝连接请求(CONNECTION_ID= DaiNx 3GxQoKa 7 gYAEdsmwQ ==)
我的ATP是这样的

这是我得到的错误:

有什么建议吗?

xn1cxnb4

xn1cxnb41#

只要我选择钱包压缩文件,我就可以从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

我需要DBID(编辑)

./list-autonomous-databases.sh
+--------+-----------+---------+-----------+----------------------------------------------------------------------------------------------------------+
| DBName | DBWorkoad | Display | Status    | id                                                                                                       |
+--------+-----------+---------+-----------+----------------------------------------------------------------------------------------------------------+
| DEMODB | OLTP      | DEMODB  | AVAILABLE | ocid1.autonomousdatabase.oc1.eu-frankfurt-1.xxxxxxxxxxxxxxxxxx |
+--------+-----------+---------+-----------+----------------------------------------------------------------------------------------------------------+

现在,下载钱包

./download-wallet-autonomous-database.sh ocid1.autonomousdatabase.oc1.eu-frankfurt-1.xxxxxxxxxxxxxxxxxxxxx

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

确保您具有连接性(查看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!

祝你好运!

pkbketx9

pkbketx92#

我找到了答案:
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被设置为SO级别的环境变量,我刚刚删除了。不是最好的解决办法,但它奏效了。

相关问题