12
返回列表 发新帖
楼主: PiscesCanon

[讨论] drop表空间缓慢

[复制链接]
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
11#
发表于 2017-5-9 22:55 | 只看该作者
本帖最后由 Yong Huang 于 2017-5-9 09:03 编辑

This guy
https://laimisnd.wordpress.com/2 ... uding-contents-and/
reported exactly the same problem and cited two Oracle documents. The first one is quite relevant
Drop Tablespace Including Contents And Datafiles Takes Hours To Complete (Doc ID 438461.1)
which suggests
execute dbms_stats.gather_schema_stats('SYS');
The only problem with that document is that it covers Oracle versions  9.2.0.1 to 10.2.0.3, even though the document was last updated in Sept 2016. You can post a comment by clicking "Give Feedback" on the upper right corner saying you only have this problem in 11.2.0.4. You can also say there's no need to gather stats for the whole SYS schema; just tab$ is enough. (By default, gathering table stats automatically cascades to its indexes.)

> 发现绑定变量的值都是9,不知道有没有问题。

I don't see any problem. You actually only have one bind variable :1, and it represents the tablespace number.

> 执行计划用图片,排版容易看。

You don't have to use an image to align text when posting the execution plan. You can use fixed-width font such as Courier or Courier New. You can manually do so by typing:
[ font = courier new ]
plan here
[ / font ]
(Remove spaces within my square brackets)

> 我用查出来的绑定变量的值9去替换有问题的sql语句中的变量后,执行速度非常快,而且结果集是0

Sometimes a literal SQL uses a different plan than one using a bind variable. But if the results are different, there may be a problem.

使用道具 举报

回复
论坛徽章:
0
12#
 楼主| 发表于 2017-5-11 13:39 | 只看该作者
Yong Huang 发表于 2017-5-9 22:55
This guy
https://laimisnd.wordpress.com/2 ... uding-contents-and/
reported exactly the same proble ...

感谢提供相关问题链接。
另外,替换绑定变量后的执行计划确实和drop表空间提取的执行计划不同。
最后感谢大师耐心回复,对于该问题耽误太多时间,也发现自身太多知识盲点,接下来针对自身问题对自己充电,之后有点提升再来回顾该问题。再次感谢大师。

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表