zoukankan      html  css  js  c++  java
  • Oracle-同义词失效能否自动编译?

    客户有个问题,同义词突然失效了,第一反应是Oracle Page包失效会在下一次调用中自动编译?

    测试一下同义词!

    结论是可以自动编译,那么问题在于什么原因导致查询同义词没有自动编译成功! 这个可以根据具体报错排查

    SQL> select count(*) from syn_a;
    
      COUNT(*)
    ----------
         37784
    SQL> alter table a move;
    select object_name,object_type,status from user_objects;
    OBJECT_NAME          OBJECT_TYPE         STATUS
    -------------------- ------------------- -------
    SYN_A                SYNONYM             VALID
    A                    TABLE               VALID
    A_VIEW               VIEW                VALID
    
    SQL> drop table a;
    SQL> select object_name,object_type,status from user_objects;
    OBJECT_NAME          OBJECT_TYPE         STATUS
    -------------------- ------------------- -------
    SYN_A                SYNONYM             INVALID
    A_VIEW               VIEW                INVALID
    SQL> create table a as select * from sys.dba_objects;
    SQL> select count(*) from a_view;
      COUNT(*)
    ----------
         37784
    
    SQL> select object_name,object_type,status from user_objects;
    OBJECT_NAME          OBJECT_TYPE         STATUS
    -------------------- ------------------- -------
    A                    TABLE               VALID
    SYN_A                SYNONYM             INVALID
    A_VIEW               VIEW                VALID
    
    SQL> select count(*) from syn_a;
      COUNT(*)
    ----------
         37784
    SQL> select object_name,object_type,status from user_objects;
    OBJECT_NAME          OBJECT_TYPE         STATUS
    -------------------- ------------------- -------
    A                    TABLE               VALID
    SYN_A                SYNONYM             VALID
    A_VIEW               VIEW                VALID
  • 相关阅读:
    [TJOI2015]棋盘
    [FJOI2017]矩阵填数——容斥
    [ZJOI2016]小星星
    [HEOI2013]SAO ——计数问题
    ZJOI2008 骑士
    莫队算法——暴力出奇迹
    可持久化线段树
    dij与prim算法
    LCA 最近公共祖先
    Linux 设置交换分区
  • 原文地址:https://www.cnblogs.com/lvcha001/p/14515884.html
Copyright © 2011-2022 走看看