Initializing a materialized view

Initialize a materialized view to populate it with data and make it available for use by the database server. To initialize a materialized view, you follow the same steps as refreshing a materialized view.

Prerequisites

You must have DBA authority or have INSERT permission on the materialized view. You must also have SELECT permissions on the underlying objects that the materialized view references.

Context and remarks

You can also initialize all uninitialized materialized views in the database at once using the sa_refresh_materialized_views system procedure.

 Initialize a materialized view using Sybase Central

Before creating, initializing, or refreshing materialized views, ensure that all materialized view restrictions have been met.

  1. Use the SQL Anywhere 12 plug-in to connect to the database.

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

  3. Right-click a materialized view and click Refresh Data.

  4. Select an isolation level and click OK.

Results

The materialized view is populated with data and becomes available for use by the database server. You can now query the materialized view.

Next

Query the materialized view to ensure that it returns the expected data.

A failed initialization (refresh) attempt returns the materialized view to an uninitialized state. If this occurs, review the definition for the materialized view to confirm that the underlying tables and columns specified are valid and available objects in your database.

 See also