• 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
  • 相关阅读:
    数据库系统原理
    Java并发编程详解读书笔记(一)
    Java基础之String
    Java基础之数据类型
    winform BackgroundWorker控件的用法
    汉子转拼音
    model验证(验证登录、注册...)
    Ajax.BeginForm 异步搜索
    Ajax.ActionLink 辅助方法实现局部刷新
    js 随笔
  • 原文地址:https://www.cnblogs.com/lvcha001/p/14515884.html
Copyright © 2020-2023  润新知