Highlights DBASK Q (2)

introduction

Recently we DBASK applet adds database MongoDB, Redis, Elasticsearch, DB2, Weblogic and other new thematic sections and some new technology experts, in addition, also associated with the new technologies chat, OB, architecture abstracts, 51CTO technology stack, etc. No data in the field of public are welcome to read to share.

Technical experts coming

The following is a technical expert ink Tianlun DBASK part budding. You can click on to read the "ink Tianlun DBASK technical experts invitation" for more information, apply our technical experts to join a team of experts, together with us to create an open and supportive database technology community.
Here Insert Picture Description

No new public association

Ink Tianlun DBASK mutual aid is an open database technology community. So, we have new technology associated with the chat, OB, architecture Digest, No. 51CTO technology stack, and so the public areas of data, to facilitate reading. If there are public numbers and related data, there are articles reprinted demand cooperation, can leave a message to contact small series Oh ~
Here Insert Picture DescriptionDBASK Q & A Highlights (2)

Q & Highlights

Next, we share this issue sorted out the problems and diagnostic summary, for reference study, a detailed analysis of the diagnostic process can jump to the small program to view by title link.
Issue a summary index of common situations do not go
ask under what circumstances do not take the index SQL, to help summarize.
Conclusion The diagnosis: 1, NULL predicate filter conditions appear; 2, predicate function occurs resulting in the conversion did not take the index; 3, statistical information is not accurate; 4, like keywords on both sides, "%" in WEHRE conditions; 5, value query condition type is inconsistent with the column; 6, query columns math; 7, or more index columns in iN oR statements; 8, whether indexing is not visible.

Question two differences, sid and service names, aliases and tns

sid and service name, and the difference between tns alias. How to distinguish between?

诊断结论:拿两节点RAC的情况说明下吧:db1/db2为两个节点的sid,是两个节点数据库实例的唯一名称,与instance_name参数一致分别为db1/db2;db为服务名,方便应用连接数据库,与service_name参数一致两个节点为db;tns别名为在tnsnames.ora文件中自定义的别名,应用使用此别名连接数据库,如连接字符串为db,tns别名设置为crmdb,应用连接直接使用crmdb即可,方便辨别。

问题三、oracle DG failover后更改flashback操作的并行度

我这边遇到一个问题,想改变DG在failover后主库进行的flashback操作时的并行度,就是主库执行flashback to scn xxxxxx的命令所默认的并行度。我们观察到默认是128的parallel,但是由于某些原因,我们可能需要降低并行度,请问有什么参数可以控制吗?
我在网上到处都找不到相关文章,也无法从专业书籍里找到类似的研究。

诊断结论:经测试,flashback的并行度默认受CPU_COUNT参数控制。

问题四、MySQL体系结构中一直说也有SGA和PGA,请问具体位置在哪?

MySQL 体系结构中一直说也有 SGA 和 PGA,5.7 的官方文档也没有描述,那请问是在 InnoDB 中,还是具体位置在哪?
诊断结论:一般而言,如果对应于Oracl的这两个对应概念,SGA指的是以Innodb buffer pool,innodb字典,frm缓存等公用缓存组合出来的内存区域。PGA指的是以sort buffer,binlog buffer等线程专用内存组合成的内存区域。

问题五、oracle 11g支持IPV6吗?

公司最近在做IPV6的改造方案,我想问下对现有oracle数据库会有什么影响吗?公司主要用oracle11g和oracle12c。
诊断结论:11gr2支持单节点使用ipv6,12cR1支持public IP的ipv6(内联不支持),12cR2完全支持。

问题六、move表后,表空间可用300G,但是无法resize

由于磁盘组冗余度不符合安全要求,对各表空间(Bigfile)进行清理后尝试做数据文件的resize操作,过程如下:
1、新建表空间,作为数据中转用
2、MOVE大部分表(90%)至其新建表空间后MOVE回原有表空间,从而减少数据库碎片
3、收缩对应的数据文件在MOVE回原有表空间后重建相关索引,统计发现可用空间提高40G左右,有效的减少了碎片
但是无法resize数据文件到MOVE之后的大小。
诊断结论:实际上按照你的操作思路,可以move 100%的表都去另外一个表空间,然后直接drop掉原有表空间就可以了。如果存在没MOVE表的EXTENTS已经扩展到了数据文件的边缘,是没办法resize的。

问题七、如何快速预估表的行数

请问有哪些方法可以快速预估表的行数?

诊断结论:1、并行查询count(*);2、统计信息num_rows字段;3、sample block() 取样查询。

问题八、RAC配置多个public网络

现在有一个需求,客户有两个网络,都需要连接数据库,需要配置两个public网络,请问如何配置。
诊断结论:首先官方建议不要在安装Oracle时配置多个public网络,等集群安装完之后再通过命令去添加public网络,测试步骤详见小程序文章。

问题九、关于分区表全局分区索引和全局不分区索引的效率
按月分区的分区表,单个分区表记录大约1500万,对于非分区键上的索引来说,是建全局分区索引还是不分区索引效率高?分区索引按照列HASH分区还是有其它方式?
专家解答:LOCAL索引的最大好处是在进行分区操作,比如TRUNCATE PARTITION, DROP PARTITION时,不会出现索引INVALID的情况,不影响索引的可用性。由于GLOBAL索引所有的数据存储在一起,因此当执行分区操作的时候,索引会失效,而如果想要保证所有的有效性,需要增加UPDATE (GLOBAL) INDEXES语句,这使得原本很快结束的DDL操作,由于需要维护全局索引而变得非常缓慢,且产生大量的日志。12c之后,全局索引的异步同步可以缓解全局索引的这个问题。
而GLOBAL索引的好处是,在表变为分区后,只要索引仍然是GLOBAL索引,通过索引访问数据的效率就不会下降。由于LOCAL索引的索引分区数量和表分区数量相等,如果访问一个LOCAL索引,且查询条件未指定分区键值,这时Oracle将会扫描所有的索引分区。而GLOBAL索引则只需要访问一棵索引树,当分区数量众多时,二者的效率差异是非常明显的。
当然,它们还有其他的区别。就用户而言,判断需要GLOBAL还是LOCAL索引,最主要看是否会频繁进行分区的维护操作,比如定期删除老分区,如果是的话,LOCAL是最佳选择,如果不是,则考虑GLOBAL索引。

问题十、同样的SQL,变量不同执行计划不一样

一条相似的SQL语句,变量值不同,执行计划不同。SQL如下:

select order_no from OWNER.TAB_NAME where pa_id = '10221178' and ORDER_TIME > SYSDATE - 120;(异常)select order_no from OWNER.TAB_NAME where pa_id = '10221178' and ORDER_TIME > SYSDATE - 150

Conclusion The diagnosis: trc file 120 can be seen in the lowest cost is bit map and the execution path, trc file 120 can be seen in the lowest cost is bit map and the execution path. As for why the two are not the same execution plans, index selection should IDX_XXX rate changes lead to increased costs related to the bit map.

Question 11, oralce 11g RAC System time synchronization problem
oralce 11g RAC system time on the slow slowly than normal, and how to solve it, the time between rac nodes are synchronized, but slower than the actual time of 30 minutes, this problem how to avoid it, rac itself comes a time synchronization service could be added ntp service outside?
Conclusion The diagnosis: two nodes are generally open in the NTP service, synchronize external NTP time server, the practice is to configure the NTP service. If you enable NTP service, the cluster service will stop their ctss no effect. If you need to enable NTP, under special circumstances could lead to a node restart, insurance purposes, can go to the next stop window changes together.


Guess you like

Origin blog.51cto.com/14406471/2414434
Recommended