- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
7#
发表于 2013-5-17 14:30:33
SPLIT不会?
SQL> CREATE TABLE MacleanV
2 nologging
3 partition by range(object_id)
4 (partition p1 values less than (99999) tablespace users,
5 partition p2 values less than (maxvalue) tablespace users)
6 as select * from dba_objects where rownum=0;
Table created.
SQL> insert into macleanV select * from dba_objects;
89127 rows created.
SQL> commit;
Commit complete.
SQL> exec dbms_stats.gather_table_stats('SYS','MACLEANV');
PL/SQL procedure successfully completed.
SQL> select num_rows,blocks from dba_tables where table_name='MACLEANV';
NUM_ROWS BLOCKS
---------- ----------
89127 2014
SQL> select partition_name,num_rows,blocks from dba_tab_partitions where table_name='MACLEANV';
PARTITION_NAME
--------------------------------------------------------------------------------
NUM_ROWS BLOCKS
---------- ----------
P1
89127 2014
P2
0 0
SQL> exec dbms_stats.lock_table_stats('SYS','MACLEANV');
PL/SQL procedure successfully completed.
SQL> exec dbms_stats.gather_table_stats('SYS','MACLEANV');
BEGIN dbms_stats.gather_table_stats('SYS','MACLEANV'); END;
*
ERROR at line 1:
ORA-20005: object statistics are locked (stattype = ALL)
ORA-06512: at "SYS.DBMS_STATS", line 32913
ORA-06512: at line 1
SQL> alter table macleanv split partition p1 at (20001) into (partition p1,partition p3);
Table altered.
SQL> select partition_name,num_rows,blocks from dba_tab_partitions where table_name='MACLEANV';
PARTITION_NAME
--------------------------------------------------------------------------------
NUM_ROWS BLOCKS
---------- ----------
P1
P2
0 0
P3
|
|