Create a package specification with a deprecated procedure (prc_1) …
create or replace package tq84_pkg_a as
procedure prc_1; pragma deprecate(prc_1, 'Don''t use tq84_pkg_a.prc_1, use prc_2');
procedure prc_2;
end tq84_pkg_a;
/
Enable PL/SQL warnings (specifically 6020) and recompile the package:
alter session set plsql_warnings='enable:(6019, 6020, 6021, 6022)';
alter package tq84_pkg_b compile;
--
-- SP2-0809: Package altered with compilation warnings
show errors package body tq84_pkg_b;
-- LINE/COL ERROR
-- -------- -----------------------------------------------------------------
-- 5/9 PLW-06020: reference to a deprecated entity: PRC_1 declared in
-- unit TQ84_PKG_A[3,15]. Don't use tq84_pkg_a.prc_1, user prc_2