IPv6 Formatting for JDBC and SQLPlus

1 min read
Apr 26, 2020

Does IPv6 formatting for JDBC and SQLPlus seem new to you well, it's been available since 11gR2. You're familiar with IPv6, right? If not, click here. Basically, the only thing you need to do is enclose the IPv6 address in square brackets, like this: Connect on IPV4:
SQL> connect user/pass@172.23.10.40:1521/PYTHIANDB
 
  Connected.
Connect on IPV6:
SQL> connect user/pass@[1:95e05a:g0d:da7a:2020]:1521/PYTHIANDB
 
  Connected.
JDBC (thin) IPV4:
url="jdbc:oracle:thin:@(DESCRIPTION=
 (LOAD_BALANCE=on) (ADDRESS_LIST=
 (ADDRESS=(PROTOCOL=TCP)(HOST=172.23.10.40) (PORT=1521))
 (ADDRESS=(PROTOCOL=TCP)(HOST=172.23.10.41)(PORT=1521)))
 (CONNECT_DATA=(SERVICE_NAME=PYTHIANDB)))"
JDBC (OCI) IPV4:
url="jdbc:oracle:oci:@(DESCRIPTION=
 (ADDRESS= (PROTOCOL=TCP)(HOST=172.23.10.40)(PORT=1521)) 
 (CONNECT_DATA=(SERVICE_NAME=PYTHIANDB)))"
JDBC (thin) IPV6:
url="jdbc:oracle:thin:@(DESCRIPTION=
 (LOAD_BALANCE=on) (ADDRESS_LIST=
 (ADDRESS=(PROTOCOL=TCP)(HOST=[1:95e05a:g0d:da7a:2020]) (PORT=1521))
 (ADDRESS=(PROTOCOL=TCP)(HOST=[1:95e05a:g0d:da7a:2021])(PORT=1521)))
 (CONNECT_DATA=(SERVICE_NAME=PYTHIANDB)))"
JDBC (OCI) IPV6:
url="jdbc:oracle:oci:@(DESCRIPTION=
 (ADDRESS= (PROTOCOL=TCP)(HOST=[1:95e05a:g0d:da7a:2020])(PORT=1521)) 
 (CONNECT_DATA=(SERVICE_NAME=PYTHIANDB)))"
As you might suspect, the same thing applies to your TNSNAMES entries. Also, according to this, you even use it for your LISTENER:
LISTENER =
  (DESCRIPTION_LIST =
  (DESCRIPTION =
  (ADDRESS =
  (PROTOCOL = TCP)
  (HOST = [1:95e05a:g0d:da7a:2020])(PORT =1521))
  )
  )
Hope this helps!

Get Email Notifications

No Comments Yet

Let us know what you think