在postgresql中通過(guò)dblink查詢oracle表報(bào)錯(cuò):
postgres=# select * from t1; ERROR: error connecting to Oracle: OCIEnvCreate failed to create environment handle |
這個(gè)問題需要通過(guò)strace才能發(fā)現(xiàn),首先執(zhí)行PG_BACKEND_PID()函數(shù),可以返當(dāng)前會(huì)話的服務(wù)器進(jìn)程PID。
postgres=# select * from t1; ERROR: error connecting to Oracle: OCIEnvCreate failed to create environment handle DETAIL: postgres=# postgres=# SELECT pg_backend_pid(); pg_backend_pid ---------------- 97376 |
通過(guò)strace另開啟一個(gè)會(huì)話追蹤97376。
epoll_wait(3, [{EPOLLIN, {u32=41936840, u64=41936840}}], 1, -1) = 1 recvfrom(10, "Q |