Oracle BSLN_INTERNAL
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 Performance Tuning Baseline Related Utilities
AUTHID DEFINER
Dependencies
BSLN DBA_HIST_BASELINE DBMS_STANDARD
BSLN_BASELINES DBA_HIST_BASELINE_METADATA GV_$INSTANCE
BSLN_METRIC_DEFAULTS DBA_HIST_DATABASE_INSTANCE PLITBLM
BSLN_OBSERVATION_SET DBA_HIST_SNAPSHOT USER_JOBS
BSLN_OBSERVATION_T DBA_HIST_SYSMETRIC_SUMMARY V_$DATABASE
BSLN_STATISTICS DBA_HIST_WR_CONTROL V_$INSTANCE
BSLN_STATISTICS_SET DBA_THRESHOLDS V_$METRICNAME
BSLN_STATISTICS_T DBMS_JOB V_$PARAMETER
BSLN_THRESHOLD_PARAMS DBMS_MANAGEMENT_PACKS WRH$_SYSMETRIC_HISTORY
BSLN_TIMEGROUPS DBMS_OUTPUT WRH$_SYSMETRIC_SUMMARY
BSLN_VARIANCE_SET DBMS_SERVER_ALERT WRM$_BASELINE
BSLN_VARIANCE_T    
Documented No
Exceptions
Error Code Reason
ORA-20106 Baseline not found
First Available Not known
Security Model Owned by DBSNMP with EXECUTE granted to the OEM_MONITOR role
Source {ORACLE_HOME}/rdbms/admin/prvtblid.plb
{ORACLE_HOME}/rdbms/admin/prvtblib.plb
Subprograms
 
ALLOW_DROP
Undocumented bsln_internal.allow_drop(
baseline_id   IN NUMBER,
baseline_name IN VARCHAR2,
dbid          IN NUMBER)
RETURN BOOLEAN;
TBD
 
BASELINE_REC
Undocumented bsln_internal.baseline_rec(bsln_guid_in IN RAW) RETURN dbsnmp.bsln_baselines;
TBD
 
COMPUTE_LOAD_MAS
Undocumented bsln_internal.compute_load_mas(
bsln_guid_in    IN RAW,
compute_date_in IN DATE);
TBD
 
COMPUTE_LOAD_MES_TG
Undocumented bsln_internal.compute_load_mes_tg(
bsln_guid_in    IN RAW,
compute_date_in IN DATE);
TBD
 
COMPUTE_LOAD_MES_XX
Undocumented bsln_internal.compute_load_mes_xx(
bsln_guid_in    IN RAW,
compute_date_in IN DATE);
TBD
 
COMPUTE_STATISTICS
Undocumented bsln_internal.compute_statistics(
baseline_id_in   IN NUMBER,
instance_name_in IN VARCHAR2,
dbid_in          IN NUMBER);
TBD
 
DEDUCED_TIMEGROUPING
Undocumented bsln_internal.deduced_timegrouping(bsln_guid_in IN RAW) RETURN VARCHAR2;
TBD
 
DEDUCE_TIMEGROUPINGS
Undocumented bsln_internal.deduce_timegroupings(
compute_date_in IN DATE,
dbid_in         IN NUMBER);
exec dbsnmp.bsln_internal.deduce_timegroupings(SYSDATE, dbsnmp.bsln_internal.this_dbid);

PL/SQL procedure successfully completed.
 
DELETE_BSLN_JOBS
Presumably deletes some BSLN jobs, but definitely not the one in the demo at right bsln_internal.delete_bsln_jobs;
SELECT job_name
FROM dba_scheduler_jobs
WHERE job_name LIKE '%BSLN%';

JOB_NAME
------------------------
BSLN_MAINTAIN_STATS_JOB


exec dbsnmp.bsln_internal.delete_bsln_jobs;

PL/SQL procedure successfully completed.

SELECT job_name
FROM dba_scheduler_jobs
WHERE job_name LIKE '%BSLN%';

JOB_NAME
------------------------
BSLN_MAINTAIN_STATS_JOB
 
ELECTED_TIMEGROUPING
Undocumented bsln_internal.elected_timegrouping(
bsln_guid_in    IN RAW,
variances_in    IN dbsnmp.bsln_variance_set,
summary_size_in IN NUMBER)
RETURN VARCHAR2;
TBD
 
HOUR_OF_WEEK
Undocumented bsln_internal.hour_of_week(date_in IN DATE) RETURN BINARY_INTEGER;
SELECT dbsnmp.bsln_internal.hour_of_week(SYSDATE)
FROM dual;

DBSNMP.BSLN_INTERNAL.HOUR_OF_WEEK(SYSDATE)
------------------------------------------
                                       154
 
IN_EFFECT_THRESHOLD_REC
Undocumented bsln_internal.in_effect_threshold_rec(
dbid_in          IN NUMBER,
instance_name_in IN VARCHAR2,
metric_id_in     IN NUMBER)
RETURN dbsnmp.bsln_threshold_params;
TBD
 
LOAD_DAY_OFFSETS
Undocumented bsln_internal.load_day_offsets;
exec dbsnmp.bsln_internal.load_day_offsets;

PL/SQL procedure successfully completed.
 
MAINTAIN_STATISTICS
Undocumented bsln_internal.maintain_statistics(dbid_in IN NUMBER);
exec dbsnmp.bsln_internal.maintain_statistics(dbsnmp.bsln_internal.this_dbid);

PL/SQL procedure successfully completed.
 
MAINTAIN_THRESHOLDS
Undocumented bsln_internal.maintain_thresholds;
exec dbsnmp.bsln_internal.maintain_thresholds;

PL/SQL procedure successfully completed.
 
MES_TG
Undocumented bsln_internal.mes_tg(
baseline_id_in   IN NUMBER,
timegrouping_in  IN VARCHAR2,
compute_date_in  IN DATE,
begin_snap_id_in IN NUMBER,
end_snap_id_in   IN NUMBER,
instance_name_in IN VARCHAR2,
dbid_in          IN NUMBER)
RETURN dbsnmp.bsln_statistics_set;
TBD
 
MES_XX
Undocumented bsln_internal.mes_xx(
baseline_id_in   IN NUMBER,
compute_date_in  IN DATE,
begin_snap_id_in IN NUMBER,
end_snap_id_in   IN NUMBER,
instance_name_in IN VARCHAR2,
dbid_in          IN NUMBER)
RETURN dbsnmp.bsln_statistics_set;
TBD
 
METRIC_SIGNAL_QUALITIES
Undocumented bsln_internal.metric_signal_qualities(
reference_time_in IN DATE,
observations_in   IN dbsnmp.bsln_observation_set,
statistics_in     IN dbsnmp.bsln_statistics_set)
RETURN dbsnmp.bsln.signal_rectype;
TBD
 
N_FIELD
Appears to return DY for DAY and NT for night bsln_internal.n_field(hour_of_week_in IN BINARY_INTEGER) RETURN VARCHAR2;
DECLARE
 retVal VARCHAR2(10);
BEGIN
  FOR i IN 0 .. 167 LOOP
    IF MOD(i, 12) = 0 THEN
      SELECT TO_CHAR(i) || '-' || dbsnmp.bsln_internal.n_field(i)
      INTO retVal
      FROM dual;

      dbms_output.put_line(retVal);
    END IF;
  END LOOP;
END;
/
0-NT
12-DY
24-NT
36-DY
48-NT
60-DY
72-NT
84-DY
96-NT
108-DY
120-NT
132-DY
144-NT
156-DY

PL/SQL procedure successfully completed.
 
SET_ALL_THRESHOLDS
Undocumented

It appears the guid must be a specific guid and not just a random one
bsln_internal.set_all_thresholds(bsln_guid_in IN RAW);
exec dbsnmp.bsln_internal.set_all_thresholds(SYS_GUID());
BEGIN dbsnmp.bsln_internal.set_all_thresholds(SYS_GUID()); END;
*
ERROR at line 1:
ORA-20106: Baseline not found
ORA-06512: at "DBSNMP.BSLN_INTERNAL", line 454
ORA-06512: at "DBSNMP.BSLN_INTERNAL", line 178
ORA-06512: at line 1
 
SET_BASELINE_METRIC_THRESHOLD
Undocumented bsln_internal.set_baseline_metric_threshold(
bsln_rec_in  IN dbsnmp.bsln_baselines,
metric_id_in IN NUMBER);
TBD
 
SET_LAST_COMPUTE_DATE
Undocumented bsln_internal.set_last_compute_date(
ompute_date_in IN DATE,
bsln_guid_in   IN RAW);
TBD
 
SIGNAL_QUALITY_SCORE
Undocumented bsln_internal.signal_quality_score(
obs_value_in  IN NUMBER,
statistics_in IN dbsnmp.bsln_statistics_t)
RETURN NUMBER;
TBD
 
STD7
Returns an integer value for the day of the week but with Saturday equal to 0 rather than 7 bsln_internal.std7(date_in IN DATE) RETURN BINARY_INTEGER;
DECLARE
 tdate DATE;
 x     dbms_id;
 y     PLS_INTEGER;
 z     PLS_INTEGER;
BEGIN
  FOR d IN 1..7 LOOP
  tdate := TRUNC(SYSDATE)+d;
    SELECT TO_CHAR(tdate, 'DAY'), TO_CHAR(tdate, 'D'), dbsnmp.bsln_internal.std7(tdate)
    INTO x, y, z
    FROM dual;
    dbms_output.put_line(RPAD(x, 9, ' ') || ' - ' || 'y' || ' - ' || z);
  END LOOP;
END;
/
SATURDAY  - y - 0
SUNDAY    - y - 1
MONDAY    - y - 2
TUESDAY   - y - 3
WEDNESDAY - y - 4
THURSDAY  - y - 5
FRIDAY    - y - 6
 
THIS_DBID
Returns the DBID of the current Oracle Database

Equivalent to querying dbid from v$database
bsln_internal.this_dbid RETURN NUMBER;
-- also see the DEDUCE_TIMEGROUPINGS and MAINTAIN_STATISTICS demos above

SELECT dbsnmp.bsln_internal.this_dbid
FROM dual;

 THIS_DBID
----------
1863203691
 
THIS_INSTANCE_NAME
Returns the name of the connected Oracle Database instance bsln_internal.this_instance_name RETURN VARCHAR2;
SELECT dbsnmp.bsln_internal.this_instance_name
FROM dual;

THIS_INSTANCE_NAME
-------------------
orabasexxi
 
THRESHOLD_REC
Undocumented bsln_internal.threshold_rec(
bsln_guid_in IN RAW,
metric_id_in IN NUMBER)
RETURN dbsnmp.bsln_threshold_params;
TBD
 
UNSET_ALL_THRESHOLDS
Undocumented bsln_internal.unset_all_thresholds(bsln_guid_in IN RAW);
TBD
 
UNSET_THRESHOLD
Undocumented bsln_internal.unset_threshold(
instance_name_in IN VARCHAR2,
metric_id_in     IN NUMBER);
TBD
 
W_FIELD
Undocumented bsln_internal.w_field(hour_of_week_in IN BINARY_INTEGER) RETURN VARCHAR2;
SELECT dbsnmp.bsln_internal.w_field(18)
FROM dual;

DBSNMP.BSLN_INTERNAL.W_FIELD(38)
--------------------------------
WE


SELECT dbsnmp.bsln_internal.w_field(150)
FROM dual;

DBSNMP.BSLN_INTERNAL.W_FIELD(38)
--------------------------------
WD

Related Topics
Built-in Functions
Built-in Packages
Database Security
BSLN
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-2021 Daniel A. Morgan All Rights Reserved
  DBSecWorx