Oracle Database Extensions For Developer’s Guide

2y ago
33 Views
2 Downloads
461.13 KB
60 Pages
Last View : 15d ago
Last Download : 2m ago
Upload by : Troy Oden
Transcription

Oracle DatabaseExtensions for .NET Developer's Guide11g Release 1 (11.1.0.7.20) for Microsoft WindowsE15631-01August 2009

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

ContentsPreface . vAudience. vDocumentation Accessibility . vRelated Documents . viPasswords in Code Examples . viiConventions . viiWhat's New in Oracle Database Extensions for .NET . ixNew Features in Oracle Database Extensions for .NET Release 11.1.0.6.20 .1Introduction to Oracle Database Extensions for .NETOracle Database Extensions for .NET Overview .Oracle Database Extensions for .NET Architecture.Oracle CLR Host.External Processes .Dedicated Agent Architecture .Multithreaded Agent Architecture.Listener and Tnsnames Files .Oracle Data Provider for .NET.Oracle Developer Tools for Visual Studio.Oracle Deployment Wizard for .NET .2ix1-11-21-21-21-31-31-31-51-51-5Installation and ConfigurationSystem Requirements.Requirements for .NET Stored Procedures and Functions .File Locations after Installation .Installation and First Use.Configuring Extproc Agent Using Windows Service.OraClrAgnt Service Parameters.Tuning OraClrAgnt for Performance.Migrating .NET Stored Procedures from Oracle Database 10.2 to Oracle Database 11.1 .Mandatory Migration of .NET 1.x Stored Procedures to .NET 2.0.Determining if Code Changes are Needed .Migration Approaches.2-12-22-22-22-22-32-42-42-52-52-5iii

Addressing Code Incompatibilities Between ODP.NET for .NET 1.x and ODP.NET for .NET2.0 . 2-6Addressing Code Incompatibilities Between Oracle Database Extensions for .NET Versions 1.xand 2.0 . 2-6Recompile and Redeploy .NET 1.x Stored Procedures Using ODP.NET for .NET 2.0. 2-7Configure .NET 1.x Stored Procedures Using ODP.NET for .NET 2.0 . 2-7Oracle Database Extensions for .NET Registry Options . 2-8Unloading .NET Assemblies for Easy Redeployment . 2-8Backward Compatibility for Nullable ODP.NET Connected Types . 2-8Selecting a .NET Run Time Version . 2-9Debug Tracing . 2-9TraceOption . 2-9TraceFileName. 2-10TraceLevel . 2-10Unhandled Exceptions . 2-10extproc.exe Config File . 2-103Development and Deployment with Visual Studio .NETStep 1: Develop the Stored Procedure or Function and Build it into an Assembly .Step 2: Run the Oracle Deployment Wizard for .NET .Step 3: Choose the Procedure or Function to Deploy and Security Level.Step 4: Determine the Appropriate Parameter Type Mappings.Step 5: Deploy the Procedure or Function .Step 6: Test the Procedure or Function .Step 7: Debug the Procedure or Function .43-13-13-23-23-23-33-3Development and Deployment of a .NET Stored Function DemoOverview of .NET Stored Function Demonstration. 4-1Step 1: Create the GetDeptNo Function and Build it into an Assembly. 4-1Step 2: Start the Oracle Deployment Wizard for .NET . 4-3Step 3: Choose the Function to Deploy . 4-8Step 4: Determine the Appropriate Parameter Type Mappings. 4-9Step 5: Deploy the Function to an Oracle Database . 4-10Step 6: Test the Function . 4-11Invoking from Oracle Developer Tools for Visual Studio . 4-11Invoking from ODP.NET client . 4-12Invoking from SQL*Plus . 4-13AData Type ConversionBTroubleshooting Common ErrorsGlossaryIndexiv

PrefaceThis document describes the features of Oracle Database for Windows softwareinstalled on Windows 2003, Windows 2000, and Windows XP Professional operatingsystems.This guide describes Oracle Database Extensions for .NET, which provides a CommonLanguage Runtime (CLR) host for Oracle Database and data access through OracleData Provider for .NET (ODP.NET) classes.This preface contains these topics: Audience Documentation Accessibility Related Documents Passwords in Code Examples ConventionsAudienceOracle Database Extensions for .NET Developer's Guide is intended for programmerswho are developing applications to access an Oracle Database using Oracle DatabaseExtensions for .NET. This documentation is also valuable to systems analysts, projectmanagers, and others interested in the development of database applications.To use this document, you must be familiar with Microsoft .NET Framework classesand ADO.NET and have a working knowledge of application programming usingMicrosoft C#, Visual Basic, or another .NET language.Users should also be familiar with the use of Structured Query Language (SQL) toaccess information in relational database systems.Documentation AccessibilityOur goal is to make Oracle products, services, and supporting documentationaccessible to all users, including users that are disabled. To that end, ourdocumentation includes features that make information available to users of assistivetechnology. This documentation is available in HTML format, and contains markup tofacilitate access by the disabled community. Accessibility standards will continue toevolve over time, and Oracle is actively engaged with other market-leadingtechnology vendors to address technical obstacles so that our documentation can beaccessible to all of our customers. For more information, visit the Oracle AccessibilityProgram Web site at http://www.oracle.com/accessibility/.v

Accessibility of Code Examples in DocumentationScreen readers may not always correctly read the code examples in this document. Theconventions for writing code require that closing braces should appear on anotherwise empty line; however, some screen readers may not always read a line of textthat consists solely of a bracket or brace.Accessibility of Links to External Web Sites in DocumentationThis documentation may contain links to Web sites of other companies ororganizations that Oracle does not own or control. Oracle neither evaluates nor makesany representations regarding the accessibility of these Web sites.Deaf/Hard of Hearing Access to Oracle Support ServicesTo reach Oracle Support Services, use a telecommunications relay service (TRS) to callOracle Support at 1.800.223.1711. An Oracle Support Services engineer will handletechnical issues and provide customer support according to the Oracle service requestprocess. Information about TRS is available athttp://www.fcc.gov/cgb/consumerfacts/trs.html, and a list of phonenumbers is available at http://www.fcc.gov/cgb/dro/trsphonebk.html.Related DocumentsFor more information, see these Oracle resources: Oracle Developer Tools for Visual Studio Help Oracle Data Provider for .NET Developer's Guide Oracle Database PL/SQL Packages and Types Reference Oracle Database SQL Reference Oracle Database Installation Guide for Windows Oracle Database Release Notes for Windows Oracle Database Platform Guide for Windows Oracle Database New Features Oracle Net Services Reference GuideMany of the examples in this book use the sample schemas, which are installed bydefault when you select the Basic Installation option with an Oracle Databaseinstallation. Refer to Oracle Database Sample Schemas for information on how theseschemas were created and how you can use them yourself.Printed documentation is available for sale in the Oracle Store athttp://oraclestore.oracle.com/To download free release notes, installation documentation, white papers, or othercollateral, please visit the Oracle Technology Network (OTN). You must register onlinebefore using OTN; registration is free and can be done athttp://www.oracle.com/technology/membership/If you already have a username and password for OTN, then you can go directly to thedocumentation section of the OTN Web site i

Passwords in Code ExamplesFor simplicity in demonstrating this product, code examples do not perform thepassword management techniques that a deployed system normally uses. In aproduction environment, follow the Oracle Database password managementguidelines, and disable any sample accounts. See Oracle Database Security Guide forpassword management guidelines and other security recommendations.ConventionsThe following text conventions are used in this document:ConventionMeaningboldfaceBoldface type indicates graphical user interface elements associatedwith an action, or terms defined in text or the glossary.italicItalic type indicates book titles, emphasis, or placeholder variables forwhich you supply particular values.monospaceMonospace type indicates commands within a paragraph, URLs, codein examples, text that appears on the screen, or text that you enter.vii

viii

What's New in Oracle Database Extensionsfor .NETThis section describes new features in Oracle Database Extensions for .NET andprovides references to additional information.The following section describes the new features in Oracle Database Extensions for.NET.New Features in Oracle Database Extensions for .NETRelease 11.1.0.6.20Oracle Database Extensions for .NET release 11.1.0.6.20 includes the following: Support for Unloading .NET AssembliesYou may unload .NET assemblies after .NET stored procedure execution iscomplete. This feature enables you to redeploy and to test code without having torestart extproc.See Also: "Unloading .NET Assemblies for Easy Redeployment" onpage 2-8 Support for Nullable TypesOracle Database Extensions for .NET now supports nullable types as procedure orfunction parameters.See Also: "Backward Compatibility for Nullable ODP.NETConnected Types" on page 2-8ix

x

11Introduction to Oracle DatabaseExtensions for .NETThis chapter introduces Oracle Database Extensions for .NET, which makes it possibleto build and run .NET stored procedures or functions with Oracle Database forMicrosoft Windows.This chapter contains these topics: Oracle Database Extensions for .NET Overview Oracle Database Extensions for .NET Architecture Oracle Data Provider for .NET Oracle Developer Tools for Visual Studio Oracle Deployment Wizard for .NETOracle Database Extensions for .NET OverviewOracle Database Extensions for .NET provides the following: A Common Language Runtime (CLR) host for Oracle Database Data access through Oracle Data Provider for .NET classes Oracle Deployment Wizard for Visual StudioThe Oracle Database hosts the Microsoft Common Language Runtime (CLR) in anexternal process, outside of the Oracle database process. The integration of OracleDatabase with the Microsoft Common Language Runtime (CLR) enables applicationsto run .NET stored procedures or functions on Oracle Database, on MicrosoftWindows Vista, Windows 2003, Windows 2000, and Windows XP.Application developers can write stored procedures and functions using any .NETcompliant language, such as C# and VB.NET, and use these .NET stored procedures inthe database, in the same manner as other PL/SQL or Java stored procedures. .NETstored procedures can be called from PL/SQL packages, procedures, functions, andtriggers; from SQL statements, or from anywhere a PL/SQL procedure or function canbe called.Application developers build .NET procedures or functions into a .NET assembly,typically using Microsoft Visual Studio. Oracle Data Provider for .NET is used in .NETstored procedures and functions for data access. After building .NET procedures andfunctions into a .NET assembly, developers deploy them in Oracle Database, using theOracle Deployment Wizard for .NET, a component of the Oracle Developer Tools forVisual Studio.Introduction to Oracle Database Extensions for .NET1-1

Oracle Database Extensions for .NET ArchitectureThe .NET stored procedure or function appears to the caller as a PL/SQL storedprocedure or function because a PL/SQL wrapper has been generated for it. The userinvokes a .NET stored procedure or function through this PL/SQL wrapper. OracleDeployme

Oracle Database Extensions for .NET Developer's Guide is intended for programmers who are developing applications to access an Oracle Database using Oracle Database Extensions for .NET. This documentation is also valuable to systems analysts, project managers, and others interested in the development of database applications. To use this document, you must be familiar with Microsoft .NET .

Related Documents:

Oracle is a registered trademark and Designer/2000, Developer/2000, Oracle7, Oracle8, Oracle Application Object Library, Oracle Applications, Oracle Alert, Oracle Financials, Oracle Workflow, SQL*Forms, SQL*Plus, SQL*Report, Oracle Data Browser, Oracle Forms, Oracle General Ledger, Oracle Human Resources, Oracle Manufacturing, Oracle Reports,

viii Related Documentation The platform-specific documentation for Oracle Database 10g products includes the following manuals: Oracle Database - Oracle Database Release Notes for Linux Itanium - Oracle Database Installation Guide for Linux Itanium - Oracle Database Quick Installation Guide for Linux Itanium - Oracle Database Oracle Clusterware and Oracle Real Application Clusters

LÄS NOGGRANT FÖLJANDE VILLKOR FÖR APPLE DEVELOPER PROGRAM LICENCE . Apple Developer Program License Agreement Syfte Du vill använda Apple-mjukvara (enligt definitionen nedan) för att utveckla en eller flera Applikationer (enligt definitionen nedan) för Apple-märkta produkter. . Applikationer som utvecklas för iOS-produkter, Apple .

Oracle e-Commerce Gateway, Oracle Business Intelligence System, Oracle Financial Analyzer, Oracle Reports, Oracle Strategic Enterprise Management, Oracle Financials, Oracle Internet Procurement, Oracle Supply Chain, Oracle Call Center, Oracle e-Commerce, Oracle Integration Products & Technologies, Oracle Marketing, Oracle Service,

2 Installing Oracle Database and Creating a Database 2.1 Overview of Installing Oracle Database Software and Creating a Database 2-1 2.1.1 Checking Oracle Database Installation Prerequisites 2-2 2.1.2 Deciding on Oracle Database Installation Choices 2-3 2.1.2.1 Install Option for Oracle Database 2-3 2.1.2.2 Installation Class for Oracle .

Bruksanvisning för bilstereo . Bruksanvisning for bilstereo . Instrukcja obsługi samochodowego odtwarzacza stereo . Operating Instructions for Car Stereo . 610-104 . SV . Bruksanvisning i original

Getting Started with Database Classic Cloud Service. About Oracle Database Classic Cloud Service1-1. About Database Classic Cloud Service Database Deployments1-2. Oracle Database Software Release1-3. Oracle Database Software Edition1-3. Oracle Database Type1-4. Computing Power1-5. Database Storage1-5. Automatic Backup Configuration1-6

c. Describe the major events of the American Revolution and explain the factors leading to American victory and British defeat; include the Battles of Lexington and Concord, Saratoga, and Yorktown. d. Describe key individuals in the American Revolution with emphasis on King George III, George Washington, Benjamin Franklin, Thomas Jefferson, Benedict Arnold, Patrick Henry, and John Adams .