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