Oracle Database Gateway For Teradata

Transcription

Oracle Database Gateway for TeradataUser’s Guide11g Release 2 (11.2)E12068-01July 2009

Oracle Database Gateway for Teradata User's Guide, 11g Release 2 (11.2)E12068-01Copyright 2002, 2009, Oracle and/or its affiliates. All rights reserved.Primary Author:Maitreyee ChalihaContributor: Vira Goorah, Juan Pablo Ahues-Vasquez, Peter Castro, Charles Benet, Peter Wong, and GovindLakkojuThis software and related documentation are provided under a license agreement containing restrictions onuse and disclosure and are protected by intellectual property laws. Except as expressly permitted in yourlicense agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license,transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverseengineering, disassembly, or decompilation of this software, unless required by law for interoperability, isprohibited.The information contained herein is subject to change without notice and is not warranted to be error-free. Ifyou find any errors, please report them to us in writing.If this software or related documentation is delivered to the U.S. Government or anyone licensing it onbehalf of the U.S. Government, the following notice is applicable:U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical datadelivered to U.S. Government customers are "commercial computer software" or "commercial technical data"pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. Assuch, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions andlicense terms set forth in the applicable Government contract, and, to the extent applicable by the terms ofthe Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer SoftwareLicense (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.This software is developed for general use in a variety of information management applications. It is notdeveloped or intended for use in any inherently dangerous applications, including applications which maycreate a risk of personal injury. If you use this software in dangerous applications, then you shall beresponsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe useof this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use ofthis software in dangerous applications.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarksof their respective owners.This software and documentation may provide access to or information on content, products, and servicesfrom third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim allwarranties of any kind with respect to third-party content, products, and services. Oracle Corporation andits affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use ofthird-party content, products, or services.

ContentsPreface . ixAudience.Documentation Accessibility .Related Documents .Conventions .1ixixxxiIntroductionOverview. 1-1Heterogeneous Services Technology . 1-1Oracle Database Gateways . 1-22Teradata Gateway Features and RestrictionsUsing the Pass-Through Feature .CHAR Semantics .Multi-byte Character Sets Ratio Suppression .IPv6 Support.Gateway Session IDLE Timeout.Database Compatibility Issues for Teradata .Schema Considerations .Naming Rules .Rules for Naming Objects .Case Sensitivity .Data Types.Binary Literal Notation .Data Type Conversion.Queries.Row Selection .Empty Bind Variables.Locking .Known Restrictions .Transactional Integrity .Transaction Capability .COMMIT or ROLLBACK in PL/SQL Cursor Loops Closes Open Cursors .Pass-Through Feature.Bind Variables for Date Columns -52-52-62-62-62-62-6iii

SQL Syntax .WHERE CURRENT OF Clause.CONNECT BY Clause .ROWID .EXPLAIN PLAN Statement.Callback Support.SQL*Plus.Database Links.Stored Procedures .CALLBACK links .Known Problems .Teradata LONG VARCHAR Data Type .Schema Names and PL/SQL.Data Dictionary Views and PL/SQL.3Case StudiesCase Descriptions.Installation Media Contents.Demonstration Files.Demonstration Requirements.Creating Demonstration Tables.Demonstration Table Definitions.Demonstration Table Contents .Case 1: Simple Queries .Case 2: A More Complex Query .Case 3: Joining Teradata Tables .Case 4: Write Capabilities .DELETE Statement.UPDATE Statement .INSERT Statement.Case 5: Data Dictionary Query .Case 6: The Pass-Through Feature .UPDATE Statement .SELECT Statement ta Type ConversionData Type Conversion . A-1BSupported SQL Syntax and FunctionsSupported SQL Statements .DELETE .INSERT .SELECT .UPDATE .Oracle Functions.Functions Not Supported by Teradata.ivB-1B-1B-1B-1B-2B-2B-2

Functions Supported by Teradata .Arithmetic Operators .Comparison Operators.Group Functions .String Functions .Other Functions.CData DictionaryData Dictionary Support.Teradata System Catalog Tables .Accessing the Gateway Data Dictionary .Direct Queries to Teradata Tables .Supported Views and Tables.Data Dictionary Mapping.Default Column Values .Gateway Data Dictionary Descriptions lization ParametersInitialization Parameter File Syntax .Oracle Database Gateway for Teradata Initialization Parameters.Initialization Parameter Description.HS DB DOMAIN .HS DB INTERNAL NAME .HS DB NAME .HS DESCRIBE CACHE HWM .HS LANGUAGE .Character Sets .Language .Territory .HS LONG PIECE TRANSFER SIZE .HS OPEN CURSORS .HS RPC FETCH REBLOCKING .HS RPC FETCH SIZE .HS TIME ZONE .HS TRANSACTION MODEL .IFILE .HS FDS CONNECT INFO .HS FDS DEFAULT OWNER .HS FDS RECOVERY ACCOUNT .HS FDS RECOVERY PWD.HS FDS TRACE LEVEL.HS FDS TRANSACTION LOG .HS FDS FETCH ROWS.HS IDLE TIMEOUT .HS NLS LENGTH SEMANTICS.HS KEEP REMOTE COLUMN D-7D-7D-8D-8D-8D-9D-9D-9D-10D-10D-10D-10D-11v

HS FDS REMOTE DB CHARSET . D-11HS FDS SUPPORT STATISTICS . D-12HS FDS SQLLEN INTERPRETATION . D-12vi

List of C–34Data Type Conversions.Oracle Data Dictionary View Names and Teradata Equivalents .ALL CATALOG .ALL COL COMMENTS .ALL CONS COLUMNS .ALL CONSTRAINTS.ALL IND COLUMNS .ALL INDEXES .ALL OBJECTS.ALL TAB COLUMNS.ALL TAB COMMENTS.ALL TABLES .ALL USERS .ALL VIEWS.DBA CATALOG.DBA COL COMMENTS.DBA OBJECTS .DBA TAB COLUMNS .DBA TAB COMMENTS .DBA TABLES.DICT COLUMNS .DICTIONARY .DUAL.USER CATALOG .USER COL COMMENTS.USER CONS COLUMNS .USER CONSTRAINTS .USER IND COLUMNS.USER INDEXES.USER OBJECTS .USER TAB COLUMNS .USER TAB COMMENTS .USER TABLES .USER USERS.USER VIEWS 6C-16C-17C-18C-19C-19C-20C-21vii

viii

PrefaceThis manual describes the Oracle Database Gateway for Teradata, which enablesOracle client applications to access Teradata data through Structured Query Language(SQL). The gateway, with the Oracle database, creates the appearance that all dataresides on a local Oracle database, even though the data can be widely distributed.This preface covers the following topics: Audience Documentation Accessibility Related Documents ConventionsAudienceThis manual is intended for Oracle database administrators who perform thefollowing tasks: Installing and configuring the Oracle Database Gateway for Teradata Diagnosing gateway errors Using the gateway to access Teradata dataYou should understand the fundamentals of OracleDatabase Gateways and the UNIX based platforms before usingthis guide to install or administer the gateway.Note:Documentation AccessibilityOur goal is to make Oracle products, services, and supporting documentationaccessible to all users, including users that are disabled. To that end, ourdocumentation includes features that make information available to users of assistivetechnology. This documentation is available in HTML format, and contains markup tofacilitate access by the disabled community. Accessibility standards will continue toevolve over time, and Oracle is actively engaged with other market-leadingtechnology vendors to address technical obstacles so that our documentation can beaccessible to all of our customers. For more information, visit the Oracle AccessibilityProgram Web site at http://www.oracle.com/accessibility/.ix

Accessibility of Code Examples in DocumentationScreen readers may not always correctly read the code examples in this document. Theconventions for writing code require that closing braces should appear on anotherwise empty line; however, some screen readers may not always read a line of textthat consists solely of a bracket or brace.Accessibility of Links to External Web Sites in DocumentationThis documentation may contain links to Web sites of other companies ororganizations that Oracle does not own or control. Oracle neither evaluates nor makesany representations regarding the accessibility of these Web sites.Deaf/Hard of Hearing Access to Oracle Support ServicesTo reach Oracle Support Services, use a telecommunications relay service (TRS) to callOracle Support at 1.800.223.1711. An Oracle Support Services engineer will handletechnical issues and provide customer support according to the Oracle service requestprocess. Information about TRS is available athttp://www.fcc.gov/cgb/consumerfacts/trs.html, and a list of phonenumbers is available at http://www.fcc.gov/cgb/dro/trsphonebk.html.Related DocumentsFor more information, see these Oracle resources: Oracle Database New Features Guide Oracle Call Interface Programmer's Guide Oracle Database Administrator's Guide Oracle Database Advanced Application Developer's Guide Oracle Database Concepts Oracle Database Performance Tuning Guide Oracle Database Error Messages Oracle Database Globalization Support Guide Oracle Database Reference Oracle Database SQL Language Reference Oracle Database Net Services Administrator's Guide SQL*Plus User's Guide and Reference Oracle Database Heterogeneous Connectivity User's Guide Oracle Database Security GuideMany of the examples in this book use the sample schemas, which are installed bydefault when you select the Basic Installation option with an Oracle Databaseinstallation. Refer to Oracle Database Sample Schemas for information on how theseschemas were created and how you can use them yourself.Printed documentation is available for sale in the Oracle Store athttp://oraclestore.oracle.com/To download free release notes, installation documentation, white papers, or othercollateral, please visit the Oracle Technology Network (OTN). You must register onlinebefore using OTN; registration is free and can be done atx

http://otn.oracle.com/membership/If you already have a user name and password for OTN, then you can go directly tothe documentation section of the OTN Web site he following text conventions are used in this document:ConventionMeaningboldfaceBoldface type indicates graphical user interface elements associatedwith an action, or terms defined in text or the glossary.italicItalic type indicates book titles, emphasis, or placeholder variables forwhich you supply particular values.monospaceMonospace type indicates commands within a paragraph, URLs, codein examples, text that appears on the screen, or text that you enter.xi

xii

11IntroductionThis chapter introduces the challenge faced by organizations when running severaldifferent database systems. It briefly covers Heterogeneous Services, the technologythat the Oracle Database Gateway for Teradata is based on.To get a good understanding of generic gateway technology, Heterogeneous Services,and how Oracle Database Gateways fit in the picture, reading the Oracle DatabaseHeterogeneous Connectivity User's Guide first is highly recommended.This chapter contains the following sections: Overview Heterogeneous Services Technology Oracle Database GatewaysOverviewHeterogeneous data access is a problem that affects a lot of companies. A lot ofcompanies run several different database systems. Each of these systems stores dataand has a set of applications that run against it. Consolidation of this data in onedatabase system is often hard - in large part because many of the applications that runagainst one database may not have an equivalent that runs against another. Until suchtime as migration to one consolidated database system is made feasible, it

This manual describes the Oracle Database Gateway for Teradata, which enables Oracle client applications to access Teradata data through Structured Query Language (SQL). The gateway, with the Oracle databa se, creates the appearance that all data resides on a local Oracle database, even though the data can be widely distributed.