Oracle PRVT_SMGUTIL
Version 21c

General Information
Library Note Morgan's Library Page Header
ACE Director Alum Daniel Morgan, founder of Morgan's Library, is scheduling complimentary technical Workshops on Database Security for the first 30 Oracle Database customers located anywhere in North America, EMEA, LATAM, or APAC that send an email to asra_us@oracle.com. Request a Workshop for your organization today.
Purpose Internal support for Management Packs and Real Application Testing (RAT)
AUTHID DEFINER
Dependencies
DBMS_ADVISOR DBMS_RAT_MASK_INTERNAL PRVTEMX_ADMIN
DBMS_ASH_INTERNAL DBMS_SQLPA PRVTEMX_CELL
DBMS_KEG_LIB DBMS_SQLTUNE PRVT_ADVISOR
DBMS_MANAGEMENT_PACKS DBMS_SYS_ERROR PRVT_AWR_VIEWER
DBMS_PERF DBMS_WRR_PROTECTED PRVT_HDM
Documented No
Exceptions
Error Code Reason
ORA-13722 invalid input value for procedure argument PACK_NAME
First Available Not Known
Security Model Owned by SYS with no privileges granted
Source {ORACLE_HOME}/rdbms/admin/prvssmgu.plb
Subprograms
 
CHECK_PACK_ENABLED
Completes successfully if the named pack is enabled prvt_smgutil.check_pack_enabled(pack_name IN VARCHAR2);
exec prvt_smgutil.check_pack_enabled('RAT');
BEGIN prvt_smgutil.check_pack_enabled('RAT'); END;
*
ERROR at line 1:
ORA-13722: invalid input value for procedure argument PACK_NAME
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.PRVT_SMGUTIL", line 41
ORA-06512: at line 1


exec prvt_smgutil.check_pack_enabled('TUNING');

PL/SQL procedure successfully completed.
 
CHECK_RAT_OPTION
Completes successfully if Real Application Clusters is a valid option prvt_smgutil.check_rat_option;
exec prvt_smgutil.check_rat_option;

PL/SQL procedure successfully completed.
 
IS_PACK_ENABLED
Completes successfully if the named pack is enabled prvt_smgutil.is_pack_enabled(pack_name IN VARCHAR2) RETURN BOOLEAN;
BEGIN
  IF prvt_smgutil.is_pack_enabled('DIAGNOSTIC') THEN
    dbms_output.put_line('Enabled');
  ELSE
    dbms_output.put_line('Disabled');
  END IF;
END;
/
Enabled

PL/SQL procedure successfully completed.
 
IS_RAT_OPTION_ENABLED
Completes successfully if Real Application Testing is enabled prvt_smgutil.is_rat_option_enabled RETURN BOOLEAN;
BEGIN
  IF prvt_smgutil.is_rat_option_enabled THEN
    dbms_output.put_line('Enabled');
  ELSE
    dbms_output.put_line('Disabled');
  END IF;
END;
/
Enabled

PL/SQL procedure successfully completed.
 
PRVT_PACK_ENABLED
Returns 1 of the identified pack is enabled prvt_smgutil.prvt_pack_enabled(
pack_name   IN BINARY_INTEGER,
raise_error IN BINARY_INTEGER)
RETURN BINARY_INTEGER;
DECLARE
 retVal BINARY_INTEGER;
BEGIN
  retVal := prvt_smgutil.prvt_pack_enabled(2, 7445);
    dbms_output.put_line(retVal);
END;
/
1

PL/SQL procedure successfully completed.
 
VALIDATE_ARG_LEN
Undocumented prvt_smgutil.validate_arg_len(
p_value IN VARCHAR2,
p_name  IN VARCHAR2,
p_len   IN NUMBER);
exec prvt_smgutil.validate_arg_len('TEST', 'MORGAN', 1);
BEGIN prvt_smgutil.validate_arg_len('TEST', 'MORGAN', 1); END;
*
ERROR at line 1:
ORA-13723: input value for procedure argument MORGAN exceeds maximum allowed length of 1
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.PRVT_SMGUTIL", line 137
ORA-06512: at line 1


-- note that the following is also a violation of ORA-13723
-- likely an invalid exception message as a P_LEN of 3 also fails


exec prvt_smgutil.validate_arg_len('TEST', 'MORGAN', 4);

PL/SQL procedure successfully completed.

Related Topics
Built-in Functions
Built-in Packages
Database Security
What's New In 21c
What's New In 23c

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2023 Daniel A. Morgan All Rights Reserved
  DBSecWorx