embulk-output-jdbc
embulk-output-jdbc copied to clipboard
Support Oracle database service name
Now database
means SID.
For using database service name, must set full JDBC URL, but it is inconvenient.
For using database service name, use url
instead of host/database
in:
type: oracle
driver_path:.......ojdbc6.jar
url: jdbc:oracle:thin:@x.x.x.x:1524/<service_name>
out:
type: stdout
But what happened if there are multiple port or host in tnsname.ora
file?
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1524))
(ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1525))
(LOAD_BALANCE = ON)
(FAILOVER = ON)
)
Oracle JDBC Thin Driver doesn't use tnsname.ora
by default.
So embulk-output-oracle will connect to x.x.x.x:1524
as written in url
.
FYI http://przemyslawkruglej.com/archive/2013/11/connecting-to-oracle-database-using-tnsnames-ora-in-java/
Thanks @hito4t !
I create a PR for this issue.