Rebuilding Netezza view sometimes becomes necessary when the view’s source table have changed underneath the view. Rebuilding a view can be done on Netezza or in Aginity. In Aginity, it is a simple process, assume your user has permissions to create or replace a view. The process breaks down into just a few steps:
Generate the create / replace view SQL of the original view into the query window, if you don’t have it already
In the object browser:
- Navigate to the Database and view you wish to rebuild
- Select the view and right click
- Select ‘Scripts’, then ‘DDL to Query window’
Make may updates to create / replace View SQL
- This step is not always necessary, sometimes the changes which invalided the view did not actually impact the code of the view. If changes are necessary, make may updates to the SQL code.
Execute The code
- This I usually do by choosing the ‘Execute as a single batch’ option. Make sure the code executes successfully.
Verify the view
- To verify the simply execute a select statement and make it executes without errors and/or warning.