PGNP Native OLE DB Provider for Postgresql, Greenplum, Redshift Developer’S Manual
Total Page:16
File Type:pdf, Size:1020Kb
CATA 2021 PGNP Native OLE DB Provider for PostgreSQL, Greenplum, Redshift Developer’s Manual This document contains description of various PGNP features, use cases and programming techniques. It is written for professional developers. Konstantin Izmailov Copyright © 2006-2019. All Rights Reserved. 2/12/2021 This document is property of PGNP team. Neither a part nor the entire document can be reproduced, changed, distributed or published without prior written permission of owners. Please contact us if you have any questions: [email protected]. Page 2 Table of Contents 1 Introduction .................................................................................................................................................................... 6 2 Installation and Product Activation ................................................................................................................................ 7 2.1.1 UI based installation ........................................................................................................................................ 7 2.1.2 Unattended/silent installation ...................................................................................................................... 10 2.1.3 Activation on a computer behind a firewall (in DMZ) .................................................................................. 11 3 Provider’s Features ....................................................................................................................................................... 12 3.1 Database Transformation ..................................................................................................................................... 12 3.1.1 Transforming MS SQL 2000 database into a PostgreSQL database using DTSWizard .................................. 12 3.1.2 Transforming MS SQL 2005, 2008, 2012 database into a PostgreSQL database using DTSWizard .............. 15 3.2 Transactions .......................................................................................................................................................... 15 3.2.1 Local Transactions ......................................................................................................................................... 15 3.2.2 Distributed Transactions ............................................................................................................................... 17 3.2.3 PostgreSQL Nested Transactions .................................................................................................................. 18 3.3 Linked Servers ....................................................................................................................................................... 19 3.3.1 Create Linked Server using SQL Server Wizard ............................................................................................. 19 3.3.2 Create Linked Server using SQL Server Stored Procedures .......................................................................... 21 3.3.3 Viewing and changing Linked Server RPC status........................................................................................... 22 3.3.4 Running Linked Server in a separate process (out-of-proc) .......................................................................... 22 3.4 Replication with SQL Server 2000 ......................................................................................................................... 23 3.4.1 Configuring Publisher, Subscribers and Distributor ...................................................................................... 23 3.4.2 Creating publication ...................................................................................................................................... 24 3.4.3 Create Snapshot ............................................................................................................................................ 27 3.4.4 Adding Subscribers ........................................................................................................................................ 28 3.4.5 Synchronize ................................................................................................................................................... 32 3.5 Replication with SQL Server 2005/2008/2012 ...................................................................................................... 34 3.5.1 Configure SQL Server as Distributor .............................................................................................................. 34 3.5.2 Configure the publisher to use a specified distribution database ................................................................ 34 3.5.3 Create Linked Server ..................................................................................................................................... 34 3.5.4 Create the snapshot publication ................................................................................................................... 35 3.5.5 Create the snapshot subscription ................................................................................................................. 35 3.5.6 Deleting subscription and publication .......................................................................................................... 37 3.5.7 Create publication for transactional replication ........................................................................................... 37 Page 3 3.5.8 Create subscription for transactional replication ......................................................................................... 38 3.6 Generating reports in SQL Server Reporting Services........................................................................................... 40 3.7 Two phase commit protocol (2PC) ........................................................................................................................ 42 3.7.1 Configuring DTC ............................................................................................................................................ 42 3.7.2 Starting DTC Service ...................................................................................................................................... 42 3.7.3 Enabling prepared transactions in PostgreSQL ............................................................................................. 42 3.7.4 Troubleshooting issues with 2PC .................................................................................................................. 42 3.8 FastLoad feature ................................................................................................................................................... 43 3.8.1 Configuring OLE DB connection in BIDS ........................................................................................................ 43 3.8.2 Configuring Source and Destination ............................................................................................................. 44 3.9 The Query Optimizer ............................................................................................................................................. 45 3.9.1 Simple query substitution ............................................................................................................................. 46 3.9.2 Template based substitution ........................................................................................................................ 47 3.9.3 Exact Match scenario: optimizing ROLAP cube ............................................................................................. 48 3.9.4 Optimizing metadata retrieval ...................................................................................................................... 49 3.10 “Hinting” statements ............................................................................................................................................ 51 3.10.1 Copying table from SQL Server to Postgres in DTSWizard ............................................................................ 51 3.10.2 Tweaking Data Flow in SSIS Package ............................................................................................................. 52 3.10.3 Using comments to change Extended Properties parameters per statement ............................................. 53 4 Programming with the Provider.................................................................................................................................... 54 4.1 Connection String .................................................................................................................................................. 54 4.1.1 Main String parameters ................................................................................................................................ 54 4.1.2 Extended Properties ...................................................................................................................................... 54 4.1.3 Parameter BULK_METHOD ........................................................................................................................... 58 4.1.4 Parameters for Redshift ................................................................................................................................ 58 4.1.5 Deprecated and not supported parameters ................................................................................................