Script: PostgreSQL 实现字符串拆分 split (二)
几年前写过一篇在oracle 使用oracle函数实现的类似java 语言中的split 拆分功能,这篇改用PostgreSQL实现类型的功能。
在PG提供了两个函数用于拆份字符串:
regexp_split_to_array:它根据正则表达式拆分字符串并将其部分返回到数组中。
regexp_split_to_table:它根据正则表达式将字符串拆分为多个部分,并将其部分返回到表的行中。
提供综合数据库运维服务与优化方案(不限Oracle MySQL PG GaussDB GoldenDB OceanBase等), 微信/Tel:(+86)134-365-60330
几年前写过一篇在oracle 使用oracle函数实现的类似java 语言中的split 拆分功能,这篇改用PostgreSQL实现类型的功能。
在PG提供了两个函数用于拆份字符串:
regexp_split_to_array:它根据正则表达式拆分字符串并将其部分返回到数组中。
regexp_split_to_table:它根据正则表达式将字符串拆分为多个部分,并将其部分返回到表的行中。
这篇简单的记录PostGreSQL12 (以下简称PG)Binary packages on RHEL 7.3安装过程,与后期的PG DB 和RHEL7 OS字符集修改。
Udev is the mechanism used to create and name /dev device nodes corresponding to the devices that are present in the system. Udev uses matching information provided by sysfs with rules provided by the user to dynamically add the required device nodes.
The following error message is displayed in the database host operating system log of a customer today.
kernel: EXT4-fs warning (device dm-0): ext4_dx_add_entry: Directory index full!
Starting with 11gR1, Oracle Data Guard asynchronous redo transport will read redo directly from the in-memory log buffer, provided that the requested redo blocks still reside in the log buffer, start 11g R2 use NSA backgroup process do that.
You can use this SQL script to report tablespace space details in 12c Multitenant database.
Buffer Deadlock is very typical wait event and not so much seen in database. But when you are encountering with this mysterious wait then you would see the effect of wait and performance bottleneck of the server.
A few days ago, I encountered a case, a 11.2.0.4 three-node Oracle RAC database on RHEL 6.6 , when trying to login to the database instance using sqlplus “/ as sysdba” on the third node, It’s very slow, and vmstat show that there is a very large swap in and out, but there is still a lot of memory free space
If kernel can not find memory to allocate when it’s needed, it puts in-use user data pages on the swap-out queue, to be swapped out. If the Virtual Memory (VM) cannot allocate memory and canot swap out in-use memory, the Out-of-memory killer may begin killing current userspace processes.
一套12c R2 4-nodes Oracle RAC on RHEL 7的环境,已安装0417 RU。 该库有一套Phyical DataGard, 同时也是GoldenGate的target端,存在一个replicat 进程同步数据,因为OGG的认证导致ADG hang最终使归档删除失败。
Oracle Database有强大的AWR报告分析整体的服务器性能问题, 但是MySQL之前是没有的,需要自定义大量的脚本生成监控数据, 从MySQL 5.7 (5.7.9)开始,可以使用sys.diagnostics()存储过程依赖于PERFORMANCE_SCHEMA,生成类似于Oracle AWR一样的MySQL性能报告。
简单记录一下这个内部错误 ora-600 [kxspoac : EXL 1], 环境11.2.0.3 RAC on hpux ia, 这是一个并行查询相关的错误,当启了10503 event后并行查询带绑定变量的SQL时有可能会出现此错误。
前不久有个下线EXADATA并同时从11g R2 升级12C R2的案例,反应升级12c后明显感觉原来查询表空间使用率的脚本时间比升级前长了很多, 要花好几分钟, 这种情况时通常是因为recyclebin$回收站中的对象太多,清理回收站解决, 但是这次的回收站并无多少对象(<100), 这是一个50 TB左右的数据库,有350个左右的数据文件。
本篇是12c版本中cpu high的第三种情况: scm0进程占用较高的cpu使用率,(Distributed Lock Management )DLM Statistics Collection and Management从属(SCM0)后台进程负责收集和管理全局入队服务(GES)和全局缓存服务(GCS)的统计信息。如果在数据库中启用了DLM统计信息收集此进程(scm0)才会存在…
为了当分析节点重启和节点驱逐故障时,避免因缺少网络和操作系统级信息无法定位,引入diagsnap并与GI集成,diagsnap是12.1.0.2 GI引入的新进程,CHM的osysmod管理diagsnap资源,该资源收集弥补CHM通常不收集的其他OS统计信息…
前不久遇到的一个问题,一套12.2的RAC环境, CPU使用率高,使用top可以看到有大量crsctl.bin进程导致, sys cpu占用了大部分, 如果从数据库内查看等待会伴随着wait event “crs call completion”,
继续一个killed无法释放的案例, 环境是11.2.0.4 2nodes-RAC on SELS11, 开始是数据库突然出现了非常高的负载wait event是“enq: SV – contentio”,“row cache lock”,“enq: SQ – contention ”, 因为这个事件KILL了一批进程,后期发现有个进程始终是KILLED状态,并且同时影响后期的AWR都无法生成。
这次预警主要是因为AIX的新特性Flash cache device相关的bug引起的ORACLE 数据库可用性风险, 虽然坑是AIX挖的,但是对于装数据库和巡检(RDA),DBA及客户就是直接受害者。 OracleDBA在使用RDA巡检运行在AIX 7.1 、7.2上使用了ASM 的数据库时可能会把库查死
在oracle 19c引入了新的format option “hint report”, hint report 显示我们sql文本中使用的hint, report body中会显示hint对应查询块hint是否使用, display_xplan的TYPICAL默认只是显示无效的hint.
Automatic index是有索引管理后台进程TASK调用, 可以自动的create, rebuild , drop 索引。后台进程是每15分钟调用一次,(是有j001进程执行_AUTO_INDEX_TASK_INTERVAL参数控制15分钟)。也是基于传统手动优化SQL的思路,基于SQL中的列使用识别可以创建的索引,然后验证自动索引对性能的影响,然后按预设的值去创建索引,只不过整个过程是自动的,并且整个过程都有审核报告。