Discussions
Categories
- 385.5K All Categories
- 5.1K Data
- 2.5K Big Data Appliance
- 2.5K Data Science
- 453.4K Databases
- 223.2K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 47 Multilingual Engine
- 606 MySQL Community Space
- 486 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.2K ORDS, SODA & JSON in the Database
- 585 SQLcl
- 4K SQL Developer Data Modeler
- 188K SQL & PL/SQL
- 21.5K SQL Developer
- 46 Data Integration
- 46 GoldenGate
- 298.4K Development
- 4 Application Development
- 20 Developer Projects
- 166 Programming Languages
- 295K Development Tools
- 150 DevOps
- 3.1K QA/Testing
- 646.7K Java
- 37 Java Learning Subscription
- 37.1K Database Connectivity
- 201 Java Community Process
- 108 Java 25
- 22.2K Java APIs
- 138.3K Java Development Tools
- 165.4K Java EE (Java Enterprise Edition)
- 22 Java Essentials
- 176 Java 8 Questions
- 86K Java Programming
- 82 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 208 Java User Groups
- 25 JavaScript - Nashorn
- Programs
- 667 LiveLabs
- 41 Workshops
- 10.3K Software
- 6.7K Berkeley DB Family
- 3.6K JHeadstart
- 6K Other Languages
- 2.3K Chinese
- 207 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 474 Portuguese
Materialized View refresh fails with ORA-04062: timestamp of package "SYS.DBMS_SNAPSHOT_UTL" has bee

Oracle 12.2
I have 12 identical oracle users with identical objects. Each has identical mviews that refresh hourly through their own private db link each pointing to different user account on a different database. For some reason only two of the 12 users get this error for this one particular mview - xvgld_us_states. I noticed when creating these mat views I would also get this ora-04062 sys.dbms_snapshot_utl error during mview creation as well. when I issued the create statement a second or third time the create statement was successful. Do I need to remotely compile this sys.dbms_snapshot_utl package remotely before refreshing? Seems odd to have to do that. Is it complaining about the remote sys.dbma_snapshot_utl or the local version? Do I need to recompile all the materialized views before refreshing so this error does not occur? I can manually refresh this mview and at times all works well.
ORA-12048: error encountered while refreshing materialized view "GLDRPT004"."XVGLD_US_STATES"
ORA-06512: at "SYS.DBMS_SNAPSHOT_KKXRCA", line 2952
ORA-04062: timestamp of package "SYS.DBMS_SNAPSHOT_UTL" has been changed
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_SNAPSHOT_KKXRCA", line 85
ORA-06512: at "SYS.DBMS_SNAPSHOT_KKXRCA", line 245
ORA-06512: at "SYS.DBMS_SNAPSHOT_KKXRCA", line 1227
ORA-06512: at "SYS.DBMS_SNAPSHOT_KKXRCA", line 2414
ORA-06512: at "SYS.DBMS_SNAPSHOT_KKXRCA", line 2908
ORA-06512: at "SYS.DBMS_SNAPSHOT_KKXRCA", line 3191
ORA-06512: at "SYS.DBMS_SNAPSHOT_KKXRCA", line 3221
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 15
ORA-06512: at "GLDRPT004.MATERIALIZED_VIEW_CONTROL", line 31
Best Answer
-
Hello @Mark Reichman,
I would suggest to check for following parameter value and ensure you have the same in both source and target DBs:
remote_dependencies_mode=SIGNATURE
If you have access to MOS, please read: ORA-4062 Explained (for Client and Server PL/SQL) (Doc ID 73506.1)
Best regards,
Jesus Botello-Mares
Answers
-
That error usually means, either...
You've changed the definition of a DB Link that one of the slave MViews is referring to. In which case, you'll have to rebuild the MView.
-OR-
You are using a DB Link on many schemas on the same DB, but with the same name but on different schemas. If you need to refresh some materialized views through a db link on many schemas on the same database, be sure to give a different name to your db links. If you don't you could get your error. Here's an old article, that mentions it
-
This is normal standard behavior. Object is invalidated when one or more objects it depends on change. Oracle simply tells you package changed since MV was created. It is up to to investigate what changed and if it affects MVs. Refreshing second (and subsequent) time will succeed.
SY.
-
Solomon - That is a system package. It seems to change all the time and I wont be able to recompile the package since I do not have DBA privs.
Paulzip - I read that same post about the db link names which is exactly what we have going on. Each user has a similarly name db link with different user and database inside. We did that so migrations could use the same db link name. I noticed that was a 9i issue and was thinking that surely would have been resolved by now.
I think I'm just going to recompile all the mviews before refreshing allowing them to pick the new package signature or timestamp so that this does not happen.
-
Mark Reichman wrote:I noticed that was a 9i issue and was thinking that surely would have been resolved by now.
Unfortunately, that isn't always the case. It might be a deep rooted problem in the MView architecture, in which case, Oracle may never fix it. Oracle, like any organisation, weigh up the cost of re-engineering something that causes problems for certain end users, versus the inconvenience / likelihood / ease of workarounds for end users.
-
Hello @Mark Reichman,
I would suggest to check for following parameter value and ensure you have the same in both source and target DBs:
remote_dependencies_mode=SIGNATURE
If you have access to MOS, please read: ORA-4062 Explained (for Client and Server PL/SQL) (Doc ID 73506.1)
Best regards,
Jesus Botello-Mares
-
System package compile time can change when patching is done or someone explicitly recompiles them. What is LAST_DDL_TIME for DBMS_SNAPSHOT_UTL?
SY.
-
Everything seems to be
NAME TYPE VALUE
------------------------ ------ ---------
remote_dependencies_mode string TIMESTAMP
I may try ALTER SESSION SET REMOTE_DEPENDENCIES_MODE=SIGNATURE as recommended in the Doc ID 73506.1 at MOS.
-
Thanks everyone. It appears after one day of testing the doc id at MOS that Jesus pointed me to actually helped with this issue. I put the following line as the first line in my refresh proc and it seems to have fixed the issue. I did not compile anything as I stated above but just added this line at the top before issuing dbms_mview.refresh.
ALTER SESSION SET REMOTE_DEPENDENCIES_MODE=SIGNATURE