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
firstname.lastname@example.org. Request a Workshop for
your organization today.
Intended for use with RAC, and not part of the
default installation, provides mechanism for applications to view and
compile cursors in the local library cache using cursors selected from the
library cache on a remote instance.
Owned by SYS with EXECUTE granted to PUBLIC.
According to the docs the session executing the code must have the SELECT_CATALOG_ROLE role as well as the ability to ALTER the target schema and a valid database link to the same user in the source schema. So why is execute granted to PUBLIC? I have no idea.
I suspect no one at Oracle does either.
-- In 126.96.36.199 we wrote the following: Attempting to compile this package using dbmslibc.sql produces the following errors:
98/20 PLS-00201: identifier 'DBMS_LIBCACHE$DEF.DB_LINK' must be declared
160/3 PL/SQL: Declaration ignored
161/19 PLS-00201: identifier 'DBMS_LIBCACHE$DEF.DB_LINK' must be declared
-- you must run catlibc.sql before attempting to install this package.
The database link parameter is mandatory and points to the instance that will be used for extracting the SQL statements. The user must have the role SELECT_ON_CATALOG at the source instance.
For improved security, the connection may use a password file or LDAP authentication. The database link is mandatory only for releases with dbms_libcache$def.ACCESS_METHOD = DB_LINK_METHOD.
-- as of 188.8.131.52 things get worse and as this is package has not been maintained since 2001 it will stay in the Library
-- but be sure to test it thoroughly before depending upon any of its functionality
Warning: Package created with compilation errors.
SP2-0310: unable to open file "prvtlibc.plb"
-- attempting to compile the two parts separately also fails and results in the following:
SQL> SELECT object_name, object_type, status
2 FROM cdb_objects
3 WHERE object_name LIKE '%DBMS_LIBCACHE%';
Call when the library cache on the source instance is stable, and whenever the target library cache is restarted
p_db_link IN dbms_libcache$def.db_link%type,
p_username IN VARCHAR2 DEFAULT NULL,
p_threshold_executions IN NATURAL DEFAULT 3,
p_threshold_sharable_mem IN NATURAL DEFAULT 1000,
p_parallel_degree IN NATURAL DEFAULT 1);
-- prepares the database's library cache exec dbms_libcache.compile_from_remote('CACHELINK');
-- prepares the library cache for a named schema's entries exec dbms_libcache.compile_from_remote('CACHELINK', 'UWCLASS');
-- prepares the library cache for a named schema's statements with greater than 10 executions exec dbms_libcache.compile_from_remote('CACHELINK', 'UWCLASS', 10);
-- as above but additionally specifying a minimum cursor size of 4K exec dbms_libcache.compile_from_remote('CACHELINK', 'UWCLASS', 10, 4096);