How to reduce space of the largest object (table system.logmnr_restart_ckpt$)in System Tablespace

Today, I noticed that the customer’s system tablespace usage is quite large, currently around 3.5TB. The largest object is the system.Logmnr_restart_ckpt$ table, which is already close to 2TB in size. The next largest is the aud$unified table used for unified auditing. In my blog yesterday 《Know more about Unified Auditing in Oracle 19c》

Know more about Unified Auditing in Oracle 19c

Today, a customer encountered a database issue in an Oracle 19c 4-node RAC environment on an Oracle Exadata machine. The database is experiencing a high number of active sessions—thousands in total—indicating waits for ‘enq: hw contention’ and ‘enq: tx contention.’ The blocked business session is executing the SQL statement “insert into AUD$UNIFIED…,” related to unified auditing of the database

,

How to diagnose slow performance or long execution times with Oracle Data Pump (expdp)?

You can easily track the duration of each export/import operation by directing the export/import job to write timestamps to the logfile using the LOGTIME parameter. For more details, refer to Expdp/Impdp LOGTIME.

However, simply having this information alone is often insufficient, even if you know there was a version or operating system change. What’s really needed to diagnose or analyze performance is concrete data—and that’s where the METRICS and LOGTIME parameters come in handy.

,

Troubleshooting ‘local write wait’ wait event during Truncate table

I have seen problems with Local Write Wait in the Oracle database, normal tables in the databases were being used for temporary working storage before that data was then written to another table. The content of the working storage tables was then cleared out by periodically truncating them.

Migrate oracle to openGauss/oceanbase/达梦/kingbase: md5 function

在十年前简单测试过oracle 9i 的加密解密用法之dbms_obfuscation_toolkit(二),其中有md5单向加密, 最近在oracle迁移到opengauss项目中用到了md5, 这里简单记录替换方案,在pg或og中直接就有md5 function. 在mysql及Mysql系的产品和ocenabse, 达梦一样存在该函数md5。

Migrate oracle to openGauss: dbms_crypto.encrypt /decrypt functions

在oracle迁移opengauss数据库时,可能会遇到在oracle数据库中使用dbms_crypto 加密的数据 ,在目标数据库opengauss有时也不需要完全等同,仅实现加密功能即可,需要我们改写对应的存储过程,或自定义包装function, 也需要合理规划数据迁移的一些方法,比如需要先解密,在目标库重新加密,尤其是加密方法不同,避免迁移源加密数据到目标库后无法解密,当然如果应用层能实现加密功能那是极好的

Migrate oracle to openGauss: cast_to_raw/cast_to_varchar2 & base64_encode/base64_decode functions

我和我们的团队最近在迁移oracle到openGauss(postgresql)时现在有一些存储过程中使用了加密函数,其中有一些涉及到编码的package 如utl_i18、utl_raw、utl_encode,对一些明文数值进行raw或base64编码,这里记录一下oracle到opengauss后对应的函数实现, 基本也适用于postgresql,下一篇会记录加密函数。

,

v$active_session_history slow, 如何查询v$fixed_view_definition中的全文本?

最近一个客户oracle数据库中大量的活动会话在查询v$active_session_history, 原因是一个监控软件的刷新ASH数据,但是该SQL正常也都是秒回,该数据库一次查询近6分钟,好奇要分析一下这个案例,但因为客户环境无法远程,所以无分析过程,这里记录我的分析思路,同时在分析v$active_session_history 发现取完整的SQL定义并不是很容易,记录oradebug peek , objdump, gdb等方式读取内存中FIXED VIEW定义的方法。

,

Troubleshooting Oracle RAC hang due to DBreplay capture write wcr file on NFS

我之前写过一篇关于的文章。在将 Oracle 迁移到国产数据库的过程中,为了进行负载重演,一些国产数据库需要在 Oracle 源库上进行 DBReplay 的 capture。然而,这种操作对源生产环境会带来一定风险,不仅有 license 商务风险,还存在可用性风险,比如空间或性能问题。在之前的文档中,我建议将 capture 产生的 WCR rec 文件存储在高吞吐量且稳定的文件系统设备上。然而还是因为没有足够的重视wcr文件存储,最近还是因为 WCR 文件存放在NFS写入问题,导致了源数据库的全库 hang 死等重大故障。这里简单记录一下这个事件。

, , ,

Oracle 19c RAC(19.11) ‘crsctl stop crs’ without -f Terminated Database Another node Instances, and more about Flex ASM

最近,在对一套Oracle 19c RAC(Real Application Clusters)进行计划内的维护操作时,遇到了一个预料之外的问题。原本打算通过一个常规的滚动停实例操作来维护其中一个节点,即通过执行 crsctl stop crs 命令来停止节点1的实例。然而,在执行此命令后,意外地发现节点2的实例也随之自动终止了。这一情况发生在Oracle 19.11版本中,如果此类问题频发,无疑会对未来的维护操作带来不确定性。

在去年《Troubleshooting Oracle RAC node OS shutdown (‘crsctl stop crs -f’) cause db instance stop on another node》我们也曾遇到过类似的问题,当时使用的版本是19.10。

,

Troubleshooting Oracle 12c/19c logon and DML fail with ORA-00604 &ORA-00904: “DECL_OBJ#”: invalid identifier

最近在Oracle 12C环境中,一个用户在尝试登录备用数据库(standby)时失败。在修复主数据库(primary db)并执行datapatch之后,发现大量包(package)失效,导致正常业务运行也出现错误。特别是在递归调用一个触发器(trigger)时,出现了错误:ORA-00904: “DECL_OBJ#”。此外,尝试禁用或删除该触发器时也失败。这是一个需要重点记录的问题。

, ,

Troubleshooting Oracle 19c real-time statistics row cache lock(dc_realtime_tabst)

Recently, a customer’s Oracle database encountered a performance problem, waiting for “row cache lock”. Analysis showed that the cache# p1 value pointed to the dc_realtime_tabst 。

, ,

How to fixed Oracle RAC Apache Tomcat CVE-2024-21733 issue?

Starting from 12.2.0.1 Grid infrastructure home does have tomcat installed on the GI_HOME. A security scan may find Tomcat security vulnerability CVE-2024-21733 in your Oracle RAC environment. How do I fix it ?

Troubleshooting Oracle a node CRS (asm resource) start fail with “CRS-5019” error after OS reboot

客户一套ORACLE 3 node RAC, 因为需要节点3 主机停机维护, 重启后CRS无法启动, 其它两个节点node 1 ,node2 运行正常。 node 3启动过程中 ora.asm 资源启动hang ,等待enq: dd – contention , 简单记录分析步骤。

,

Troubleshooting Oracle RAC high active sessions wait log file sync &buffer busy waits & gc xx events due to Interconnect latency

最近有家半导体客户的oracle RAC间隔性出现了2次活动会话高负载的堵塞现象,找到我协助分析, 当时的主要活动会等待是buffer busy wait, enq: tx … 的hot object现象,同时有较高的log file sync 单次延时,当分析数据库性能问题时,从top event入手没错,但是也要防止被带偏,也可能是因为其它的影响,简单记录这个事件。

, ,

How to analyze enq: TM – Contention with LogMiner?

最近有个客户遇到了enq: TM – contention, 确认表上有大量的FK,并且存在FK 无索引的现象,同是一张表有近60个FK ,同时子表又有几十个子表的多层FK(外键关连) , 关于这个event十多年前有记录过一个笔记”Tuning enq: TM – contention with foreign key (外键引起的队列)”, 现在这个客户也是认可是有外键缺失索引的问题,但非要找到当时的堵塞者SQL, 当然如果SQL很快如果没进ASH, 可能就不好分析了,这里使用分享logminer如何查找线索。

,

Oracle 、Oceanbase、GoldenDB数据库比较系列(二十五):sql profile/ outline 影响范围(中)

在ORACLE中,SQL Profile 是对 SQL 语句文本的数据库级匹配。由于相同的 SQL 文本在不同用户下可能会受到影响,因此需要一些方法来避免这种情况。OceanBase 提供了 outline 功能,可以用于固定执行计划。那么在 OceanBase 中是否存在与 ORACLE 类似的、影响不同用户的问题呢?多个用户的相同 SQL 语句和相同的表是否共享同一个 outline 呢?outline 是全库共享的还是用户级私有的?

Oracle 、Oceanbase、GoldenDB数据库比较系列(二十四):sql profile/ outline 影响范围(上)

在关系数据库性能优化技术中,有时存在数据库优化器评估问题,产生了错误的执行计划或执行计划改变,导致SQL执行效率变差,在无法或短时间内修改应用SQL代码时,需要从数据库端快速固定指定的执行计划,问题:
多个用户多个table(含索引)相同结构,对于相同的SQL文本,是否会互相影响?
多个用户相同的table, 对于相同的SQL文本,是否会互相影响?

, ,

Oracle Controlfile Corrupted ORA-27048: skgfifi: file header information is invalid

今天一个客户的文件系统空间耗尽,数据库重启后,数据库无法启动,mount后提示ORA-00205: error in identifying control file, check alert log for more info, 查看DB ALERT LOG提示ORA-27048: skgfifi: file header information is invalid, 因为控制文件头损坏。简单记录.

Oracle Incremental Statistics 忽略ESTIMATE_PERCENT ?

Oracle Database 11g 引入了增量统计信息维护(Incremental Statistics Maintenance),以提高大型分区表统计信息收集的性能。当为分区表启用增量统计信息维护时,Oracle 会通过聚合分区级别统计信息来准确生成全局级别统计信息。除了增量统计信息外,配置较小的采样率也是加快大表统计信息收集的另一种方法。今天有位同事问,为什么在同时配置增量统计信息和小采样率时,小采样率没有起作用。

,