Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dckCS-0007D5-9z for pgsql-admin@arkaria.postgresql.org; Wed, 02 Aug 2017 03:19:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dckCR-0007dv-Nc for pgsql-admin@arkaria.postgresql.org; Wed, 02 Aug 2017 03:19:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dckAe-0004SV-PU for pgsql-admin@postgresql.org; Wed, 02 Aug 2017 03:18:05 +0000 Received: from cat-porwal-prod-mail1.catalyst.net.nz ([2404:130:4080::4]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dckAT-0006JF-8K for pgsql-admin@postgresql.org; Wed, 02 Aug 2017 03:18:03 +0000 Received: from localhost (localhost [127.0.0.1]) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTP id DDB2C80148 for ; Wed, 2 Aug 2017 15:17:45 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at cat-porwal-prod-mail1.servers.catalyst.net.nz Received: from cat-porwal-prod-mail1.catalyst.net.nz ([127.0.0.1]) by localhost (cat-porwal-prod-mail1.servers.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9fHwLDDsQmqQ for ; Wed, 2 Aug 2017 15:17:44 +1200 (NZST) Received: from [IPv6:2406:e001:fe0:1:d1cd:6d6c:9ae7:a5c7] (unknown [IPv6:2406:e001:fe0:1:d1cd:6d6c:9ae7:a5c7]) (Authenticated sender: mark.kirkwood@catalyst.net.nz) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTPSA id ABEA780524 for ; Wed, 2 Aug 2017 15:17:44 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catalyst.net.nz; s=catalyst; t=1501643864; bh=H091gqlNuuO0IsPmNP9xN8EZCx4WmN3zYj4lNbLCfxU=; h=Subject:To:References:From:Date:In-Reply-To; b=JbDbeF7QZGmU1UsCZaIvEYTLy52aU8F7krdtw5ewdJwqje7jjblFXTLZLPieUfudO RVaY05dtL/2VomO72ORTM3EQc/jnbEFAF8MPVdDqJ6Xm1noFrOkXa6VAvd+DYujTSE PbFXxQ2d2iaQeNHexIyVbxOP/3kWBelpqyQ9eZjs= Subject: Re: oracle_fdw issues To: pgsql-admin@postgresql.org References: <341df494-f543-d4fa-a6b7-e1288b56d66b@propaas.com> From: Mark Kirkwood Message-ID: <18e8c399-7782-e6f8-4c93-0a5d1d8d8e71@catalyst.net.nz> Date: Wed, 2 Aug 2017 15:17:44 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <341df494-f543-d4fa-a6b7-e1288b56d66b@propaas.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Hi, The ORA 12154 makes me suspect that VLCDB is being considered as a TNS alais - and was not found in any tnsnames.ora that your client env variables pointed to. So you might need to: - make a tnsnames.ora if not done so already - set TNS_ADMIN to point the the dir it is in Alternatively I think you can use the JDBC style connect descriptor e.g ://hostname/SID in your CREATE SERVER command. regards Mark On 02/08/17 13:58, PropAAS DBA wrote: > > Hi All; > > > I'm trying to setup oracle_fdw and I think I'm mostly there but I have > an issue. Here's what I've done. > > > - both PostgreSQL 9.6 and Oracle v10 running on the same server > > As the postgres user I can connect to the Oracle instance like so: > > 1) export ORACLE_HOME > > 2) export ORACLE_SID > > Note: the oracle sid = VLCDB > > 3) run sqlplus and when prompted enter system for the user and then > the passwd > > > So based on the fact I can connect, I did this: > > > 1) downloaded, compiled and installed oracle_fdw > > 2) connected to psql and ran this: > > - CREATE EXTENSION oracle_fdw; > > - CREATE SERVER oradb1 FOREIGN DATA WRAPPER oracle_fdw > OPTIONS (dbserver 'VLCDB'); > > -GRANT USAGE ON FOREIGN SERVER oradb1 TO postgres; > > - CREATE USER MAPPING FOR postgres SERVER oradb1 > OPTIONS (user 'system', password 'orapwd'); > > > > All of the above commands completed successfully, then I created a > foreign table which also succeeded: > > CREATE FOREIGN TABLE oratab1 (pid int, cname varchar(30), cstatus > varchar(30), c_ts timestamp with time zone) > > SERVER oradb1 options (schema 'CLD', table 'cust_ord_process_status'); > > > Now if I run: > > IMPORT FOREIGN SCHEMA CLD FROM SERVER oradb1 INTO local_cld_sch; > > it hangs for a long time and eventually returns this error > > * > **ERROR: cannot connect to foreign Oracle server** > **DETAIL: ORA-12154: TNS:could not resolve the connect identifier > specified* > > > > Also If I run this (based on the foreign table above) > > select * from oratab1 limit 10; > > > it also hangs for a long time, then I get this error > > * > **ERROR: cannot connect**ion for foreign table "oratab1" cannot be > established > **DETAIL: ORA-12154: TNS:could not resolve the connect identifier > specified* > > * > * > > > Thoughts? > > Thanks in advance > > > > -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin