Distributed Databases   «Prev  Next»

Lesson 9 Snapshot security
Objective Implement Materialized View Replication in Oracle 23c

Administering Materialized View Replication Security

In "Oracle 23c", the concept of snapshot replication has evolved significantly, with Materialized Views (MVs) replacing the older terminology and functionality of snapshots. Although the underlying concept remains similar, replicating data between master and remote sites, Oracle 23c incorporates 1) stronger security models, 2) more automation, and 3) enterprise-grade replication mechanisms such as Oracle GoldenGate and DBMS_MVIEW[1] package enhancements.

πŸ” Materialized View Security in Oracle 23c

In Oracle Database 23c, materialized views are "physical database objects" that store the results of a query, offering performance benefits by caching data for replication or data warehousing. The security of materialized views is critical because they contain potentially sensitive data derived from master tables, which may be located remotely or locally. The primary theory behind materialized view security revolves around controlling access to the data they store and ensuring that only authorized users can view or manipulate it. This is achieved through a combination of 1) privilege management, 2) query-based data filtering, and 3) integration with Oracle’s robust security framework, which include
  1. roles,
  2. privileges, and
  3. Virtual Private Database (VPD)[2]
policies. By restricting access to the defining query's result set, materialized views inherently limit exposure of sensitive data, as users can only see data that satisfies the view’s query, aligning with the principle of least privilege.
  • Privilege-Based Access Control and Data Subsetting: A core aspect of materialized view security in Oracle 23c is the granular control over privileges required to create, access, or refresh these views. To create a materialized view, users need the CREATE MATERIALIZED VIEW privilege, and if the view is in another schema, the CREATE ANY MATERIALIZED VIEW privilege is required, along with access to the master tables via READ or SELECT privileges. For refresh-on-commit views, additional privileges like ON COMMIT REFRESH are necessary. This privilege model ensures that only authorized users can define or update materialized views. Furthermore, materialized views can be subsetted using a WHERE clause in the defining query, which restricts the data propagated to the view. This subsetting not only reduces network traffic and storage but also enhances security by ensuring users only access data relevant to their role or task, effectively implementing data masking at the view level. For example, a materialized view might only include customer data for a specific region, preventing exposure of other sensitive records.
  • Integration with Advanced Security Features: Oracle 23c enhances materialized view security by integrating with advanced features like VPD and encryption. VPD allows dynamic, policy-based row-level access control, where security policies attached to the master tables or the materialized view itself restrict data visibility based on user context (e.g., role, department, or location). This ensures that even if a user has access to the materialized view, they only see rows permitted by the VPD policy, adding a layer of runtime security. Additionally, Oracle’s Transparent Data Encryption (TDE) can be applied to the tablespaces storing materialized views, protecting data at rest from unauthorized access. In replication environments, materialized views often serve as read-only replicas, and Oracle 23c ensures secure data transmission using encrypted database links. These mechanisms collectively ensure that materialized views not only optimize performance but also adhere to stringent security requirements, safeguarding sensitive data against unauthorized access or breaches in distributed or data warehousing scenarios.


Comparison and modern implementation of snapshot security in Oracle 23c

Here is a comparison and modern implementation of snapshot security in Oracle 23c based on the Oracle 8i model.
βœ… What Still Holds True (From Oracle 8i):
  • Security can still be managed via trusted vs untrusted models.
  • You still define database links, replication accounts, and user privileges.
  • Materialized view refresh operations rely on roles like administrator, propagator, and refresher, although implemented with updated package APIs.

πŸ”„ Modern Oracle 23c Equivalent: Implementation Steps
  1. Use Materialized Views Instead of Snapshots
    • All snapshot terminology is deprecated. Use:
      CREATE MATERIALIZED VIEW ...
      
    • Use fast refresh, complete refresh, or on-demand refresh options.
  2. User Roles and Privileges
    Role Oracle 23c Privileges / Roles
    MV Administrator DBMS_MVIEW, DBA_MVIEWS, DBA_REFRESH, DBMS_MVIEW_ANALYSIS
    Propagator (if using Streams/Queue) DBMS_SCHEDULER, AQ_ADMINISTRATOR_ROLE or GoldenGate-based roles
    Remote MV Site Refresher CREATE MATERIALIZED VIEW, ALTER, EXECUTE ON DBMS_MVIEW
  3. Database Links
    Define secure, dedicated DB links:
    CREATE DATABASE LINK master_site_link
      CONNECT TO mv_admin IDENTIFIED BY password
      USING 'masterdb';
    

Use 1)wallet-based authentication or 2) TCPS (SSL-encrypted) for modern secure links.

In Oracle 23c, both wallet-based authentication and TCPS (SSL-encrypted communication) are essential for secure database links and client/server interactions, but they serve distinct purposes in the overall security architecture.
Here's a breakdown of the two:
1. πŸ” Wallet-Based Authentication
Purpose:Manages credentials (passwords, certificates, keys) securely in an Oracle Wallet instead of storing them in clear text in scripts or DB links.
  • Key Features:- Stores:
    • User credentials (for proxy authentication)
    • Certificates (for SSL/TLS handshake)
    • Private keys
  • Prevents hardcoding passwords in CREATE DATABASE LINK statements.
  • Used with:
    • Secure External Password Store (SEPS)
    • SSL/TLS for client verification
    • Mutual authentication setups
  • Wallets are usually located at:

$ORACLE_BASE/admin//wallet

Sample Use (Secure External Password Store):
CREATE DATABASE LINK secure_link
  CONNECT TO user IDENTIFIED BY VALUES 'EXTERNAL'
  USING 'remote_db';

πŸ” Behind the scenes, Oracle fetches credentials from the wallet.
2. πŸ”— TCPS (SSL-Encrypted Communication)
Purpose:Provides end-to-end encrypted communication between Oracle clients and servers using the SSL/TLS protocol.
Key Features:
  • Uses TCPS (SSL over TCP) in tnsnames.ora and listener.ora.
  • Requires certificates stored in a wallet (server and optionally client).
  • Ensures:
    • Data encryption in transit
    • Optional client authentication
    • Protection against man-in-the-middle (MITM) attacks

Sample `tnsnames.ora` Entry Using TCPS:
REMOTE_DB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCPS)(HOST = remote.host)(PORT = 2484))
    (CONNECT_DATA = (SERVICE_NAME = remotedb_service))
    (SECURITY = (SSL_SERVER_CERT_DN = "CN=remotehost"))
  )

πŸ“Œ Summary: Side-by-Side Comparison
Feature Wallet-Based Authentication TCPS (SSL-Encrypted) Communication
Main Use Credential storage Encrypted network traffic
Security Goal Avoid hardcoded passwords Prevent eavesdropping and MITM attacks
Stores Passwords, Certs, Keys Certs, Keys (used during SSL handshake)
Oracle Component Secure External Password Store (SEPS) Oracle Net Services, Listener
Required for Proxy-authenticated DB links, TLS auth TCPS connections
Used In sqlnet.ora, orapki, DB links tnsnames.ora, listener.ora, TCPS entries
πŸ”§ Trusted[3] vs. Untrusted[4] Model in Oracle 23c
  • πŸ”’ Trusted MV Security (23c)
    • A centralized admin user has full access across all replication components.
    • Enables centralized refresh and fast deployment.
    • Use for internal or secure LAN environments.
    • Typically used with fast refresh via DBMS_MVIEW.REFRESH.
  • πŸ›‘οΈ Untrusted MV Security (23c)
    • Each materialized view site has its own admin and refresh control.
    • DB links restricted to schema-level access using minimal privileges.
    • Useful for multi-tenant, cross-domain, or partner site replication.
    • May involve refresh groups with tight access control:
        BEGIN
      	DBMS_REFRESH.MAKE(
      	  name => 'remote_group',
      	  list => 'remote_schema.mv1, remote_schema.mv2',
      	  next_date => SYSDATE,
      	  interval => 'SYSDATE + 1/24',
      	  implicit_destroy => TRUE,
      	  rollback_seg => NULL,
      	  push_deferred_rpc => TRUE,
      	  refresh_after_errors => TRUE
      	);
        END;
      

πŸ“¦ Replication Tools in 23c
Tool / Method Use Case
DBMS_MVIEW Primary API for MV refresh and management
Oracle GoldenGate For real-time, high-volume replication with secure separation
Data Pump + MV Instantiation Modern equivalent of export/import instantiation
DBMS_REPCAT / Advanced Replication Deprecated, replaced by GoldenGate and MView replication

πŸ“Œ Summary
Feature Oracle 8i Oracle 23c Modern Equivalent
Snapshot Snapshot Materialized View
Replication security model Trusted/Untrusted Trusted/Untrusted (via roles, network isolation)
DB link auth Plaintext login TCPS + Wallet/Proxy Auth
Replication APIs DBMS_REPCAT, Replication Manager DBMS_MVIEW, GoldenGate, Data Pump
Admin functions Manual grants Role-based + API-based refresh control

Replication Concepts - Quiz


Click the Quiz link below to test your understanding of replication concepts.
Replication Concepts - Quiz
[1] DBMS_MVIEW: Within the context of Oracle Materialized Views, `DBMS_MVIEW` is a PL/SQL package that provides a set of procedures and functions for managing and administering materialized views. It allows database administrators and developers to perform tasks such as creating, refreshing, dropping, and querying the metadata of materialized views.
[2] Oracle's Virtual Private Database (VPD): Oracle's Virtual Private Database (VPD) is a security feature that dynamically adds a WHERE clause to SQL statements, effectively restricting user access to specific data based on their identity or other criteria. It provides fine-grained access control at the row level, enhancing security and data integrity.
[3] Trusted: A security model in which an administrator has access privileges to local and remote sites.
[4] Untrusted: A security model in which an administrator has access privileges only to the local site.

SEMrush Software 9 SEMrush Banner 9