14.9 Performing Custom Collections

Use the custom collection options to change the diagnostic collections from the default.

14.9.1 Adjusting the Diagnostic Data Collection Period

Oracle Trace File Analyzer trims and collects any important logs updated in the past one hour.

If you know that you only want logs for a smaller window, then you can cut this collection period. Cutting the collection period helps you make collections as small and quick as possible.

There are four different ways you can specify the period for collection:

Table 14-7 Ways to Specify the Collection Period

Command Description

tfactl diagcollect -last n h|d

Collects since the previous n hours or days.

  • Number of days must be less than or equal to 7
  • Number of hours must be less than or equal to 168

tfactl diagcollect -from “yyyy-mm-dd

Collects from the date and optionally time specified.

Valid date and time formats:

"Mon/dd/yyyy hh:mm:ss"

"yyyy-mm-dd hh:mm:ss"

"yyyy-mm-ddThh:mm:ss"

"yyyy-mm-dd"

tfactl diagcollect –from "yyyy-mm-dd" -to "yyyy-mm-dd"

Collects between the date and optionally time specified.

Valid date and time formats:

"Mon/dd/yyyy hh:mm:ss"

"yyyy-mm-dd hh:mm:ss"

"yyyy-mm-ddThh:mm:ss"

"yyyy-mm-dd"

tfactl diagcollect -for “yyyy-mm-dd

Collects for the specified date.

Valid date formats:

"Mon/dd/yyyy"

"yyyy-mm-dd"

14.9.2 Collecting for Specific Events

Perform default diagnostic collection or choose an event from the list of recent incidents to collect diagnostic data for that event alone.

Choose to run:

  • A diagnostic collection for a specific recent event
  • A default time range diagnostic collection

To collect for specific events:

  1. To run a default diagnostic collection:
    tfactl diagcollect
    For example:
    $ tfactl diagcollect
    Choose the event you want to perform a diagnostic collection for:
    1. Mar/12/2019 16:08:20 [ db.orcl.orcl ]  ORA-04030: out of process memory when trying to allocate
    2. Mar/12/2019 16:08:18 [ db.orcl.orcl ]  ORA-04031: unable to allocate 8 bytes of shared memory
    3. Mar/12/2019 16:08:16 [ db.orcl.orcl ]  ORA-00494: enqueue held for too long more than seconds by osid
    4. Mar/12/2019 16:08:14 [ db.orcl.orcl ]  ORA-29709: Communication failure with Cluster Synchronization
    5. Mar/12/2019 16:08:04 [ db.orcl.orcl ]  ORA-29702: error occurred in Cluster Group Service operation
    6. Mar/12/2019 16:07:59 [ db.orcl.orcl ]  ORA-32701: Possible hangs up to hang ID= detected
    7. Mar/12/2019 16:07:51 [ db.orcl.orcl ]  ORA-07445: exception encountered: core dump [] [] [] [] [] []
    8. Mar/12/2019 16:07:49 [ db.orcl.orcl ]  ORA-00700: soft internal error, arguments: [700], [], [],[]
    9. Mar/11/2019 22:02:19 [ db.oradb.oradb ]  DIA0 Critical Database Process Blocked: Hang ID 1 blocks 5 sessions
    10. Default diagnostic collection, for no specific event
    
    Please choose the event : 1-10 [] 10
    
    By default TFA will collect diagnostics for the last 12 hours. This can result in large collections
    For more targeted collections enter the time of the incident, otherwise hit <RETURN> to collect for the last 12 hours
    [YYYY-MM-DD HH24:MI:SS,<RETURN>=Collect for last 12 hours] :
    
    Collecting data for the last 12 hours for all components...
    Collecting data for all nodes
    
    Collection Id : 20190312163846node1
    
    Detailed Logging at : /scratch/app/product/19c/tfa/repository/collection_Tue_Mar_12_16_38_47_PDT_2019_node_all/diagcollect_20190312163846_node1.log
    2019/03/12 16:38:50 PDT : NOTE : Any file or directory name containing the string .com will be renamed to replace .com with dotcom
    2019/03/12 16:38:50 PDT : Collection Name : tfa_Tue_Mar_12_16_38_47_PDT_2019.zip
    2019/03/12 16:38:50 PDT : Collecting diagnostics from hosts : [node1]
    2019/03/12 16:38:50 PDT : Scanning of files for Collection in progress...
    2019/03/12 16:38:50 PDT : Collecting additional diagnostic information...
    2019/03/12 16:38:55 PDT : Getting list of files satisfying time range [03/12/2019 04:38:50 PDT, 03/12/2019 16:38:55 PDT]
    2019/03/12 16:39:02 PDT : Collecting ADR incident files...
    2019/03/12 16:39:06 PDT : Completed collection of additional diagnostic information...
    2019/03/12 16:39:07 PDT : Completed Local Collection
    .------------------------------------.
    |         Collection Summary         |
    +----------+-----------+------+------+
    | Host     | Status    | Size | Time |
    +----------+-----------+------+------+
    | node1 | Completed | 21MB |  17s |  |    
    '----------+-----------+------+------'
    
    Logs are being collected to: /scratch/app/product/19c/tfa/repository/collection_Tue_Mar_12_16_38_47_PDT_2019_node_all
    /scratch/app/product/19c/tfa/repository/collection_Tue_Mar_12_16_38_47_PDT_2019_node_all/node1.tfa_Tue_Mar_12_16_38_47_PDT_2019.zip
    $ tfactl diagcollect
    Choose the event you want to perform a diagnostic collection for:
    1. Mar/12/2019 16:08:20 [ db.orcl.orcl ]  ORA-04030: out of process memory when trying to allocate
    2. Mar/12/2019 16:08:18 [ db.orcl.orcl ]  ORA-04031: unable to allocate 8 bytes of shared memory
    3. Mar/12/2019 16:08:16 [ db.orcl.orcl ]  ORA-00494: enqueue held for too long more than seconds by osid
    4. Mar/12/2019 16:08:14 [ db.orcl.orcl ]  ORA-29709: Communication failure with Cluster Synchronization
    5. Mar/12/2019 16:08:04 [ db.orcl.orcl ]  ORA-29702: error occurred in Cluster Group Service operation
    6. Mar/12/2019 16:07:59 [ db.orcl.orcl ]  ORA-32701: Possible hangs up to hang ID= detected
    7. Mar/12/2019 16:07:51 [ db.orcl.orcl ]  ORA-07445: exception encountered: core dump [] [] [] [] [] []
    8. Mar/12/2019 16:07:49 [ db.orcl.orcl ]  ORA-00700: soft internal error, arguments: [700], [], [],[]
    9. Mar/11/2019 22:02:19 [ db.oradb.oradb ]  DIA0 Critical Database Process Blocked: Hang ID 1 blocks 5 sessions
    10. Default diagnostic collection, for no specific event
    
    Please choose the event : 1-10 [] 1
    User root does not have permissions to run SRDC 'ora4030' for database 'orcl'.
  2. To run a diagnostic collection for a specific event that does not have an SRDC:
    tfactl diagcollect
    For example:
    $ tfactl diagcollect
    Choose the event you want to perform a diagnostic collection for:
    1. Mar/12/2019 16:08:20 [ db.orcl.orcl ]  ORA-04030: out of process memory when trying to allocate
    2. Mar/12/2019 16:08:18 [ db.orcl.orcl ]  ORA-04031: unable to allocate 8 bytes of shared memory
    3. Mar/12/2019 16:08:16 [ db.orcl.orcl ]  ORA-00494: enqueue held for too long more than seconds by osid
    4. Mar/12/2019 16:08:14 [ db.orcl.orcl ]  ORA-29709: Communication failure with Cluster Synchronization
    5. Mar/12/2019 16:08:04 [ db.orcl.orcl ]  ORA-29702: error occurred in Cluster Group Service operation
    6. Mar/12/2019 16:07:59 [ db.orcl.orcl ]  ORA-32701: Possible hangs up to hang ID= detected
    7. Mar/12/2019 16:07:51 [ db.orcl.orcl ]  ORA-07445: exception encountered: core dump [] [] [] [] [] []
    8. Mar/12/2019 16:07:49 [ db.orcl.orcl ]  ORA-00700: soft internal error, arguments: [700], [], [],[]
    9. Mar/11/2019 22:02:19 [ db.oradb.oradb ]  DIA0 Critical Database Process Blocked: Hang ID 1 blocks 5 sessions
    10. Default diagnostic collection, for no specific event
    
    Please choose the event : 1-10 [] 9
    Collecting data for all nodes
    Scanning files from mar/11/2019 18:02:19 to mar/11/2019 23:02:19
    
    Collection Id : 20190312162708node1
    
    Detailed Logging at : /scratch/app/product/19c/tfa/repository/collection_Tue_Mar_12_16_27_09_PDT_2019_node_all/diagcollect_20190312162708_node1.log
    2019/03/12 16:27:12 PDT : NOTE : Any file or directory name containing the string .com will be renamed to replace .com with dotcom
    2019/03/12 16:27:12 PDT : Collection Name : tfa_Tue_Mar_12_16_27_09_PDT_2019.zip
    2019/03/12 16:27:12 PDT : Collecting diagnostics from hosts : [node1]
    2019/03/12 16:27:12 PDT : Scanning of files for Collection in progress...
    2019/03/12 16:27:12 PDT : Collecting additional diagnostic information...
    2019/03/12 16:27:17 PDT : Getting list of files satisfying time range [03/11/2019 18:02:19 PDT, 03/11/2019 23:02:19 PDT]
    2019/03/12 16:27:23 PDT : Collecting ADR incident files...
    2019/03/12 16:27:28 PDT : Completed collection of additional diagnostic information...
    2019/03/12 16:27:33 PDT : Completed Local Collection
    .------------------------------------.
    |         Collection Summary         |
    +----------+-----------+------+------+
    | Host     | Status    | Size | Time |
    +----------+-----------+------+------+
    | node1 | Completed | 10MB |  21s |
    '----------+-----------+------+------'
    
    Logs are being collected to: /scratch/app/product/19c/tfa/repository/collection_Tue_Mar_12_16_27_09_PDT_2019_node_all
    /scratch/app/product/19c/tfa/repository/collection_Tue_Mar_12_16_27_09_PDT_2019_node_all/node1.tfa_Tue_Mar_12_16_27_09_PDT_2019.zip
  3. To run a diagnostic collection for a specific event that has an SRDC:

    Note:

    When choosing an SRDC the user running the collection needs to be in the dba group of the database chosen in the event.
    tfactl diagcollect
    For example:
    $ tfactl diagcollect
    Choose the event you want to perform a diagnostic collection for:
    1. Mar/12/2019 16:08:20 [ db.orcl.orcl ]  ORA-04030: out of process memory when trying to allocate
    2. Mar/12/2019 16:08:18 [ db.orcl.orcl ]  ORA-04031: unable to allocate 8 bytes of shared memory
    3. Mar/12/2019 16:08:16 [ db.orcl.orcl ]  ORA-00494: enqueue held for too long more than seconds by osid
    4. Mar/12/2019 16:08:14 [ db.orcl.orcl ]  ORA-29709: Communication failure with Cluster Synchronization
    5. Mar/12/2019 16:08:04 [ db.orcl.orcl ]  ORA-29702: error occurred in Cluster Group Service operation
    6. Mar/12/2019 16:07:59 [ db.orcl.orcl ]  ORA-32701: Possible hangs up to hang ID= detected
    7. Mar/12/2019 16:07:51 [ db.orcl.orcl ]  ORA-07445: exception encountered: core dump [] [] [] [] [] []
    8. Mar/12/2019 16:07:49 [ db.orcl.orcl ]  ORA-00700: soft internal error, arguments: [700], [], [],[]
    9. Mar/11/2019 22:02:19 [ db.oradb.oradb ]  DIA0 Critical Database Process Blocked: Hang ID 1 blocks 5 sessions
    10. Default diagnostic collection, for no specific event
    
    Please choose the event : 1-10 [] 1
    Scripts to be run by this srdc: srdc_db_sid_memorysizes_10glower.sql srdc_db_sid_memorysizes_11gplus.sql ipspack 
    Components included in this srdc: OS DATABASE CHMOS
    Collecting data for local node(s)
    Scanning files from Mar/12/2019 14:08:20 to Mar/12/2019 18:08:20
    WARNING: End time entered is after the current system time.
    
    Collection Id : 20190312163524node1
    
    Detailed Logging at : /scratch/app/product/19c/tfa/repository/srdc_ora4030_collection_Tue_Mar_12_16_35_25_PDT_2019_node_local/diagcollect_20190312163524_node1.log
    2019/03/12 16:35:30 PDT : NOTE : Any file or directory name containing the string .com will be renamed to replace .com with dotcom
    2019/03/12 16:35:30 PDT : Collection Name : tfa_srdc_ora4030_Tue_Mar_12_16_35_25_PDT_2019.zip
    2019/03/12 16:35:30 PDT : Scanning of files for Collection in progress...
    2019/03/12 16:35:30 PDT : Collecting additional diagnostic information...
    2019/03/12 16:35:35 PDT : Getting list of files satisfying time range [03/12/2019 14:08:20 PDT, 03/12/2019 16:35:30 PDT]
    2019/03/12 16:35:49 PDT : Collecting ADR incident files...
    2019/03/12 16:35:52 PDT : Completed collection of additional diagnostic information...
    2019/03/12 16:35:54 PDT : Completed Local Collection
    .-------------------------------------.
    |          Collection Summary         |
    +----------+-----------+-------+------+
    | Host     | Status    | Size  | Time |
    +----------+-----------+-------+------+
    | node1 | Completed | 2.9MB |  24s |
    '----------+-----------+-------+------'
    
    Logs are being collected to: /scratch/app/product/19c/tfa/repository/srdc_ora4030_collection_Tue_Mar_12_16_35_25_PDT_2019_node_local
    /scratch/app/product/19c/tfa/repository/srdc_ora4030_collection_Tue_Mar_12_16_35_25_PDT_2019_node_local/node1.tfa_srdc_ora4030_Tue_Mar_12_16_35_25_PDT_2019.zip

14.9.3 Excluding Large Files from Diagnostic Collection

Prevent excessively large files from delaying or stalling collections.

Run the tfactl set maxfilecollectionsize for the diagnostic collection command to consider only the last 200 KB for the files that are larger than the size specified.

  1. To set the maximum file size:
    tfactl set maxfilecollectionsize=size_in_MB
  2. To collect diagnostic data:
    tfactl diagcollect

14.9.4 Collecting from Specific Nodes

To collect from specific nodes:

  1. To collect from specific nodes:
    tfactl diagcollect –node list of nodes
    For example:
    $ tfactl diagcollect -last 1d -node myserver65

Related Topics

14.9.5 Collecting from Specific Components

To collect from specific components:

  1. To collect from specific components:
    tfactl diagcollect component

    For example:

    To trim and collect all files from the databases hrdb and fdb in the last 1 day:
    $ tfactl –diagcollect -database hrdb,fdb -last 1d
    To trim and collect all Oracle Clusterware files, operating system logs, and CHMOS/OSW data from node1 and node2 updated in the last 6 hours:
    $ tfactl diagcollect -crs -os -node node1,node2 -last 6h
    To trim and collect all Oracle ASM logs from node1 updated between from and to time:
    $ tfactl diagcollect -asm -node node1 -from "2016-08-15" -to "2016-08-17"
    Following are the available component options.

    Table 14-8 Component Options

    Component Option Description

    -cha

    Collects Oracle Cluster Health Advisor logs.

    -ips

    Collects Incident Packaging Service logs.

    -database database_names

    Collects database logs from databases specified in a comma-separated list.

    -asm

    Collects Oracle ASM logs.

    -crsclient

    Collects Client Logs that are under GIBASE/diag/clients.

    -dbclient

    Collects Client Logs that are under DB ORABASE/diag/clients.

    -dbwlm

    Collects Database Workload Management (DBWLM) logs.

    -tns

    Collects TNS logs.

    -rhp

    Collects Rapid Home Provisioning (RHP) logs.

    -procinfo

    Collects Gathers stack and fd from /proc for all processes.

    -afd

    Collects AFD logs.

    -crs

    Collects Oracle Clusterware logs.

    -wls

    Collects Oracle WebLogic Server (WLS) logs.

    -emagent

    Collects Oracle Enterprise Manager Agent (EMAGENT) logs.

    -oms

    Collects Oracle Management Service (OMS) logs.

    -ocm

    Collects Oracle Configuration Manager (OCM) logs.

    -emplugins

    Collects Oracle Enterprise Manager Plug-ins (EMPLUGINS) logs.

    -em

    Collects Oracle Enterprise Manager (EM) logs.

    -acfs

    Oracle Advanced Cluster File System (Oracle ACFS).

    -install

    Collects Oracle Installation related files.

    -cfgtools

    Collects configuration tools logs.

    -os

    Collects operating system files such as /var/log/messages.

    -ashhtml

    Collects Generate Active Session History (ASH) HTML report.

    -ashtext

    Collects Generate Active Session History (ASH) text report.

    -awrhtml

    Collects Automatic Workload Repository (AWR) HTML logs.

    -awrtext

    Collects Automatic Workload Repository (AWR) text report.

Related Topics

14.9.6 Collecting from Specific Directories

Oracle Trace File Analyzer discovers all Oracle diagnostics and collects relevant files based on the type and last time updated.

If you want to collect other files, then you can specify extra directories. Oracle Trace File Analyzer collects only the files updated in the relevant time range (one hour by default).

You can configure collection of all files irrespective of the time last updated. Configure on a directory by directory basis using the -collectall option.

To collect from specific directories:

  1. To include all files updated in the last one hour:
    tfactl diagcollect –collectdir dir1,dir2,...dirn

    For example:

    To trim and collect all Oracle Clusterware files updated in the last one hour as well as all files from /tmp_dir1 and /tmp_dir2 at the initiating node:
    $ tfactl diagcollect –crs –collectdir /tmp_dir1,/tmpdir_2
  2. To configure Oracle Trace File Analyzer to collect all files from a directory, first configure it with the -collectall option:
    $ tfactl add dir -collectall

    or

    tfactl modify dir -collectall
    Start a diagnostic collection using the -collectalldirs option:
    $ tfactl diagcollect -collectalldirs

    Note:

    If the -collectalldirs option is not used normal, then the file type, name, and time range restrictions are applied.

Related Topics

14.9.7 Changing the Collection Name

Oracle Trace File Analyzer zips collections and puts the zip files in the repository directory using the following naming format:

repository/collection_date_time/node_all/node.tfa_date_time.zip

You must only change the name of the zipped files using the following options. Manually changing the file name prevents you from using collections with various Oracle Support self-service tools.

To change the collection name:

  1. To use your own naming to organize collections:
    –tag tagname

    The files are collected into tagname directory inside the repository.

  2. To rename the zip file:
    –z zip name

Related Topics

14.9.8 Preventing Copying Zip Files and Trimming Files

By default, Oracle Trace File Analyzer Collector:

  • Copies back all zip files from remote notes to the initiating node

  • Trims files around the relevant time

To prevent copying zip files and trimming files:

  1. To prevent copying the zip file back to the initiating node:
    –nocopy
    For example:
    $ tfactl diagcollect -last 1d -nocopy
  2. To avoid trimming files:
    –notrim
    For example:
    $ tfactl diagcollect -last 1d -notrim

Related Topics

14.9.9 Performing Silent Collection

  1. To initiate a silent collection:
    –silent

    The diagcollect command is submitted as a background process.

    For example:
    $ tfactl diagcollect -last 1d -silent

Related Topics

14.9.10 Collecting Core Files

  1. To collect core files:
    –cores
    For example:
    $ tfactl diagcollect -last 1d -cores

Related Topics

14.9.11 Collecting Incident Packaging Service (IPS) Packages

Incident Packaging Service packages details of problems stored by Oracle Database in ADR for later diagnosis.

Syntax

Oracle Trace File Analyzer runs IPS to query and collect these packages.

tfactl ips option

Table 14-9 tfactl ips Command Parameters

Command Description

tfactl ips

Runs the IPS.

tfactl ips show incidents

Shows all IPS incidents.

tfactl ips show problems

Shows all IPS problems.

tfactl ips show package

Shows all IPS Packages.

tfactl diagcollect -ips -h

Shows all available diagcollect IPS options.

tfactl diagcollect -ips

Performs an IPS collection following prompts. You can use all the standard diagcollect options to limit the scope of IPS collection.

tfactl diagcollect -ips -adrbasepath adr_base -adrhomepath adr_home

Performs an IPS collection in silent mode.

tfactl diagcollect -ips -incident incident_id

Collects ADR details about a specific incident id.

tfactl diagcollect -ips -problem problem_id

Collect ADR details about a specific problem id.

You can change the contents of the IPS package. Use the following options:

  1. Start the collection.

  2. Suspend the collection using the -manageips option.

    For example:

    $ tfactl diagcollect -ips -incident incident_id -manageips -node local
  3. Find the suspended collection using the print suspendedips option.

    For example:

    $ tfactl print suspendedips
  4. Manipulate the package.

  5. Resume the collection using the -resumeips option.

    For example:

    $ tfactl diagcollect -resumeips collection_id

Related Topics