zz$sys helper

From zzat
Jump to: navigation, search

The package zz$sys_helper is zztat's interface to elevated privileges. The zztat users, both on the zztat repository database and on target databases have a limited set of privileges. Any and all actions that require higher privileges are channeled through this package.

The zz$sys_helper package is created in plaintext so you may inspect the source to verify exactly what it is that zztat is able to do in your database as the SYS user. It is the only package whose source is readable.

Do not alter the package source, or your zztat installation will become unsupported.

While zztat functions and is able to provide basic monitoring functionality without the zz$sys_helper package installed, it is not recommended, and most of the more powerful functionality will remain disabled.

The package provides the following functions and procedures.

Support Procedures and Functions

Type Name Parameters Data Type Description
Procedure add_datafile tablespace varchar2 Adds a datafile to a tablespace. This is called by the reaction ADD_DATAFILE.
Procedure create_directory path

directory_name

varchar2

varchar2

This is used by the zztat patcher and creates a directory to read the patch data from. Returns the created directory name as an OUT parameter.
Procedure drop_directory directory_name varchar2 This is used by the zztat patcher to clean up and drop directory objects.
Procedure clean_aud$ - - Part of the zztat Auditing Add-on. Cleans out records from sys.aud$ that were previously archived.
Procedure fetch_source target

flags

code

varchar2

number

clob

Called by the zztat patcher to fetch the source code of an object before replacing it in an apply sessions. Returns the object source code as an OUT parameter.
Procedure kill_session sid

serial#

status

message

number

number

number

varchar2

Called by the KILL_SESSION reaction to terminate a session. Refuses to kill SYS and background process sessions. Returns status (0 = success, !=0 upon failure) and a status message as OUT parameters.
Procedure latch_report alert_rowid

body

rowid

varchar2

Produces a report showing latching activity.
Procedure mutex_report alert_rowid

body

rowid

varchar2

Produces a report showing latching activity.
Procedure patch_schema target

code

returncode

output

varchar2

clob

number

varchar2

Used by the zztat patcher for apply and rollback. Has the ability to run code as another user directly but restricts it to the zztat schemas to ensure security is properly enforced.
Procedure session_report sid

serial#

alert_rowid

body

number

number

rowid

varchar2

Produces a report showing the session's activity
Procedure session_pga_report sid

serial#

get_details

alert_rowid

body

number

number

boolean

rowid

varchar2

Produces a report showing the session's PGA usage.
Procedure write_alert_log message varchar2 Writes a message to the database alert log.

Data Readers

Type Name Parameters Data Type Description
Function all_ini_par - - Returns data from x$ksppi and x$ksppcv showing all init.ora parameters including hidden ones. Used by the ALLINIPAR metric.
Function aud$ - - Part of the zztat Auditing Add-on. Returns data from sys.aud$.
Function db_users - - Returns a list of user accounts from dba_users. Does not read or return the encrypted password. Used by the DB_USERS metric.
Function v$restore_point - - Returns data from v$restore_point. This is used to avoid having to grant powerful privileges to read just that view, which cannot be properly granted access to otherwise.
Function x$mutex_sleep - - Returns data from x$mutex_sleep using a specially crafted query. Called by HS_MUTEX metric / MUTEX_HISPEED_SAMPLE reaction.
Function x$ksuprlat - - Returns data from x$ksuprlat using a specially crafted query. Called by the HS_LATCH metric / LATCH_HISPEED_SAMPLE reaction.
Function x$kslwt - - Returns data from x$kslwt using a specially crafted query. Called by the HS_SESWAIT metric / SESSION_WAIT_HISPEED_SAMPLE reaction.
Function x$krbmsft path varchar2 Returns the list of files found in the specified directory.