# DCd2pc.ctl:207:Collects Distributed Transaction Information # $Id: DCd2pc.ctl,v 1.2 2013/10/30 07:18:23 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/DB/DCd2pc.ctl,v 1.2 2013/10/30 07:18:23 RDA Exp $ # # Change History # 20121021 MSC Improve cross module references. =head1 NAME DB:DCd2pc - 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 !${I_DBC/E} return echo tput('bold'),'Processing DB.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 !${B_SYSDBA/P} {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 DB:DBinfo() =head2 in-doubt - In-Doubt Distributed Transactions Collects information about in-doubt distributed transactions. =cut report indoubt title '---+!! In-Doubt Transaction Information' title $TOC debug ' Inside D2PC module, getting transaction and session counts' prefix write '---+ 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 Subsessions*| ' || " COUNT(*) || '|' " FROM pending_sub_sessions$; } call writeSql($sql) if hasOutput(true) write $TOP debug ' Inside D2PC module, getting global name' prefix {write '---+ Global Name' write '|*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 {write '---+ In-Doubt Transactions' write '|*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 {write '---+ Neighboring Nodes' write '|*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, L =begin credits =over 10 =item RDA 4.14: Faye Todd, Amira Ali. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. =head1 TRADEMARK NOTICE Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. =cut