Oracle配置IPV6
- 网络基础环境改造双栈
- OS双栈配置
创建全局IPv6
手工配置可以使用ip命令来配置:
ip -6 addr add 2001::171/64 dev eth0
或者使用ifconfig命令来配置:
ifconfig eth0 inet6 add 2022:1:0:0::db1/64
IPv6连通性测试
在本地使用ping6进行连通性测试,先使用全局IPv6进行测试
ping6 2022:1::db1 -c3
再使用本地关联IPv6进行测试,此时需要带上网络接口名称
ping6 fe80::f816:3eff:feb9:c7e5%eth0 -c3
- 通用组件配置、各个通用组件支持情况
Oracle11g开始支持IPV6
Oracle配置IPv6监听
编辑listener.ora文件,修改监听配置增加IPV6地址
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.224.171)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 2001::171)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/12.2.0/db)
(GLOBAL_DBNAME = orcl)
(SID_NAME = orcl)
)
(SID_DESC =
(GLOBAL_DBNAME = canalpdb)
(SID_NAME = orcl)
)
)
修改完后重启监听,数据库将监听IPV4和IPV6的网络接口。
lsnrctl stop
lsnrctl start
lsnrctl status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 06-APR-2022 10:09:50
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.224.171)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 06-APR-2022 10:08:39
Uptime 0 days 0 hr. 1 min. 10 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/db/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/hdptest-18/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.224.171)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=2001::171)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "canalpdb" has 2 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "d9c2612e2e195cbce055000000000171" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl" has 2 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
编辑tnsnames.ora文件,添加数据库客户端连接的tns
canalpdbv61521 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 2001::171)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = canalpdb)
)
)
使用sqlplus 连接IPv6进行测试
sqlplus sys/oracle@canalpdbv61521 as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Wed Apr 6 10:13:15 2022
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
4 CANALPDB READ WRITE NO
SQL>
sqlplus canal/canal123@[2001::171]:1521/canalpdb
SQL*Plus: Release 12.2.0.1.0 Production on Wed Apr 6 10:19:30 2022
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Last Successful login time: Wed Apr 06 2022 10:19:13 +08:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL>
使用sqlplus 连接IPv4进行测试
sqlplus canal/canal123@192.168.224.171:1521/canalpdb
SQL*Plus: Release 12.2.0.1.0 Production on Wed Apr 6 10:21:35 2022
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Last Successful login time: Wed Apr 06 2022 10:19:30 +08:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL>
jdbc连接
使用普通的IPv4
Jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.224.171)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=canalpdb)))
使用IPv6
Jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=[2001::171])(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=canalpdb)))
- 配合业务侧进行相关测试




