Oracle DBMS_PRVTRMIE
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 General use Workspace Manager utilities.
AUTHID DEFINER
Data Types MAPPING_PRIORITIES_TYPE
Dependencies
DBMS_ASSERT DBMS_RMGR_PACT_EXPORT RESOURCE_MAPPING_PRIORITY$
DBMS_RESOURCE_MANAGER DBMS_RMGR_PLAN_EXPORT RESOURCE_PLAN$
DBMS_RMGR_GROUP_EXPORT RESOURCE_CONSUMER_GROUP$ RESOURCE_PLAN_DIRECTIVE$
DBMS_RMGR_LIB RESOURCE_GROUP_MAPPING$  
Documented No
First Available 12.1
Security Model Owned by SYS with no privileges granted
Source {ORACLE_HOME}/rdbms/admin/prvtrmie.plb
{ORACLE_HOME}/rdbms/admin/prvtrmin.plb
Subprograms
 
APPEND_BOOLEAN_ARG
Undocumented dbms_prvtrmie.append_boolean_arg(
sql_string    IN OUT VARCHAR2,
field         IN     VARCHAR2,
value         IN     BOOLEAN,
default_value IN     BOOLEAN,
prepend_comma IN     BOOLEAN);
TBD
 
APPEND_NUMBER_ARG
Undocumented dbms_prvtrmie.append_number_arg(
sql_string    IN OUT VARCHAR2,
field         IN     VARCHAR2,
value         IN     NUMBER,
prepend_comma IN     BOOLEAN);
TBD
 
APPEND_STRING_ARG
Undocumented dbms_prvtrmie.append_string_arg(
sql_string     IN OUT VARCHAR2
field          IN     VARCHAR2,
value          IN     VARCHAR2,
replace_quotes IN     BOOLEAN,
double_quote   IN     BOOLEAN,
prepend_comma  IN     BOOLEAN);
TBD
 
BEGIN_PROCEDURE_EXPORT
Undocumented dbms_prvtrmie.begin_procedure_export(
sql_string     OUT VARCHAR2,
package        IN  VARCHAR2,
procedure_name IN  VARCHAR2);
TBD
 
CACHE_OBJ_GRANTS
Undocumented dbms_prvtrmie.cache_obj_grants(
grantee_name   IN VARCHAR2,
grantor_name   IN VARCHAR2,
consumer_group IN VARCHAR2,
grant_option   IN BINARY_INTEGER);
exec dbms_prvtrmie.cache_obj_grants('C##UWCLASS', 'SYS', 'SYS_GROUP', 0);

PL/SQL procedure successfully completed.
 
CHECK_COMPATIBILITY
Undocumented dbms_prvtrmie.check_compatibility(compatible OUT NUMBER);
DECLARE
 outVal NUMBER;
BEGIN
  dbms_prvtrmie.check_compatibility(outVal);
  dbms_output.put_line(outVal);
END;
/
1

PL/SQL procedure successfully completed.
 
CLEAR_OBJ_GRANTS
Undocumented dbms_prvtrmie.clear_obj_grants;
exec dbms_prvtrmie.clear_obj_grants;

PL/SQL procedure successfully completed.
 
END_PROCEDURE_EXPORT
Undocumented dbms_prvtrmie.end_procedure_export(sql_string IN OUT VARCHAR2);
TBD
 
GET_CONSUMER_GRP
Undocumented dbms_prvtrmie.get_consumer_grp(
bjid IN  NUMBER,
cg   OUT sys.resource_consumer_group$);
This is the first time we have ever seen this behavior. Note that the data dictionary indicates that sys.resource_consumer_group$ is a PL/SQL record.

POSITION  ARGUMENT_NAME  IN_OUT  DATA_TYPE     TYPE
--------- -------------- ------- ------------- ----------------------------
        1 objid          IN      NUMBER
        2 cg             OUT     PL/SQL RECORD sys.resource_consumer_group$

but the compilation fails as shown here:

DECLARE
 cgOut sys.resource_consumer_group$;
BEGIN
  dbms_prvtrmie.get_consumer_grp(1, cgOut);
  dbms_output.put_line(cgOut.name);
END;
/
 cgOut sys.resource_consumer_group$;
*
ERROR at line 2:
ORA-06550: line 2, column 8:
PLS-00488: 'SYS.RESOURCE_CONSUMER_GROUP$' must be a type
ORA-06550: line 0, column 0:
PL/SQL: Compilation unit analysis terminated


and a query of dba_objects shows the object to be a table not a PL/SQL record.
So how the package is compiled and valid is a mystery left for the future.
 
GET_GROUP_MAPPINGS
Undocumented dbms_prvtrmie.get_group_mappings(
mapping_rule                OUT sys.resource_group_mapping$
mapping_rule_cursor_open IN OUT PL/SQL BOOLEAN,
mapping_rule_found          OUT PL/SQL BOOLEAN);
DECLARE
 mrule sys.resource_group_mapping$; -- again this is a table ... not a type
 mrco  BOOLEAN := TRUE;
 mrfnd BOOLEAN;
BEGIN
  dbms_prvtrmie.get_group_mappings(mrule, mrco, mrfnd);
END;
/
 
GET_MAPPING_PRIORITY
Undocumented dbms_prvtrmie.get_mapping_priority(
mapping_priorities OUT sys.dbms_prvtrmie.mapping_priorities_type);
TBD
 
GET_OBJ_GRANTS
Undocumented dbms_prvtrmie.get_obj_grants(
grantee_name      OUT VARCHAR2,
grantor_name      OUT VARCHAR2,
consumer_group    OUT VARCHAR2,
grant_option      OUT BINARY_INTEGER,
state          IN OUT BOOLEAN);
DECLARE
 tee_name dbms_id;
 tor_name dbms_id;
 cons_grp dbms_id;
 groption BINARY_INTEGER;
 statevar BOOLEAN := FALSE;
BEGIN
  dbms_prvtrmie.get_obj_grants(tee_name, tor_name, cons_grp, groption, statevar);
  dbms_output.put_line(tee_name);
  dbms_output.put_line(tor_name);
  dbms_output.put_line(cons_grp);
  dbms_output.put_line(groption);
END;
/

PL/SQL procedure successfully completed.
 
GET_PLAN_DIRECTIVES
Return plan directives for the open cursor if found dbms_prvtrmie.get_plan_directives(
plandir                OUT sys.resource_plan_directive$,
plandir_cursor_open IN OUT BOOLEAN,
plandir_found          OUT BOOLEAN);
TBD
 
GET_RESOURCE_PLAN
Returns resource plans for the identified object dbms_prvtrmie.get_resource_plan(
objid IN  NUMBER,
plan  OUT sys.resource_plan$);
TBD
 
IS_SYS_MANAGED
Undocumented but while it appears to give the correct answer as shown in the demo at right ... returns FALSE when asked about sys.obj$ so it is not using "SYS_MANAGED" to mean owned by SYS. dbms_prvtrmie.is_sys_managed(objname IN VARCHAR2) RETURN BOOLEAN;
BEGIN
  IF dbms_prvtrmie.is_sys_managed('C##UWCLASS.SERVERS') THEN
    dbms_output.put_line('T');
  ELSE
    dbms_output.put_line('F');
  END IF;
END;
/
F

PL/SQL procedure successfully completed.
 
WRAP_WITH_ERROR_HANDLING
Undocumented dbms_prvtrmie.wrap_with_error_handling(
sql_string IN/OUT VARCHAR2
error1     IN NUMBER,
error2     IN NUMBER,
error3     IN NUMBER,
error4     IN NUMBER,
error5     IN NUMBER,
all_errors IN BOOLEAN);
TBD
 
WRAP_WITH_EXECUTE_IMMEDIATE
This is positively brilliant. It may be undocumented and unsupported but we plan to start using it in a lot of the code we write for maintenance purposes (not in applications). dbms_prvtrmie.wrap_with_execute_immediate(sql_string IN/OUT VARCHAR2);
DECLARE
 sqlStr dbms_id := 'DROP TABLE ZZYZX';
BEGIN
  dbms_prvtrmie.wrap_with_execute_immediate(sqlStr);
  dbms_output.put_line(sqlStr);
END;
/
begin execute immediate 'begin DROP TABLE ZZYZX; end;'; exception when others then NULL; end;

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