4.7 Managing Oracle Database and Oracle Grid Infrastructure Logs

This section enables you to manage Oracle Database and Oracle Grid Infrastructure diagnostic data and disk usage snapshots.

4.7.1 Managing Automatic Diagnostic Repository Log and Trace Files

Use the managelogs command to manage Automatic Diagnostic Repository log and trace files.

The -purge command option removes files managed by Automatic Diagnostic Repository. This command clears files from “ALERT”, "INCIDENT", "TRACE", "CDUMP", "HM", "UTSCDMP", "LOG" under diagnostic destinations. The -purge command also provides details about the change in the file system space.

If the diagnostic destinations contain large numbers of files, then the command runs for a while. Check the removal of files in progress from the corresponding directories.

To remove files, you must have operating system privileges over the corresponding diagnostic destinations.

To manage Automatic Diagnostic Repository log and trace files:

  1. To limit purge, or show operations to only files older than a specific time:
    $ tfactl managelogs -older nm|h|d Files from past 'n' [d]ays or 'n' [h]ours or 'n' [m]inutes
    For example:
    $ tfactl managelogs -purge -older 30d -dryrun 
    
    $ tfactl managelogs -purge -older 30d
  2. To get an estimate of how many files are removed and how much space is freed, use the –dryrun option:
    For example:
    $ tfactl managelogs -purge -older 30d -dryrun
  3. To remove files and clean disk space:
    For example:
    $ tfactl managelogs -purge -older 30d 
    
    $ tfactl managelogs -purge -older 30d –gi
    
    $ tfactl managelogs -purge -older 30d -database
    
  4. To view the space usage of individual diagnostic destinations:
    For example:
    $ tfactl managelogs -show usage
    
    $ tfactl managelogs -show usage –gi
    
    $ tfactl managelogs -show usage -database
    

Related Topics

4.7.2 Managing Disk Usage Snapshots

Use tfactl commands to manage Oracle Trace File Analyzer disk usage snapshots.

Oracle Trace File Analyzer automatically monitors disk usage, records snapshots, and stores the snapshots under tfa_install_dir/tfa/repository/suptools/node/managelogs/usage_snapshot/

By default, the time interval between snapshots is 60 minutes.

To manage disk usage snapshots:

  1. To change the default time interval for snapshots:
    $ tfactl set diskUsageMonInterval=minutes

    where minutes is the number of minutes between snapshots.

  2. To turn the disk usage monitor on or off:
    $ tfactl set diskUsageMon=ON|OFF

4.7.3 Purging Oracle Database and Oracle Grid Infrastructure Logs

Use these tfactl commands to manage log file purge policy for Oracle Database and Oracle Grid Infrastructure logs.

Automatic purging is enabled by default on a Domain Service Cluster (DSC), and disabled by default elsewhere. When automatic purging is enabled, every 60 minutes, Oracle Trace File Analyzer automatically purges logs that are older than 30 days.

To purge Oracle Trace File Analyzer logs automatically:

  1. To turn on or off automatic purging:
    $ tfactl set manageLogsAutoPurge=ON|OFF
  2. To adjust the age of logs to purge:
    $ tfactl set manageLogsAutoPurgePolicyAge=nd|h
  3. To adjust the frequency of purging:
    $ tfactl set manageLogsAutoPurgeInterval=minutes

4.7.4 Securing Access to Diagnostic Collections

Running tfactl commands is restricted to authorized users.

tfactl provides a command-line interface and shell to do the following:

  • Run diagnostics and collect all relevant log data from a time of your choosing

  • Trim log files to collect only what is necessary for diagnosis

  • Collect and package all trimmed diagnostics from any desired nodes in the cluster and consolidate everything in one package on a single node

Authorized non-root users can run a subset of the tfactl commands. All other tfactl commands require root access. Users who are not authorized cannot run tfactl commands.

By default, the following users are authorized to access a subset of tfactl commands:

  • Oracle Grid Infrastructure home owner

  • Oracle Database home owners

User access is applicable only if Oracle Trace File Analyzer is installed as root on Linux and UNIX. User access is not applicable if Oracle Trace File Analyzer is installed as non-root, or on Microsoft Windows.

Note:

If an operating system user added to the AHF access control list is deleted without being removed from AHF, then a user created later with the same user name will inherit the deleted user's privileges. To avoid this situation, if an operating system user is deleted, ensure that the user is removed from the AHF access control list.

To provision user access to tfactl:

  • To list the users who have access to tfactl:

    tfactl access lsusers
  • To add a user to access tfactl:

    tfactl access add –user user [-local]

    By default, access commands are applicable to cluster-wide unless you specify the –local command option to restrict them to local node.

  • To remove a user from accessing tfactl:

    tfactl access remove –user user [-local]
  • To remove all users from accessing tfactl:

    tfactl access removeall [-local]
  • To reset user access to default:

    tfactl access reset

Related Topics