zz$util

From zzat
Jump to: navigation, search

zz$util is a helper package that provides functions that can be used in conjunction with zz$manage or when writing reports on zztat's data dictionary.

It has the following functions and procedures:

zz$util package specification
Type Name Parameters Data Type Description
function metric_exists dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the metric exists. False otherwise.

function metric_is_disabled dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the metric has the DISABLED flag set. False otherwise.

function metris_is_replonly dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the metric has the REPLICATE_ONLY flag set. False otherwise.

function metric_is_internal dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the metric has the INTERNAL flag set. False otherwise.

function metric_is_autosync dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the metric has the AUTOSYNC flag set. False otherwise.

function metric_is_repoonly dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the metric has the REPOSITORY_ONLY flag set. False otherwise.

function metric_is_tgtonly dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the metric has the TARGET_ONLY flag set. False otherwise.

function metric_uses_queue dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the metric has the USE_QUEUES flag set. False otherwise.

function metric_is_ondemand dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the metric has the ON_DEMAND flag set. False otherwise.

function metris_is_onupgrade dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the metric has the ON_UPGRADE flag set. False otherwise.

function metric_is_trunc dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the metric has the TRUNC_ON_SNAP flag set. False otherwise.

function metric_is_snaptwice dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the metric has the SNAP_TWICE flag set. False otherwise.

function gauge_exists dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the gauge exists. False otherwise.

function gauge_is_disabled dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the gauge has the DISABLED flag set. False otherwise.

function gauge_is_autosync dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the gauge has the AUTOSYNC flag set. False otherwise.

function gauge_is_repoonly dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the gauge has the REPOSITORY_ONLY flag set. False otherwise.

function gauge_is_tgtonly dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the gauge has the TARGET_ONLY flag set. False otherwise.

function gauge_is_logicaland dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the gauge has the LOGICAL_AND flag set. False otherwise.

function reaction_exists dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the reaction exists. False otherwise.

function reaction_is_disabled dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the reaction has the DISABLE flag set. False otherwise.

function reaction_is_disonfail dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the reaction has the DISABLE_ON_FAIL flag set. False otherwise.

function reaction_is_repoonly dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the reaction has the REPOSITORY_ONLY flag set. False otherwise.

function reaction_is_tgtonly dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the reaction has the TARGET_ONLY flag set. False otherwise.

function chain_is_skipfailed dbid

name

number

varchar2

Returns boolean.

dbid is optional and automatically replaced with -1 if not specified or given as NULL.

Returns true if the reaction chain has the SKIP_FAILED flag set. False otherwise.

function get_dbid Returns number.

Gets the DBID of the current database.

function dbid2name dbid number Returns varchar2.

Returns the database name from zz$db.name when given the dbid.

function name2dbid name varchar2 Returns number.

Returns the database DBID from zz$db when given the name.

function get_db_type Returns varchar2.

Returns the type of the current database. REPOSITORY or TARGET.

function get_db_mode dbid number Returns varchar2.

Returns the mode of the specified database - PUSH or PULL.

function get_tablespace Returns varchar2.

Returns the tablespace name the current zztat installation uses.

function get_hostname Returns varchar2.

Returns the host_name from v$instance.

function get_datatype typecode number Returns varchar2.

Unfortunately, the Oracle developers don't talk to each other, and the type# in col$ doesn't match dbms_types.typecode. This function implements our own mapping.

function get_disabled Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_disabled)) = power(2, zz$util.get_disabled).

function get_replonly Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_replonly)) = power(2, zz$util.get_replonly).

function get_internal Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_internal)) = power(2, zz$util.get_internal).

function get_autosync Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_autosync)) = power(2, zz$util.get_autosync).

function get_disonfail Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_disonfail)) = power(2, zz$util.get_disonfail).

function get_usequeue Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_usequeue)) = power(2, zz$util.get_usequeue).

function get_repoonly Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_repoonly)) = power(2, zz$util.get_repoonly).

function get_tgtonly Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_tgtonly)) = power(2, zz$util.get_tgtonly).

function get_ondemand Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_ondemand)) = power(2, zz$util.get_ondemand).

function get_onupgrade Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_onupgrade)) = power(2, zz$util.get_onupgrade).

function get_trunc Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_trunc)) = power(2, zz$util.get_trunc).

function get_snaptwicef Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_snaptwice)) = power(2, zz$util.get_snaptwice).

function get_logicaland Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_logicaland)) = power(2, zz$util.get_logicaland).

function get_autoack Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_autoack)) = power(2, zz$util.get_autoack).

function get_skipfailed Returns number.

Helper function that can be used in SQL. Returns the base flag property and can be used in a bitand() call to determine if a flag is set when passing the flags column of a table such as zz$metric, zz$gauge, zz$reaction or zz$reaction_chain.

Usage notes: bitand(flags, power(2, zz$util.get_skipfailed)) = power(2, zz$util.get_skipfailed).