"I spent my entire adult life looking out for the well-being, the training, the equipping of the troops for whom I was responsible.
I will not be lectured about what our military needs by a five-deferment draft dodger,"
~ Sen. Tammy Duckworth
Sqltune internal utility procedures and functions that do not access dictionary objects. Some of these utilities are called as part of upgrade and downgrade scripts.
-- This record represents a remote context with db link to a remote db.
-- The remote context is required when executing a remote query.
TYPE sqltune_remote_ctx IS RECORD (
db_link_to VARCHAR2(4000) := NULL); -- db link to a remote db
-- global variables for remote contexts
Returns TRUE if this is the root container of a CDB or FALSE is returned for PDBs and for non-CDB
con_name OUT VARCHAR2,
con_id OUT NUMBER)
conn / as sysdba
IF dbms_sqltune_util0.cdb_is_root(cname, cid) THEN
dbms_output.put_line('ROOT: ' || cname);
dbms_output.put_line('ROOT: ' || TO_CHAR(cid));
ELSIF dbms_sqltune_util0.cdb_is_pdb(cname, cid) THEN
dbms_output.put_line('PDB: ' || cname);
dbms_output.put_line('PDB: ' || TO_CHAR(cid));
dbms_output.put_line('No Idea Where I Am');
Checks whether a user has SELECT
privilege on an object
The problem, however, is that it returns 1 even when the schema being checked does not have the SELECT privilege on the table in question.
That it is broken makes perfect sense when you realize it must be run by SYS because no privs are granted ... and ... the user_name being checked is nullable.
About the only way I would expect this to work would be with Database Vault where SYS might not have privs to a schema.
user_name IN VARCHAR2 := NULL,
object_owner IN VARCHAR2 := NULL,
object_name IN VARCHAR2,
object_type IN VARCHAR2 := NULL)
Given the value of a bind_data column in raw type this function returns the number of bind values contained in the column
dbms_sqltune_util0.get_binds_count(bind_data IN RAW) RETURN PLS_INTEGER;
WHERE is_bind_sensitive = 'Y'
AND rownum = 1;