重现sql执行计划SYS_OP_C2C隐式转换

联系:手机/微信(+86 17813235971) QQ(107644445)QQ咨询惜分飞

标题:重现sql执行计划SYS_OP_C2C隐式转换

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

在一次的sql优化中,遇到SYS_OP_C2C函数,通过分析是由于一个表的varchar2和另外一个表的nvarchar2列进行关联导致,通过以下简单使用进行重现.对于这个问题,如果需要使用index,需要创建SYS_OP_C2C的函数index,或者把列类型修改一致.

SQL> create user xff identified by oracle;

用户已创建。

SQL> grant dba to xff;

授权成功。

SQL> create table xff.t1(id number,name varchar2(100));

表已创建。

SQL> insert into xff.t1 select  object_id,object_name from dba_objects;

已创建 89932 行。

SQL> commit;

提交完成。

SQL> create table xff.t2(id number,name nvarchar2(100));

表已创建。

SQL> insert into xff.t2 select  object_id,object_name from dba_objects;

已创建 89933 行。

SQL> commit;

提交完成。


SQL> exec dbms_stats.gather_table_stats('XFF','T1',cascade=>true);

PL/SQL 过程已成功完成。

SQL> exec dbms_stats.gather_table_stats('XFF','T2',cascade=>true);

PL/SQL 过程已成功完成。


SQL> set autot on
SQL>  select count(1) from xff.t1, xff.t2 where t1.name=t2.name;

  COUNT(1)
----------
    160752


执行计划
----------------------------------------------------------
Plan hash value: 906334482

------------------------------------------------------------------------------------
| Id  | Operation           | Name | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |      |     1 |    74 |       |   760   (1)| 00:00:10 |
|   1 |  SORT AGGREGATE     |      |     1 |    74 |       |            |          |
|*  2 |   HASH JOIN         |      |   146K|    10M|  3256K|   760   (1)| 00:00:10 |
|   3 |    TABLE ACCESS FULL| T1   | 89932 |  2195K|       |   137   (1)| 00:00:02 |
|   4 |    TABLE ACCESS FULL| T2   | 89933 |  4303K|       |   205   (1)| 00:00:03 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("T2"."NAME"=SYS_OP_C2C("T1"."NAME"))

还有一种情况也可能发生该转换,比如使用dblink的访问远程库,本地库和远程库字符集不一致.参考:SQL Statements Performed Across Database Links run Slowly. Explain Plan Shows Function SYS_OP_C2C has been Applied to Predicates, and Query uses a Full Table Scan. (Doc ID 2010872.1)

12.1.0.2扩展补丁信息-202107

联系:手机/微信(+86 17813235971) QQ(107644445)QQ咨询惜分飞

标题:12.1.0.2扩展补丁信息-202107

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

12.1.0.2版本早进入了扩展服务期,这里提供相关信息,便于大家查找

Release Date Version Download link Included in Windows Bundle
20-Jul-2021 12.1.0.2.210720 (Jul 2021) Database Patch Set Update (DB PSU) Patch 32768233 12.1.0.2.210720 WIN DB BP Patch 32774982
20-Apr-2021 12.1.0.2.210420 (Apr 2021) Database Patch Set Update (DB PSU) Patch 32328635 12.1.0.2.210420 WIN DB BP Patch 32396181
19-Jan-2021 12.1.0.2.210119 (Jan 2021) Database Patch Set Update (DB PSU) Patch 31985579 12.1.0.2.210119 WIN DB BP Patch 32000405
20-Oct-2020 12.1.0.2.201020 (Oct 2020) Database Patch Set Update (DB PSU) Patch 31550110 12.1.0.2.201020 WIN DB BP Patch 31658987
14-Jul-2020 12.1.0.2.200714 (Jul 2020) Database Patch Set Update (DB PSU) Patch 31113348 12.1.0.2.200714 WIN DB BP Patch 31211574
14-Apr-2020 12.1.0.2.200414 (Apr 2020) Database Patch Set Update (DB PSU) Patch 30700212 12.1.0.2.200414 WIN DB BP Patch 30861721
14-Jan-2020 12.1.0.2.200114 (Jan 2020) Database Patch Set Update (DB PSU) Patch 30340202 12.1.0.2.200114 WIN DB BP Patch 30455401
Release Date Version Download link
20-Jul-2021 12.1.0.2.210720 (Jul 2021) Grid Infrastructure Patch Set Update (GI PSU) Patch 32917447
20-Apr-2021 12.1.0.2.210420 (Apr 2021) Grid Infrastructure Patch Set Update (GI PSU) Patch 32495126
19-Jan-2021 12.1.0.2.210119 (Jan 2021) Grid Infrastructure Patch Set Update (GI PSU) Patch 32131261
20-Oct-2020 12.1.0.2.201020 (Oct 2020) Grid Infrastructure Patch Set Update (GI PSU) Patch 31718737
14-Jul-2020 12.1.0.2.200714 (Jul 2020) Grid Infrastructure Patch Set Update (GI PSU) Patch 31305174
14-Apr-2020 12.1.0.2.200414 (Apr 2020) Grid Infrastructure Patch Set Update (GI PSU) Patch 30805421
14-Jan-2020 12.1.0.2.200114 (Jan 2020) Grid Infrastructure Patch Set Update (GI PSU) Patch 30464119
Release Date Version Includes GI PSU Download link
20-Jul-2021 12.1.0.2.210720 Database Proactive Bundle Patch (Jul 2021) 12.1.0.2.210720 Patch 32917362
20-Apr-2021 12.1.0.2.210420 Database Proactive Bundle Patch (Apr 2021) 12.1.0.2.210420 Patch 32518631
19-Jan-2021 12.1.0.2.210119 Database Proactive Bundle Patch (Jan 2021) 12.1.0.2.210119 Patch 32131231
20-Oct-2020 12.1.0.2.201020 Database Proactive Bundle Patch (Oct 2020) 12.1.0.2.201020 Patch 31718813
14-Jul-2020 12.1.0.2.200714 Database Proactive Bundle Patch (Jul 2020) 12.1.0.2.200714 Patch 31307682
14-Apr-2020 12.1.0.2.200414 Database Proactive Bundle Patch (Apr 2020) 12.1.0.2.200414 Recommend Patch 31307682 or later
14-Jan-2020 12.1.0.2.200114 Database Proactive Bundle Patch (Jan 2020) 12.1.0.2.200114 Recommend Patch 31307682 or later
Release Date Version Unix PSU Patch Windows Bundle Patch
20-Jul-2021 12.1.0.2.210720 (Jul 2021) OJVM Component Patch Set Update Patch 32876425 Patch 32905878
20-Apr-2021 12.1.0.2.210420 (Apr 2021) OJVM Component Patch Set Update Patch 32473164 Patch 32427683
19-Jan-2021 12.1.0.2.210119 (Jan 2021) OJVM Component Patch Set Update Patch 32119956 Patch 32142066
20-Oct-2020 12.1.0.2.201020 (Oct 2020) OJVM Component Patch Set Update Patch 31668915 Patch 31740134
14-Jul-2020 12.1.0.2.200714 (Jul 2020) OJVM Component Patch Set Update Patch 31219939 Patch 31465095
14-Apr-2020 12.1.0.2.200414 (Apr 2020) OJVM Component Patch Set Update Patch 30805558 Patch 31037459
14-Jan-2020 12.1.0.2.200114 (Jan 2020) OJVM Component Patch Set Update Patch 30502041 Patch 30671054
Release Date Version Download Link
20-Jul-2021 Combo OJVM PSU 12.1.0.2.210720 and DB PSU 12.1.0.2.210720 Patch 32900172
20-Apr-2021 Combo OJVM PSU 12.1.0.2.210420 and DB PSU 12.1.0.2.210420 Patch 32579074
19-Jan-2021 Combo OJVM PSU 12.1.0.2.210119 and DB PSU 12.1.0.2.210119 Patch 32126886
20-Oct-2020 Combo OJVM PSU 12.1.0.2.201020 and DB PSU 12.1.0.2.201020 Patch 31720729
14-Jul-2020 Combo OJVM PSU 12.1.0.2.200714 and DB PSU 12.1.0.2.200714 Patch 31326396
14-Apr-2020 Combo OJVM PSU 12.1.0.2.200414 and DB PSU 12.1.0.2.200414 Patch 30783658
14-Jan-2020 Combo OJVM PSU 12.1.0.2.200114 and DB PSU 12.1.0.2.200114 Patch 30463684
Release Date Version Download Link
20-Jul-2021 Combo OJVM PSU 12.1.0.2.210720 and DBBP 12.1.0.2.210720 Patch 32900201
20-Apr-2021 Combo OJVM PSU 12.1.0.2.210420 and DBBP 12.1.0.2.210420 Patch 32579100
19-Jan-2021 Combo OJVM PSU 12.1.0.2.210119 and DBBP 12.1.0.2.210119 Patch 32126908
20-Oct-2020 Combo OJVM PSU 12.1.0.2.201020 and DBBP 12.1.0.2.201020 Patch 31720769
14-Jul-2020 Combo OJVM PSU 12.1.0.2.200714 and DBBP 12.1.0.2.200714 Patch 31326402
14-Apr-2020 Combo OJVM PSU 12.1.0.2.200414 and DBBP 12.1.0.2.200414 Recommend Patch 31326402 or later
14-Jan-2020 Combo OJVM PSU 12.1.0.2.200114 and DBBP 12.1.0.2.200114 Recommend Patch 31326402 or later
Release Date Version Download Link
20-Jul-2021 Combo OJVM PSU 12.1.0.2.210720 and GI PSU 12.1.0.2.210720 Patch 32900185
20-Apr-2021 Combo OJVM PSU 12.1.0.2.210420 and GI PSU 12.1.0.2.210420 Patch 32579077
19-Jan-2021 Combo OJVM PSU 12.1.0.2.210119 and GI PSU 12.1.0.2.210119 Patch 32126899
20-Oct-2020 Combo OJVM PSU 12.1.0.2.201020 and GI PSU 12.1.0.2.201020 Patch 31720761
14-Jul-2020 Combo OJVM PSU 12.1.0.2.200714 and GI PSU 12.1.0.2.200714 Patch 31326400
14-Apr-2020 Combo OJVM PSU 12.1.0.2.200414 and GI PSU 12.1.0.2.200414 Patch 30783882
14-Jan-2020 Combo OJVM PSU 12.1.0.2.200114 and GI PSU 12.1.0.2.200114 Patch 30463691

11.2.0.4扩展补丁信息-202107

联系:手机/微信(+86 17813235971) QQ(107644445)QQ咨询惜分飞

标题:11.2.0.4扩展补丁信息-202107

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

11.2.0.4版本早进入了扩展服务期,这里提供相关信息,便于大家查找

Release Date Version Download link Included in Windows Bundle Comments
20-Jul-2021 11.2.0.4.210720 (Jul 2021) Database Patch Set Update (DB PSU) Patch 32758711 Patch 32775108 Linux x86-64 is Available. Bundles for other Platforms ETA is 13-Aug-2021.
20-Apr-2021 11.2.0.4.210420 (Apr 2021) Database Patch Set Update (DB PSU) Patch 32328626 Patch 32392141
19-Jan-2021 11.2.0.4.210119 (Jan 2021) Database Patch Set Update (DB PSU) Patch 31983472 Patch 32003403
20-Oct-2020 11.2.0.4.201020 (Oct 2020) Database Patch Set Update (DB PSU) Patch 31537677 Patch 31659823
Release Date Version Download link
20-Jul-2021 11.2.0.4.210720 (Jul 2021) Grid Infrastructure Patch Set Update (GI PSU) Patch 32917428
20-Apr-2021 11.2.0.4.210420 (Apr 2021) Grid Infrastructure Patch Set Update (GI PSU) Patch 32495145
19-Jan-2021 11.2.0.4.210119 (Jan 2021) Grid Infrastructure Patch Set Update (GI PSU) Patch 32131250
20-Oct-2020 11.2.0.4.201020 (Oct 2020) Grid Infrastructure Patch Set Update (GI PSU) Patch 31718723
Release Date Version Unix PSU Patch Windows Bundle Patch Comments
20-Jul-2021 11.2.0.4.210720 (Jul2021) OJVM Component Patch Set Update Patch 32876451 Patch 32905855 Patches are delayed. ETA is 13-Aug-2021.
20-Apr-2021 11.2.0.4.210420 (Apr2021) OJVM Component Patch Set Update Patch 32671980 Patch 32428494
19-Jan-2021 11.2.0.4.210119 (Jan2021) OJVM Component Patch Set Update ** Patch 32145687
20-Oct-2020 11.2.0.4.201020 (Oct 2020) OJVM Component Patch Set Update Patch 31668908 Patch 31740195
Release Date Version Download Link Comments
20-Jul-2021 Combo OJVM PSU 11.2.0.4.210720 and DB PSU 11.2.0.4.210720 Patch 32900228 Patch is delayed. ETA is 13-Aug-2021.
20-Apr-2021 Combo OJVM PSU 11.2.0.4.201020 and DB PSU 11.2.0.4.210420 Patch 32579111
19-Jan-2021 Combo OJVM PSU 11.2.0.4.201020 and DB PSU 11.2.0.4.210119 Patch 32126939 
20-Oct-2020 Combo OJVM PSU 11.2.0.4.201020 and DB PSU 11.2.0.4.201020 Patch 31720776
Release Date Version Download Link Comments
20-Jul-2021 Combo OJVM PSU 11.2.0.4.210720 and GI PSU 11.2.0.4.210720 Patch 32900245 Patch is delayed. ETA is 13-Aug-2021.
20-Apr-2021 Combo OJVM PSU 11.2.0.4.201020 and GI PSU 11.2.0.4.210420 Patch 32579106
19-Jan-2021 Combo OJVM PSU 11.2.0.4.201020 and GI PSU 11.2.0.4.210119 Patch 32126942
20-Oct-2020 Combo OJVM PSU 11.2.0.4.201020 and GI PSU 11.2.0.4.201020 Patch 31720783

安全漏洞扫描结果让人无语

联系:手机/微信(+86 17813235971) QQ(107644445)QQ咨询惜分飞

标题:安全漏洞扫描结果让人无语

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

对于安全公司对oracle漏洞扫描的结果的准确性一直不太认可,前几天有客户linux 平台11.2.0.4的数据库打上了210420的patch,结果xx安全厂商扫描之后,依旧有大量安全漏洞,我随机对其中的两个高危漏洞进行分析,结果发现主要有:已经修复的漏洞继续报,漏洞对应数据库版本和实际数据库不符
数据库库的补丁信息
20210811190805


已经修复的漏洞依旧报
20210811190838
20210811190844

这里比较明显CVE-2018-3110漏洞oracle在18年7月份的补丁中已经修复,而我们这个是21年04月的补丁包含了该patch,已经修复了该问题
直接报漏洞和数据库版本不匹配
20210811190828

CVE-2016-1000031这个安全漏洞根本只是在12.2+版本中才有,他直接给客户的11204版本提示高危漏洞

win环境报ora-600 kokasgi1处理

联系:手机/微信(+86 17813235971) QQ(107644445)QQ咨询惜分飞

标题:win环境报ora-600 kokasgi1处理

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

又一例数据库启动报ORA-600 kokasgi1错误的恢复请求

SMON: enabling tx recovery
Database Characterset is AL32UTF8
Errors in file e:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_3024.trc  (incident=44691):
ORA-00600: 内部错误代码, 参数: [kokasgi1], [], [], [], [], [], [], [], [], [], [], []
Incident details in: e:\app\administrator\diag\rdbms\orcl\orcl\incident\incdir_44691\orcl_ora_3024_i44691.trc
Errors in file e:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_3024.trc:
ORA-00600: 内部错误代码, 参数: [kokasgi1], [], [], [], [], [], [], [], [], [], [], []
Errors in file e:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_3024.trc:
ORA-00600: 内部错误代码, 参数: [kokasgi1], [], [], [], [], [], [], [], [], [], [], []
Error 600 happened during db open, shutting down database
USER (ospid: 3024): terminating the instance due to error 600
Instance terminated by USER, pid = 3024
ORA-1092 signalled during: ALTER DATABASE OPEN...
opiodr aborting process unknown ospid (3024) as a result of ORA-1092

通过咨询是由于根据某厂商给出来的建议对对oracle的user$的系统默认用户update等操作
rename-sys


通过分析现在库的用户情况
20210729084444

通过一系列处理之后绕过kokasgi1错误,open数据库报ORA-12432错误

SMON: enabling tx recovery
Database Characterset is AL32UTF8
No Resource Manager plan active
Errors in file e:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_3268.trc:
ORA-12432: LBAC 错误: zllegbs:OCIStmtExecute
Errors in file e:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_3268.trc:
ORA-12432: LBAC 错误: zllegbs:OCIStmtExecute
Error 12432 happened during db open, shutting down database
USER (ospid: 3268): terminating the instance due to error 12432
Instance terminated by USER, pid = 3268
ORA-1092 signalled during: alter database open...
opiodr aborting process unknown ospid (3268) as a result of ORA-1092

通过分析启动过程确认数据库在启动的时候访问lbacsys.lbac$pol表异常

PARSE ERROR #2:len=38 dep=1 uid=0 oct=3 lid=0 tim=37509085805630 err=942
select max(pol#) from lbacsys.lbac$pol
ORA-12432: LBAC 错误: zllegnp:OCIStmtExecute
ORA-12432: LBAC 错误: zllegnp:OCIStmtExecute

*** 2021-07-28 18:31:15.593
USER (ospid: 3512): terminating the instance due to error 12432

经过修改文件让数据库不在访问该表,数据库启动正常

SMON: enabling cache recovery
Successfully onlined Undo Tablespace 2.
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Database Characterset is AL32UTF8
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
Wed Jul 28 19:52:59 2021
QMNC started with pid=32, OS id=2840 
Completed: alter database open

顺利导出数据,恢复完成