Home

Oracle Database Gateway for SQL Server User's Guide

image

Contents

1. Supported Views and Table Supported Views and Table 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 TABLE PRIVILEGES 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 C 2 Oracle Database Gateway for Microsoft SQL Server User s Guide Data Dictionary Mapping No other Oracle database data dictionary tables or views are supported If you use a view not on the list you will receive the Oracle database error code for no more rows available Queries through the gateway of any data dictionary table or view beginning with ALL can return rows from the SQL Server database even when access privileges for those SQL Server objects have not been granted When querying an Oracle database with the Oracle data dictionary rows are returned only for those objects you are permitted to access Data Dictionary Mapping The tables in this section list Oracle data dictionary view names and the equivalent SQL Server system tables used A plus sign
2. Table C 31 USER TAB COLUMNS Name Null Type Value TABLE NAME VARCHAR2 256 COLUMN NAME VARCHAR2 256 DATA TYPE VARCHAR2 8 DATA TYPE MOD VARCHAR2 1 NULL DATA TYPE OWNER VARCHAR2 1 NULL DATA LENGTH NUMBER DATA PRECISION NUMBER DATA SCALE NUMBER C 18 Oracle Database Gateway for Microsoft SQL Server User s Guide Gateway Data Dictionary Descriptions Table C 31 Cont USER TAB COLUMNS Name Null Type Value NULLABLE VARCHAR2 1 y or N COLUMN_ID NUMBER DEFAULT_LENGTH NUMBER 0 DATA DEFAULT VARCHAR2 1 NULL NUM_DISTINCT NUMBER LOW_VALUE NUMBER 0 HIGH_VALUE NUMBER 0 DENSITY NUMBER 0 NUM_NULLS NUMBER 0 NUM_BUCKETS NUMBER 0 LAST ANALYZED DATE NULL SAMPLE SIZE NUMBER 0 CHARACTER SET NAME VARCHAR2 1 NULL CHAR_COL_DECL_LENGTH NUMBER 0 GLOBAL_STATS VARCHAR2 1 NULL USER_STATS VARCHAR2 1 NULL AVG_COL_LEN NUMBER 0 Table C 32 USER_TAB_COMMENTS Name Null Type Value TABLE_NAME VARCHAR2 256 TABLE_TYPE VARCHAR2 5 TABLE or VIEW COMMENTS VARCHAR2 1 NULL Table C 33 USER TABLES Name Null Type Val
3. Name Null Type Value GLOBAL STATS VARCHAR2 1 NULL USER STATS VARCHAR2 1 NULL AVG_COL_LEN NUMBER 0 Table C 10 ALL TAB COMMENTS Name Null Type Value OWNER VARCHAR2 256 TABLE NAME VARCHAR2 256 TABLE TYPE VARCHAR2 5 TABLE or VIEW COMMENTS VARCHAR2 1 NULL Table C 11 ALL TABLES Name Null Type Value OWNER VARCHAR2 256 TABLE NAME VARCHAR2 256 TABLESPACE_NAME VARCHAR 1 NULL CLUSTER_NAME VARCHAR 1 NULL IOT NAME VARCHARZ2 1 NULL PCT_FREE NUMBER 0 PCT_USED NUMBER 0 INI_TRANS NUMBER 0 MAX TRANS NUMBER 0 INITIAL EXTENT NUMBER 0 NEXT EXTENT NUMBER 0 MIN EXTENTS NUMBER 0 MAX EXTENTS NUMBER 0 PCT INCREASE NUMBER 0 FREELISTS NUMBER 0 FREELIST GROUPS NUMBER 0 LOGGING VARCHAR 1 NULL BACKED UP VARCHAR 1 NULL NUM_ROWS NUMBER 0 BLOCKS NUMBER 0 EMPTY_BLOCKS NUMBER 0 Data Dictionary C 9 Gateway Data Dictionary Descriptions Table C 11 Cont ALL TABLES Name Null Type Value AVG SPACE NUMBER 0 CHAIN CNT NUMBER 0 AVG ROW LEN NUMBER 0 AVG SPACE FREELIST BLOCKS NUMBER 0 NUM FREELIST BLOCKS NUMBER 0 DEGREE VARCHAR2 1 NULL INSTANCES VARCHAR2 1 NULL CACHE VARCHAR2 1 NULL TABLE_LOCK VARCHAR 1 NULL SAMPLE_SIZE NUMBER 0 LAST_ANALYZED DATE NULL PARTITIONED VARCHAR2 1 NULL IOT_TYPE VARCHAR2 1 NULL
4. GTW EMP EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO 7369 SMITH CLERK 7902 17 DEC 80 800 20 7499 ALLEN SALESMAN 7698 20 FEB 81 1600 300 30 7521 WARD SALESMAN 7698 22 FEB 81 1250 500 30 7566 JONES MANAGER 7839 02 APR 81 2975 20 7654 MARTIN SALESMAN 7698 28 SEP 81 1250 1400 30 7698 BLAKE MANAGER 7839 01 MAY 81 2850 30 7782 CLARK MANAGER 7839 09 JUN 81 2450 10 7788 SCOTT ANALYST 7566 09 DEC 82 3000 20 7839 KING PRESIDENT 17 NOV 81 5000 10 7844 TURNER SALESMAN 7698 08 SEP 81 1500 0 30 7876 ADAMS CLERK 7788 12 JAN 83 1100 20 7900 JAMES CLERK 7698 03 DEC 81 950 30 7902 FORD ANALYST 7566 03 DEC 81 3000 20 7934 MILLER CLERK 7782 23 JAN 82 1300 10 GTW_DEPT DEPTNO DNAME LOC 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON GTW_SALGRADE GRADE LOSAL HISAL 1 700 1200 2 1201 1400 3 1401 2000 3 4 Oracle Database Gateway for Microsoft SQL Server User s Guide Case 4 Write Capabilities 4 2001 3000 5 3001 9999 Case 1 Simple Queries Case 1 demonstrates the following A simple query a A simple query retrieving full date information The first query retrieves all the data from GTW DEPT and confirms that the gateway is working correctly The second query retrieves all the data from GTW EMP including the time portion of the hire date because the default date format was set to DD MON YY HH24 MM SS for the session by an ALTER SESSION command Case 2 A More Complex Que
5. Property Description Range of values Any valid user ID Specifies the name of the recovery account used for the commit confirm transaction model An account with user name and password must be set up at the non Oracle system For more information about the commit confirm model see the HS_ TRANSACTION MODEL parameter The name of the recovery account is case sensitive HS FDS RECOVERY PWD Property Description Default Value RECOVER Range of values Any valid password Specifies the password of the recovery account used for the commit confirm transaction model set up at the non Oracle system For more information about the commit confirm model see the HS TRANSACTION MODEL parameter The name of the password of the recovery account is case sensitive HS FDS RESULTSET SUPPORT Property Description Default Value FALSE Range of Values TRUE FALSE Enables result sets to be returned from stored procedures By default all stored procedures do not return a result set to the user Note If you set this initialization parameter you must do the following Change the syntax of the procedure execute statement for all existing stored procedures to handle result sets Workin the sequential mode of Heterogeneous Services HS FDS TRACE LEVEL Property Description Default Value OFF Range of values OFF ON DEBUG Specifies whether error tracing is turn
6. Name Null Type Value OBJECT TYPE VARCHAR2 9 TABLE or VIEW or INDEX or PROCEDURE CREATED DATE LAST_DDL_TIME DATE TIMESTAMP VARCHAR2 1 NULL STATUS VARCHAR2 5 VALID TEMPORARY VARCHAR2 1 NULL GENERATED VARCHAR2 1 NULL SECONDARY VARCHAR2 1 NULL Table C 9 ALL TAB COLUMNS Name Null Type Value OWNER VARCHAR2 256 TABLE NAME VARCHAR2 256 COLUMN NAME VARCHAR2 256 DATA TYPE VARCHAR2 8 DATA TYPE MOD VARCHAR2 1 NULL DATA_TYPE_OWNER VARCHAR 1 NULL DATA_LENGTH NUMBER DATA_PRECISION NUMBER DATA_SCALE NUMBER NULLABLE VARCHAR2 1 y or N COLUMN_ID NUMBER DEFAULT_LENGTH NUMBER 0 DATA DEFAULT VARCHAR2 1 NULL NUM_DISTINCT NUMBER 0 LOW_VALUE NUMBER 0 HIGH_VALUE NUMBER 0 DENSITY NUMBER 0 NUM_NULLS NUMBER 0 NUM_BUCKETS NUMBER 0 LAST_ANALYZED DATE NULL SAMPLE_SIZE NUMBER 0 CHARACTER_SET_NAME VARCHAR2 1 NULL CHAR_COL_DEC_LENGTH NUMBER 0 C 8 Oracle Database Gateway for Microsoft SQL Server User s Guide Gateway Data Dictionary Descriptions Table C 9 Cont ALL TAB COLUMNS
7. number number date date number datel date2 Statements with the preceding expressions are sent to the SOL Server database without any translation Since SQL Server does not support these date arithmetic functions the statements return an error SQL Server IMAGE TEXT and NTEXT Data Types The following restrictions apply when using IMAGE TEXT and NTEXT data types An unsupported SQL function cannot be used in a SQL statement that accesses a column defined as SQL Server data type IMAGE TEXT or NTEXT You cannot use SQL Plus to select data from a column defined as SOL Server data type IMAGE TEXT or NTEXT when the data is greater than 80 characters in length Oracle recommends using Pro C or Oracle Call Interface to access such data in a SOL Server database IMAGE TEXT and NTEXT data cannot be read through pass through queries If a SOL statement is accessing a table including an IMAGE TEXT or NTEXT column the statement will be sent to SOL Server as two separate statements One statement to access the IMAGE TEXT or NTEXT column and a second statement for the other columns in the original statement This will result in two connections to SOL Server due to a limitation in the Microsoft ODBC driver which only allows one statement for each connection which can cause a hang depending on the sequence of SQL statements If this happens try issuing a commit and separating the statements
8. NULL LAST CHANGE DATE Data Dictionary C 5 Gateway Data Dictionary Descriptions Table C 6 ALL IND COLUMNS Name Null Type Value INDEX OWNER NOT NULL VARCHAR2 30 INDEX NAME NOT NULL VARCHAR2 30 TABLE OWNER NOT NULL VARCHAR2 30 TABLE NAME NOT NULL VARCHAR2 30 COLUMN NAME VARCHAR2 8192 COLUMN POSITION NOT NULL FLOAT 53 COLUMN LENGTH NOT NULL FLOAT 53 DESCEND VARCHAR2 4 Table C 7 ALL INDEXES Name Null Type Value OWNER VARCHAR2 256 INDEX NAME VARCHAR2 256 INDEX TYPF VARCHAR2 1 NULL TABLE_OWNER VARCHAR2 256 TABLE_NAME VARCHAR2 256 TABLE_TYPE VARCHAR 7 TABLE or CLUSTER UNIQUENESS VARCHAR2 1 NULL COMPRESSION VARCHAR2 1 NULL PREFIX LENGTH NUMBER 0 TABLESPACE NAME VARCHAR2 1 NULL INI_TRANS NUMBER 0 MAX_TRANS NUMBER 0 INITIAL_EXTENT NUMBER 0 NEXT_EXTENT NUMBER 0 MIN_EXTENTS NUMBER 0 MAX_EXTENTS NUMBER 0 PCT_INCREASE NUMBER 0 PCT_THRESHOLD NUMBER 0 INCLUDE_COLUMN NUMBER 0 FREELISTS NUMBER 0 FREELIST_GROUPS NUMBER 0 PCT_FREE NUMBER 0 LOGGING VARCHAR2 1 NULL BLEVEL NUMBER 0 C 6 Oracle Database Gateway for Microsoft SQL S
9. TEMPORARY VARHCAR2 1 NULL SECONDARY VARCHAR2 1 NULL NESTED VARCHAR2 1 NULL BUFFER_POOL VARCHAR2 1 NULL ROW_MOVEMENT VARCHAR2 1 NULL GLOBAL_STATS VARCHAR2 1 NULL USER_STATS VARCHAR2 1 NULL DURATION VARHCAR2 1 NULL SKIP_CORRUPT VARCHAR2 1 NULL MONITORING VARCHAR2 1 NULL Table C 12 ALL USERS Name Null Type Value USERNAME VARCHAR2 256 USER ID NOT NULL NUMBER 5 CREATED NOT NULL DATE Table C 13 ALL VIEWS Name Null Type Value OWNER VARCHAR2 256 VIEW NAME VARCHAR2 256 TEXT LENGTH NUMBER 0 C 10 Oracle Database Gateway for Microsoft SQL Server User s Guide Gateway Data Dictionary Descriptions Table C 13 Cont ALL VIEWS Name Null Type Value TEXT VARCHAR2 256 TYPE TEXT LENGTH NUMBER 0 TYPE TEXT VARCHAR2 1 OID TEXT LENGTH NUMBER 0 OID TEXT VARCHAR2 1 VIEW TYPE OWNER VARCHAR2 1 VIEW TYPF VARCHAR2 1 Table C 14 DBA CATALOG Name Null Type Value OWNER VARCHAR2 256 TABLE NAME VARCHAR2 256 TABLE TYPE VARCHAR2 5 TABLE or VIEW Table C 15 DBA COL COMMENTS Name Null Type Value OWNER VARCHAR2 256 TABLE NAME VARCHAR2 256 COLUMN NAME VARCHAR2 256 COMMENTS
10. VARCHAR2 1 AU DELETE PRIV VARCHAR2 1 NS UPDATE PRIV VARCHAR2 1 AU REFERENCES PRIV VARCHAR2 1 AU ALTER PRIV VARCHAR2 1 NS INDEX PRIV VARCHAR2 1 NS CREATED NOT NULL DATE Table C 24 USER CATALOG Name Null Type Value TABLE NAME VARCHAR2 256 TABLE TYPE VARCHAR2 5 TABLE or VIEW Table C 25 USER COL COMMENTS Name Null Type Value TABLE NAME VARCHAR2 256 COLUMN NAME VARCHAR2 256 COMMENTS VARCHAR2 1 NULL Table C 26 USER CONS COLUMNS Name Null Type Value OWNER NOT NULL VARCHAR2 30 CONSTRAINT NAME NOT NULL VARCHAR2 30 TABLE NAME NOT NULL VARCHAR2 30 COLUMN NAMI EY s VARCHAR2 8192 POSITION FLOAT 53 Data Dictionary C 15 Gateway Data Dictionary Descriptions Table C 27 USER CONSTRAINTS Name Null Type Value OWNER VARCHAR2 256 CONSTRAINT NAME VARCHAR2 256 CONSTRAINT TYPE VARCHAR2 1 R or P or U or C TABLE NAME VARCHAR2 256 SEARCH CONDITION VARCHAR2 1 NULL R_OWNER VARCHAR2 256 R_CONSTRAINT_NAME VARCHAR2 256 DELETE_RULE VARCHAR2 1 NULL STATUS VARCHAR2 1 NULL DEFERRABLE VARCHAR2 1 NULL DEF
11. DATE NULL SAMPLE_SIZE NUMBER 0 CHARACTER_SET_NAME VARCHAR 1 NULL CHAR_COL_DEC_LENGTH NUMBER 0 GLOBAL_STATS VARCHAR 1 NULL USER_STATS VARCHAR 1 NULL AVG_COL_LEN NUMBER 0 C 12 Oracle Database Gateway for Microsoft SQL Server User s Guide Gateway Data Dictionary Descriptions Table C 18 DBA TAB COMMENTS Name Null Type Value OWNER VARCHAR2 256 TABLE_NAME VARCHAR2 256 TABLE_TYPE VARCHAR2 5 TABLE or VIEW COMMENTS VARCHAR2 1 NULL Table C 19 DBA_TABLES Name Null Type Value OWNER VARCHAR2 256 TABLE_NAME VARCHAR2 256 TABLESPACE NAME VARCHAR2 1 NULL CLUSTER_NAME VARCHAR2 1 NULL IOT_NAME VARCHAR2 1 NULL PCT_FREE NUMBER 0 PCT_USED NUMBER 0 INI_TRANS NUMBER 0 MAX_TRANS NUMBER 0 INITIAL_EXTENT NUMBER 0 NEXT_EXTENT NUMBER 0 MIN_EXTENTS NUMBER 0 MAX_EXTENTS NUMBER 0 PCT_INCREASE NUMBER 0 FREELISTS NUMBER 0 FREELIST_GROUPS NUMBER 0 LOGGING VARCHAR2 1 NULL BACKED_UP VARCHAR2 1 NULL NUM_ROWS NUMBER 0 BLOCKS NUMBER 0 EMPTY_BLOCKS NUMBER 0 AVG_SPACE NUMBER 0 CHAIN_CNT NUMBER 0 AVG_ROW_LEN NUMBER 0 AVG_SPACE_FREELIST_BLOCKS NUMBER 0 NUM_FREELIST_BLOCKS NUMBER 0 DEGREE VARCHAR2 1 NULL INSTANCES
12. Heterogeneous Services This limit is known as the describe cache high water mark The cache contains descriptions of the mapped tables that Heterogeneous Services reuses so that it does not have to re access the non Oracle data store If you are accessing many mapped tables increase the high water mark to improve performance Increasing the high water mark improves performance at the cost of memory usage HS LANGUAGE Property Description Default value System specific Range of values Any valid language name up to 255 characters Provides Heterogeneous Services with character set language and territory information of the non Oracle data source The value must use the following format language territory character set Note The globalization support initialization parameters affect error messages the data for the SOL Service and parameters in distributed external procedures Character Sets Ideally the character sets of the Oracle database and the non Oracle data source are the same If they are not the same Heterogeneous Services attempts to translate the character set of the non Oracle data source to the Oracle database character set and back again The translation can degrade performance In some cases Heterogeneous Services cannot translate a character from one character set to another Note The specified character set must be a superset of the operating system character set on the platform whe
13. INT IDENTITY NUMBER 10 MONEY NUMBER 19 4 NCHAR NCHAR NTEXT LONG if Oracle DB Character Set Unicode Otherwise it is not supported NVARCHAR NVARCHAR NVARCHAR MAX LONG if Oracle DB Character Set Unicode Otherwise it is not supported NUMERIC NUMBER p s NUMERIC IDENTITY NUMBER p s REAL FLOAT 24 SMALLDATETIME DATE Data Type Conversion Data Type Conversion Table A 1 Cont Data Type Conversions SQL Server Oracle Comment SMALLMONEY NUMBER 10 4 SMALLINT NUMBER 5 SMALLINT IDENTITY NUMBER 5 SYSNAME NVARCHAR TEXT LONG TIMESTAMP RAW TINYINT NUMBER 3 TINYINT IDENTITY NUMBER 3 VARBINARY RAW VARBINARY MAX LONG RAW VARCHAR VARCHAR2 VARCHAR MAX LONG XML LONG A 2 Oracle Database Gateway for Microsoft SQL Server User s Guide Supported SQL Syntax and Functions This appendix contains the following sections Supported SQL Statements Oracle Functions Supported SQL Statements DELETE INSERT SELECT With a few exceptions the gateway provides full support for Oracle DELETE INSERT SELECT and UPDATE statements The gateway does not support Oracle data definition language DDL statements No form of the Oracle ALTER CREATE DROP GRANT or TRUNCATE statements can be used Instead use the pass through feature of the gateway if you need to u
14. Note The column width of some columns in the translated data dictionary tables would be different when the gateway connects to a SOL Server Version 7 0 database Table C 2 ALL CATALOG Name Null Type Value OWNER VARCHAR2 256 TABLE NAME VARCHAR2 256 TABLE TYPE VARCHAR2 5 TABLE or VIEW C 4 Oracle Database Gateway for Microsoft SQL Server User s Guide Gateway Data Dictionary Descriptions Table C 3 ALL COL COMMENTS Name Null Type Value OWNER VARCHAR2 256 TABLE NAME VARCHAR2 256 COLUMN NAME VARCHAR2 256 COMMENTS VARCHAR2 1 Table C 4 ALL CONS COLUMNS Name Null Type Value OWNER NOT NULL VARCHAR2 30 CONSTRAINT NAME Gi VARCHAR2 30 TABLE_NAME VARCHAR2 30 COLUMN_NAME VARCHAR2 8192 POSITION FLOAT 53 Table C 5 ALL CONSTRAINTS Name Null Type Value OWNER VARCHAR2 256 CONSTRAINT NAME VARCHAR2 256 CONSTRAINT_TYPE VARCHAR2 1 C or P or R or U TABLE NAME VARCHAR2 256 SEARCH CONDITION VARCHAR2 1 NULL R OWNER VARCHAR2 256 R CONSTRAINT NAME VARCHAR2 256 DELETE RULE VARCHAR2 1 NULL STATUS VARCHAR2 1 NULL DEFERRABLE VARCHAR2 1 NULL DEFERRED VARCHAR2 1 NULL VALIDATED VARCHAR2 1 NULL GENERATED VARCHAR2 1 NULL BAD VARCHAR2 1 NULL RELY VARCHAR2 1
15. OBJECTS Sintii aa aa tente eerta uter Meli cete eee Mer OEC dn C 11 DBA LAB COLUMN S 2 tete ette cui creto ee tates sean Me eoe eee enc C 12 DBA LVAB COMMEBENTUS 4 rete A evertere reser ee iA er T e RE P Re C 13 DBASTABLES 2 a a E bes die Lese ML bd C 13 DIEN COLUMN Sissi AV tette itum S ees C 14 DIG THONARY 52 mtn ee edere e edet e eee a PERRO C 14 IDIB uL m C 14 TABEESPRIVIBEGES a ee test Hee let vaca eese eo tese ete eoe bu C 15 USER CAT AT OG estate utate ei cada cti e tes a ag s EAD IR C 15 USER COL COMMENTI Sca 5 rite eerte ete cb e ei eee C 15 USER CONS COLDUMNTNS 5 eet hte tutte bestie AO ea Ee ees C 15 USER CONSERAIN TS iuter ett t ee tee deeem ts C 16 USER IND COLUMN S retn hse ere tutti itu eere ete detis C 16 USERSINDEXES tende ee it etd e rere A Ari ERE Ee ETE AUGE C 16 USER OBJECTO ten enne teet e m eee ir pet e Re de C 18 USER TAB COLUMNS ecrit tree ire ettet tete eire te reet ehe C 18 USER TAB COMMENTS coma me ente deett it e eei ea es C 19 USER T ABDES 4 m E A E Me nh C 19 USERCUSERS idera m T PEE a eR e ee C 21 USERS VIEWS ER RM C C 21 Audience Preface This manual describes the Oracle Database Gateway for SOL Server which enables Oracle client applications to access SOL Server data through Structured Query Language SQL The gateway with the Oracle database creates the appearance that all data resides on a local Oracle database even though the data can be widely distributed This p
16. Repeat execution of get_next_result_set to get the output arguments PL SQL Program Fetching from Result Sets in Sequential Mode Assume that the table Loc_emp is a local table exactly like the SOL Server emp table The same assumption applies for loc_dept outargs is a table with columns corresponding to the out arguments of the SQL Server stored procedure create or replace package rcpackage is type RCTYPE is ref cursor end rcpackage declare rcl rcpackage rctype SQL Server Gateway Features and Restriction 2 5 Database Compatibility Issues for SQL Server reci loc emp rowtype rc2 rcpackage rctype rec2 loc dept rowtype rc3 rcpackage rctype rec3 outargs rowtype out arg varchar2 255 begin Execute procedure out arg null refcurproc MSQL Hello World out arg rcl Fetch 20 rows from the remote emp table and insert them into loc emp for i in 1 20 loop fetch rcl into recl insert into loc emp recl empno recl ename recl job recl mgr recl hiredate recl sal recl comm recl deptno end loop Close ref cursor close rcl Get the next result set returned by the stored procedure rc2 dbms hs result set get next result setGMSQL Fetch 5 rows from the remote dept table and insert them into loc dept for i in 1 5 loop fetch rc2 into rec2 insert into loc dept values rec2 deptno rec2 dname rec2 10c end loop Close ref cursor close rc2 Get the output arg
17. SUBSTRING negative number UPPER UPPER Supported SQL Syntax and Functions B 3 Oracle Functions Other Functions Oracle SQL Server ABS ABS CEIL CEILING COS COS EXP EXP FLOOR FLOOR LN LOG LOG LOG10 MOD NOT NVL IS NOT NULL NVL IS NULL POWER POWER ROUND ROUND SIN SIN SQRT SQRT TAN TAN Functions Supported by the Gateway If an Oracle function has no equivalent function in SOL Server the Oracle function is not translated into the SOL statement and must be post processed if the SOL statement is a SELECT The gateway however does support the TO DATE function equivalent in SQL Server as follows TO DATE date string date column Where date string is converted to a string with the following format yyyy mm dd hh mi ss fff Recommendation Supply the date string with the same format as the result that is yyyyy mm dd hh mi ss fff date column is a column with a date data type It is converted to a parameter with a timestamp data type B 4 Oracle Database Gateway for Microsoft SQL Server User s Guide C Data Dictionary The Oracle Database Gateway for SOL Server translates a query that refers to an Oracle database data dictionary table into a query that retrieves the data from SOL Server system tables You perform queries on data dictionary tables over the database link in the same way you query
18. To update or delete a specific row through the gateway a condition style WHERE clause must be used CONNECT BY Clause The gateway does not support the CONNECT BY clause in a SELECT statement Functions in Subqueries Bind variables and expressions are not supported as operands in string functions or mathematical functions when part of subquery in an INSERT UPDATE or DELETE SQL statement Parameters in Subqueries Due to a limitation in SQL Server you cannot use parameters in subqueries Data Dictionary Table and Views in UPDATE Statement Data dictionary tables and views in the SET clause of an UPDATE statement are not supported ROWID The Oracle ROWID implementation is not supported TO DATE TO DATE is a reserved word and cannot be used as a database identifier name EXPLAIN PLAN Statement The EXPLAIN PLAN statement is not supported Callback Support SQL statements that require the gateway to callback to Oracle database would not be supported The following categories of SOL statements will result in a callback Any DML with a sub select which refers to a table in Oracle database For example INSERT INTO empenon oracle SELECT FROM oracle emp SQL Server Gateway Features and Restriction 2 13 Known Problems Any DELETE INSERT UPDATE or SELECT FOR UPDATE SQL statement containing SQL func
19. UPDATE statements but are evaluated by the Oracle database if the statement is a SELECT statement That is the Oracle database performs post processing of SELECT statements sent to the gateway If an unsupported function is used in a DELETE INSERT or UPDATE statement the following Oracle error occurs ORA 02070 database db link name does not support function in this context Functions Supported by SQL Server The gateway translates the following Oracle database functions in SQL statements to their equivalent SQL Server functions Arithmetic Operators Comparison Operators Pattern Matching Group Functions String Functions Other Functions Arithmetic Operators Oracle SQL Server B 2 Oracle Database Gateway for Microsoft SQL Server User s Guide Oracle Functions Comparison Operators Oracle SQL Server IS NOT NULL IS NOT NULL IS NULL IS NULL Pattern Matching Oracle SQL Server LIKE LIKE NOT LIKE NOT LIKE Group Functions Oracle SQL Server AVG AVG COUNT COUNT MAX MAX MIN MIN SUM SUM String Functions Oracle SQL Server CONCAT expressionl expression2 ASCII ASCII CHR CHAR INSTR with two arguments CHARINDEX LENGTH DATALENGTH LOWER LOWER LTRIM LTRIM RTRIM RTRIM SUBSTR second argument cannot be a
20. VARCHAR2 1 NULL Data Dictionary C 13 Gateway Data Dictionary Descriptions Table C 19 Cont DBA TABLES Name Null Type Value CACHE VARCHAR 1 NULL TABLE_LOCK VARCHAR 1 NULL SAMPLE_SIZE NUMBER 0 LAST_ANALYZED DATE NULL PARTITIONED VARCHAR2 1 NULL IOT_TYPE VARCHAR 1 NULL TEMPORARY VARHCAR2 1 NULL SECONDARY VARCHAR2 1 NULL NESTED VARCHAR2 1 NULL BUFFER_POOL VARCHAR2 1 NULL ROW_MOVEMENT VARCHAR2 1 NULL GLOBAL_STATS VARCHAR2 1 NULL USER_STATS VARCHAR2 1 NULL DURATION VARHCAR2 1 NULL SKIP_CORRUPT VARCHAR2 1 NULL MONITORING VARCHAR2 1 NULL Table C 20 DICT COLUMNS Name Null Type Value TABLE NAME VARCHAR2 256 COLUMN NAME VARCHAR2 256 COMMENTS VARCHAR2 1 NULL Table C 21 DICTIONARY Name Null Type Value TABLE NAME VARCHAR2 256 COMMENTS VARCHAR2 1 Table C 22 DUAL Name Null Type Value DUMMY NOT NULL VARCHAR2 1 XU C 14 Oracle Database Gateway for Microsoft SQL Server User s Guide Gateway Data Dictionary Descriptions Table C 23 TABLE PRIVILEGES Name Null Type Value GRANTEE VARCHAR2 256 OWNER VARCHAR2 256 TABLE_NAME VARCHAR2 256 GRANTOR VARCHAR2 256 SELECT_PRIV VARCHAR2 1 Y INSERT PRIV
21. following notice is applicable U S GOVERNMENT RIGHTS Programs software databases and related documentation and technical data delivered 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 As such use duplication disclosure modification and adaptation of the Programs including documentation and technical data shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement and to the extent applicable the additional rights set forth in FAR 52 227 19 Commercial Computer Software Restricted Rights June 1987 Oracle USA Inc 500 Oracle Parkway Redwood City CA 94065 The Programs are not intended for use in any nuclear aviation mass transit medical or other inherently dangerous applications It shall be the licensee s responsibility to take all appropriate fail safe backup redundancy and other measures to ensure the safe use of such applications if the Programs are used for such purposes and we disclaim liability for any damages caused by such use of the Programs Oracle JD Edwards PeopleSoft and Siebel are registered trademarks of Oracle Corporation and or its affiliates Other names may be trademarks of their respective owners The Programs may provide links to Web sites and access to content products and services from third parties Oracle
22. formatlogin 2 15 Error messages error tracing D 10 Errors ORA 02070 2 11 Executing Stored Procedures 3 6 F fetch array size with H5 FDS FETCH ROWS D 11 FLOAT data type A 1 Functions in SOL 2 2 G Gateway case studies 3 1 data dictionary tables C 1 pass through feature 2 1 2 12 Index 1 supported functions B 1 supported SOL syntax B 1 globalization support Heterogeneous Services D 5 GRANT statement B 1 Group functions B 3 H Heterogeneous Services defining maximum number of open cursors D 6 optimizing data transfer D 6 setting global name D 4 specifying cache high water mark D 5 tuning internal data buffering D 7 tuning LONG data transfer D 6 Hexadecimal notation 2 8 HS CALL NAME initialization parameter D 3 HS DB NAME initialization parameter D 4 HS DESCRIBE CACHE HWM initialization parameter D 5 HS FDS CONNECT INFO D 8 HS FDS DEFAULT OWNER initialization parameter D 9 HS FDS FETCH ROWS parameter D 11 HS FDS PROC IS FUNC initialization parameter D 9 HS FDS RECOVERY PWD initialization parameter D 11 HS FDS RESULTSET SUPPORT initialization parameter D 10 HS FDS TRACE LEVEL initialization parameter D 10 enabling agent tracing D 2 HS FDS TRANSACTION LCG initialization parameter D 11 HS LANGUAGE initialization parameter D 5 HS LONG PIECE TRANSFER SIZE initialization parameter D 6 HS_OPEN_CURSORS initialization parameter D 6 HS_RPC_FETCH_REBLOCKING initialization
23. hexadecimal digits surrounded by single quotes For example the following statement is not supported SQL gt INSERT INTO BINARY TABGMSQL VALUES Oxff Where BINARY TAB contains a column of data type VARBINARY or BINARY Use bind variables when inserting into or updating VARBINARY and BINARY data types Bind Variables With LONG Columns The gateway does not support using bind variables to update columns of data type LONG 2 8 Oracle Database Gateway for Microsoft SQL Server User s Guide Database Compatibility Issues for SQL Server Queries Data Type Conversion SQL Server does not support implicit date conversions Such conversions must be explicit For example the gateway issues an error for the following SELECT statement SELECT DATE COL FROM TESTG MSQL WHERE DATE_COL 1 JAN 2004 To avoid problems with implicit conversions add explicit conversions as in the following SELECT DATE_COL FROM TEST MSQL WHERE DATE_COL TO_DATE 1 JAN 2004 See Also Appendix A Data Type Conversion for more information about restrictions on data types Query issues include the following Row Selection Empty Strings Empty Bind Variables Row Selection SQL Server evaluates a query condition for all selected rows before returning any of the rows If there is an error in the evaluation process for one or
24. in different transactions SQL Server Gateway Features and Restriction 2 15 Known Problems The gateway does not support the PL SQL function COLUMN VALUE LONG of the DBMS SQL package See Also Appendix B Supported SOL Syntax and Functions for more information about restrictions on SQL syntax String Functions If you concatenate numeric literals using the or CONCAT operator when using the gateway to query a SQL Server database the result is an arithmetic addition For example the result of the following statement is 18 SQL gt SELECT 9 9 FROM DUAL MSQL The result is 99 when using Oracle to query an Oracle database Schema Names and PL SQL If you do not prefix a SOL Server database object with its schema name in a SOL statement within a PL SQL block the following error message occurs ORA 6550 PLS 201 Identifier table name must be declared Change the SQL statement to include the schema name of the object Data Dictionary Views and PL SQL You cannot refer to data dictionary views in SOL statements that are inside a PL SQL block Stored Procedures Return values of stored procedures which return result sets are incorrect 2 16 Oracle Database Gateway for Microsoft SQL Server User s Guide 3 Case Studies The following case studies for SOL Server demonstrate some of the features of the Oracle Database Gateway You can verify that the gateway is installed and operating c
25. indicates that a join operation is involved Table C 1 Oracle Data Dictionary View Names and SQL Server Equivalents View Name ALL CATALOG jb COL COMMENTS LL CONS COLUMNS gt o LL CONSTRAINTS LL IND COLUMNS LL INDEXES LL OBJECTS LL TAB COLUMNS LL TAB COMMENTS jL TABLES jb USERS gt bp p bp Db bb iL VIEWS DBA_CATALOG DBA COL COMMENTS DBA OBJECTS DBA TABLES DBA TAB COLUMNS DBA TAB COMMENTS DICT COLUMNS DICTIONARY DUAL TABLE PRIVILEGES USER CATALOG USER COL COMMENTS USER CONS COLUMNS SQL Server System Table Name sysusers sysobjects sysusers sysobjects syscolumns sp_pkeys sp_fkeys sysusers sysobjects sysindexes sysconstraints sysreferences sysusers sysindexes syscolumns sysusers sysindexes sysobjects sysusers sysobjects sysindexes sysusers sysobjects syscolumns sysusers sysobjects sysusers sysobjects sysusers sysusers sysobjects syscomments sysusers sysobjects sysusers sysobjects syscolumns sysusers sysobjects sysindexes sysusers sysobjects sysusers sysobjects syscolumns sysusers sysobjects sysobjects syscolumns sysobjects sysusers sysprotects sysusers sysobjects sysusers sysobjects sysusers sysobjects syscolumns sp_pkeys sp_fkeys Data Dictionary C 3 Gateway Data Dictionary Descriptions Table C 1 Cont Oracle
26. parameter D 6 HS_RPC_FETCH_SIZE initialization parameter D 7 HS_TIME_ZONE initialization parameter D 7 IFILE initialization parameter D 8 IMAGE datatype A 1 Initialization parameter file customizing D 1 INSERT statement 3 6 B 1 B 2 K Known restrictions 2 10 L Locking database 2 10 LONG RAW data type A 1 Index 2 MONEY data type A 1 N NCHAR data type A 1 NULL values 2 7 NUMBER data type A 1 NUMERIC data type A 1 NVARCHAR data type A 1 NVL function 3 5 O Objects naming rules 2 7 ORA 02070 2 11 P parameters gateway initialization file HS FDS FETCH ROWS D 11 Passing commands to database 2 11 Pass Through Feature 3 6 Pattern Matching B 3 PL SQL 2 16 R RAW data type A 1 REAL data type A 1 remote functions referenced in SOL statements D 3 ROLLBACK restrictions 2 11 ROWID 2 13 S savepointsupport 2 11 SELECT statement 3 6 B 1 C 1 SMALL DATETIME data type A 1 SMALLINT data type A 2 Stored procedures 2 11 2 16 running in chained mode 2 7 Stored procedures in SOL Server 2 2 String functions B 3 SUM function 3 5 I TIMESTAMP data type A 2 TINYINT data type A 2 Transaction modes 2 7 transactional capability 2 11 transactional integrity 2 11 TRUNCATE statement B 1 Two phase commit 2 11 U UPDATE statement 2 13 3 5 3 6 B 2 V VARBINARY data type 2 15 A 2 VARCHAR data type A 2 W WHERE CURR
27. parameter can be used to tune a system for the best performance with the best trade off between round trips and memory requirements and network latency or response time HS OPEN CURSORS Property Description Default value 50 Range of values 1 to the value of Oracle s OPEN CURSORS initialization parameter Defines the maximum number of cursors that can be open on one connection to a non Oracle system instance The value never exceeds the number of open cursors in the Oracle database Therefore setting the same value as the OPEN_CURSORS initialization parameter in the Oracle database is recommended HS RPC FETCH REBLOCKING Property Description Default value ON Range of values OFF or ON Controls whether Heterogeneous Services attempts to optimize performance of data transfer between the Oracle database and the Heterogeneous Services agent connected to the non Oracle data store The following values are possible OFF disables reblocking of fetched data so that data is immediately sent from agent to server ON enables reblocking which means that data fetched from the non Oracle system is buffered in the agent and is not sent to the Oracle database until the amount of fetched data is equal to or higher than the value of HS RPC FETCH SIZE D 6 Oracle Database Gateway for Microsoft SQL Server User s Guide Initialization Parameter Description initialization parameter However any buffered data is return
28. procedure execute statement for all existing stored procedures In the following example the employee name JOHN SMYTHE is passed to the SQL Server stored procedure REVISE_SALARY The stored procedure retrieves the salary value from the SQL Server database to calculate a new yearly salary for JOHN SMYTHE The revised salary returned in RESULT is used to update EMP in a table of an Oracle database DECLARE INPUT VARCHAR2 15 RESULT NUMBER 8 2 BEGIN INPUT JOHN SMYTHE RESULT REVISE SALARYG MSQL INPUT UPDATE EMP SET SAL RESULT WHERE ENAME INPUT END The procedural feature automatically converts non Oracle data types to and from PL SQL data types Result Sets and Stored Procedures The Oracle Database Gateway for SQL Server provides support for stored procedures which return result sets By default all stored procedures and functions do not return a result set to the user To enable result sets set the HS_FDS_RESULTSET_SUPPORT parameter in the initialization parameter file See Also Appendix D Initialization Parameters for information about both editing the initialization parameter file and the HS_ FDS_RESULTSET_SUPPORT parameter For further information about Oracle support for result sets in non Oracle databases see Oracle Database Heterogeneous Connectivity Administrator s Guide Note If you set the HS_FDS_RESULTSET_SUPPORT gateway in
29. requested table view or synonym to one or more SQL Server system table names The gateway translates all data dictionary column names to their corresponding SQL Server column names within the query If the mapping involves one SQL Server system table the gateway translates the requested table Data Dictionary C 1 Data Dictionary Support name to its corresponding SQL Server system table name within the query If the mapping involves multiple SOL Server system tables the gateway constructs a join in the query using the translated SOL Server system table names 2 Sends the translated query to SOL Server 3 Might convert the retrieved SQL Server data to give it the appearance of the Oracle database data dictionary table 4 Passes the data dictionary information from the translated SQL Server system table to the Oracle database Note The values returned when querying the gateway data dictionary might not be the same as the ones returned by the Oracle SOL Plus DESCRIBE command Direct Queries to SQL Server Tables Queries issued directly to individual SQL Server system tables are allowed but they return different results because the SOL Server system table column names differ from those of the data dictionary view Also certain columns in an SQL Server system table cannot be used in data dictionary processing Supported Views and Tables The gateway supports the following views and tables
30. ByPos STMH amp BNDH 1 ERRH 1 dvoid arg2 20 SQLT CHR dvoid amp inds 1 amp rlens 1 amp rcode 1 0 ub4 0 OCI DEFAULT inds 2 0 rlens 2 0 OCIDescriptorAlloc ENVH dvoid amp rset OCI_DTYPE_RSET 0 dvoid 0 OCIBindByPos STMH amp BNDH 2 ERRH 2 dvoid rset 0 SQLT_RSET dvoid amp inds 2 amp rlens 2 amp rcode 2 0 ub4 0 OCI_DEFAULT Execute procedure OCIStmtExecute SVCH STMH ERRH 1 0 CONST OCISnapshot 0 OCISnapshot 0 OCI_DEFAULT Convert result set to statement handle OCIResultSetToStmt rset ERRH rstmt OCIStmt rset After this the user can fetch from rstmt Issue get_next_result_set call to get handle to next_result set Prepare Get next result set procedure call OCIStmtPrepare STMH ERRH n rs stm strlen n rs stm OCI NTV SYNTAX OCI DEFAULT Bind return value OCIBindByPos STMH amp BNDH 1 ERRH 1 dvoid rset 0 SQLT RSET dvoid amp inds 1 amp rlens 1 amp rcode 1 0 ub4 0 OCI DEFAULT Execute statement to get next result set OCIStmtExecute SVCH STMH ERRH 1 0 CONST OCISnapshot 0 OCISnapshot 0 OCI DEFAULT Convert next result set to statement handle OCIResultSetToStmt rset ERRH rstmt OCIStmt rset Now rstmt will point to the second result set returned by the remote stored procedure
31. DDL statements are executed in their own separate transaction The following SQL Server DDL statements can cause an error condition if you attempt to pass them with the gateway pass through feature or if you execute a SOL Server stored procedure that contains them Table 2 1 Restricted DDL Statements Statement Name TER DATABASE REATE DATABASE REATE INDEX REATE PROCEDURE REATE TABLE REATE VIEW ISK INIT ROP object UMP TRANSACTION Q0 uu o ao QO QA Q Q gt RANT LOAD DATABASE LOAD TRANSACTION RECONFIGURE EVOKE ELECT INTO R S TRUNCATE TABLE U PDATE STATISTICS See Also SOL Server documentation for more information about DDL statements SQL Syntax This section lists restrictions on the following SQL syntax a WHERE CURRENT OF Clause CONNECT BY Clause a Functions in Subqueries 2 12 Oracle Database Gateway for Microsoft SQL Server User s Guide Known Restrictions Parameters in Subqueries Data Dictionary Table and Views in UPDATE Statement ROWID TO DATE a EXPLAIN PLAN Statement Callback Support See Also Appendix B Supported SOL Syntax and Functions for more information about restrictions on SQL syntax WHERE CURRENT OF Clause UPDATE and DELETE statements with the WHERE CURRENT OF clause are not supported by the gateway because they rely on the Oracle ROWID implementation
32. Data Dictionary View Names and SQL Server Equivalents View Name SQL Server System Table Name USER CONSTRAINTS sysusers sysobjects sysindexes sysconstraints sysreferences USER_IND_COLUMNS sysusers sysindexes syscolumns USER_INDEXES sysusers sysindexes sysobjects USER_OBJECTS sysusers sysobjects sysindexes USER TAB COLUMNS sysusers sysobjects syscolumns USER_TAB_COMMENTS sysusers sysobjects USER_TABLES sysusers sysobjects USER_USERS sysusers USER_VIEWS sysusers sysobjects syscomments Default Column Values There is a minor difference between the gateway data dictionary and a typical Oracle database data dictionary The Oracle database columns that are missing in an SOL Server system table are filled with zeros spaces null values not applicable values N A or default values depending on the column type Gateway Data Dictionary Descriptions The gateway data dictionary tables and views provide the following information Name data type and width of each column The contents of columns with fixed values They are described here with information retrieved by an Oracle SOL Plus DESCRIBE command The values in the Nu11 column might differ from the Oracle database data dictionary tables and views Any default value is shown to the right of an item but this is not information returned by DESCRIBE
33. ENT OF clause 2 13 Index 3 Index 4
34. ERRED VARCHAR2 1 NULL VALIDATED VARCHAR2 1 NULL GENERATED VARCHAR2 1 NULL BAD VARCHAR2 1 NULL RELY VARCHAR2 1 NULL LAST_CHANGE DATE Table C 28 USER_IND_COLUMNS Name Null Type Value INDEX_NAME NOT NU VARCHAR2 30 TABLE_NAME NOT NU VARCHAR2 30 COLUMN_NAME VARCHAR2 8192 COLUMN_POSITION NOT NU FLOAT 53 COLUMN_LENGTH NOT NU FLOAT 53 DESCEND VARCHAR 4 Table C 29 USER INDEXES Name Null Type Value INDEX NAME VARCHAR2 256 INDEX TYPE TABLE OWNER TABLE NAMFE TABLE TYPE C 16 Oracle Database Gateway for Microsoft SQL Server User s Guide VARCHAR2 1 NULL VARCH A A VARCHAR2 256 E AR2 256 x A VARCHAR2 7 TABLE or CLUSTER Gateway Data Dictionary Descriptions Table C 29 Cont USER INDEXES Name Type Value UNIQUENESS VARCHAR2 1 NULL COMPRESSION VARCHAR2 1 NULL PREFIX LENGTH NUMBER 0 TABLESPACE NAME VARCHAR2 1 NULL INI TRANS NUMBER 0 MAX TRANS NUMBER 0 INITIAL EXTENT NUMBER 0 NEXT EXTENT NUMBER 0 MIN EXTENTS NUMBER 0 MAX EXTENTS NUMBER 0 PCT INCREASE NUMBER 0 PCT THRESHOLD NUMBER 0 INCLUDE COLUMN NUMBER 0 FREELISTS NUMBER 0 FREELIST GROUPS NUMBER 0 PCT FREE NUMBER 0 LOGGING VARCHAR2 1 NULL BLEVEL NUMBER LEA
35. F BLOCKS NUMBER 0 DISTINCT KEYS NUMBER 0 AVG LEAF BLOCKS PER KEY NUMBER 0 AVG DATA BLOCKS PER KEY NUMBER 0 CLUSTERING FACTOR NUMBER 0 STATUS VARCHAR2 1 NULL NUM ROWS NUMBER 0 SAMPLE SIZE NUMBER 0 LAST ANALYZED DATE NULL DEGREE VARCHAR2 1 NULL INSTANCES VARCHAR2 1 NULL PARTITIONED VARCHAR2 1 NULL TEMPORARY VARCHAR2 1 NULL GENERATED VARCHAR2 1 NULL SECONDARY VARCHAR2 1 NULL BUFFER POOL VARCHAR2 1 NULL USER STATS VARCHAR2 1 NULL DURATION VARHCAR2 1 NULL PCT DIRECT ACCESS NUMBER 0 Data Dictionary C 17 Gateway Data Dictionary Descriptions Table C 29 Cont USER INDEXES Name Null Type Value ITYP OWNER VARCHAR2 1 NULL ITYP NAME VARCHAR2 1 NULL PARAMETERS VARCHAR2 1 NULL GLOBAL STATS VARCHAR2 1 NULL DOMIDX STATUS VARCHAR2 1 NULL DOMIDX OPSTATUS VARCHAR2 1 NULL FUNCIDX STATUS VARCHAR2 1 NULL Table C 30 USER OBJECTS Name Null Type Value OBJECT NAME VARCHAR2 256 SUBOBJECT NAME VARCHAR2 1 NULL OBJECT_ID NUMBER DATA_OBJECT_ID NUMBER 0 OBJECT_TYPE VARCHAR2 9 TABLE or VIEW or INDEX or PROCEDURE CREATED DATE LAST_DDL_TIME DATE TIMESTAMP VARCHAR2 1 NULL STATUS VARCHAR2 5 VALID TEMPORARY VARCHAR 1 NULL GENERATED VARCHAR2 1 NULL SECONDARY VARCHAR2 1 NULL
36. FuriClons eie den enr ieri t eri ie ERR EE iO HER ee LESER FATHER Me Una EFE ice 2 16 Schema Names and BE SOLk iii doit Hecht itu Pa s red 2 16 Data Dictionary Views and PL 9QL 5 tette trei etre deret state 2 16 Stored Procedures 2 025 ni ee eee E e La e d ee bed alice d e 2 16 Case Studies Case Descriptions snot oem aitor ino 3 1 Installation Media Coritents 2e nete ee ettet et td eter de ert testis 3 2 Demonstration Files in ne ien ene e tene ede edat 3 2 Demonstration Requirements sse nennen nenne nennen nennen 3 2 Creating Demonstration Tables sess eene enne rn cra raras 3 3 Demonstration Table Definitions sessi ten erei tenente trennen 3 3 Demonstration Table Contents 52 ctore a deed EP ea Ee dera ha deber gd 3 4 Case 1 Simple Queres eese en eee eb ee bcn eb eL i eh deesset det 3 5 Case 2 A More Complex Query nein ponet ABI o ete ne id 3 5 Case 3 Joining SOL Server Tables esses eene nnne nennen 3 5 Case 4 Write Capabilities eee ee eee Eee en eee e et eee eee tags 3 5 DELETE Statement cete er tee aee EA e ted a Se ih tede teet 3 5 UPDATE Statement omnee een eet date iie bees 3 5 INSERT Statement oret tte bobo t b o P ee b tidie 3 6 Case 5 Data Dictionary Query sessssssessseeeeeneee e nene e nene nennen nennen nennen 3 6 Case 6 The Pass Through Feature sees eene nene nnne nennen tenentes 3 6 UPDATE Statem
37. OMAIN initialization parameters define the global name of the non Oracle system Note The HS_DB_NAME and HS DB DOMAIN initialization parameters must combine to form a unique address ina cooperative server environment HS_DB_INTERNAL_NAME Property Description Default value 01010101 Range of values 1 to 16 hexadecimal characters Specifies a unique hexadecimal number identifying the instance to which the Heterogeneous Services agent is connected This parameter s value is used as part of a transaction ID when global name services are activated Specifying a nonunique number can cause problems when two phase commit recovery actions are necessary for a transaction HS_DB_NAME Property Description Default value HO Range of values 1 to 8 characters Specifies a unique alphanumeric name for the data store given to the non Oracle system This name identifies the non Oracle system within the cooperative server environment The HS DB NAME and HS_DB_DOMAIN initialization parameters define the global name of the non Oracle system HS_DESCRIBE_CACHE_HWM Property Description Default value 100 Range of values 1 to 4000 D 4 Oracle Database Gateway for Microsoft SQL Server User s Guide Initialization Parameter Description Specifies the maximum number of entries in the describe cache used by
38. ORING VARCHAR2 1 NULL C 20 Oracle Database Gateway for Microsoft SQL Server User s Guide Gateway Data Dictionary Descriptions Table C 34 USER USERS Name Null Type Value USERNAME VARCHAR2 256 USER ID NOT NULL NUMBER 5 ACCOUNT STATUS VARCHAR2 4 OPEN LOCK DATE DATE NULL EXPIRY DATE DATE NULL DEFAULT TABLESPACE VARCHAR2 1 NULL TEMPORARY_TABLESPACE VARCHAR2 1 NULL CREATED NOT NULL DATE INITIAL_RSRC_CONSUMER_GROUP VARCHAR2 1 NULL EXTERNAL_NAME VARCHAR2 1 NULL Table C 35 USER_VIEWS Name Null Type Value VIEW_NAME VARCHAR2 256 TEXT_LENGTH NUMBER 0 TEXT VARCHAR2 256 TYPE_TEXT_LENGTH NUMBER 0 TYPE_TEXT VARCHAR2 1 NULL OID_TEXT_LENGTH NUMBER 0 OID_TEXT VARCHAR2 1 NULL VIEW_TYPE_OWNER VARCHAR2 1 NULL VIEW_TYPE VARCHAR2 1 NULL Data Dictionary C 21 Gateway Data Dictionary Descriptions C 22 Oracle Database Gateway for Microsoft SQL Server User s Guide D Initialization Parameters The Oracle database initialization parameters in the init ora file are distinct from gateway initialization parameters Set the gateway parameters in the initialization parameter file using an agent specific mechan
39. Oracle amp Database Gateway for SQL Server User s Guide 11g Release 1 11 1 B31049 02 July 2007 ORACLE Oracle Database Gateway for SOL Server User s Guide 112 Release 1 11 1 B31049 02 Copyright 2002 2007 Oracle All rights reserved Primary Author Maitreyee Chaliha Contributor Vira Goorah Juan Pablo Ahues Vasquez Peter Castro Charles Benet Peter Wong and Govind Lakkoju The Programs which include both the software and documentation contain proprietary information they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright patent and other intellectual and industrial property laws Reverse engineering disassembly or decompilation of the Programs except to the extent required to obtain interoperability with other independently created software or as specified by law is prohibited The information contained in this document is subject to change without notice If you find any problems in the documentation please report them to us in writing This document is not warranted to be error free Except as may be expressly permitted in your license agreement for these Programs no part of these Programs may be reproduced or transmitted in any form or by any means electronic or mechanical for any purpose If the Programs are delivered to the United States Government or anyone licensing or using the Programs on behalf of the United States Government the
40. SQL Server create procedure REFCURPROC argl varchar 255 arg2 varchar 255 output as select arg2 argl select from EMP select from DEPT go This stored procedure assigns the input parameter arg to the output parameter arg2 opens the query SELECT FROM EMP in ref cursor rcl and opens the query SELECT FROM DEPT in ref cursor rc2 OCI Program Fetching from Result Sets in Sequential Mode The following example shows OCI program fetching from result sets in sequential mode OCIEnv ENVH OCISvcCtx SVCH OCIStmt STMH OCIError ERRH OCIBind BNDH 3 OraText arg1 20 OraText arg2 255 OCIResult rset OCIStmt rstmt ub2 rcode 3 ub2 rlens 3 sb2 inds 3 OraText stmt OraText begin refcurproc MSQL 1 2 3 end OraText n rs stm OraText begin ret DBMS HS RESULT SET GET NEXT RESULT SETGMSQL end Prepare procedure call statement Handle Initialization code skipped OCIStmtPrepare STMH ERRH stmt strlen stmt OCI NTV SYNTAX OCI DEFAULT Bind procedure arguments inds 0 0 strcpy char argl Hello World rlens 0 strlen argl 2 4 Oracle Database Gateway for Microsoft SQL Server User s Guide Remote User defined Function Support OCIBindByPos STMH amp BNDH 0 ERRH 1 dvoid argl 20 SQLT CHR dvoid amp inds 0 amp rlens 0 amp rcode 0 0 ub4 0 OCI DEFAULT inds 1 1 OCIBind
41. ULTSET SUPPORT a HS FDS TRACE LEVEL a HS FDS TRANSACTION LOG a H5 FDS REPORT REAL AS DOUBLE a HS FDS FETCH ROWS Initialization Parameter Description The following sections describe all the initialization file parameters that can be set for gateways HS CALL NAME Property Description Default value None Range of values Not applicable Specifies the remote functions that can be referenced in SOL statements The value is a list of remote functions and their owners separated by semicolons in the following format owner name function name For example ownerl Al owner2 A2 owner3 A3 If an owner name is not specified for a remote function the default owner name becomes the user name used to connect to the remote database specified when the Heterogeneous Services database link is created or taken from user session if not specified in the DB link The entries for the owner names and the function names are case sensitive Initialization Parameters D 3 Initialization Parameter Description HS DB DOMAIN Property Description Default value WORLD Range of values 1 to 199 characters Specifies a unique network sub address for a non Oracle system The H8 DB DOMAIN initialization parameter is similar to the DB DOMAIN initialization parameter described in the Oracle Database Reference The HS DB DOMAIN initialization parameter is required if you use the Oracle Names server The H5 DB NAME and H8 DB D
42. VARCHAR2 1 NULL Table C 16 DBA OBJECTS Name Null Type Value OWNER VARCHAR2 256 OBJECT NAME VARCHAR2 256 SUBOBJECT NAME VARCHAR2 1 NULL OBJECT_ID NUMBER DATA_OBJECT_ID NUMBER 0 OBJECT_TYPE VARCHAR2 9 TABLE or VIEW or INDEX or PROCEDURE CREATED DATE LAST_DDL_TIME DATE Data Dictionary C 11 Gateway Data Dictionary Descriptions Table C 16 Cont DBA OBJECTS Name Null Type Value TIMESTAMP VARCHAR2 1 NULL STATUS VARCHAR2 5 NULL TEMPORARY VARCHAR2 1 NULL GENERATED VARCHAR2 1 NULL SECONDARY VARCHAR2 1 NULL Table C 17 DBA_TAB_COLUMNS Name Null Type Value OWNER VARCHAR2 256 TABLE_NAME VARCHAR2 256 COLUMN_NAME VARCHAR2 256 DATA_TYPE VARCHAR2 8 DATA_TYPE_MOD VARCHAR 1 NULL DATA_TYPE_OWNER VARCHAR 1 NULL DATA_LENGTH NUMBER DATA_PRECISION NUMBER DATA_SCALE NUMBER NULLABLE VARCHAR2 1 Y or N COLUMN ID NUMBER DEFAULT LENGTH NUMBER 0 DATA DEFAULT VARCHAR 1 NULL NUM_DISTINCT NUMBER LOW_VALUE NUMBER 0 HIGH_VALUE NUMBER 0 DENSITY NUMBER 0 NUM_NULLS NUMBER 0 NUM_BUCKETS NUMBER 0 LAST_ANALYZED
43. acle Database Reference HS FDS CONNECT INFO Property Description Default Value None Range of Values Not applicable HS FDS CONNECT INFO which describes the connection to the non Oracle system The default initialization parameter file already has an entry for this parameter The syntax for H8 FDS CONNECT INFO for the gateway is as follows For UNIX HS FDS CONNECT INFO host name port number instance name l l database name where host name is the host name or IP address of the machine hosting the SOL Server database port numberis the port number of the SOL Server database server instance name is the instance of SOL Server running on the machine and database_name is the SOL Server database name Either of the variables port numberor instance name can be used but not both together Optionally they both can be omitted The variable database name is always optional The slash is required when a particular value is omitted For example all of the following entries are valid HS FDS CONNECT INFO host name instance name database name HS FDS CONNECT INFO host name database name HS FDS CONNECT INFO host name port name database name D 8 Oracle Database Gateway for Microsoft SQL Server User s Guide Initialization Parameter Description HS FDS CONNECT INFO host name instance name HS FDS CONNECT INFO host name For Windows HS FDS CONNECT INFO host name instance name database name where ho
44. ccess SOL Server through the gateway can be affected by the following possible scenarios Readaccess might block write access a Write access might block read access a Statement level read consistency is not guaranteed See Also SOL Server documentation for information about the SQL Server locking model Known Restrictions If you encounter incompatibility problems not listed in this section or in Known Problems on page 2 14 contact Oracle Support Services The following section describes the known restrictions and includes suggestions for dealing with them when possible Multiple Open Statements Transactional Integrity Transaction Capability a COMMIT or ROLLBACK in PL SQL Cursor Loops Closes Open Cursors a Stored Procedures Pass Through Feature a DDL Statements SQL Syntax Functions a SOL Plus COPY Command with Lowercase Table Names Database Links Note If you have any questions or concerns about the restrictions contact Oracle Support Services Multiple Open Statements Accessing SQL Server has the limitation that one open statement or cursor is allowed for each connection If a second statement or cursor needs to open in the same transaction to access SQL Server it requires a new connection Because of this limitation multiple open statements or cursors within the same transaction can lock each other because they use different connections to SOL Server To avoid this rest
45. cess privileges must permit access by the user that the gateway is logging in as See Also Oracle Database Heterogeneous Connectivity Administrator s Guide for more information about executing stored procedures Standard PL SQL statements are used to execute a stored procedure The gateway supports stored procedures in three mutually exclusive modes Normal mode Have access to IN OUT arguments only Return value mode Have a return value for all stored procedures a Resultset mode Out values are available as last result set Remote User defined Function Support User defined functions in a remote non Oracle database can be used in SOL statements See Also Oracle Database Heterogeneous Connectivity Administrator s Guide for more information about executing user defined functions on a non Oracle database Return Values and Stored Procedures By default all stored procedures and functions do not return a return value to the user To enable return values set the H8 FDS PROC IS FUNC parameter in the initialization parameter file See Also Appendix D Initialization Parameters for information about both editing the initialization parameter file and the HS FDS PROC IS FUNC parameter 2 2 Oracle Database Gateway for Microsoft SQL Server User s Guide Remote User defined Function Support Note If you set the HS FDS PROC IS FUNC gateway initialization parameter you must change the syntax of the
46. chnology that the Oracle Database Gateway for SQL Server is based on To get a good understanding of generic gateway technology Heterogeneous Services Generic Connectivity and how Oracle Database Gateways fit in the picture reading Oracle Database Heterogeneous Connectivity Administrator s Guide first is highly recommended This chapter contains the following sections Overview Heterogeneous Services Technology Oracle Database Gateways Heterogeneous data access is a problem that affects a lot of companies A lot of companies run several different database systems Each of these systems stores data and has a set of applications that run against it Consolidation of this data in one database system is often hard in large part because many of the applications that run against one database may not have an equivalent that runs against another Until such time as migration to one consolidated database system is made feasible it is necessary for the various heterogeneous database systems to interoperate Oracle Database Gateways provide the ability to transparently access data residing in a non Oracle system from an Oracle environment This transparency eliminates the need for application developers to customize their applications to access data from different non Oracle systems thus decreasing development efforts and increasing the mobility of the application Applications can be developed using a consistent Oracle interface for both O
47. d procedures in the SQL Server database accordingly CREATE TABLE GTW_EMP EMPNO SMALLINT NOT NULL ENAME VARCHAR 10 JOB VARCHAR 9 MGR SMALLINT HIREDATE DATETIME SAL NUMERIC 7 2 COMM NUMERIC 7 2 DEPTNO SMALLINT go CREATE TABLE GTW DEPT DEPTNO SMALLINT NOT NULL DNAME VARCHAR 14 LOC VARCHAR 13 go CREATE TABLE GTW SALGRADE GRADE MONEY LOSAL NUMERIC 9 4 HISAL NUMERIC 9 4 go DROP PROCEDURE InsertDept go CREATE PROCEDURE InsertDept dno INTEGER dname VARCHAR 14 loc VARCHAR 13 AS INSERT INTO GTW_DEPT VALUES dno dname loc go DROP PROCEDURE GetDept go CREATE PROCEDURE GetDept dno INTEGER dname VARCHAR 14 OUTPUT AS SELECT dname DNAME FROM GTW_DEPT WHERE DEPTNO dno go Demonstration Table Definitions The following table definitions use information retrieved by the SQL PLUS DESCRIBE command GTW_EMP Name Null Type EMPNO NOT NULL NUMBER 5 ENAME VARCHAR2 10 Case Studies 3 3 Creating Demonstration Tables JOB VARCHAR2 9 MGR NUMBER 5 HIREDATE DATE SAL NUMBER 7 2 COMM NUMBER 7 2 DEPTNO NUMBER 5 GTW DEPT Name Null Type DEPTNO NOT NULL NUMBER 5 DNAME VARCHAR2 14 LOC VARCHAR2 13 GTW SALGRADE Name Null Type GRADE NUMBER 19 4 LOSAL NUMBER 9 4 HISAL NUMBER 9 4 Demonstration Table Contents The contents of the SOL Server tables are
48. d through stored procedures that embed commits or rollbacks cannot be controlled by the Oracle transaction manager or Oracle COMMIT or ROLLBACK commands When accessing stored procedures with result sets through the Oracle Database Gateway for SOL Server you must work in the sequential mode of Heterogeneous Services When accessing stored procedures with multiple result sets through the Oracle Database Gateway for SQL Server you must read all the result sets before continuing Output parameters of stored procedures must be initialized to an empty string Pass Through Feature If the SOL statements being passed through the gateway result in an implicit commit at the SOL Server database the Oracle transaction manager is unaware of the commit and an Oracle ROLLBACK command cannot be used to roll back the transaction SQL Server Gateway Features and Restriction 2 11 Known Restrictions DDL Statements SQL Server requires some DDL statements to be executed in their own transaction and only one DDL statement can be executed in a given transaction If you use these DDL statements in a SQL Server stored procedure and you execute the stored procedure through the gateway using the procedural feature or if you execute the DDL statements through the gateway using the pass through feature an error condition might result This is because the procedural feature and the pass through feature of the gateway cannot guarantee that the
49. data dictionary tables in the Oracle database The gateway data dictionary is similar to the Oracle database data dictionary in appearance and use This appendix contains the following sections Data Dictionary Support Data Dictionary Mapping Gateway Data Dictionary Descriptions Data Dictionary Support The following paragraphs describe the Oracle Database Gateway for SOL Server data dictionary support SQL Server System Tables SQL Server data dictionary information is stored in the SOL Server database as SOL Server system tables All SOL Server system tables have names prefixed with sys The SQL Server system tables define the structure of a database When you change data definitions SOL Server reads and modifies the SOL Server system tables to add information about the user tables Accessing the Gateway Data Dictionary Accessing a gateway data dictionary table or view is identical to accessing a data dictionary in an Oracle database You issue a SOL SELECT statement specifying a database link The Oracle database data dictionary view and column names are used to access the gateway data dictionary in an Oracle database Synonyms of supported views are also acceptable For example the following statement queries the data dictionary table ALI CATALOG to retrieve all table names in the SOL Server database SQL gt SELECT FROM ALL CATALOG QGMSQL When a data dictionary access query is issued the gateway 1 Maps the
50. e private If however you are storing sensitive information like a password in the initialization parameter file then you may not want it uploaded to the server because the initialization parameters and values are not encrypted when uploaded Making the initialization parameters private prevents the upload from happening and they do not appear in dynamic performance views Use PRIVATE for the initialization parameters only if the parameter value includes sensitive information such as a user name or password SET PRIVATE specifies that the parameter value is set as an environment variable for the agent process and is also private not transferred to the Oracle database not appearing in dynamic performance views or graphical user interfaces Oracle Database Gateway for SQL Server Initialization Parameters This section lists all the initialization file parameters that can be set for the Oracle Database Gateway for SQL Server They are as follows HS CALL NAME HS DB DOMAIN HS DB INTERNAL NAME HS DB NAME HS DESCRIBE CACHE HWM HS LANGUAGE HS LONG PIECE TRANSFER SIZE HS OPEN CURSORS HS RPC FETCH REBLOCKING D 2 Oracle Database Gateway for Microsoft SQL Server User s Guide Initialization Parameter Description HS RPC FETCH SIZE a HS_TIME_ ZONE a HS TRANSACTION MODEL a IFILE a H5 FDS CONNECT INFO a H5 FDS DEFAULT OWNER a H5 FDS PROC IS FUNC a HS FDS RECOVERY ACCOUNT a HS FDS RECOVERY PWD a H5 FDS RES
51. ecified in the column definition Naming Rules Naming rule issues include the following Rules for Naming Objects a Case Sensitivity Rules for Naming Objects Oracle and SQL Server use different database object naming rules For example the maximum number of characters allowed for each object name can be different Also the use of single and double quotation marks case sensitivity and the use of alphanumeric characters can all be different See Also Oracle Database Reference and SQL Server documentation Case Sensitivity The Oracle database defaults to uppercase unless you surround identifiers with double quote characters For example to refer to the SQL Server table called emp enter the name with double quote characters as follows SQL gt SELECT FROM emp MSQL However to refer to the SOL Server table called emp owned by Scott from an Oracle application enter the following SQL SELECT FROM Scott emp GMSQL If the SOL Server table called emp is owned by SCOTT a table owner name in uppercase letters you can enter the owner name without double quote characters as follows SQL SELECT FROM SCOTT emp GMSQL SQL Server Gateway Features and Restriction 2 7 Database Compatibility Issues for SQL Server Or SQL SELECT FROM scott emp QGMSQL Oracle recommends that you surround all SQL Server object names with double quote characters and use the exact letter case for the object names as t
52. ed The directory contains the following demonstration files Demonstration Files bldmsql sql casel sql case2 sql case3 sql case4a sql case4b sql case4c sql case5 sql case6a sql case6b sql case7 sql dropmsql sql Demonstration Requirements The case studies assume these requirements have been met The gateway demonstration tables and stored procedures are installed in the SQL Server database The Oracle database has an account named SCOTT with a password of TIGER a The Oracle database has a database link called GTWLINK set up as public or private to the user SCOTT which connects the gateway to a SOL Server database as SCOTT with password TIGER2 For example you can create the database link as follows SQL gt CREATE DATABASE LINK GTWLINK CONNECT TO SCOTT 2 IDENTIFIED BY TIGER2 USING GTWSID a Oracle Net Services is configured correctly and running 3 2 Oracle Database Gateway for Microsoft SQL Server User s Guide Creating Demonstration Tables Creating Demonstration Tables The case studies are based on the GTW_EMP GTW DEPT and GTW_SALGRADE tables and the stored procedures InsertDept and GetDept If the demonstration tables and stored procedures have not been created in the SOL Server database use the bldmsql sql script to create them Enter the following gt isql USCOTT PTIGER2 ibldmsql sql The script creates the demonstration tables and store
53. ed immediately when a fetch indicates that no more data exists or when the non Oracle system reports an error HS RPC FETCH SIZE Property Description Default value 50000 Range of values 1to 10000000 Tunes internal data buffering to optimize the data transfer rate between the server and the agent process Increasing the value can reduce the number of network round trips needed to transfer a given amount of data but also tends to increase data bandwidth and to reduce latency as measured between issuing a query and completion of all fetches for the query Nevertheless increasing the fetch size can increase latency for the initial fetch results of a query because the first fetch results are not transmitted until additional data is available HS TIME ZONE Property Description Default value for Derived from the NLS TERRITORY initialization parameter 1 Jhh mm Range of values for Any valid datetime format mask 1 Jhh mm Specifies the default local time zone displacement for the current SOL session The format mask hh mm is specified to indicate the hours and minutes before or after UTC Coordinated Universal Time formerly Greenwich Mean Time For example HS TIME ZONE hh mm HS TRANSACTION MODEL Property Description Default Value COMMIT CONFIRM Range of Values COMMIT CONFIRM READ ONLY SINGLE SITE Specifies the type of transaction model that is used when the
54. ed on or off for gateway connectivity The following values are valid D 10 Oracle Database Gateway for Microsoft SQL Server User s Guide Initialization Parameter Description OFF disables the tracing of error messages a ON enables the tracing of error messages that occur when you encounter problems The results are written by default to a gateway log file in LOG directory where the gateway is installed DEBUG enables the tracing of detailed error messages that can be used for debugging HS FDS TRANSACTION LOG Property Description Default Value HS TRANSACTION LOG Range of Values Any valid table name Specifies the name of the table created in the non Oracle system for logging transactions For more information about the transaction model see the HS TRANSACTION MODEL parameter HS FDS REPORT REAL AS DOUBLE Property Description Default Value FALSE Range of Values TRUE FALSE Enables Oracle Database Gateway for SQL Server to treat SINGLE FLOAT PRECISION fields as DOUBLE FLOAT PPRECISION fields HS FDS FETCH ROWS Property Description Default Value 100 Range of Values Any integer between 1 and 1000 Syntax HS FDS FETCH ROWS num HS FDS FETCH ROWS specifies the fetch array size This is the number of rows to be fetched from the non Oracle database and to return to Oracle database at one time This paramete
55. ent c aee os e e ae eto eei 3 6 SELECT St terment nemen een eite 3 6 Case 7 Executing Stored Procedures esses eene nennen 3 6 Data Type Conversion Data Ty pe Conversion optet requie tute que E EO A ede ente en em ds A 1 Supported SQL Syntax and Functions Supported SOL Statements mic coito iria iii eei ined inte ide eret ede B 1 DELETE ici ia aae atn eo tedio duse at tea d nets B 1 INSERT p E B 1 SELECT e rere O NORTON B 1 UPDATE Maida tete eee onec to beet re rie oreet lid B 2 Oracle Eurictions io rone tite tede to ce te rbi ED at EP Ee Dre ioter etas B 2 Functions Not Supported by SQL Server sss ener B 2 Functions Supported by SOL Server t tee tereti ee eee tere te a eee Pe eer voit B 2 Functions Supported by the Gateway eene nennt B 4 C Data Dictionary Data Dicti ary Support AAA C 1 SOL Server System Tables sinmi tae C 1 Accessing the Gateway Data Dictionary oconoccococinononnnncnnnennnnnnnrnannronnnnnnnnnnnnnararananannnnn nennen C 1 Direct Queries to SOL Server Tables sese enne C 2 Supported Views and Tables eee etta eei tenete d idee id desd ai csi C 2 Data Dictionary Mapping eee ete eter eee p Deere rete de rede C 3 Default Column Values eret tete teet e ele eee eee eed C 4 Gateway Data Dictionary Descriptions sse nennen e enn eere C 4 D Initialization Parameters Initialization Parameter File Syntax s
56. erver User s Guide Gateway Data Dictionary Descriptions Table C 7 Cont ALL INDEXES Name Null Type Value LEAF BLOCKS NUMBER 0 DISTINCT KEYS NUMBER 0 AVG LEAF BLOCKS PER KEY NUMBER 0 AVG DATA BLOCKS PER KEY NUMBER 0 CLUSTERING FACTOR NUMBER 0 STATUS VARCHAR2 1 NULL NUM ROWS NUMBER 0 SAMPLE SIZE NUMBER 0 LAST ANALYZED DATE NULL DEGREE VARCHAR2 1 NULL INSTANCES VARCHAR2 1 NULL PARTITIONED VARCHAR2 1 NULL TEMPORARY VARCHAR2 1 NULL GENERATED VARCHAR2 1 NULL SECONDARY VARCHAR2 1 NULL BUFFER POOL VARCHAR2 1 NULL USER STATS VARCHAR2 1 NULL DURATION VARCHAR2 1 NULL PCT DIRECT ACCESS NUMBER 0 ITYP OWNER VARCHAR2 1 NULL ITYP NAME VARCHAR2 1 NULL PARAMETERS VARCHAR2 1 NULL GLOBAL STATS VARCHAR2 1 NULL DOMIDX STATUS VARCHAR2 1 NULL DOMIDX OPSTATUS VARCHAR2 1 NULL FUNCIDX STATUS VARCHAR2 1 NULL Table C 8 ALL OBJECTS Name Null Type Value OWNER VARCHAR2 256 OBJECT NAME VARCHAR2 256 SUBOBJECT NAME VARCHAR2 1 NULL OBJECT ID NUMBER DATA OBJECT ID NUMBER 0 Data Dictionary Gateway Data Dictionary Descriptions Table C 8 Cont ALL OBJECTS
57. ess nee enenenen D 1 Oracle Database Gateway for SOL Server Initialization Parameters sess D 2 Initialization Parameter Description s sss ener tnenenen D 3 HS CALL NAME dien EE RUE Rte e ipi D 3 TS DB DOMAIN A ER AER ete D 4 H5 DB INFTERNALE NAME 5 ite aora ete re eint bete i ees D 4 HS DB NAME 3 3 temet diese ir RE ERE ER EU re ET e eS D 4 HS DESCRIBE CACHE HWM sasiore rerien seines na Eare a sas ai a taa Ea D 4 HS LAN GU AGE 00 aa eina Ue REN ce Re e ve ERES eie is D 5 HS LONG PIECE TRANSFER SIZE 2 nri ie tede HE ee e s D 6 HS OPEN CURSORS I 5 2 8 p nxegnisupnHdem de Co Ee et NS D 6 HSCRPC FEICH REBEOGKIN G ue ttes de ee e eter D 6 HS REO FETCH SIZE an dte e nS BR D CDI ede D 7 HSSTIME ZONE 27 332 aeter ie Meo Re fe ee BE ils tv SURE CE HH Sr ERIS D 7 HS TRANSACTION MODEL eiecti ede ed Leia dt ee eee suse Shades D 7 IBIEE A Sete nnne a RR Sg e etiaai din D 8 HS FDS CONNEGT N O cuicos alada s D 8 HS FDS DEFAULT OWNER eoon era raaraa ai n E a e a ea a e ati ariaa D 9 AS EDS PROCAS FUN Era ene eu repete e te ettet neta n D 9 HS FDS RECOVERY ACCOUN ie Renee e eee RS D 9 HS FDS RECOVERY PWD 2 2 head ih etalon inm e mte A ERE e D 10 HAS EDS RESULTSET SUPPORT A Se e b RR RUE D 10 FHS FDS ERAGE LEEVEL 3 inecdannens omnt n ec N ORE en D 10 HSEFDSTRANSACTON LOG hte e tate teet eee ter oe he RETEN D 11 HS FDS REPORT REAL AS DOUBLE 1 4 eterne entrent enntrst rent tenten
58. hey appear in the SOL Server data dictionary This convention is not required when referring to the supported Oracle data dictionary tables or views listed in Appendix C Data Dictionary If existing applications cannot be changed according to these conventions create views in Oracle to associate SOL Server names to the correct letter case For example to refer to the SOL Server table emp from an existing Oracle application by using only uppercase names define the following view SQL CREATE VIEW EMP EMPNO ENAME SAL HIREDATE AS SELECT empno ename sal hiredate FROM emp MSQL With this view the application can issue statements such as the following SQL gt SELECT EMPNO ENAME FROM EMP Using views is a workaround solution that duplicates data dictionary information originating in the SQL Server data dictionary You must be prepared to update the Oracle view definitions whenever the data definitions for the corresponding tables are changed in the SQL Server database Data Types Data type issues include the following Binary Literal Notation Bind Variables With LONG Columns Data Type Conversion Binary Literal Notation Oracle SOL uses hexadecimal digits surrounded by single quotes to express literal values being compared or inserted into columns defined as data type RAW This notation is not converted to syntax compatible with the SOL Server VARBINARY and BINARY data types a 0x followed by
59. is not responsible for the availability of or any content provided on third party Web sites You bear all risks associated with the use of such content If you choose to purchase any products or services from a third party the relationship is directly between you and the third party Oracle is not responsible for a the quality of third party products or services or b fulfilling any of the terms of the agreement with the third party including delivery of products or services and warranty obligations related to purchased products or services Oracle is not responsible for any loss or damage of any sort that you may incur from dealing with any third party Contents dO AP el 0 NT e EA E ASE A Sd vii Audierice mins tilapia i temet e Heo Ur HER vii Documentation Accessibility eisseu pa a EE E nano nennen tenens vii Related Documenta nentes sn duet mitibus viii ConventONS uti lae bte ben vied ioter ko st eras bo EH ve Hd rid b tee Hb ia io bte ix 1 Introduction OVerVIeW z n eere deberet toit ecd iie bt Fo eva tee rev ebd basa 1 1 Heterogeneous Services Technology sss ee eene e eee en nennen 1 2 Oracle Database Gate ways viciado deep ttes 1 2 2 SQL Server Gateway Features and Restriction Using the Pass Through Feature sse eee eene n nnne ener 2 1 Executing Stored Procedures and Functions sess eee een 2 2 Remote User defined Function Support esses eee ee
60. ism or set them in the Oracle data dictionary using the DBMS HS package The gateway initialization parameter file must be available when the gateway is started This appendix contains a list of the gateway initialization parameters that can be set for each gateway and their description It also describes the initialization parameter file syntax It includes the following sections Initialization Parameter File Syntax Oracle Database Gateway for SOL Server Initialization Parameters Initialization Parameter Descriptions Initialization Parameter File Syntax The syntax for the initialization parameter file is as follows 1 2 3 The file is a sequence of commands Each command should start on a separate line End of line is considered a command terminator unless escaped with a backslash If there is a syntax error in an initialization parameter file none of the settings take effect Set the parameter values as follows SET PRIVATE parameter value Where parameter is an initialization parameter name It is a string of characters starting with a letter and consisting of letters digits and underscores Initialization parameter names are case sensitive valueis the initialization parameter value It is case sensitive An initialization parameter value is either a Astring of characters that does not contain any backslashes white space or double quotation marks b Aquoted string beginning with a double q
61. itialization parameter you must change the syntax of the procedure execute statement for all existing stored procedures or errors will occur When accessing stored procedures with result sets through the Oracle Database Gateway for SQL Server you will be in the sequential mode of Heterogeneous Services The Oracle Database Gateway for SQL Server returns the following information to Heterogeneous Services during procedure description All the input arguments of the remote stored procedure SQL Server Gateway Features and Restriction 2 3 Remote User defined Function Support None of the output arguments One out argument of type ref cursor corresponding to the first result set returned by the stored procedure Client programs have to use the virtual package function doms_hs_result_ set get next result set to get the ref cursor for subsequent result sets The last result set returned is the out argument from the procedure The limitations of accessing result sets are the following Result sets returned by a remote stored procedure have to be retrieved in the order in which they were placed on the wire On execution of a stored procedure all result sets returned by a previously executed stored procedure will be closed regardless of whether the data has been completely retrieved or not In the following example the SQL Server stored procedure is executed to fetch the contents of the emp and dept tables from
62. more rows no rows are returned even though the remaining rows satisfy the condition Oracle evaluates the query condition row by row and returns a row when the evaluation is successful Rows are returned until a row fails the evaluation Empty Strings Oracle processes an empty string in a SOL statement as a null value SQL Server processes an empty string as an empty string When comparing an empty string the gateway passes literal empty strings to the SOL Server database without any conversion If you intended an empty string to represent a null value SOL Server does not process the statement that way it uses the empty string You can avoid this problem by using NULL or IS NULL in the SQL statement instead of the empty string syntax as in the following example SELECT from emp MSQL where ename IS NULL Selecting an empty string For VARCHAR columns the gateway returns an empty string to the Oracle database as NULL value For CHAR columns the gateway returns the full size of the column with each character as empty space SQL Server Gateway Features and Restriction 2 9 Known Restrictions Locking Empty Bind Variables For VARCHAR bind variables the gateway passes empty bind variables to the SOL Server database as a NULL value The locking model for an SQL Server database differs significantly from the Oracle model The gateway depends on the underlying SQL Server behavior so Oracle applications that a
63. ne nnne 2 2 Return Values and Stored Procedures ccccccecssssesssessesscessecsecsseesecssseseceesesesecseesesceseecsecaeessecsaeeaes 2 2 Result Sets and Stored Procedures sse eterne rentre enint nennen 2 3 Database Compatibility Issues for SOL Server eee eene 2 6 Implicit Transactions Chained Mode sss eene enne nnne 2 7 Column Definida 2 7 Nammung Rul Sz emn eee i td e Ip Meet aides ond a oos 2 7 rings NN 2 8 CUA A A A acid E 2 9 A A O eed 2 10 Known Restrictions xt tec Hbc i Ner Hb exe ai it 2 10 Multiple Open Statements ren e ed 2 10 Transactional Integrity sae e are ab ether darte e aite ad ad detaches 2 11 Transaction Capability dte desi eee eee e te Pr t iret ue 2 11 COMMIT or ROLLBACK in PL SQL Cursor Loops Closes Open Cursors 2 11 Stored Procedures 2 2 Aere eee ec eet Mie ene eos 2 11 Pass Ihrough Featu te il ala dit 2 11 DA A E eA ee es ere EY 2 12 DTS TEAK vies IT 2 12 FUN CHONS 5 ILI i eR RA e ote eect kee ete ee pa Ped e ERR RICO Manet ates 2 14 SQL Plus COPY Command with Lowercase Table Names esee 2 14 DatabasesEinkS3 ca cen eot ete te ant etra MCA M L298 2 14 Known Problems abeo sedeat Hebe di e E eei Eia on 2 14 Enerypted Format LOoglh e eter gei rede e Rec ee evi D entes 2 15 Date Atthm ett iii 2 15 SQL Server IMAGE TEXT and NTEXT Data Types eee eene 2 15 String
64. neous Services also maintains the transaction coordination between Oracle and the remote non Oracle system such as providing the two phase commit protocol to ensure distributed transaction integrity even for non Oracle systems that do not natively support two phase commit See Also Oracle Database Heterogeneous Connectivity Administrator s Guide for more information about Heterogeneous Services Oracle Database Gateways The capabilities SOL mappings data type conversions and interface to the remote non Oracle system are contained in the gateway The gateway interacts with Heterogeneous Services to provide the transparent connectivity between Oracle and non Oracle systems The gateway can be installed on any machine independent of the Oracle or non Oracle database It can be the same machine as the Oracle database or on the same machine as the SOL Server database or on a third machine as a standalone 1 2 Oracle Database Gateway for Microsoft SQL Server User s Guide 2 SQL Server Gateway Features and Restriction After the gateway is installed and configured you can use the gateway to access SOL Server data pass SOL Server commands from applications to the SOL Server database perform distributed queries and copy data This chapter contains the following sections Using the Pass Through Feature Executing Stored Procedures and Functions Database Compatibility Issues for SQL Server Known Restrictions a Kno
65. non Oracle database is updated by a transaction The following values are possible COMMIT CONFIRM provides read and write access to the non Oracle database and allows the gateway to be part of a distributed update To use the commit confirm model the following items must be created in the non Oracle database Initialization Parameters D 7 Initialization Parameter Description IFILE Transaction log table The default table name is H5 TRANSACTION LOG A different name can be set using the HS FDS TRANSACTION LOG parameter The transaction log table must be granted SELECT DELETE and INSERT privileges set to public Recovery account The account name is assigned with the HS_FDS_ RECOVERY ACCOUNT parameter Recovery account password The password is assigned with the HS_FDS_ RECOVERY PWD parameter READ ONLY provides read access to the non Oracle database SINGLE SITE provides read and write access to the non Oracle database However the gateway cannot participate in distributed updates Property Description Default value None Range of values Valid parameter file names Use the IFILE initialization parameter to embed another initialization file within the current initialization file The value should be an absolute path and should not contain environment variables The three levels of nesting limit does not apply See Also Or
66. orrectly by using the demonstration files included in the distribution media The demonstration files are automatically copied to disk when the gateway is installed This chapter contains the following sections Case Descriptions Installation Media Contents Demonstration Files Demonstration Requirements Creating Demonstration Tables a Case 1 Simple Queries Case 2 A More Complex Query Case 3 Joining SOL Server Tables a Case 4 Write Capabilities Case 5 Data Dictionary Query Case 6 The Pass Through Feature a Case 7 Executing Stored Procedures Case Descriptions The cases illustrate A simple query Case 1 Amore complex query Case 2 Joining SQL Server tables Case 3 Write capabilities Case 4 a A data dictionary query Case 5 The pass through feature Case 6 a Executing stored procedures Case 7 Case Studies 3 1 Installation Media Contents Installation Media Contents The installation media contains the following a Demonstration files One SQL script file that creates the demonstration tables and stored procedures in the SOL Server database a One SQL script file that drops the demonstration tables and stored procedures from the SOL Server database Demonstration Files After a successful gateway installation use the demonstration files stored in the directory ORACLE HOMENdg4msq1Ndemo where ORACLE HOME is the directory under which the gateway is install
67. ough feature which allows an application to send commands or statements to SOL Server This case demonstrates A pass through UPDATE statement using bind variables A pass through SELECT statement UPDATE Statement Case 6a provides an example of a pass through UPDATE statement with bind variables In this example the salary for EMPNO 7934 is set to 4000 SELECT Statement Case 6b provides an example of a pass through SELECT statement The data that is returned from the SELECT statement is inserted into a local table at the Oracle database Case 7 Executing Stored Procedures Case 7 demonstrates the gateway executing a stored procedure in the SQL Server database 3 6 Oracle Database Gateway for Microsoft SQL Server User s Guide A Data Type Conversion This appendix contains the following section Data Type Conversion Data Type Conversion The gateway converts SQL Server data types to Oracle data types as follows Table A 1 Data Type Conversions SQL Server Oracle Comment BIGINT NUMBER 19 BIGINT IDENTITY NUMBER 19 BINARY RAW BIT NUMBER 3 CHAR CHAR DATETIME DATE Fractional parts of a second are truncated DECIMAL NUMBER p s DECIMAL IDENTITY NUMBER p s FLOAT FLOAT 53 IMAGE LONG RAW INT NUMBER 10
68. r will be affected by the HS RPC FETCH SIZE and H8 RPC FETCH REBLOCKING parameters I Initialization Parameters D 11 Initialization Parameter Description D 12 Oracle Database Gateway for Microsoft SQL Server User s Guide A ALTER statement B 1 Arithmetic operators B 2 BIGINT data type A 1 BINARY data type A 1 BIT data type A 1 C Case rules 2 7 Case studies 3 1 Chained mode 2 7 CHAR data type A 1 character sets Heterogeneous Services D 5 COMMIT restrictions 2 11 Comparison operators B 3 CONCAT operator 2 16 CONNECT BY clause 2 13 COPY command 2 14 CREATE statement B 1 Cursor loops restrictions 2 11 D Data definition language B 1 Data dictionary views C 2 Data type BIGINT A 1 BINARY A 1 BIT A 1 CHAR A 1 conversion 2 9 DATE A 1 DATETIME A 1 DECIMAL A 1 FLOAT A 1 IMAGE A 1 LONGRAW A 1 MONEY A 1 Index NCHAR A 1 NUMBER A 1 NUMERIC A 1 NVARCHAR A 1 RAW A 1 REAL A 1 SMALL DATETIME A 1 SMALL MONEY A 2 SMALLINT A 2 TIMESTAMP A 2 TINYINT A 2 VARBINARY 2 15 A 2 VARCHAR A 2 DATE data type A 1 DATETIME data type A 1 DECIMAL data type A 1 DELETE statement 3 5 B 1 B 2 demonstration build SOL script 3 2 Demonstration files 3 2 Demonstration tables 3 3 Demonstration tables build SOL script 3 3 describe cache high water mark definition D 5 DROP statement B 1 E Encrypted
69. racle and SQL Server Gateway technology is composed of two parts a component that has the generic technology to connect to a non Oracle system which is common to all the non Oracle systems called Heterogeneous Services and a component that is specific to the non Oracle system that the gateway connects to Heterogeneous Services in conjunction with the Oracle Database Gateway agent enables transparent access to non Oracle systems from an Oracle environment Introduction 1 1 Heterogeneous Services Technology Heterogeneous Services Technology Heterogeneous Services provides the generic technology for connecting to non Oracle systems As an integrated component of the database Heterogeneous Services can exploit features of the database such as the powerful SOL parsing and distributed optimization capabilities Heterogeneous Services extend the Oracle SOL engine to recognize the SOL and procedural capabilities of the remote non Oracle system and the mappings required to obtain necessary data dictionary information Heterogeneous Services provides two types of translations the ability to translate Oracle SOL into the proper dialect of the non Oracle system as well as data dictionary translations which displays the metadata of the non Oracle system in the local format For situations where no translations are available native SOL can be issued to the non Oracle system using the pass through feature of Heterogeneous Services Heteroge
70. re the agent is installed Language The language component of the H8 LANGUAGE initialization parameter determines Day and month names of dates AD EC PM and AM symbols for date and time Default sorting mechanism Note that Oracle does not determine the language for error messages for the generic Heterogeneous Services messages ORA 25000 through ORA 28000 These are controlled by the session settings in the Oracle database Note Use the HS NLS DATE LANGUAGE initialization parameter to set the day and month names and the AD BC PM and AM symbols for dates and time independently from the language Initialization Parameters D 5 Initialization Parameter Description Territory The territory clause specifies the conventions for day and week numbering default date format decimal character and group separator and ISO and local currency symbols Note that the level of globalization support between the Oracle database and the non Oracle data source depends on how the gateway is implemented HS LONG PIECE TRANSFER SIZE Property Description Default value 64 KB Range of values Any value up to 2 GB Sets the size of the piece of LONG data being transferred A smaller piece size means less memory requirement but more round trips to fetch all the data A larger piece size means fewer round trips but more of a memory requirement to store the intermediate pieces internally Thus the initialization
71. reface covers the following topics Audience Documentation Accessibility Related Documentation a Conventions This manual is intended for Oracle database administrators who perform the following tasks Installing and configuring the Oracle Database Gateway for SQL Server Diagnosing gateway errors Using the gateway to access SOL Server data Note You should understand the fundamentals of Oracle Database Gateways and the Microsoft Windows operating system before using this guide to install or administer the gateway Documentation Accessibility Our goal is to make Oracle products services and supporting documentation accessible with good usability to the disabled community To that end our documentation includes features that make information available to users of assistive technology This documentation is available in HTML format and contains markup to facilitate access by the disabled community Accessibility standards will continue to evolve over time and Oracle is actively engaged with other market leading technology vendors to address technical obstacles so that our documentation can be accessible to all of our customers For more information visit the Oracle Accessibility Program Web site at http www oracle com accessibility Accessibility of Code Examples in Documentation Screen readers may not always correctly read the code examples in this document The conventions for writing code req
72. riction issue a commit or modify the logic or both 2 10 Oracle Database Gateway for Microsoft SQL Server User s Guide Known Restrictions Transactional Integrity The gateway cannot guarantee transactional integrity in the following cases a When a statement that is processed by the gateway causes an implicit commit in the target database When the target database is configured to work in autocommit mode Note Oracle strongly recommends the following a If you know that executing a particular statement causes an implicit commit in the target database then ensure that this statement is executed in its own transaction The gateway sets Autocommit Mode to Off when a connection is established to the SOL Server database Transaction Capability The gateway does not support savepoints If a distributed update transaction is under way involving the gateway and a user attempts to create a savepoint the following error occurs ORA 02070 database dblink does not support savepoint in this context By default the gateway is configured as COMMIT CONFIRM COMMIT or ROLLBACK in PL SQL Cursor Loops Closes Open Cursors Any COMMIT or ROLLBACK issued in a PL SQL cursor loop closes all open cursors which can result in the following error ORA 1002 fetch out of sequence To prevent this error move the COMMIT or ROLLBACK statement outside the cursor loop Stored Procedures Changes issue
73. ry Case 2 demonstrates the following The functions SUM expression and NVL expri expr2 inthe SELECT list a The GROUP BY and HAVING clauses This query retrieves the departments from GTW_EMP whose total monthly expenses are higher than 10 000 Case 3 Joining SQL Server Tables Case 3 demonstrates the following a Joins between SOL Server tables Subselects The query retrieves information from three SQL Server tables and relates the employees to their department name and salary grade but only for those employees earning more than the average salary Case 4 Write Capabilities Case 4 is split into three cases and demonstrates the following DELETE Statement UPDATE Statement INSERT Statement DELETE Statement Case 4a demonstrates bind values and subselect All employees in department 20 and one employee WARD in department 30 are deleted UPDATE Statement Case 4b provides an example of a simple UPDATE statement In this example employees are given a 100 a month salary increase Case Studies 3 5 Case 5 Data Dictionary Query INSERT Statement Case 4c is an example of a simple insert statement that does not provide information for all columns Case 5 Data Dictionary Query Case 5 demonstrates data dictionary mapping It retrieves all the tables and views that exist in the SOL Server database that begin with GTW Case 6 The Pass Through Feature Case 6 demonstrates the gateway pass thr
74. s a separate gateway process and connections cannot be shared Known Problems This section describes known problems and includes suggestions for correcting them when possible If you have any questions or concerns about the problems contact Oracle Support Services A current list of problems is available online Contact your local Oracle office for information about accessing the list The following known problems are described in this section Encrypted Format Login 2 14 Oracle Database Gateway for Microsoft SQL Server User s Guide Known Problems Date Arithmetic SOL Server IMAGE TEXT and NTEXT Data Types String Functions Schema Names and PL SQL Data Dictionary Views and PL SQL Stored Procedures Encrypted Format Login The Oracle9i database Release 9 2 and earlier supported an Oracle initialization parameter DBLINK ENCRYPT LOGIN When this parameter is set to TRUE the password for the login user ID is not sent over the network If this parameter is set to TRUE in the initialization parameter file used by the Oracle9i database you must change the setting to FALSE the default setting to allow Oracle9i to communicate with the gateway In the current release Oracle Database 11g Release 11 1 the DBLINK ENCRYPT LOG Date Arithmetic IN initialization parameter is obsolete so you need not check it The following SOL expressions do not function correctly with the gateway date
75. schemas of the seed database which is installed by default when you install Oracle Refer to Oracle Database Sample Schemas for information on how these schemas were created and how you can use them yourself Printed documentation is available for sale in the Oracle Store at http oraclestore oracle com To download free release notes installation documentation white papers or other collateral please visit the Oracle Technology Network OTN You must register online before using OTN registration is free and can be done at http otn oracle com technology membership If you already have a user name and password for OTN then you can go directly to the documentation section of the OTN Web site at http otn oracle com technology documentation Conventions The following text conventions are used in this document Convention Meaning boldface Boldface type indicates graphical user interface elements associated with an action or terms defined in text or the glossary italic Italic type indicates book titles emphasis or placeholder variables for which you supply particular values monospace Monospace type indicates commands within a paragraph URLs code in examples text that appears on the screen or text that you enter 1 Overview Introduction This chapter introduces the challenge faced by organizations when running several different database systems It briefly covers Heterogeneous Services the te
76. se DDL statements against the SOL Server database Note TRUNCATE cannot be used in a pass through statement See Also Oracle Database Reference for a detailed descriptions of keywords parameters and options The DELETE statement is fully supported However only Oracle functions supported by SOL Server can be used See Also Functions Supported by SQL Server on page B 2 for a list of supported functions The INSERT statement is fully supported However only Oracle functions supported by SOL Server can be used See Also Functions Supported by SQL Server on page B 2 for a list of supported functions The SELECT statement is fully supported with these exceptions Supported SQL Syntax and Functions B 1 Oracle Functions UPDATE CONNECT BY condition NOWAIT START WITH condition WHERE CURRENT OF The UPDATE statement is fully supported However only Oracle functions supported by SQL Server can be used See Also Functions Supported by SQL Server on page B 2 for a list of supported functions Oracle Functions All functions are evaluated by the SOL Server database after the gateway has converted them to SQL Server SQL equivalents The exception is the TO DATE function which is evaluated by the gateway Functions Not Supported by SQL Server Oracle SQL functions with no equivalent function in SQL Server are not supported in DELETE INSERT or
77. st nameis the host name or IP address of the machine hosting the SOL Server database instance nameis the instance of SOL Server running on the machine and database name is the SOL Server database name Both instance name and database name are optional If instance_name is omitted and database name is provided the slash is required This can be shown as follows HS FDS CONNECT INFO host name database name HS FDS DEFAULT OWNER Property Description Default Value None Range of Values Not applicable The name of the table owner that is used for the non Oracle database tables if an owner is not specified in the SOL statements Note Ifthis parameter is not specified and the owner is not explicitly specified in the SOL statement then the user name of the Oracle user or the user name specified when creating the database link is used HS FDS PROC IS FUNC Property Description Default Value FALSE Range of Values TRUE FALSE Enables return values from functions By default all stored procedures and functions do not return a return value to the user Note If you set this initialization parameter you must change the syntax of the procedure execute statement for all existing stored procedures to handle return values HS FDS RECOVERY ACCOUNT Property Description Default Value RECOVER Initialization Parameters D 9 Initialization Parameter Description
78. t rnt D 11 HS EDS BEEICEI ROWSZc tetendit nentes Sanh D 11 Index List of Tables vi T pos ape A de cd RI D E E o ME QR NETUS OONDARWBN OO 999oooooooooooooooooooomp o d d m NN N oO C 23 C 24 C 25 C 26 C 27 C 28 C 29 C 30 C 31 C 32 C 33 C 34 C 35 Restricted DDL Statement cccccccssscssscssscessecessecsseeescesseeeeseceseecssseessceeecssesessecseescneeeeseeees 2 12 Data Type Conversions invitation iio cda ad DA A 1 Oracle Data Dictionary View Names and SQL Server Equivalent cccocnionommmmmmmm C 3 ALLE CATALOG reete th eee N eere iter e E ER RAR bes lob A C 4 ATIC OL COMMENTS 52 iet terere e Em pi ite et bem eres C 5 ATT CONS GCOPEDMINS 4 itt nett me atte edet Pe et e MATEO e Cd C 5 ABE CONSTRAINTS SIS AAA ee ee A ees C 5 AT TSIND COPRUMNJD a eee Ep tees C 6 ATUS SUINID EES onra e e A cattle eode oer Lese eee leo etu o C 6 ATTE OBJIEGTS x itte titu tetuer sueta iride Mas EM uat Sulle Me eram C 7 ALL TAB COLUMN Sia dra cn ue fe e tote eise tion e ee i e e e des C 8 ALE TAB COMMENTS AI etre ter Ml este atte estne e eee Pea a ea ode C 9 AES DA BEES 26x xt A eo eso Noob E A e Rie eee 800 C 9 ATI SUSERO32 dictu His ola ma ime tete ttu Gu n et ec Cea C 10 Aqu VIEW OS Bocas deserta seat reet e ertt ee e PR eO e tines e PETERE ee EN sibs C 10 DBA CATATGOG ote osten eee eese ree des tote e pedet erra aree e re ed e C 11 DBA COL COMMENTS eee tt re Ert he Pe E te eee epe eire C 11 DBA
79. tions or statements that need to be executed at the originating Oracle database These SOL functions include USER USERENV and SYSDATE and the SOL statements are in selects of data from the originating Oracle database For example DELETE FROM emp non_oracle WHERE hiredate gt SYSDATE SELECT ename FROM tkhoemp non_oracle WHERE hiredate IN SELECT hiredate FROM tkhoemp FOR UPDATE OF empno a Any SQL statement that involves a table in Oracle database and a LONG or LOB column in a remote table For example SELECT a longl b empno FROM scott tableGnon oracle a emp b WHERE a id b empno SELECT a longl b dummy FROM table nonGnon oracle a dual b where a 1ong1 is a LONG column Functions The following restrictions apply to using functions a Unsupported functions cannot be used in statements that refer to LONG columns When negative numbers are used as the second parameter in a SUBSTR function incorrect results are returned This is due to incompatibility between the Oracle SUBSTR function and the equivalent in SOL Server SQL Plus COPY Command with Lowercase Table Names You need to use double quotes to wrap around lowercase table names For example copy from tkhouser tkhouser inst1 insert loc tkhodept using select from tkhodept Gholink2 Database Links The gateway is not multithreaded and cannot support shared database links Each gateway session spawn
80. ue TABLE NAME VARCHAR2 256 TABLESPACE NAME VARCHAR2 1 NULL CLUSTER NAME VARCHAR2 1 NULL IOT NAME VARCHAR2 1 NULL PCT FREE NUMBER 0 PCT USED NUMBER 0 INI TRANS NUMBER 0 MAX TRANS NUMBER 0 Data Dictionary C 19 Gateway Data Dictionary Descriptions Table C 33 Cont USER TABLES Name Null Type Value INITIAL EXTENT NUMBER 0 NEXT EXTENT NUMBER 0 MIN EXTENTS NUMBER 0 MAX EXTENTS NUMBER 0 PCT INCREASE NUMBER 0 FREELISTS NUMBER 0 FREELIST GROUPS NUMBER 0 LOGGING VARCHAR 1 NULL BACKED UP VARCHAR2 1 NULL NUM_ROWS NUMBER 0 BLOCKS NUMBER 0 EMPTY_BLOCKS NUMBER 0 AVG_SPACE NUMBER 0 CHAIN_CNT NUMBER 0 AVG_ROW_LEN NUMBER 0 AVG_SPACE_FREELIST_BLOCKS NUMBER 0 NUM_FREELIST_BLOCKS NUMBER 0 DEGREE VARCHAR 1 NULL INSTANCES VARCHAR2 1 NULL CACHE VARCHAR 1 NULL TABLE_LOCK VARCHAR 1 NULL SAMPLE_SIZE NUMBER 0 LAST_ANALYZED DATE NULL PARTITIONED VARCHAR2 1 NULL IOT_TYPE VARCHAR2 1 NULL TEMPORARY VARHCAR2 1 NULL SECONDARY VARCHAR2 1 NULL NESTED VARCHAR2 1 NULL BUFFER_POOL VARCHAR2 1 NULL ROW_MOVEMENT VARCHAR2 1 NULL GLOBAL_STATS VARCHAR2 1 NULL USER_STATS VARCHAR2 1 NULL DURATION VARCHAR2 1 NULL SKIP_CORRUPT VARCHAR2 1 NULL MONIT
81. uire that closing braces should appear on an otherwise empty line however some screen readers may not always read a line of text that consists solely of a bracket or brace vii Accessibility of Links to External Web Sites in Documentation This documentation may contain links to Web sites of other companies or organizations that Oracle does not own or control Oracle neither evaluates nor makes any representations regarding the accessibility of these Web sites TTY Access to Oracle Support Services Oracle provides dedicated Text Telephone TTY access to Oracle Support Services within the United States of America 24 hours a day seven days a week For TTY support call 800 446 2398 Related Documentation viii For more information see the following documents Oracle Database New Features Guide a Oracle Call Interface Programmer s Guide a Oracle Database Administrator s Guide Oracle Database Advanced Application Developer s Guide Oracle Database Concepts Oracle Database Performance Tuning Guide a Oracle Database Error Messages a Oracle Database Globalization Support Guide Oracle Database Reference Oracle Database SQL Language Reference a Oracle Database Net Services Administrator s Guide a SQL Plus User s Guide and Reference Oracle Database Heterogeneous Connectivity Administrator s Guide Oracle Database 2 Day DBA a Oracle Database Security Guide Many of the examples in this book use the sample
82. uments from the remote stored procedure Since we are in sequential mode they will be returned in the form of a result set rc3 dbms hs result set get next result setQGMSQL Fetch them and insert them into the outarguments table fetch rc3 into rec3 insert into outargs rec3 outarg rec3 retval Close ref cursor close rc3 end Database Compatibility Issues for SQL Server SQL Server and Oracle databases function differently in some areas causing compatibility problems The following compatibility issues are described in this section Implicit Transactions Chained Mode Column Definitions 2 6 Oracle Database Gateway for Microsoft SQL Server User s Guide Database Compatibility Issues for SQL Server Naming Rules Data Types Queries Locking Implicit Transactions Chained Mode The gateway supports the ANSI standard implicit transactions SOL Server stored procedures must be written for this mode Running implicit transactions allows the gateway to extend the Oracle two phase commit protection to transactions updating Oracle and SQL Server databases Column Definitions By default a SOL Server table column cannot contain null values unless NULL is specified in the column definition SOL Server assumes all columns cannot contain null values unless you set a SOL Server option to override this default For an Oracle table null values are allowed in a column unless NOT NULL is sp
83. uotation mark and ending with a double quotation mark The following can be used inside a quoted string Initialization Parameters D 1 Oracle Database Gateway for SQL Server Initialization Parameters backslash is the escape character Mn inserts a new line Ntinserts a tab N inserts a double quotation mark NNinserts a backslash A backslash at the end of the line continues the string on the next line If a backslash precedes any other character then the backslash is ignored For example to enable tracing for an agent set the HS FDS TRACE LEVEL initialization parameter as follows HS FDS TRACE LEVEL ON SET and PRIVATE are optional keywords You cannot use either as an initialization parameter name Most parameters are needed only as initialization parameters so you usually do not need to use the SET or PRIVATE keywords If you do not specify either SET or PRIVATE the parameter is used only as an initialization parameter for the agent SET specifies that in addition to being used as an initialization parameter the parameter value is set as an environment variable for the agent process Use SET for parameter values that the drivers or non Oracle system need as environment variables PRIVATE specifies that the initialization parameter should be private to the agent and should not be uploaded to the Oracle database Most initialization parameters should not b
84. wn Problems Using the Pass Through Feature The gateway can pass SQL Server commands or statements from the application to the SQL Server database using the DBMS_HS_PASSTHROUGH package Use the DBMS_HS_PASSTHROUGH package in a PL SQL block to specify the statement to be passed to the SQL Server database as follows DECLARE num_rows INTEGER BEGIN num rows DBMS HS PASSTHROUGH EXECUTE IMMEDIATEGMSQL command END Where command cannot be one of the following BEGIN TRANSACTION a COMMIT ROLLBACK SAVE a SHUTDOWN a RELEASE SAVEPOINT a CONNECT SQL Server Gateway Features and Restriction 2 1 Executing Stored Procedures and Functions SQL Server tool commands The DBMS_HS_PASSTHROUGH package supports passing bind values and executing SELECT statements Note TRUNCATE cannot be used in a pass through statement See Also Oracle Database PL SQL Packages and Types Reference and Chapter 3 Features of Oracle Database Gateways and Generic Connectivity of Oracle Database Heterogeneous Connectivity Administrator s Guide for more information about the DBMS_HS_ PASSTHROUGH package Executing Stored Procedures and Functions Using the procedural feature the gateway can execute stored procedures that are defined in the SQL Server database It is not necessary to relink the gateway or define the procedure to the gateway but the procedure s ac

Download Pdf Manuals

image

Related Search

Related Contents

G1-W42-Electrical Systems and Wiring Diagrams  Quick User`s Guide  XFX Radeon 5870 1024 MB 1GB  Danby DMW608BL User's Manual  アンダーシンク型  New Release/Song Delivery User`s Manual  Klimacomputer RC1 Bedienungsanleitung  BDV090  Caldera Mural Caldeira Mural  

Copyright © All rights reserved.
Failed to retrieve file