Oracle REDO_DIFF
Version 21c

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 The source code for the package specification and body are listed below but the origin of how it got into the 21.3 database, and what it is intended to accomplish, is still a mystery. That said, it is a decent piece of work and I want to thank whoever thought to put it there.
AUTHID DEFINER
Dependencies
DBMS_OUTPUT V_$SYSSTAT  
Documented No
First Available Not known
Security Model Owned by SYS with no privileges granted
Source: Formatted for clarity cd $ORACLE_HOME
grep -ir "REDO_DIFF"

did not identify a single file that contained this string.
CREATE OR REPLACE NONEDITIONABLE PACKAGE "SYS"."REDO_DIFF" AUTHID DEFINER IS
 PROCEDURE diff_it;
END redo_diff;
/

CREATE OR REPLACE NONEDITIONABLE PACKAGE BODY "SYS"."REDO_DIFF" IS
 s NUMBER;
--=========================================
FUNCTION get_size RETURN NUMBER IS
 s_ NUMBER;
BEGIN
  SELECT value
  INTO s_
  FROM sys.v_$sysstat
  WHERE name = 'redo size';
  RETURN s_;
END get_size;
--=========================================
PROCEDURE diff_it IS
 s_new NUMBER;
BEGIN
  s_new := get_size;
  dbms_output.put_line('redo diff: ' || TO_CHAR(s_new - s));
  s := s_new;
END diff_it;
--=========================================
-- intialization section
BEGIN
 s := get_size;
END redo_diff;
/
 
DIFF_IT
Reports the amount of redo generated in by the system from the time of initialization in the current session until it is rerun redo_diff.diff_it;
set serveroutput on;

exec redo_diff.diff_it;
redo diff: 0

PL/SQL procedure successfully completed.

-- do some stuff for 5 to 10 minutes then rerun

exec redo_diff.diff_it;
redo diff: 631856

PL/SQL procedure successfully completed.

Related Topics
Built-in Functions
Built-in Packages
Database Security
What's New In 19c
What's New In 20c-21c

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