I'm trying to use go-oci8 on my project. I use OSX. I already prepare the oracle instantclient and everything, and I can finally use it using sqlplus.
This is my tnsnames.ora
210=(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=192.168.0.210)
(PORT=1521)
)
)
(CONNECT_DATA=
(SID=ORCL)
(SERVER=DEDICATED)
(SERVICE_NAME=orcl.my.local)
)
)
This is the env.
export ORACLE_HOME=/Applications/oracle/instantclient_11_2 export PKG_CONFIG_PATH=$ORACLE_HOME/pkg export GO_OCI8_CONNECT_STRING="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.210)(PORT=1521)))(CONNECT_DATA=(SID=ORCL)(SERVER=DEDICATED)(SERVICE_NAME=orcl.my.local)))" export ORACLE_SID="ORCL" export DYLD_LIBRARY_PATH=$ORACLE_HOME:$DYLD_LIBRARY_PATH export PATH=$PATH:$ORACLE_HOME
sqlplus scott/tiger@210
.---
I have put oci8.pc
file inside $PKG_CONFIG_PATH
and below is the content of the file.
orainc=/Applications/oracle/instantclient_11_2/sdk/include oralib=/Applications/oracle/instantclient_11_2 Name: oci8 Description: Oracle Instant Client Version: 12.1 Cflags: -I${orainc} Libs: -L${oralib} -lclntsh
Everytime I run it, this error always showing up.
ORA-12545: Connect failed because target host or object does not exist
Could you help me solving this problem? Or am I missing something. Thank you in advance.
fmt.Fprintln(os.Stderr, `Please specifiy connection parameter in GO_OCI8_CONNECT_STRING environment variable, | |
or as the first argument! (The format is user/name@host:port/sid)`) | |