网站首页
JSP空间
动态资讯
开源项目
技术文档
资源下载
J2EE资源
客户论坛
在线支付
 
  技术文档>>数据库技术>>Oracle技术>>Oracle开发>查看文档  
  oracle 10g分区表维护中的两个注意事项     
  文章作者:未知  文章来源:赛迪网技术社区  
  查看:76次  录入:管理员--2008-04-30  
 

【赛迪网-it技术报道】oracle 10g分区表维护中的两个注意事项:

1.全局索引

sql> alter table analyse_content truncate subpartition data0712_deyang;

table truncated

truncate分区后,修改或者插入数据报错:

ora-01502: index 'phs.pk' or partition of such index is in unusable state

这个时候只能rebuild index

sql> alter index phs.pk rebuild;

index altered

执行以后恢复正常,或者使用如下语句:

sql> alter table analyse_content truncate subpartition data0712_zigong update

global indexes;

table truncated

这样它会自动恢复索引。

2.物化视图

对于已经建有fast refresh view的分区表来说,truncate和drop分区/表会导致物化视图出错。

sql> alter table analyse_content drop subpartition data0712_mianyang;

table altered

sql> alter table analyse_content truncate subpartition data0712_luzhou;

table truncated

再次查询物化视图,这个两个分区的数据仍然存在,说明物化视图不能对这种ddl语句进行更新。

尝试在基础表插入数据,报错:

ora-32313: refresh fast of " " unsupported after pmops

这时候必须手工刷新mv

sql> exec dbms_mview.refresh('mv_analyse_content','f');

begin dbms_mview.refresh('mv_analyse_content','f'); end;

ora-32313: pmop 之后不支持 "phs"."mv_analyse_content" 的 refresh fast

ora-06512: 在 "sys.dbms_snapshot", line 2255

ora-06512: 在 "sys.dbms_snapshot", line 2461

ora-06512: 在 "sys.dbms_snapshot", line 2430

ora-06512: 在 line 1

看来快速刷新'f'是不行,还是得完全刷新'c'

sql> exec dbms_mview.refresh('mv_analyse_content','c');

pl/sql procedure successfully completed

执行完后,mv里面的数据恢复正常,基表不再报错。

实际10g里面,truncate分区后,某些物化视图可以执行fast refresh,具体有很多限制,

要查询doc,反正select * from table这种视图肯定可以'f',不过却没有什么意义。

---2008 04 22 在doc上找到了pct特性的限制,如下:

at least one of the detail tables referenced by the materialized view must be

partitioned.

partitioned tables must use either range, list or composite partitioning.

the top level partition key must consist of only a single column.

the materialized view must contain either the partition key column or a partition

marker or rowid or join dependent expression of the detail table. see oracle

database pl/sql packages and types reference for details regarding the dbms_

mview.pmarker function.

if you use a group by clause, the partition key column or the partition marker or

rowid or join dependent expression must be present in the group by clause.

if you use an analytic window function or the model clause, the partition key

column or the partition marker or rowid or join dependent expression must be

present in their respective partition by subclauses.

data modifications can only occur on the partitioned table. if pct refresh is being

done for a table which has join dependent expression in the materialized view,

then data modifications should not have occurred in any of the join dependent

tables.

the compatibility initialization parameter must be a minimum of 9.0.0.0.0.

pct is not supported for a materialized view that refers to views, remote tables, or

outer joins.

pct-based refresh is not supported for union all materialized views.

对于海量数据库,如果不能使用drop分区,则delete相当慢。

如果使用了,又会导致完全刷新mv,同样慢。

在物化视图的时候要认真考虑pct特性。

对于分区表 已经相关索引,快照的维护,建议还是参考oracle的doc,在admin guide和

dataware house guide里有非常完善描述。虽然没有涉及internal,但完全可以满足应用。

 
 
上一篇: 循序渐进讲解oracle数据库的hash join (1)    下一篇: oracle 9i和10g安装后的基本环境与服务 (1)
  相关文档
由浅入深讲解oracle数据库的备份与恢复 05-14
快速掌握ora-00600 4194错误的解决方法 11-15
在oracle 10g中建立没有域名的db_link 03-21
dba应当如何查看oracle数据库连接情况 04-14
oracle ebs 11.5 for linux as4安装心得 08-08
讲解oracle数据库应用程序中raid的级别 05-05
如何用dbms_rowid获取rowid的详细信息 03-26
oracle tnslistener服务启动后自动停止问题 07-21
Oracle 与 DB2 数据类型分类对应说明 05-13
细化解析:怎样恢复一个丢失的 数据文件 11-15
学习 Oracle过程中几个常见问题的总结 08-05
实例讲解如何删除oracle 10g的垃圾表 03-28
oracle数据库中管理表空间和数据文件 (1) 04-24
循序渐进讲解oracle数据库管理员的职责 (1) 04-29
教你正确认识oracle数据库的结构组件 11-15
Oracle动态并行处理框架及其优越性 04-12
SQL Server与Oracle、DB2的性能比较 04-11
监控数据库性能的"sql"语句都有哪些? (1) 02-27
在线日志文件都是active或current的现象 02-26
_row_cache_cursors参数应当如何设置 04-16
返回首页 | 关于我们 | J网章程 | JSP空间合租 | 客服中心 | 免责声明 | 常见问题 | 参观机房
本站主机空间代理至厦门市华众网络科技有限公司
《中华人民共和国增值电信业务经营许可证》
编号:闽B2-20050079
@2005-2008福建JSP技术网 版权所有 闽ICP备05000928号
厦门(总部):13616026886 福州:0591-87655121
邮箱:admin@fjjsp.com 站长QQ,点击这里给我发消息