10 Managing Oracle ASM with ASMCMD

Oracle Automatic Storage Management (Oracle ASM) Command-Line Utility (ASMCMD) provides commands for managing Oracle ASM.

This chapter describes the Oracle Automatic Storage Management (Oracle ASM) Command-Line Utility (ASMCMD). This chapter contains the following topics:

See Also:

Oracle Advanced Cluster File System Administrator's Guide for information about ASMCMD commands to manage Oracle ADVM volumes

Note:

Oracle does not recommend using identifiers for Oracle AI Database object names that must be quoted. While the use of quoted identifiers may be valid as names in some command-line tools or in SQL statements, such as CREATE DISKGROUP "1DATA", the names may not be valid when using other tools that manage the object. For more information about naming Oracle AI Database objects, refer to Oracle AI Database SQL Language Reference.

ASMCMD Audit Files Management Commands

This document describes the ASMCMD Oracle ASM audit files management commands.

The following table provides a summary of ASMCMD audit files management commands.

Table 10-1 Summary of ASMCMD audit files management commands

Command Description

audcleanaudittrail

Deletes the audit files of the specified audit trail type.

audclearproperty

Clears the value for the specified audit property.

audcleartimestamp

Clears the last archive timestamp set by “audsettimestamp” command.

audcreatejob

Creates a purge job for specified audit trail type.

auddropjob

Drops the specified audit purge job.

audsetdebug

Sets the tracing to the specified debug level.

audsetjobinterval

Sets the job interval for the specified audit purge job.

audsetjobstatus

Sets the status of the specified purge job to either “enable” or “disable” state.

audsetproperty

Sets the value of specified audit property for given audit trail type.

audsettimestamp

Sets the last archive timestamp for specified audit trail type.

audshowtimestamp

Displays the last archive timestamps set by "audsettimestamp" command.

lsaudcleanupjobs

Displays the configured audit trail purge jobs.

lsaudconfigparams

Displays the configured audit trail properties for the given audit trail type.

audcleanaudittrail

Purpose

Deletes the audit files of the specified audit trail type. The command will delete the files based on Last Archive Timestamp set using “audsettimestamp" command, if --useTimestamp option is specified. Else, it will delete all the files that are not being actively written to.

Syntax and Description

audcleanaudittrail {--os|--uni} [--useTimestamp] [--target <target_instance>]

Options for the audcleanaudittrail command

Table 10-2 Options for the audcleanaudittrail command

Option Description

--os

Cleans up audit files of OS audit trail type.

--uni

Cleans up audit files of Unified audit trail type.

--useTimestamp

If specified, uses last archive timestamp in cleaning up the audit records.

--target

Target instance where the command should be executed. The value could be either IOS or APX.

Examples

The following are examples of audcleanaudittrail command.

In the example below, the audit files of OS audit trail type that are older than the timestamp specified by "audsettimestamp" command will be deleted.

Example 10-1 Using the ASMCMD audcleanaudittrail command

ASMCMD> audcleanaudittrail --os --useTimestamp

In the example below, the audit files of Unified audit trail type that are older than the timestamp specified by "audsettimestamp" command will be deleted

Example 10-2 Using the ASMCMD audcleanaudittrail command

ASMCMD> audcleanaudittrail --uni --useTimestamp

In the example below, the audit files of Unified audit trail type in APX instance that are older than the timestamp, set using "audsettimestamp" command, will be deleted.

Example 10-3 Using the ASMCMD audcleanaudittrail command

ASMCMD> audcleanaudittrail --uni --useTimestamp --target APX

audclearproperty

Purpose

Clears the value for the specified audit property. When --use_def argument is used, the value of the property is set to its respective default value.

Syntax and Description

audclearproperty {--file_max_size|--file_max_age} [--use_def] {--os|--uni} [--target <target_instance>]

Options for the audclearproperty command

Table 10-3 Options for the audclearproperty command

Option Description

--file_max_size

Maximum audit file size

Note:

For more details, see Administering Oracle ASM audit trail

--file_max_age

Maximum audit file age

Note:

For more details, see Administering Oracle ASM audit trail

--use_def

Resets or sets the value back to default value.

--os

Clears property of OS audit trail type.

--uni

Clears property of Unified audit trail type.

--target

Target instance where the command should be executed. The value could be either APX or IOS.

Note:

The default value for the age of an audit file is 5 Days and the default value for the size of an audit file is 10 MB.

Examples

The following are examples of audclearproperty command.

The example below sets the file_max_size property for the audit files of OS audit trail type to its default value.

Example 10-4 Using the ASMCMD audclearproperty command

ASMCMD> audclearproperty --file_max_size --use_def --os

The example below clears the file_max_age property for the audit files of Unified audit trail type in APX instance. In other words, it sets file_max_age property to zero.

Example 10-5 Using the ASMCMD audclearproperty command

ASMCMD> audclearproperty --file_max_age --uni --target APX

audcleartimestamp

Purpose

Clears the last archive timestamp set by audsettimestamp.

Syntax and Description

audcleartimestamp {--os  --inst <instancenumber> |--uni} [--target <target_instance>]

Options for the audcleartimestamp command

Table 10-4 Options for the audcleartimestamp command

Option Description

--os

Clears the last archive timestamp set for OS audit trail type.

--uni

Clears the last archive timestamp set for Unified audit trail type.

--inst <instancenumber>

Instance number

--target

Target instance where the command should be executed. The value could be either APX or IOS.

Examples

The following are examples of audcleartimestamp command.

The example below clears the last archive timestamp set for instance number 1 of OS audit trail type.

Example 10-6 Using the ASMCMD audcleartimestamp command

ASMCMD> audcleartimestamp --os --inst 1

The example below clears the last archive timestamp set for Unified audit trail type.

Example 10-7 Using the ASMCMD audcleartimestamp command

ASMCMD> audcleartimestamp --uni

The example below clears the timestamp set for Unified audit trail type in IOS instance.

Example 10-8 Using the ASMCMD audcleartimestamp command

ASMCMD> audcleartimestamp --uni --target IOS

audcreatejob

Purpose

Creates a purge job for specified audit trail type. The purge job runs at a frequency specified by --int and purges the audit files.

Syntax and Description

audcreatejob --name <job_name> --int <purge_int> {--os | --uni} [--use_ts] [--target <target_instance>]

Options for the audcreatejob command.

Table 10-5 Options for the audcreatejob command

Option Description

--name <job_name>

Name of the purge job

--int <purge_int>

Purge interval in hours

--os

Purge job for OS audit trail type

--uni

Purge job for Unified audit trail type

--use_ts

When specified, the purge will be based on the last archive timestamp set by audsettimestamp command.

-target

target instance where the command should be executed. The value could be either APX or IOS.

Examples

The following are examples for audcreatejob command.

The example below creates a job called OSAUD_PURGE with purge interval 10 hours for OS audit trail type and the job will use the timestamp, set earlier using audsettimestamp, while purging audit files (since --use_ts is specified).

Example 10-9 Using the ASMCMD audcreatejob command

ASMCMD> audcreatejob --name OSAUD_PURGE --int 10 --os --use_ts

The example below creates a job called OSAUD_NOTS with purge interval 10 hours for OS audit trail type and the job will NOT use the timestamp, set earlier using audsettimestamp, while purging audit files (since --use_ts is NOT specified).

Example 10-10 Using the ASMCMD audcreatejob command

ASMCMD> audcreatejob --name OSAUD_NOTS --int 10 –os

The example below creates a job called OSAUD_PURGE_APX in APX instance with purge interval 10 hours for OS audit trail type and the job will not use the timestamp while purging audit files (since --use_ts is not specified).

Example 10-11 Using the ASMCMD audcreatejob command

ASMCMD> audcreatejob --name OSAUD_PURGE_APX --int 10 --os --target APX

auddropjob

Purpose

Drops the specified audit purge job. This command does not require any audit trail type information.

Syntax and Description

auddropjob --name <job_name> [--target <target_instance>]

Options for the auddropjob command.

Table 10-6 Options for the auddropjob command

Option Description

--name <job_name>

Name of the purge job

-target

target instance where the command should be executed. The value could be either APX or IOS.

Examples

The below example drops the audit purge job OSAUD_PURGE_APX in APX instance.

Example 10-12 Using the ASMCMD auddropjob command

ASMCMD> auddropjob --name OSAUD_PURGE_APX --target APX

audsetdebug

Purpose

Sets the tracing to the specified debug level.

Syntax and Description

audsetdebug {--debug | --error} [--target <target_instance>]

Options for the audsetdebug command.

Table 10-7 Options for the audsetdebug command

Option Description

--debug

Dumps all debug information into the traces.

--error

Dumps only error information into the traces.

-target

target instance where the command should be executed. The value could be either APX or IOS.

Note:

The default debug level is "error".

Examples

The following example sets the debug level to "debug".

Example 10-13 Using the ASMCMD audsetdebug command

ASMCMD> audsetdebug --debug
The following example sets the debug level to "debug" in IOS instance.

Example 10-14 Using the ASMCMD audsetdebug command

ASMCMD> audsetdebug --debug --target IOS

audsetjobinterval

Purpose

Sets the job interval for the specified audit purge job.

Syntax and Description

audsetjobinterval --name <job_name>  --int <interval> [--target <target_instance>]

Options for the audsetjobinterval command.

Table 10-8 Options for the audsetjobinterval command

Option Description

--name <job_name>

Name of audit purge job

--int <interval>

Interval in hours

-target

target instance where the command should be executed. The value could be either APX or IOS.

Examples

The following example sets the interval of audit cleanup job OSAUD_PURGE to 10 hours.

Example 10-15 Using the ASMCMD audsetjobinterval command

ASMCMD> audsetjobinterval --name OSAUD_PURGE --int 10

The following example example sets the interval of audit cleanup job OSAUD_PURGE_APX in APX instance to 20 hours.

Example 10-16 Using the ASMCMD audsetjobinterval command

ASMCMD> audsetjobinterval --name OSAUD_PURGE_APX --int 20 --target APX

audsetjobstatus

Purpose

Sets the status of the specified purge job to enabled or disabled state.

Syntax and Description

audsetjobstatus --name <job_name>  {--disable | --enable} [--target <target_instance>]

Options for the audsetjobstatus command.

Table 10-9 Options for the audsetjobstatus command

Option Description

--name <job_name>

Audit purge job name

--enable/--disable

Enables or disables the given job.

-target

target instance where the command should be executed. The value could be either APX or IOS.

Note:

Audit purge job, when disabled, will not purge audit files periodically.

Examples

The following example disables the audit job OSAUD_PURGE.

Example 10-17 Using the ASMCMD audsetjobstatus command

ASMCMD> audsetjobstatus --name OSAUD_PURGE --disable

The following example disables the audit job OSAUD_PURGE_APX in APX instance.

Example 10-18 Using the ASMCMD audsetjobstatus command

ASMCMD> audsetjobstatus --name OSAUD_PURGE_APX --disable --target APX

audsetproperty

Purpose

Sets the value of specified audit property for given audit trail type.

Syntax and Description

audsetproperty {--file_max_size | --file_max_age } --val <value> {--os | --uni} [--target <target_instance>]

Options for the audsetproperty command.

Table 10-10 Options for the audsetproperty command

Option Description

--file_max_size

Maximum size of the audit file

Note:

The value for file_max_size property must be in range [1,2000000] KB.

--file_max_age

Maximum age of the audit file

Note:

The value for file_max_age property must be in range [1, 497] days.

--val <value>

Value of the property

--os

Sets property for OS audit trail type.

--uni

Sets property for Unified audit trail type.

-target

target instance where the command should be executed. The value could be either APX or IOS.

Examples

The following are examples of the audsetproperty command.

The example below sets the file_max_size property for the audit files of OS audit trail type audit file to 10 KB.

Example 10-19 Using the ASMCMD audsetproperty command

ASMCMD> audsetproperty --file_max_size --val 10 --os
The example below sets the file_max_size property in IOS instance for audit files of Unified audit trail type to 100 KB.

Example 10-20 Using the ASMCMD audsetproperty command

ASMCMD> audsetproperty --file_max_size --val 100 --uni --target IOS

audsettimestamp

Purpose

Sets the last archive timestamp for specified audit trail type. This timestamp will be used by the audit purge job and audcleanaudittrail command, if they are configured with --useTimestamp option. In case of OS audit trail type, instance number is required.

Syntax and Description

audsettimestamp {--os|--uni} [--inst <id>] <timestamp> [--target <target_instance>]

Options for the audsettimestamp command.

Table 10-11 Options for the audsettimestamp command

Option Description

--os

Last archive timestamp for OS audit trail type

--uni

Last archive timestamp for Unified audit trail type

--inst <id>

Instance number

<timestamp>

Timestamp

-target

target instance where the command should be executed. The value could be either APX or IOS.

Examples

The following example sets the last archive timestamp of OS audit trail type in instance number 1.

Example 10-21 Using the ASMCMD audsettimestamp command

ASMCMD> audsettimestamp --os --inst 1 22-AUG-2012 07:48:53

The following example sets the timestamp of Unified audit trail type in IOS instance.

Example 10-22 Using the ASMCMD audsettimestamp command

ASMCMD> audsettimestamp --uni 01-JAN-2010 06:00:00 --target IOS

audshowtimestamp

Purpose

Displays the last archive timestamp set using "audsettimestamp" command.

Syntax and Description

audshowtimestamp [{--os|--uni}] [-g] [--target <target_instance>]

Options for the audshowtimestamp command.

Table 10-12 Options for audshowtimestamp command

Option Description

--os

Displays last archive timestamp set for OS audit trail type.

--uni

Displays last archive timestamp set for Unified audit trail type.

-g

Displays clusterwide timestamp information.

-target

target instance where the command should be executed. The value could be either APX or IOS.

Examples

The following are examples of the audshowtimestamp command.

The example below displays the last archive timestamp set for OS audit trail type.

Example 10-23 Using the ASMCMD audshowtimestamp command

ASMCMD> audshowtimestamp --os

The example below displays the clusterwide timestamp information for OS audit trail type.

Example 10-24 Using the ASMCMD audshowtimestamp command

ASMCMD> audshowtimestamp --os -g

The example below displays the clusterwide timestamp information for OS audit trail type.

Example 10-25 Using the ASMCMD audshowtimestamp command

ASMCMD> audshowtimestamp --os -g

See Also:

lsaudcleanupjobs

Purpose

Displays the configured audit trail purge jobs.

Syntax and Description

lsaudcleanupjobs [--os |--uni] [--target <target_instance>]

Options for the lsaudcleanupjobs command.

Table 10-13 Options for lsaudcleanupjobs command

Option Description

--os

Displays only the purge job configured for OS audit trail type.

--uni

Displays only the purge job configured for Unified audit trail type.

-target

target instance where the command should be executed. The value could be either APX or IOS.

Note:

lsaudcleanupjobs displays the purge jobs configured for both OS and Unified audit trail types, when no audit trail option is provided.

Examples

The following example queries audit cleanup jobs configured for OS audit trail type.

Example 10-26 Using the ASMCMD lsaudcleanupjobs command

ASMCMD> lsaudcleanupjobs --os

The following example queries audit cleanup jobs configured for OS audit trail type in IOS instance.

Example 10-27 Using the ASMCMD lsaudcleanupjobs command

ASMCMD> lsaudcleanupjobs --uni --target IOS

See Also:

lsaudconfigparams

Purpose

Displays the configured audit trail properties for the given audit trail type.

Syntax and Description

lsaudconfigparams [{--os|--uni}] [--target <target_instance>]

Options for the lsaudconfigparams command.

Table 10-14 Options for lsaudconfigparams command

Option Description

--os

Displays only the audit trail properties of OS audit trail type.

--uni

Displays only the audit trail properties of unified audit trail type.

-target

target instance where the command should be executed. The value could be either APX or IOS.

Note:

lsaudconfigparams displays the audit configuration properties for both OS and Unified audit trail type, when no audit trail type option is provided.

Examples

The following example queries audit configuration parameters for OS audit trail type.

Example 10-28 Using the ASMCMD lsaudconfigparams command

ASMCMD> lsaudconfigparams --os

The following example queries audit configuration parameters for Unified audit trail type in IOS instance.

Example 10-29 Using the ASMCMD lsaudconfigparams command

ASMCMD> lsaudconfigparams --uni --target IOS

See Also: