Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Working with Database Objects » Working with views » Working with materialized views

Refreshing materialized views Next Page

Encrypting and decrypting materialized views


Materialized views can be encrypted for additional security. For example, if a materialized view contains data that was encrypted in the underlying table, you may want to encrypt the materialized view as well. Table encryption must already be enabled in the database in order to encrypt a materialized view. The encryption algorithm and key specified at database creation are used to encrypt the materialized view. To see the encryption settings in effect for your database, including whether table encryption is enabled, query the Encryption database property using the DB_PROPERTY function, as follows:

SELECT DB_PROPERTY( 'Encryption' );

As with table encryption, encrypting a materialized view can impact performance since the database server must decrypt data it retrieves from the view.

To encrypt a materialized view (Sybase Central)
  1. Connect to the database as the DBA.

  2. Open the Views folder and right-click the materialized view.

  3. Select Properties.

    The Properties page for the materialized view displays.

  4. On the Miscellaneous tab, place a checkmark next to View data is encrypted, and then choose OK.

To decrypt a materialized view (Sybase Central)
  1. Connect to the database as the DBA.

  2. Open the Views folder and right-click the materialized view.

  3. Select Properties.

    The Properties page for the materialized view displays.

  4. On the Miscellaneous tab, remove the checkmark next to View data is encrypted, and then choose OK.

To encrypt a materialized view (SQL)
  1. Connect to the database as the DBA, or as owner of the materialized view.

  2. Execute an ALTER MATERIALIZED VIEW statement using the ENCRYPTED clause.

  3. To decrypt a materialized view (SQL)
    1. Connect to the database as the DBA, or as owner of the materialized view.

    2. Execute an ALTER MATERIALIZED VIEW statement using the NOT ENCRYPTED clause.

    3. Examples

      The following statement encrypts the EmployeeConfidential materialized view. Note that the database must already be configured to allow encrypted tables for this statement to work:

      ALTER MATERIALIZED VIEW EmployeeConfidential ENCRYPTED;

      The following statement decrypts the EmployeeConfidential materialized view:

      ALTER MATERIALIZED VIEW EmployeeConfidential NOT ENCRYPTED;
      See also