# S207D2PC.def: Collects Distributed Transaction Information # $Id: S207D2PC.def,v 1.6 2009/05/05 11:57:15 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/modules/S207D2PC.def,v 1.6 2009/05/05 11:57:15 mschenke Exp $ # # Change History # 20090505 DEM Improve main index structure. =head1 NAME S207D2PC - Collects Distributed Transaction Information =head1 DESCRIPTION This module collects information about in-doubt distributed transactions. The following report can be generated and is regrouped under C: =cut if !getSetting('DATABASE_INSTALLED') return echo tput('bold'),'Processing D2PC module ...',tput('off') # Initialization var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '^1:RDBMS' pretoc '1+:Distributed Transactions' =head2 no_privileges - Insufficient Privileges This module must be run as a SYSDBA user. =cut if !getSetting('SQL_SYSDBA') {report no_privileges write 'The Distributed Transaction module requires you to connect as a SYSDBA \ user. This can be set up during the DB module setup.' toc '2:[[',getFile(),'][rda_report][Insufficient Privileges]]' toc '-:RDBMS' return } # Load the common macros run DBinfo() =head2 in-doubt - In-Doubt Distributed Transactions Collects information about in-doubt distributed transactions. =cut report indoubt var $TTL = '---+!! In-Doubt Transaction Information' macro dsp_title {import $TOC,$TTL if $TTL {write '---+!! In-Doubt Transaction Information' write $TOC var $TTL = undef } loop $lin (@arg) write $lin } debug ' Inside D2PC module, getting transaction and session counts' prefix call dsp_title('---+ Transaction and Session Counts') set $sql {SELECT '|*In-Doubt Transactions*| ' || " COUNT(*) || '|' " FROM dba_2pc_pending; "SELECT '|*Pending Transactions*| ' || " COUNT(*) || '|' " FROM pending_trans$; "SELECT '|*Pending Sessions*| ' || " COUNT(*) || '|' " FROM pending_sessions$; "SELECT '|*Pending Sub Sessions*| ' || " COUNT(*) || '|' " FROM pending_sub_sessions$; } call writeSql($sql) if hasOutput(true) write $TOP debug ' Inside D2PC module, getting global name' prefix call dsp_title('---+ Global Name',\ '|*Global Name* |') set $sql {SELECT '|' || global_name || ' |' " FROM global_name; } call writeSql($sql) if hasOutput(true) write $TOP debug ' Inside D2PC module, getting pending in-doubt transaction' prefix call dsp_title('---+ In-Doubt Transactions',\ '|*Local Transaction ID* |\ *Global Transaction ID* |*Fail Time* |*Host* |\ *DB User* |*OS User* |*State* |*Mixed* | *Commit#* |\ *Transaction Comment* |') set $sql {SELECT '|' || " local_tran_id || ' |' || " global_tran_id || ' |' || " TO_CHAR(fail_time,'DD-Mon-YYYY" "HH24:MI:SS') || ' |' || " host || ' |' || " db_user || ' |' || " os_user || ' |' || " state || ' |' || " mixed || ' | ' || " commit# || '|' || " tran_comment || ' |' " FROM dba_2pc_pending " ORDER BY 1; } call writeSql($sql) if hasOutput(true) write $TOP debug ' Inside D2PC module, getting neighboring node information' prefix call dsp_title('---+ Neighboring Nodes',\ '|*Local Transaction ID* |*In/Out* |*Interface* |\ *DB User Owner* |*Database* |') set $sql {SELECT '|' || " local_tran_id || ' |' || " in_out || ' |' || " interface || ' |' || " dbuser_owner || ' |' || " database || ' |' " FROM dba_2pc_neighbors " ORDER BY 1; } call writeSql($sql) if hasOutput(true) write $TOP if isCreated(true) toc '2:[[',getFile(),'][rda_report][In-Doubt Transactions]]' # Disable the group title in next index if isTocCreated(true) toc '-:RDBMS' =head1 SEE ALSO L =begin credits =over 10 =item RDA 4.14: Faye Todd, Amira Ali. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002-2009, Oracle. All rights reserved. =head1 TRADEMARK NOTICE 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. =cut