4

Having simple refresh script:

BEGIN 
DBMS_SNAPSHOT.REFRESH(
  LIST => 'SCHEMA_NAME.TABLE_NAME', 
  PUSH_DEFERRED_RPC => TRUE, 
  REFRESH_AFTER_ERRORS => FALSE, 
  PURGE_OPTION => 1, 
  PARALLELISM => 0, 
  ATOMIC_REFRESH => TRUE, 
  NESTED => FALSE); 
END;

Oracle argues that:

ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2251
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2457
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2426
ORA-06512: at line 2
00942. 00000 -  "table or view does not exist"

Question: what am I missing?

Note:

  • Refreshed MV does exist
  • if schema is not specified result is the same
Denys S.
  • 6,358
  • 12
  • 43
  • 65

2 Answers2

2

That is a common case of view, depending on some other tables or views (which might depend on other data), having broken dependencies. In this particular case the view depended on other view which depended on a table which was missing a column. Thanx to Frosty Z for giving a hint.

Community
  • 1
  • 1
Denys S.
  • 6,358
  • 12
  • 43
  • 65
1

I have read elsewhere that performing a

ALTER MATERIALIZED VIEW schema_name.table_name COMPILE;

can fix this issue.

it didn't work for me and i have to drop and re-create the materialized view completely.

ShoeLace
  • 3,476
  • 2
  • 30
  • 44