Enabling or disabling a materialized view

You can control whether a materialized view is available for querying by enabling and disabling it.

Prerequisites

You must have DBA authority or be the owner of the materialized view.

Context and remarks

Many.

 Enable or disable a materialized view using Sybase Central
  1. Use the SQL Anywhere 12 plug-in to connect to the database.

  2. In the left pane, double-click Views.

  3. To enable a materialized view:

    1. Right-click the view and click Recompile And Enable.

    2. (optional) Right-click the view and click Refresh Data to populate the view with data. This step is optional because the first query after enabling would also cause the view to be populated with data.

  4. To disable a materialized view, right-click the view and click Disable.

Results

When you enable a materialized view, it becomes available for use by the database server and you can query it.

When you disable a materialized view, the data and indexes are dropped. If the view was an immediate view, it is changed to a manual view.

Querying a disabled materialized view fails and returns and error.

Next

After you re-enable a view, you must rebuild any indexes for it, and change it back to an immediate view if it was an immediate view when it was disabled.

 See also