embulk-output-jdbc icon indicating copy to clipboard operation
embulk-output-jdbc copied to clipboard

Support Oracle database service name

Open hito4t opened this issue 8 years ago • 3 comments

Now database means SID. For using database service name, must set full JDBC URL, but it is inconvenient.

hito4t avatar Mar 29 '16 04:03 hito4t

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)
    )

dafeiroc avatar Jan 10 '17 03:01 dafeiroc

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/

hito4t avatar Jan 11 '17 05:01 hito4t

Thanks @hito4t !

I create a PR for this issue.

dafeiroc avatar Jan 12 '17 05:01 dafeiroc