当前位置:网站首页>GBase 8a的create database 会被查询耗时很长怀疑卡住的现象分析
GBase 8a的create database 会被查询耗时很长怀疑卡住的现象分析
2022-06-27 19:33:00 【生命之源;】
在GBase 8a里,create database是权限最高的DDL语句,其需要一个db_lock独占锁,如果其它SQL在使用该库,则需要等待,从现象看是被卡住了。即使运行create database if not exists一样要等待锁。
现象
如下的一个create database语句,已经等待了130秒没有返回。
最后用户取消了,显示信息如下:
可以看到是无法拿到锁,取消了等待锁的操作。
排查
再次运行create database语句,然后执行gcadmin showlock,查看集群锁的情况
可以看到IP为12节点的401398进程(下面的2个红框),没有拿到db_lock的锁(FALSE),该锁被IP为14的254505拿到了。连接14节点,查看进程

发现该节点的进程正在做insert select操作,且已经执行了3266秒。
解决
等待该SQL完成
确认该业务不重要,kill掉
人工确认数据库已存在,不要运行create database语句
总结
create database一般都是运行在系统初始化阶段,在业务升级时,是不需要重建数据库的。而在业务升级时,涉及到【重建】库,肯定要先停掉现有业务,才能操作,也不会出现这个现象。
所以,除了初始化,其它的业务升级,不要包含create database 语句。
边栏推荐
- Go from introduction to actual combat - all tasks completed (notes)
- Go从入门到实战——package(笔记)
- White whoring red team goby & POC, how do you call white whoring?
- Go从入门到实战——channel的关闭和广播(笔记)
- SQL必需掌握的100个重要知识点:组合 WHERE 子句
- Very comprehensive dolphin scheduler installation and use documents
- PCIE知识点-008:PCIE switch的结构
- linux下安装oracle11g 静默安装教程
- Knowledge sorting of exception handling
- Goldfish rhca memoirs: do447 managing projects and carrying out operations -- creating job templates and starting jobs
猜你喜欢

Squid proxy server

Galaxy Kirin system LAN file sharing tutorial

Go从入门到实战——CSP并发机制(笔记)

Go从入门到实战——Panic和recover(笔记)

Go from introduction to practice - Interface (notes)

Very comprehensive dolphin scheduler installation and use documents

Let Ma Huateng down! Web3.0, hopeless

跟我一起AQS SOS AQS

Save method of JPA stepping pit series

Express e stack - small items in array
随机推荐
Yu Wenwen, Hu Xia and other stars take you to play with the party. Pipi app ignites your summer
SQL必需掌握的100个重要知识点:组合 WHERE 子句
Process control task
Go从入门到实战——CSP并发机制(笔记)
CORBA 架构体系指南(通用对象请求代理体系架构)
强制 20 天内开发 APP 后集体被裁,技术负责人怒批:祝“早日倒闭!”
Go from introduction to actual combat -- channel closing and broadcasting (notes)
DO280OpenShift访问控制--security policy和章节实验
Go from introduction to practice -- coordination mechanism (note)
win11桌面出現“了解此圖片”如何删除
SQL必需掌握的100个重要知识点:使用函数处理数据
熊市慢慢,Bit.Store提供稳定Staking产品助你穿越牛熊
Industry case | see the operation of bank digital transformation from the king of retail
Knowledge sorting of exception handling
TypeScript学习
Codeforces Round #716 (Div. 2)
oracle迁移mysql唯一索引大小写不区分别怕
SQL必需掌握的100个重要知识点:IN 操作符
Kirin V10 installation font
Codeforces Round #717 (Div. 2)