Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQY5f-0000gN-1h for pgsql-admin@arkaria.postgresql.org; Mon, 20 Apr 2020 15:12:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jQY5d-00087C-Ry for pgsql-admin@arkaria.postgresql.org; Mon, 20 Apr 2020 15:12:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQY5d-000875-FU for pgsql-admin@lists.postgresql.org; Mon, 20 Apr 2020 15:12:05 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jQY5Z-0001Yh-FJ for pgsql-admin@lists.postgresql.org; Mon, 20 Apr 2020 15:12:04 +0000 Received: by mail-wr1-x444.google.com with SMTP id j1so7209973wrt.1 for ; Mon, 20 Apr 2020 08:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=bMiKMgn44FnTL1QF5XGk2cQ3VMSncLZRUsWlQ5qdJAY=; b=l0NvK4LCFbtnpTONhfohbX0Ws55zAv+84aEfcgSDYr5rW3X4ZQZ75XM/P6XYSMfL3f ONtHPv+MPg19ZIYAnHeEZY+E7O9VVF0WLil2jSBvxTQe5eO4gYrNjdriyBevXFfs7oBV pkki4UL0U9UYhVMwuMU9xx3eOvEEjxtwFLr8771+5DRWiObg5JIoSHcAmpTXBNJhesVV GYPCESgcXuDdEGgsE0ur8MfE9QxyJs8+HaIBVtl3GgHasAct/Pq9J7dZA96hmPlzk3Hx rm4PNZAlWKZiIB1GM9Hca/6HJyAXlqVNkEGr+rYZhP8OyQwb+/EDNPNrCUV2k11MaZTN uUUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=bMiKMgn44FnTL1QF5XGk2cQ3VMSncLZRUsWlQ5qdJAY=; b=CZNg3hM8AJRTmFyoL6Qcp7PolM8dTs10F9NFmtfet2OzFCaQUPWULu4j5a/YEyicAA rvlyZWG+Fn5WMeZYauk4vKA+lvDTp8oP2R7qKxOW9Y2b5NY5g6EKT45qaF1sfk9eLKH5 tDvjsAglqlboFXALPvx2Gr+CB9cbjMsdvUtJ1TZNq6qliVt52BpDwDPOUTaNBDMeo8sW 5G6BNo1K5eAn7R9KN5uuKTJ00t90kBu0yX6ULVMfSouqKrbzsHOabVg3hpUvsq092+/Y 0gIuOcCM/+YGO447bI1kpL7gi6juFZsPejV2NKjq0eJIl1crJjngXVz/IAo5wdwfi2mB +9Vg== X-Gm-Message-State: AGi0PuY4kWW/tCiM11lRVnGvxuDl17T3ngXMPMWL8rX9xUM1RI6QVNlf pUXSMuyYzUMkvguH6O+6gI92vw== X-Google-Smtp-Source: APiQypIOghRqPjewjCSU9LUluPradN6fhtklkkGYcsCk7JbmTqLkcoigW0DiKtPWiglM7Bjd+DFryw== X-Received: by 2002:a5d:4443:: with SMTP id x3mr18771007wrr.162.1587395519523; Mon, 20 Apr 2020 08:11:59 -0700 (PDT) Received: from dynamic-eoa1xw1q44qdjznxo-pd01.res.v6.highway.a1.net (dynamic-eoa1xw1q44qdjznxo-pd01.res.v6.highway.a1.net. [2001:871:60:9afb:eb30:1de6:8277:4aec]) by smtp.gmail.com with ESMTPSA id z18sm1479447wrw.41.2020.04.20.08.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 08:11:59 -0700 (PDT) Message-ID: Subject: Re: Exporting TBs of data in Oracle schema/database into CSV format to migrate into PostgreSQL From: Laurenz Albe To: Avinash Kumar Cc: Pepe TD Vo , pgsql-admin@lists.postgresql.org, Thomas Kellerer Date: Mon, 20 Apr 2020 17:11:58 +0200 In-Reply-To: References: <172687860.2288957.1587391373846@mail.yahoo.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, 2020-04-20 at 11:59 -0300, Avinash Kumar wrote: > On Mon, Apr 20, 2020 at 11:39 AM Laurenz Albe wrote: > > On Mon, 2020-04-20 at 14:02 +0000, Pepe TD Vo wrote: > > > we can access Oracle table within Postgres? How? Need to create a database link > > > and/or how can both talk to each other? > > > > That would be the Oracle foreign data wrapper: > > https://laurenz.github.io/oracle_fdw/ > > I echo. In my experience i have seen copy using oracle_fdw performing (almost 3 times > faster than Ora2PG in some tests) a lot faster than what is existing today for the > offline data copy. So, one may just avoid the longer route of generating a CSV > and then looking for options to load it faster. > > However, for data validation - do you think we could do something like -> creating > a md5 hash out of oracle (using dbms_crypto.hash()) foreign table and local postgres > table (using md5()) ? > What else do you think is the best to validate the data between Oracle and Postgres, > other than Application and QA tests related to the App ? If there is no error transferring the data, why should there be need for validation? Unless you don't trust oracle_fdw of course. Calculating MD5-sums or similar of the data before and after would be difficult, because for example timestamps are stored quite differently. You'd have to convert the data into an identical text format on both systems, and I cannot think of a good way to do that. I think that everything beyond comparing the row count would be paranoid. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com