oracle10g partition分割槽表與物化檢視materialized view
--建立一個範圍分割槽表
1 create table t_partition(a int,b int)
2 partition by range(a)
3 (partition p1 values less than(10),
4 partition p2 values less than(maxvalue)
5* )
SQL> /
Table created.
--插入資料到分割槽表
SQL> insert into t_partition select level,level from dual connect by level<=1000;
1000 rows created.
SQL> select count(*) from t_partition;
COUNT(*)
----------
1000
SQL> commit;
Commit complete.
--收集統計資訊
SQL> exec dbms_stats.gather_table_stats(user,'t_partition');
PL/SQL procedure successfully completed.
--檢視分割槽表相關資訊
SQL> select table_name,partition_name,num_rows,high_value,partition_position from user_tab_partitions;
TABLE_NAME PARTITION_NAME NUM_ROWS HIGH_VALUE PARTITION_POSITION
-------------------- ------------------------------ ---------- ---------- ------------------
T_PARTITION P2 991 MAXVALUE 2
T_PARTITION P1 9 10 1
SQL>
SQL> create materialized view mv_t_partition build deferred as select a,b from t_partition;
create materialized view mv_t_partition build deferred as select a,b from t_partition
*
ERROR at line 1:
ORA-12014: table 'T_PARTITION' does not contain a primary key constraint
SQL> alter table t_partition add primary key(a);
Table altered.
--基於分割槽表建立物化檢視
SQL> create materialized view mv_t_partition build deferred as select a,b from t_partition;
Materialized view created.
--build deferred即在建立物化檢視不馬上載入資料
SQL> select * from mv_t_partition;
no rows selected
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-766704/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle10g materialized view物化檢視示例OracleZedView
- materialized view (物化檢視)ZedView
- 建立物化檢視MV ( Materialized View )ZedView
- oracle10g nested materialized view巢狀物化檢視示例OracleZedView巢狀
- 轉:物化檢視(Materialized View)介紹ZedView
- ogg 同步 物化檢視建立限制 Materialized ViewZedView
- zt_yangtinkung_ITPUB知識索引貼——物化檢視materialized view索引ZedView
- 物化檢視(Materialized View)的重新整理回滾約束ZedView
- 物化檢視(Materialized View)的重新整理回滾測試ZedView
- 【實驗】【PARTITION】RANGE分割槽表截斷表分割槽(Truncate Partition)
- 【實驗】【PARTITION】RANGE分割槽表移動表分割槽(Move Partition)
- 物化檢視日誌(materialized view log)引起大量Dfs Lock Handle等待ZedView
- 分割槽表PARTITION table
- Oracle分割槽表(Partition Table)Oracle
- 分割槽表PARTITION table(轉)
- [20121101]物化檢視與表(Materialized Views and Tables).txtZedView
- 【實驗】【PARTITION】RANGE分割槽表重新命名錶分割槽(Rename Partition)
- MySQL 分割槽表 partition線上修改分割槽欄位MySql
- 【實驗】【PARTITION】RANGE分割槽表合併分割槽
- 【實驗】【PARTITION】RANGE分割槽表增加分割槽
- 【實驗】【PARTITION】RANGE分割槽表刪除分割槽
- partition 分割槽表重新命名
- oracle分割槽partition及分割槽索引partition index(一)Oracle索引Index
- 非分割槽錶轉換為分割槽表和partition indexIndex
- HGDB的分割槽表實現SQL Server的分割槽檢視SQLServer
- 物化檢視妙用__表同步使用物化檢視方法
- oracle10g新特性——物化檢視Oracle
- partition 分割槽表移動到其他表空間
- Oracle Interval Partition 自動分割槽表-實驗Oracle
- 分割槽表UNUSED列後的EXCHANGE PARTITION操作
- ORACLE 範圍分割槽 partition-range分割槽Oracle
- oracle分割槽及分割槽索引partition_partition index_維護(一)Oracle索引Index
- oracle分割槽及分割槽索引partition_partition index_維護(二)Oracle索引Index
- oracle分割槽及分割槽索引partition_partition index_維護(三)Oracle索引Index
- oracle分割槽及分割槽索引partition_partition index_維護(四)Oracle索引Index
- 【實驗】【PARTITION】交換分割槽時分割槽表有主鍵目標表亦需有主鍵
- ZT oracle10g新特性——物化檢視Oracle
- 檢視分割槽範圍