Advanced: Changing refresh type for a materialized view

When you create a materialized view its refresh type is manual. However, you can change it to immediate. You can also change an immediate view back to manual again.

Prerequisites

You must be a user with DBA authority or be the owner of the view and all of the tables it references.

To change from manual to immediate, the view must be in an uninitialized state (contain no data). If the view was just created and has not yet been refreshed, it is uninitialized. If the materialized view has data in it, you must execute a TRUNCATE statement on it to return it to an uninitialized state before you can change it to immediate. The materialized view must also have a unique index, and must conform to the restrictions required for an immediate view.

An immediate view can be changed to manual at any time without any additional steps other than changing its refresh type.

Context and remarks

Many.

 Change the refresh type of 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. Right-click the materialized view and click Properties.

  4. To change a manual view to an immediate view, in the Refresh Type field, click Immediate.

  5. To change an immediate view to a manual view, in the Refresh Type field, click Manual.

  6. Click OK.

Results

The refresh type of the materialized view is changed. Immediate views are updated whenever there are changes to the data in the underlying objects. Manual views are updated whenever you refresh them.

Next

After you change a view from manual to immediate, the view must be initialized (refreshed) to populate it with data.

 See also