Class OracleDatabaseStatsExtractor

java.lang.Object
org.odpi.openmetadata.frameworks.auditlog.AuditLoggingBase
org.odpi.openmetadata.adapters.connectors.oracle.survey.OracleDatabaseStatsExtractor

public class OracleDatabaseStatsExtractor extends AuditLoggingBase
OracleDatabaseStatsExtractor gathers the same measurements as the PostgreSQL equivalent (org.odpi.openmetadata.adapters.connectors.postgres.survey.PostgresDatabaseStatsExtractor) but sources them from Oracle Database's data dictionary views (v$pdbs, cdb_data_files, all_users, all_tables, all_views, all_mviews, all_tab_columns, all_tab_col_statistics, all_tab_histograms, all_tab_modifications, dba_segments) instead of pg_catalog. All of these sources are metadata/statistics only - no user data is read. The database-level connection is to the CDB root (for the cross-PDB size lookup); the schema-level connection is to a specific pluggable database (PDB), which is the point at which the ALL_* data dictionary views become scoped to that one container.

The connections passed to it are expected to be in auto-commit mode, so that every query is its own short transaction. Oracle has no aborted-transaction state like PostgreSQL, but a long-running transaction still pins undo for its read-consistent snapshot, risking ORA-01555 (snapshot too old) on a busy server. Each schema is surveyed with its own set of queries, and a query that fails is logged and skipped, so one inaccessible schema or dropped table leaves a gap in the results rather than ending the survey.

Oracle JDBC rejects a trailing ';' on a plain SQL statement, so none of the statements here have one.
  • Constructor Details

    • OracleDatabaseStatsExtractor

      public OracleDatabaseStatsExtractor(List<String> validDatabases, SurveyActionServiceConnector surveyActionServiceConnector)
      Constructor sets up the list of pluggable databases to process and the connection to the database. Every schema in those databases is surveyed.
      Parameters:
      validDatabases - list of pluggable database (PDB) names
      surveyActionServiceConnector - calling connector
    • OracleDatabaseStatsExtractor

      public OracleDatabaseStatsExtractor(List<String> validDatabases, List<String> excludedSchemas, List<String> includedSchemas, SurveyActionServiceConnector surveyActionServiceConnector, AuditLog auditLog, String surveyActionServiceName)
      Constructor sets up the list of pluggable databases to process, the schemas within them to survey, and the connection to the database.
      Parameters:
      validDatabases - list of pluggable database (PDB) names
      excludedSchemas - schemas to leave out (null means none are excluded)
      includedSchemas - the only schemas to survey (null means all that are not excluded); takes precedence over excludedSchemas
      surveyActionServiceConnector - calling connector
      auditLog - logging destination for queries that fail (may be null)
      surveyActionServiceName - name of the calling survey action service, for the audit log