91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

How To Use Virtual Column-Based Partitioning

發布時間:2020-08-09 17:25:53 來源:ITPUB博客 閱讀:181 作者:yyp2009 欄目:關系型數據庫
      上一篇我介紹和測試了oracle 11g版本引入的虛擬列新特性,本文繼續測試分區鍵基于表的虛擬列:
Prior releases of Oracle only allowed a table to be partitioned based on a physical column. Oracle 11g, with the addition of virtual columns, now allows a partition key based on an expression, using one or more existing columns of the table. A virtual column can now be used as a partitioning key.Oracle 11g supports the concept of virtual columns on tables. These virtual columns are not physically stored in the table, but derived from data in the table. These virtual columns can be used in the partition key in all basic partitioning schemes. The example below creates a table that is list partitioned on a virtual column that represents the first letter in the username column of the table.

SQL> CREATE TABLE orders  --------------------scripts from oracle 11g doc(Example 4-9 Creating reference-partitioned tables)
  2      ( order_id           NUMBER(12),
  3        order_date         TIMESTAMP WITH LOCAL TIME ZONE,
  4        order_mode         VARCHAR2(8),
  5        customer_id        NUMBER(6),
  6        order_status       NUMBER(2),
  7        order_total        NUMBER(8,2),
  8        sales_rep_id       NUMBER(6),
  9        promotion_id       NUMBER(6),
 10        CONSTRAINT orders_pk PRIMARY KEY(order_id)
 11      )
 12    PARTITION BY RANGE(order_date)
 13      ( PARTITION Q1_2005 VALUES LESS THAN (TO_DATE('01-APR-2005','DD-MON-YYYY')),
 14        PARTITION Q2_2005 VALUES LESS THAN (TO_DATE('01-JUL-2005','DD-MON-YYYY')),
 15        PARTITION Q3_2005 VALUES LESS THAN (TO_DATE('01-OCT-2005','DD-MON-YYYY')),
 16        PARTITION Q4_2005 VALUES LESS THAN (TO_DATE('01-JAN-2006','DD-MON-YYYY'))
 17      );
    ( PARTITION Q1_2005 VALUES LESS THAN (TO_DATE('01-APR-2005','DD-MON-YYYY')),
                                          *
ERROR at line 13:
ORA-30078: partition bound must be TIME/TIMESTAMP WITH TIME ZONE literals

SQL> CREATE TABLE orders_vcol
  2      ( order_id           NUMBER(12),
  3        order_date         TIMESTAMP(6) WITH LOCAL TIME ZONE,
  4        order_mode         VARCHAR2(8),
  5        customer_id        NUMBER(6),
  6        order_status       NUMBER(2),
  7        order_total        NUMBER(8,2),
  8        sales_rep_id       NUMBER(6),
  9        promotion_id       NUMBER(6),
 10        vcol_gmt TIMESTAMP(6) AS (SYS_EXTRACT_UTC(order_date))
 11        virtual,
 12        CONSTRAINT orders_vpk PRIMARY KEY(order_id)
 13      )
 14    PARTITION BY RANGE(vcol_gmt)
 15      ( PARTITION Q1_2005 VALUES LESS THAN (TO_DATE('01-APR-2005','DD-MON-YYYY')),
 16        PARTITION Q2_2005 VALUES LESS THAN (TO_DATE('01-JUL-2005','DD-MON-YYYY')),
 17        PARTITION Q3_2005 VALUES LESS THAN (TO_DATE('01-OCT-2005','DD-MON-YYYY')),
 18        PARTITION Q4_2005 VALUES LESS THAN (TO_DATE('01-JAN-2006','DD-MON-YYYY'))
 19      );

Table created.
SQL> COLUMN table_name FORMAT A25
SQL> COLUMN partition_name FORMAT A20
SQL> COLUMN high_value FORMAT A40
SQL> SELECT table_name, partition_name, high_value, num_rows
  2  FROM   user_tab_partitions
  3  where  table_name='ORDERS_VCOL'
  4  ORDER BY table_name, partition_name;

TABLE_NAME                PARTITION_NAME       HIGH_VALUE                                 NUM_ROWS
------------------------- -------------------- ---------------------------------------- ----------
ORDERS_VCOL               Q1_2005              TIMESTAMP' 2005-04-01 00:00:00'
ORDERS_VCOL               Q2_2005              TIMESTAMP' 2005-07-01 00:00:00'
ORDERS_VCOL               Q3_2005              TIMESTAMP' 2005-10-01 00:00:00'
ORDERS_VCOL               Q4_2005              TIMESTAMP' 2006-01-01 00:00:00'



向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

徐水县| 从江县| 白水县| 营口市| 贡山| 南宁市| 富阳市| 商洛市| 安丘市| 瓦房店市| 姜堰市| 米脂县| 天祝| 商城县| 叙永县| 宣威市| 留坝县| 策勒县| 巴中市| 荥经县| 广饶县| 夏津县| 梁平县| 建瓯市| 岱山县| 宿州市| 区。| 吉安市| 黔东| 霍山县| 新泰市| 桦甸市| 沁源县| 惠州市| 专栏| 南昌市| 宜兰市| 达日县| 运城市| 东海县| 厦门市|