<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 6  文章 - 129  trackbacks - 0
    <2025年7月>
    293012345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

    常用鏈接

    留言簿(14)

    隨筆檔案(6)

    文章分類(467)

    文章檔案(423)

    相冊

    收藏夾(18)

    JAVA

    搜索

    •  

    積分與排名

    • 積分 - 829295
    • 排名 - 49

    最新評論

    閱讀排行榜

    評論排行榜

    原文  http://blogs.oracle.com/sql/entry/ora_54033_and_the_hidden

    A colleague recently asked me a question:

    "I'm modifying the data type of a column. When doing so I get the following error:

    ORA-54033: column to be modified is used in a virtual column expression

    But there's no virtual columns defined on the table! What on earth's going on?!"

    This was exceptionally confusing. Looking at the table definition we couldn't see any virtual columns defined: 

    create table tab (
      x integer, 
      y date, 
      z varchar2(30)
    );

    Sure enough, when we tried to change the data type of y we got the exception:

    alter table tab modify (y timestamp);
    
    ORA-54033: column to be modified is used in a virtual column expression

    How could this be? 

    Perhaps there was a column defined that we couldn't see. Querying user_tab_cols revealed something interesting:

    select column_name, data_default, hidden_column 
    from   user_tab_cols
    where  table_name = 'TAB';
    
    COLUMN_NAME 			DATA_DEFAULT 			HID
    ------------------------------ 	-----------------------------   ---
    SYS_STUYPW88OE302TFVBNC6$MMQXE	SYS_OP_COMBINED_HASH("X","Y")	YES
    Z		                                                NO
    Y								NO
    X								NO

    The SYS_... column isn't in the table DDL! Where does it come from? And what's SYS_OP_COMBINED_HASH all about? Has someone been mucking around with the database?

    The SYS_ prefix is a sign that the column is system generated. So something's happened that's caused Oracle to create this on our behalf.

    SYS_OP_COMBINED_HASH is an undocumented feature. The name implies Oracle is merging the arguments together to form a hash.

    Is there a feature where we want to capture information about a group of columns?

    Indeed there is -extended statistics!This feature enables to Oracle calculate statistics on a group of columns. It uses this information to improve row estimates. This is useful when there's a correlation between the values of two (or more) columns in a table.

    Someone had created extended stats on this table for (x, y).

    Now we've identified the problem, how do we get around it?

    Simple: drop and recreate the extended stats:

    exec dbms_stats.drop_extended_stats(user, 'tab', '(x, y)');
    
    alter table tab modify (y timestamp);
    
    select dbms_stats.create_extended_stats(user, 'tab', '(x, y)')
    from   dual;
    
    DBMS_STATS.CREATE_EXTENDED_STATS(USER,'TAB','(X,Y)')                           
    --------------------------------------------------------------------------------
    SYS_STUYPW88OE302TFVBNC6$MMQXE  

    Success!

    Extended stats are a great way to improve the optimizer's row estimates. If you need to create these, I recommend you also do the following:

    • Apply the extended stats to all environments
    • Put a comment on the columns explaining what you've done, e.g. 
      • comment on column tab.x is 'part of extended stats. To modify data type drop and recreate stats';
    These actions will help prevent future developers getting stuck tracking down the cause of "missing" virtual columns!


    posted on 2015-09-16 14:30 Ke 閱讀(2824) 評論(0)  編輯  收藏 所屬分類: oracle
    主站蜘蛛池模板: 国产电影午夜成年免费视频| 国产成人精品亚洲日本在线 | 一二三四在线观看免费高清中文在线观看| 亚洲综合日韩久久成人AV| j8又粗又长又硬又爽免费视频| 国产成人免费ā片在线观看| 国产成人不卡亚洲精品91| 免费夜色污私人影院在线观看| 思思久久99热免费精品6| 亚洲视频一区二区| 成人无码WWW免费视频| 亚洲AV日韩AV高潮无码专区| 免费人成网站在线观看不卡 | 亚洲AV成人片色在线观看高潮| 久久免费线看线看| 久久精品亚洲精品国产色婷| 99精品国产成人a∨免费看| 亚洲精品456在线播放| 国产免费AV片在线播放唯爱网| 亚洲另类自拍丝袜第五页| 免费观看四虎精品国产永久| 国产99视频精品免费视频76| 亚洲中文字幕在线乱码| 午夜精品射精入后重之免费观看| 亚洲国产模特在线播放| 四虎永久精品免费观看| 免费精品久久天干天干| 亚洲va在线va天堂成人| 亚洲国产一成久久精品国产成人综合 | 亚洲AV无码不卡无码| 午夜性色一区二区三区免费不卡视频| 亚洲综合精品第一页| 精品国产亚洲男女在线线电影| 99久久人妻精品免费二区| 亚洲精品无码一区二区| 亚洲熟妇中文字幕五十中出| 国产成人免费高清激情明星| 黄色毛片免费观看| 亚洲理论片在线中文字幕| 亚洲高清无码在线观看| 最近中文字幕完整免费视频ww|