Oracle DBMS_INTERNAL_LOGSTDBY
Version 18.3.0.1

General Information
Library Note Morgan's Library Page Header
Which has the higher priority in your organization: Deploying a new database or securing the ones you already have? Looking for a website, and resources, dedicated solely to securing Oracle databases? Check out DBSecWorx.
Purpose Internal support utilities for Data Guard Logical Standby Databases
AUTHID DEFINER
Dependencies
ALL_MVIEW_LOGS DBMS_DDL LOGMNR_SESSION$
ALL_OBJECTS DBMS_IJOB LOGSTDBY$APPLY_MILESTONE
AUDIT_ACTIONS DBMS_INTERNAL_SAFE_SCN LOGSTDBY$EDS_TABLES
CDEF$ DBMS_JOB LOGSTDBY$EVENTS
COL$ DBMS_LOB LOGSTDBY$HISTORY
DBA_LOGSTDBY_EDS_SUPPORTED DBMS_LOCK LOGSTDBY$PARAMETERS
DBA_LOGSTDBY_EDS_TABLES DBMS_LOGMNR_INTERNAL LOGSTDBY$SCN
DBA_LOGSTDBY_LOG DBMS_LOGSTDBY LOGSTDBY$SKIP
DBA_LOGSTDBY_PARAMETERS DBMS_LOGSTDBY_LIB LOGSTDBY$SKIP_SUPPORT
DBA_LOGSTDBY_PROGRESS DBMS_REFRESH LOGSTDBY$SKIP_TRANSACTION
DBA_LOGSTDBY_SKIP DBMS_SQL LOGSTDBY_INTERNAL
DBA_LOGSTDBY_UNSUPPORTED DBMS_STANDARD OBJ$
DBA_NESTED_TABLES DBMS_SYSTEM PRVT_COMPRESSION
DBA_OBJECT_TABLES DBMS_UTILITY SYSLSBY_EDS_DDL_TRIG
DBA_PROCEDURES DUAL TAB$
DBA_REFS IND$ TS$
DBA_TABLES INDPART$ USER$
DBA_TAB_COLS JOB$ UTL_RECOMP
DBA_USERS KUPM$MCP V$DATABASE
DBA_VIEWS KUPV$FT V$LOGSTDBY_STATE
DBMS_AQ_SYS_IMP_INTERNAL KUPV$FT_INT V$PARAMETER
DBMS_ASSERT KUPW$WORKER V$TRANSACTION
DBMS_AUDIT_MGMT LOGMNR_LOG$ X$KRVSLVST
Documented No
First Available 12.1.0
Security Model Owned by SYS with no privileges granted
Source {ORACLE_HOME}/rdbms/admin/prvtlsis.plb
Subprograms
ADD_PREFIX_ENQUOTE ENABLE_LOGICAL_REPLICATION LOCK_LSBY_META
APPLY_GET END_STREAM LSBY_LOCK_TABLE
APPLY_IS_OFF END_STREAM_SHARED LSBY_UNLOCK_TABLE
APPLY_SET ENQUOTE_QUALIFIED_COL_NAME MATCHED_PRIMARY
APPLY_STOP_NOWAIT ESCAPE_ENQUOTE_LITERAL NEED_SCN
APPLY_UNSET ESCAPE_QUOTES PARDEL
AUDDEL FGADEL PARINS
AUDINS FGAINS PARUPD
AUDUPD FGAUPD PREPARE_FOR_NEW_PRIMARY
BUILD FLUSH_SRLS PRIMARY_DBID
CANCEL_FUTURE GET_DB_ROLE PRINTLOB
CAPTURE_SCN GET_EXPORT_DML_SCN PURGE_LOGS
CHECK_SKIP_LIKE GET_OBJ_NUM REBUILD
CLEAR_LOGICAL_INSTANTIATION GET_SAFE_SCN REPAIR_LSBY
DATA_ONLY_PREREQ GUARD_BYPASS_CHK REPLACE_DICTIONARY
DISABLE_LOGICAL_REPLICATION GUARD_BYPASS_OFF REPORT_ERROR
DUMP_XDAT GUARD_BYPASS_ON RETRIEVE_STATEMENT
EDS_ADD_PREREQ GUARD_CHECK SEQUENCE_UPDATE
EDS_ADD_TABLE_FINISH HIST_READ_RECORD SEQUPD
EDS_ADD_TABLE_INT HIST_SYNCH SET_EXPORT_SCN
EDS_CHECK_EVOLVE_STARTED HIST_WRITE_RECORD_CANCEL SET_LOGICAL_INSTANTIATION
EDS_CLEANUP_METADATA HIST_WRITE_RECORD_CURRENT SET_TABLESPACE
EDS_DROP_MVIEW HIST_WRITE_RECORD_FUTURE SET_TABLE_SCN
EDS_DROP_TRIGGER HIST_WRITE_RECORD_PREVIOUS SKIP_SUPPORT
EDS_EVAL_CHANGE_VECTOR HSTDEL SKIP_TRANSACTION
EDS_EVOLVE HSTINS UNLOCK_LSBY_CON
EDS_EVOLVE_DISABLE HSTUPD UNLOCK_LSBY_META
EDS_EVOLVE_ENABLE INSTANTIATE_TAB_LOG UNSKIP_TRANSACTION
EDS_EVOLVE_TABLE_CANCEL INSTANTIATE_TAB_PREREQ UPCASE
EDS_EVOLVE_TABLE_END IS_EDS_MAINTAINED UPDATE_DYNAMIC_LSBY_OPTION
EDS_EVOLVE_TABLE_START IS_EDS_SUPPORTABLE VALIDATE_SET
EDS_GEN_MV IS_LSBY_SUPPORTABLE VALIDATE_SKIP_ACTION
EDS_GEN_TRIGGERS IS_PDB_ROOT VALIDATE_SKIP_AUTHID
EDS_GET_NAMES IS_SUPP_AND_NOTSKIP VERIFY_NOSESSION
EDS_GET_TABLESPACE JOBDEL VERIFY_SESSION
EDS_REMOVE_TABLE_FINISH JOBINS VERIFY_SESSION_LOGAUTODELETE
EDS_REMOVE_TABLE_INT JOBUPD WAIT_FOR_SAFE_SCN
EDS_USER_CURSOR LOCK_LSBY_CON  
 
APPLY_IS_OFF
Disables apply dbms_internal_logstdby.apply_is_off;
exec dbms_internal_logstdby.apply_is_off;
 
APPLY_STOP_NOWAIT
Immediate apply stop dbms_internal_logstdby.apply_stop_nowait;
exec dbms_internal_logstdby.apply_stop_nowait;
 
BUILD
Ensures supplemental logging is enabled properly and builds the LogMiner dictionary. Turns on supplemental logging automatically in 11gR2 or later. dbms_internal_logstdby.build;
exec dbms_internal_logstdby.build;
 
CANCEL_FUTURE
This is totally undocumented and I have no idea what it does but the name was just too good to allow for resistance and the syntax mindlessly simple dbms_internal_logstdby.cancel_future;
exec dbms_internal_logstdby.cancel_future;
 
CAPTURE_SCN
Undocumented dbms_internal_logstdby.capture_scn;
exec dbms_internal_logstdby.capture_scn;
BEGIN dbms_internal_logstdby.capture_scn; END;
*
ERROR at line 1:
ORA-16287: operation not permitted due to active apply state
ORA-06512: at "SYS.DBMS_INTERNAL_LOGSTDBY", line 373
ORA-06512: at line 1
 
CLEAR_LOGICAL_INSTANTIATION
Clears instantiation dbms_internal_logstdby.clear_logical_instantiation;
exec dbms_internal_logstdby.clear_logical_instantiation;
 
DISABLE_LOGICAL_REPLICATION
Poorly named ... returns the current logical replication state dbms_internal_logstdby.disable_logical_replication RETURN BOOLEAN;
See ENABLE_LOGICAL_REPLICATION below
 
DUMP_XDAT
Undocumented dbms_internal_logstdby.dump_xdat;
exec dbms_internal_logstdby.dump_xdat;
 
EDS_EVOLVE_DISABLE
Undocumented dbms_internal_logstdby.eds_evolve_disable;
exec dbms_internal_logstdby.eds_evolve_disable;
 
EDS_EVOLVE_ENABLE
Undocumented dbms_internal_logstdby.eds_evolve_enable;
exec dbms_internal_logstdby.eds_evolve_enable;
 
EDS_USER_CURSOR
Undocumented dbms_internal_logstdby.eds_user_cursor(
user_issued OUT BOOLEAN,
table_owner OUT VARCHAR2,
table_name  OUT VARCHAR2);
See {ORACLE_HOME}/rdbms/admin/catlsby.sql
 
ENABLE_LOGICAL_REPLICATION
Enables logical replication dbms_internal_logstdby.enable_logical_replication(repl_state IN BOOLEAN);
DECLARE
 retVal BOOLEAN := dbms_internal_logstdby.disable_logical_replication;
BEGIN
  IF retVal THEN
    dbms_output.put_line('TRUE');
  ELSE
    dbms_output.put_line('FALSE');
  END IF;
END;
/

exec dbms_internal_logstdby.enable_logical_replication(TRUE);

DECLARE
 retVal BOOLEAN := dbms_internal_logstdby.disable_logical_replication;
BEGIN
  IF retVal THEN
    dbms_output.put_line('TRUE');
  ELSE
    dbms_output.put_line('FALSE');
  END IF;
END;
/

exec dbms_internal_logstdby.enable_logical_replication(FALSE);

DECLARE
 retVal BOOLEAN := dbms_internal_logstdby.disable_logical_replication;
BEGIN
  IF retVal THEN
    dbms_output.put_line('TRUE');
  ELSE
    dbms_output.put_line('FALSE');
  END IF;
END;
/
 
GET_DB_ROLE
Returns the current database role

It would be interesting to know why anyone chose to do this with a proc rather than a function.
dbms_internal_logstdby.get_db_role(dbrole OUT VARCHAR2);
DECLARE
 lDBRole VARCHAR2(30);
BEGIN
  dbms_internal_logstdby.get_db_role(lDBRole);
  dbms_output.put_line(lDBRole);
END;
/
 
GET_OBJ_NUM
Return the object number for the identified table dbms_internal_logstdby.get_obj_num(
table_owner IN  VARCHAR2,
table_name  IN  VARCHAR2,
dblink      IN  VARCHAR2,
objno       OUT NUMBER);
conn / as sysdba

SELECT object_id
FROM dba_objects
WHERE object_name = 'OBJ$';

set serveroutput on

DECLARE
 objid obj$.obj#%TYPE;
BEGIN
  dbms_internal_logstdby.get_obj_num(USER, 'OBJ$', NULL, objid);
  dbms_output.put_line(TO_CHAR(objid));
END;
/
 
GET_SAFE_SCN
Appears to return the current SCN dbms_internal_logstdby.get_safe_scn(safe_scn OUT NUMBER);
DECLARE
 scnVal NUMBER;
BEGIN
  dbms_internal_logstdby.get_safe_scn(scnVal);
  dbms_output.put_line('Safe SCN: ' || TO_CHAR(scnVal));

  dbms_output.put_line('Curr SCN" ' || TO_CHAR(dbms_flashback.get_system_change_number));
END;
/
 
GUARD_BYPASS_OFF
Disable Data Guard Bypass dbms_internal_logstdby.guard_bypass_off;
exec dbms_internal_logstdby.guard_bypass_off;
 
GUARD_BYPASS_ON
Enable Data Guard Bypass dbms_internal_logstdby.guard_bypass_on;
exec dbms_internal_logstdby.guard_bypass_on;
 
GUARD_CHECK
Undocumented dbms_internal_logstdby.guard_check;
exec dbms_internal_logstdby.guard_check;
 
IS_EDS_MAINTAINED
Undocumented dbms_internal_logstdby.is_eds_maintained(
owner      IN VARCHAR2,
table_name IN VARCHAR2)
RETURN BOOLEAN;
SQL> BEGIN
  2    IF dbms_internal_logstdby.is_eds_maintained(USER, 'OBJ$') THEN
  3      dbms_output.put_line('Extended Data Type Supportable');
  4    ELSE
  5      dbms_output.put_line('Not Extended Data Type Supportable');
  6    END IF;
  7  END;
  8  /
Not Extended Data Type Supportable

PL/SQL procedure successfully completed.
 
IS_EDS_SUPPORTABLE
Extended Datatype Supportable dbms_internal_logstdby.is_eds_supportable(
owner      IN VARCHAR2,
table_name IN VARCHAR2)
RETURN BOOLEAN;
SQL> BEGIN
  2    IF dbms_internal_logstdby.is_eds_supportable(USER, 'OBJ$') THEN
  3      dbms_output.put_line('Extended Data Type Supportable');
  4    ELSE
  5      dbms_output.put_line('Not Extended Data Type Supportable');
  6    END IF;
  7  END;
  8  /
Not Extended Data Type Supportable

PL/SQL procedure successfully completed.
 
IS_LSBY_SUPPORTABLE
Is Logical Standby Supported dbms_internal_logstdby.is_lsdby_supportable(
owner      IN VARCHAR2,
table_name IN VARCHAR2)
RETURN BOOLEAN;
BEGIN
  IF dbms_internal_logstdby.is_lsby_supportable(USER, 'OBJ$') THEN
    dbms_output.put_line('Logical Standby Supportable');
  ELSE
    dbms_output.put_line('Not Logical Standby Supportable');
  END IF;
END;
/
 
IS_PDB_ROOT
Returns TRUE if the current container is CDB$ROOT otherwise appears to exit without returning FALSE dbms_internal_logstdby.is_pdb_root RETURN BOOLEAN;
conn / as sysdba

BEGIN
  IF dbms_internal_logstdby.is_pdb_root THEN
    dbms_output.put_line('Current container is CDB$ROOT');
  ELSE
    dbms_output.put_line('Current container is ' || SYS_CONTEXT('USERENV','CON_NAME'));
  END IF;
END;
/

alter session set container = 'PDBDEV';

BEGIN
  IF dbms_internal_logstdby.is_pdb_root THEN
    dbms_output.put_line('Current container is CDB$ROOT');
  ELSE
    dbms_output.put_line('Current container is ' || SYS_CONTEXT('USERENV','CON_NAME'));
  END IF;
END;
/

-- unfortunately an other example of Oracle doing EXCEPTION WHEN OTHERS THEN NULL
 
IS_SUPP_AND_NOTSKIP (new 12.2)
Undocumented dbms_internal_logstdby.is_supp_and_skip(
owner      IN VARCHAR2,
table_name IN VARCHAR2)
RETURN BOOLEAN;
SQL> BEGIN
  2    IF dbms_internal_logstdby.is_supp_and_notskip(USER, 'OBJ$') THEN
  3      dbms_output.put_line('LTRUE');
  4    ELSE
  5      dbms_output.put_line('FALSE');
  6    END IF;
  7  END;
  8  /
TRUE

PL/SQL procedure successfully completed.
 
REPLACE_DICTIONARY
Undocumented dbms_internal_logstdby.replace_dictionary;
exec dbms_internal_logstdby.replace_dictionary;
 
SET_LOGICAL_INSTANTIATION
Undocumented dbms_internal_logstdby.set_logical_instantiation;
exec dbms_internal_logstdby.set_logical_instantiation;
 
UNLOCK_LSBY_META
Undocumented dbms_internal_logstdby.unlock_lsby_meta;
exec dbms_internal_logstdby.unlock_lsby_meta;
 
UPCASE
Apparently the UPPER function was inadequate for someone dbms_internal_logstdby.upcase(inname IN VARCHAR2) RETURN VARCHAR2;
SELECT dbms_internal_logstdby.upcase('sUrElY tHiS is A JokE')
FROM dual;

SQL> SELECT dbms_internal_logstdby.upcase(123.4)
  2  FROM dual;

DBMS_INTERNAL_LOGSTDBY.UPCASE(123.4)
--------------------------------------
123.4

SQL> SELECT dbms_internal_logstdby.upcase(12a3.4)
  2  FROM dual;
SELECT dbms_internal_logstdby.upcase(12a3.4)
*
ERROR at line 1:
ORA-00907: missing right parenthesis

-- all exactly the same behaviour as the UPPER function in STANDARD
 
VERIFY_NOSESSION
Undocumented dbms_internal_logstdby.verify_nosession;
SQL> exec dbms_internal_logstdby.verify_nosession;

PL/SQL procedure successfully completed.
 
VERIFY_SESSION
Undocumented dbms_internal_logstdby.verify_session;
SQL> exec dbms_internal_logstdby.verify_session;
BEGIN dbms_internal_logstdby.verify_session; END;
*
ERROR at line 1:
ORA-16100: not a valid Logical Standby database
ORA-06512: at "SYS.DBMS_INTERNAL_LOGSTDBY", line 919
ORA-06512: at line 1

Related Topics
Built-in Functions
Built-in Packages
Data Guard
DBMS_DG
DBMS_DRS
DBMS_LOGSTDBY
What's New In 18cR3
What's New In 19cR3

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-2019 Daniel A. Morgan All Rights Reserved
  DBSecWorx