Oracle DBMS_RESCONFIG
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 Provides an interface to operate on the resource configuration list and to retrieve listener information for a resource
AUTHID CURRENT_USER
Constants
Name Data Type Value
APPEND_RECURSIVE NUMBER 2
APPEND_RESOURCE NUMBER 1
DELETE_RECURSIVE NUMBER 2
DELETE_RESOURCE NUMBER 1
Dependencies
DBMS_RC_LIB PLITBLM XDB$STRING_LIST_T
DBMS_XDB_UTIL RESOURCE_VIEW XMLTYPE
EQUAL_PATH XDB$RCLIST_V  
Documented Yes: Packages and Types Reference
First Available 10.2
Related System Privileges XDBADMIN
Security Model Owned by XDB with EXECUTE granted to PUBLIC

This is another good example of Oracle's developers not taking security as seriously as they should. All you have to do is look at the names of two of the objects, DeleteRepositoryResConfig and DeleteResConfig to know that this should not be available to someone whose only privilege is CREATE SESSION.
Source {ORACLE_HOME}/rdbms/admin/dbmsxrc.sql
Subprograms
 
ADDREPOSITORYRESCONFIG
Inserts the resource configuration specified by rcpath at the given position of the repository's configuration list. Shifts the element currently at that position (if any) and any subsequent elements to the right. dbms_resconfig.addrepositoryresconfig(
rcpath IN VARCHAR2,
pos    IN PLS_INTEGER := NULL);
exec dbms_ResConfig.AddRepositoryResConfig('/sys/xs/morgan.xml', 20);

-- see also prvthzxevents.plb
 
ADDRESCONFIG
Inserts the resource configuration specified by rcpath at the given position in the target resource's configuration list dbms_resconfig.addresconfig(
respath IN VARCHAR2,
rcpath  IN VARCHAR2,
pos     IN PLS_INTEGER := NULL);
PRAGMA SUPPLEMENTAL_LOG_DATA(deleteResConfig, AUTO);
TBD
 
APPENDRESCONFIG
Appends the resource configuration specified by rcpath to the target resource's configuration list if it is not already included in the list dbms_resconfig.appendresconfig(
respath      IN VARCHAR2,
rcpath       IN VARCHAR2,
appendOption IN PLS_INTEGER);
PRAGMA SUPPLEMENTAL_LOG_DATA(deleteResConfig, AUTO);
TBD
 
DELETEREPOSITORYRESCONFIG
Removes the configuration at the given position in the repository's configuration list. Shifts any subsequent elements to the left. Users must have XDBADMIN role to execute this. This statement is treated as if it is a DDL statement. This means the system will implicitly commit before and after this statement.

Warning: Running this statement, as shown, is destructive. Demo only.
dbms_resconfig.deleteRepositoryResConfig(pos IN PLS_INTEGER);
-- found in xse102.sql
BEGIN
  dbms_ResConfig.DeleteRepositoryResConfig(6);
  dbms_ResConfig.DeleteRepositoryResConfig(5);
  dbms_ResConfig.DeleteRepositoryResConfig(4);
  dbms_ResConfig.DeleteRepositoryResConfig(3);
  dbms_ResConfig.DeleteRepositoryResConfig(2);
  dbms_ResConfig.DeleteRepositoryResConfig(1);
  dbms_ResConfig.DeleteRepositoryResConfig(0);
END;
/
 
DELETERESCONFIG
Removes the configuration at the given position in the target resource's configuration list
Overload 1
Warning: Running this statement, as shown, is destructive. Demo only.
dbms_resconfig.deleteresconfig(
respath IN VARCHAR2,
pos     IN PLS_INTEGER);
PRAGMA SUPPLEMENTAL_LOG_DATA(deleteResConfig, AUTO);
exec dbms_resconfig.deleteresconfig('/sys/xs', 9);
Removes the configuration specified by rcpath from the target resource's configuration list. Shifts any subsequent elements to the left. Users must have write-config privilege on all affected resources to execute this.

Overload 2

Demo at right found in version 18.3.0.1 $ORACLE_HOME/rdbms/admin/nacla112.sql
dbms_resconfig.deleteresconfig(
respath      IN VARCHAR2,
rcpath       IN VARCHAR2,
deleteOption IN PLS_INTEGER);
PRAGMA SUPPLEMENTAL_LOG_DATA(deleteResConfig, AUTO);
BEGIN
  -- Delete resource config on the ACL before removing the ACL
  dbms_resconfig.deleteResConfig(r.any_path, XDB_ACL_RC, dbms_resconfig.delete_resource);
EXCEPTION
  -- It is ok if the resource config is not associated (ORA-31130) because
  -- the resource config may have been removed from the ACL
  WHEN res_cfg_not_found THEN
    NULL;
END;
 
GETLISTENERS
Returns an XML doc containing the list of listeners applicable for a given resource dbms_resconfig.getlisteners(path IN VARCHAR2) RETURN SYS.XMLType;
SELECT dbms_resconfig.getlisteners('/sys/xs') FROM dual;
 
GETREPOSITORYRESCONFIG
Returns the resource configuration at the specified position of the repository's configuration list dbms_resconfig.getRepositoryResConfig(pos IN PLS_INTEGER)
RETURN SYS.XMLType;
SELECT dbms_resconfig.getRepositoryResConfig(0)
FROM dual;
 
GETREPOSITORYRESCONFIGPATHS
Returns a list of resource configuration paths defined for the repository dbms_resconfig.getrepositoryresconfigpaths RETURN XDB$STRING_LIST_T;
SELECT * FROM TABLE(dbms_resconfig.getRepositoryResConfigPaths());

DECLARE
 out_list xdb$string_list_t := dbms_resconfig.getRepositoryResConfigPaths();
BEGIN
  FOR i in 1..out_list.COUNT LOOP
    dbms_output.put_line(out_list(i));
  END LOOP;
END;
/


-- see also xsu112.sql
 
GETRESCONFIG
Returns the resource configuration at the specified position of the target resource's configuration list dbms_resconfig.getresconfig(
respath IN VARCHAR2,
pos     IN PLS_INTEGER)
RETURN sys.XMLType;
SELECT dbms_resconfig.getresconfig('/sys/xs', 4)
FROM dual;
 
GETRESCONFIGPATHS
Returns a list of resource configuration paths defined in the target resource's configuration list dbms_resconfig.getresconfigpaths(respath IN VARCHAR2)
RETURN XDB$STRING_LIST_T;
SELECT dbms_resconfig.getresconfigpaths('/sys/xs') FROM dual;
 
Related Queries
Found in xse102.sql (in version 10.2.0.1) SELECT ANY_PATH p
FROM resource_view
WHERE under_path(RES, '/sys/xs', 1) = 1
ORDER BY depth(1) DESC;

Related Topics
Built-in Functions
Built-in Packages
DBMS_XDB
DBMS_XEVENT
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