PK
*/Aoa, mimetypeapplication/epub+zipPK */A iTunesMetadata.plist~
This chapter describes how to create and schedule Microsoft Transaction Server-related Oracle transaction recovery.
This chapter contains these topics:
Scheduling Automatic Microsoft Transaction Server Transaction Recovery
Modifying Registry Values for Oracle Fail Safe Configurations
You must configure the Microsoft Transaction Server and Oracle Database environments after installing or migrating Oracle Services for Microsoft Transaction Server (OraMTS).
Configuration is not required on the Windows computer if a Microsoft Transaction Server is installed on a computer.
To configure the Microsoft Transaction Server, perform the following tasks on the computer where the Oracle Database is installed:
Run the oramtsadmin.sql
script against the database to create the Microsoft Transaction Server administrative user account (the default username is mtssys
).
Schedule automatic transaction recovery.
See "Scheduling Automatic Microsoft Transaction Server Transaction Recovery"
If you have an Oracle Fail Safe configuration, modify the registry values before or after running the oramtsadmin.sql
script.
See "Modifying Registry Values for Oracle Fail Safe Configurations".
Distributed transaction capabilities are required to use Microsoft Transaction Server with Oracle database. Microsoft Transaction Server-related Oracle transactions become in-doubt transactions when any of the following fail:
Microsoft Transaction Server application
Network
An Oracle MTS Recovery Service resolves in-doubt transactions on the computer that started the failed transaction.
Typically, an Oracle MTS Recovery Service is automatically created and started with Oracle Services For Microsoft Transaction Server. However, for Oracle Database releases 11.2.0.3 through 11.2.0.x, depending on the options you choose during the install, Oracle MTS Recovery Service may be created, but not started at the end of the installation. In this case, it must be started manually.
Only one Oracle MTS Recovery Service can be installed for each computer. A scheduled recovery job on each Microsoft Transaction Server-enabled database permits the Oracle MTS Recovery Service to resolve in-doubt transactions.
The Oracle MTS Recovery Service resolves an in-doubt Microsoft Transaction Server transaction in the following order:
The DBMS recovery job detects an in-doubt MTS-related transaction.
The DBMS recovery job extracts the recovery service's endpoint address from the XID of the in-doubt transaction and requests the recovery service for the outcome of the MTS/MS DTC transaction.
The recovery service requests its MS DTC for transaction outcome.
The recovery service reports transaction outcome to the DBMS job process.
The DBMS recovery job commits or terminates the in-doubt transaction.
OraMTS uses server-based recovery to resolve in-doubt transactions originated by MSDTC. To do this, the OraMTS administrator must be able to access the Windows middle-tier node through UTL_HTTP
. oramtsadmin.sql
grants execute privileges on UTL_HTTP
to the OraMTS administrator, as shown in "Configuring Automatic Transaction Recovery"
Note: Starting with Oracle version 11g, the DBA needs to create an access control list (ACL) as shown in "Creating an Access Control List (ACL)". |
For Oracle database version 11g and later, the DBA must create an access control list (ACL) that grants the OraMTS administrator the privilege to make out-bound HTTP connections. Example 3-1 demonstrates this:
Example 3-1 Creating an ACL List and Adding OraMTS Administrator to it
BEGIN -- Create the new ACL, naming it "OraMTSadmin.xml", with a description. -- This provides the OraMTS administrative user e.g. MTSADMIN user FOO -- the privilege to connect DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('OraMTSadmin.xml', 'Allow usage to the UTL network packages', 'FOO', TRUE, 'connect'); -- Now grant privilege to resolve DNS names to the OraMTS administrative user DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE('OraMTSadmin.xml' , 'FOO', TRUE,'resolve'); -- Specify which hosts this ACL applies to, in this case we are allowing -- access to all hosts. if one knew the list of all Windows middle-tier, -- these could be added one by one. DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('OraMTSadmin.xml','*'); END;
Automatic transaction recovery is performed by scheduling a database job. A database job for in-doubt transactions must be scheduled for each database participating in Microsoft Transaction Server transactions.
Transaction recovery is configured by running the oramtsadmin.sql
script, which triggers utl_oramts.sql
and prvtoramts.plb
scripts to create the PL/SQL package utl_oramts
. The database view oramts_2pc_pending
is also created to show in-doubt transactions related to Microsoft Transaction Server transactions.
The oramtsadmin.sql
script:
Creates the Microsoft Transaction Server administrator user account.
Automatically schedules database jobs for transaction recovery every one minute.
When the database job is run, it checks for unresolved global transactions in the database that are related to Microsoft Transaction Server. Information in the transaction identifiers (XIDs) of the in-doubt transactions identifies the computer on which the transaction was started. The Oracle MTS Recovery Service on that computer resolves the transaction.
Schedules post-recovery cleanup every half hour.
Schedule automatic transaction recovery in the database by performing these tasks:
The JOB_QUEUE_PROCESSES
initialization parameter specifies the maximum number of job slaves started on an instance.
To set and start up job-queue processes:
Ensure that you have SYSDBA
privileges.
Go to the computer on which the Oracle Database is installed.
Start SQL*Plus:
C:\> sqlplus /NOLOG
Connect to the database as SYSDBA
:
SQL> CONNECT / AS SYSDBA
Set the JOB_QUEUE_PROCESSES
initialization parameter:
JOB_QUEUE_PROCESSES = 1
The default value for this parameter is 0
. Set this parameter to a value greater than 1
if there are many destinations to which to propagate the messages.
Shut down the Oracle Database:
SQL> SHUTDOWN
Restart the Oracle Database:
SQL> STARTUP
Exit SQL*Plus:
SQL> EXIT
The oramtsadmin.sql
script creates the Microsoft Transaction Server administrator user account with the default username mtssys
. The Microsoft Transaction Server transaction recovery jobs run under the administrator user account.
The oramtsadmin.sql
script runs the utl_oramts.sql
script to grant the following privileges and roles to the administrator user account:
To create and schedule automatic transaction recovery:
Ensure that you have SYSDBA
privileges.
Log on to the computer where the Oracle Database is installed.
Start SQL*Plus:
C:\> sqlplus /NOLOG
Connect to the database as SYSDBA
:
SQL> CONNECT / AS SYSDBA
Run the oramtsadmin.sql
script:
SQL> @ORACLE_BASE\ORACLE_HOME\oramts\admin\oramtsadmin.sql;
You are prompted for the Microsoft Transaction Server administrator username and password. You can accept the default username of mtssys
and password of mtssys
, or change them.
If you did change the password in step 5, you can change it using this script:
SQL> ALTER USER USERNAME IDENTIFIED BY new_password;
To change the username after completing this task, drop the user, rerun the oramtsadmin.sql
script, and specify a different username when prompted.
Exit SQL*Plus:
SQL> EXIT
A single PL/SQL package, utl_oramts
, is created in the Microsoft Transaction Server administrator's schema. utl_oramts
exposes these public procedures and creates this view:
Use this procedure to view Microsoft Transaction Server in-doubt transactions in the database. This procedure uses the dbms_output
package to display results.
Description This procedure requires SERVEROUTPUT
set to ON
.
SQL> SET SERVEROUTPUT ON SQL> EXECUTE utl_oramts.show_indoubt;
The following information appears:
========================================================= currently indoubt transactions ========================================================= formatid : 21255235 gtrid : C2229A505904974D81FB7316B147325900000000 bqual : 5BAB6A6B55CD294AA20335839110829C0100000000901944700050 local txid : 142.11.202 tx state : prepared protocol : HTTP endpoint : middletier-1@foo.com:2030 ========================================================= formatid : 21255235 gtrid : 259DF9C8DFC5574F8876F0DF4E15CCAD00000000 bqual : 2C8DCED5B9816244BA2B73CC013EEB870100000000901944700050 local txid : 2.18.185 tx state : prepared protocol : HTTP endpoint : middletier-2@foo.com:2030
This procedure is run by the transaction recovery job. An automatic database job is scheduled for utl_oramts.recover_automatic
. When the job is run, it checks for unresolved global transactions in the database that are related to Microsoft Transaction Server. Information in the XIDs of the in-doubt transactions identifies the computer on which the transaction started. The Oracle MTS Recovery Service is contacted and resolves the transactions.
Use this procedure to request the transaction manager (MS DTC) to forget resolved transactions. This procedure is run by the post-recovery cleanup job.
The view oramts_2pc_pending
is created by executing oramtsadmin.sql
. oramts_2pc_pending
shows in-doubt transactions in the database. This view consists of the following columns:
Formatid This is the formatid
of the global transaction in the database.
global_transaction_id This is the transaction identifier of the Oracle global transaction corresponding to the Microsoft Transaction Server transaction. In fact, this is the globally unique identifier (GUID) of the Microsoft Transaction Server transaction.
branch_id This shows the branch identifier of the Oracle transaction. A single Microsoft Transaction Server transaction can have multiple Oracle global transactions. This depends on the number of Microsoft Transaction Server/COM+ components that span the same Microsoft Transaction Server transaction. All these transactions have the small global transaction identifier, but different branch identifiers.
local_tx_id A local Oracle transaction corresponds to each Microsoft Transaction Server transaction. This column shows the identifier corresponding to this local transaction.
state This shows the state of the transaction: pending, heuristically committed, heuristically terminated, and so on.
protocol This is the protocol that the transaction recovery job in the database uses to communicate with the Oracle MTS Recovery Service.
endpoint This is the endpoint of the Windows computer on which the Microsoft Transaction Server transaction originated. For HTTP connections, this translates to a hostname and port number.
To view Microsoft Transaction Server–related in-doubt transactions in the database, use SQL*Plus to query the view oramts_2pc_pending
:
Start SQL*Plus with the Microsoft Transaction Server administrator user account:
C:\> sqlplus mtsadmin_user/ mtsadmin_password
Enter the following command:
SQL> SELECT * FROM oramts_2pc_pending;
This displays the computer on which the in-doubt transaction originated.
In typical configurations, the MS DTC and Oracle MTS Recovery Service run on the same computer. This ensures that the required information for transaction recovery is available to the Oracle-Microsoft Transaction Server integration layer.
In configurations where the Microsoft Transaction Server application is part of a Windows cluster (for example, the application can fail over to another node or host in the cluster), the MS DTC runs as a cluster-wide resource. All cluster nodes use a single instance of the MS DTC running on any cluster node.
If you have an Oracle Fail Safe configuration, make sure the following registry information is replicated on all nodes in the cluster participating in Microsoft Transaction Server transactions:
To modify registry values for Oracle Fail Safe configurations:
Go to the computer on which the MS DTC and Oracle MTS Recovery Service are installed.
Start the registry from the command prompt:
C:\> regedt32
The Registry Editor window appears.
Go to HKEY_LOCAL_MACHINE
\Software
\Oracle
\OracleMTSRecoveryService
.
Copy the registry information appearing here to all nodes in the cluster.
Reboot the computer on which you added the key.
This section describes new features of Oracle Database 11g Release 2 (11.2) and provides pointers to additional information.
The following sections describe the new features in Oracle Services for Microsoft Transaction Server.
Support for Promotable Single Phase Enlistment
Oracle database now allows all transactions to remain local until more than one database is brought into the transaction, at which point, they are promoted to distributed transactions.
Transparent Distributed Transactions on Real Applications Clusters
The database now redirects all the branches of a distributed transaction to a single Oracle RAC instance automatically.
Developer's Guide
11g Release 2 (11.2) for Microsoft Windows
E26104-01
October 2011
Oracle Services for Microsoft Transaction Server Developer's Guide, 11g Release 2 (11.2) for Microsoft Windows
E26104-01
Copyright © 1996, 2011, Oracle and/or its affiliates. All rights reserved.
Contributing Authors: Janis Greenberg, Patricia Huey, Mark Kennedy, Roza Leyderman, Janelle Simmons
Contributors: Alex Keh, Valarie Moore, Vivek Raja, Eric Wang, Yong Hu
This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license 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. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the 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, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.
This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
This software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.
Atomicity, Consistency, Isolation, and Durability (ACID)
ACID consists of the four primary attributes provided to any transaction by a transaction manager (also called a transaction manager).
component object model (COM)
A binary standard that enables objects to interact with other objects, regardless of the programming language in which each object was written.
distributed component object model (DCOM)
An extension of COM that enables objects to interact with other objects across a network.
data manipulation language
The category of SQL statements that query and update database data. Common DML statements are SELECT
, INSERT
, UPDATE
, and DELETE
.
JOB_QUEUE_PROCESSES
This initialization parameter specifies the maximum number of DBMS_JOB
jobs and Oracle Scheduler (DBMS_SCHEDULER
) jobs running concurrently on an instance. This parameter must be set to at least 1 to run Oracle Scheduler or DBMS_JOB
jobs and to use database features that depend on these jobs
listener.ora
A listener configuration file that identifies the following for a listener:
Unique name
Protocol addresses on which it accepts connection requests
Services for which it is listening
Microsoft .NET
Microsoft .NET is a set of Microsoft software technologies used to connect information, people, systems, and devices through web services to each other and to larger applications over the Internet.
Microsoft application demo
An Oracle Call Interface (OCI) implementation of the Visual C++ Sample Bank package that ships with Microsoft Transaction Server on Windows.
Microsoft Distributed Transaction Coordinator (MS DTC)
The focal point of the transaction process is a component of Microsoft Transaction Server called Microsoft Distributed Transaction Coordinator (MS DTC).
Microsoft Transaction Server
A COM-based transaction processing system that runs on an Internet or network server.
mtssys
The default Microsoft Transaction Server administrator username. In releases prior to Oracle9i Database release 1 (9.0.1), this was the username for the OraMTS.
net service name
The name used by clients to identify an Oracle Net server and the specific system identifier (SID) or database for the Oracle Net connection. A net service name is mapped to a port number and protocol. A net service name is also known as a connect string, database alias, host string, or service name.
This also identifies the specific SID or database to which the connection is attaching, and not just the Oracle Net server.
Oracle Call Interface (OCI)
An application programming interface that enables you to manipulate data and schemas in a database. You compile and link an OCI program in the same way that you compile and link a nondatabase application. There is no requirement for a separate preprocessing or precompilation step.
Oracle Data Provider for .NET (ODP.NET)
Oracle Data Provider for .NET (ODP.NET) features optimized data access to the Oracle Database from a .NET environment. ODP.NET includes support for connection pooling, PL/SQL, LOBs, RefCursors, globalization/localization, proxy user authentication/ parameter array binding, named parameters, and safe type mapping between Oracle types and .NET types.
Oracle Fail Safe
Ensures that if a failure occurs on one cluster node, then the databases and applications running on that node fail over (move) automatically and quickly to a surviving node.
Oracle MTS Recovery Service
The Oracle MTS Recovery Service resolves in-doubt transactions on the computer that started the failed transaction. A scheduled recovery job for each Microsoft Transaction Server-enabled database lets the Oracle MTS Recovery Service resolve in-doubt transactions.
Oracle Objects for OLE (OO4O)
Oracle Objects for OLE (OO4O) is a COM-based database connectivity tool that combines seamless and optimized access to Oracle Database instances with easy to use interfaces.
Oracle Open Database Connectivity (ODBC) Driver
Oracle ODBC Driver provides a standard interface that allows one application to access many different data sources. The application's source code does not have to be recompiled for each data source. A database driver links the application to a specific data source. A database driver is a dynamic link library that an application can invoke on demand to gain access to a particular data source. Therefore, the application can access any data source for which a database driver exists.
Oracle Provider for OLE DB
Interfaces that offer high performance and efficient access to Oracle data by applications, compilers, and other database components.
Oracle Services for Microsoft Transaction Server (OraMTS)
A component that provides full integration of the Oracle Database with Microsoft Transaction Server. This component enables you to develop and deploy COM-based applications using Microsoft Transaction Server.
Optimal Flexible Architecture (OFA)
A set of file naming and placement guidelines for Oracle software and databases.
resource manager (RM)
Microsoft Transaction Server enlists the database to act as a resource manager (RM) in the transaction process.
SYSDBA
A special database administration role that contains all system privileges with the ADMIN
OPTION
and the SYSOPER
system privilege. SYSDBA
also permits CREATE DATABASE
actions and time-based recovery.
SYSOPER
A special database administration role that permits a database administrator to perform STARTUP
, SHUTDOWN
, ALTER
DATABASE
OPEN/MOUNT
, ALTER
DATABASE
BACKUP
, ARCHIVE
LOG
, and RECOVER
, and includes the RESTRICTED
SESSION
privilege.
tnsnames.ora
A file that contains connect descriptors mapped to net service names. The file can be maintained centrally or locally for use by all or individual clients.
This manual explains how to install, configure, use, and administer Oracle Services for Microsoft Transaction Server that apply to operating systems. It covers the features of Oracle Database software that apply to the Windows 2000, Windows XP, and Windows Server 2003 operating systems.
This preface contains these topics:
This guide is intended for anyone who performs the following tasks:
Uses component object model (COM) components with Microsoft Transaction Server
Registers COM components as transactional and has Microsoft Transaction Server control the transaction
Uses client-side connection pooling in Microsoft Transaction Server
Uses .NET applications with Oracle Services for Microsoft Transaction Server to access Oracle Database instances.
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc
.
Access to Oracle Support
Oracle customers have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info
or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs
if you are hearing impaired.
For more information, see these Oracle resources:
For information about Oracle error messages, see Oracle Database Error Messages. Oracle error message documentation is available only in HTML. If you only have access to the Oracle Documentation CD, you can browse the error messages by range. Once you find the specific range, use your browser's "find in page" feature to locate the specific message. When connected to the Internet, you can search for a specific error message using the error message search feature of the Oracle online documentation.
Many of the examples in this book use the sample 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.
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://www.oracle.com/technology/membership/
If you already have a username and password for OTN, then you can go directly to the documentation section of the OTN Web site at
http://www.oracle.com/technology/documentation/
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. |