- 操作系统版本
操作系统为CentOS 7.6 - 数据库版本及架构
数据库架构:2x2 数据库版本为Release 21c 21.1.6 revision (81235e1) - 问题描述
应用程序执行sql报错 - 错误代码
ERR-RD000(13034): Service is not available
ERR-HY000(11031): Unable to attach the shared memory segment : sthAttach() returned errno(13) - 原因
未向数据库系统下达shutdown命令,而由于某种原因gmaster进程被终止的状态 - 解决方法
确认数据库异常终止
$ ps -ef | grep $LOGNAME | grep gmaster
$ vi $SUNDB_DATA/trc/system.trc
*未启动gmaster进程,SUNDB system.trc最新日志中没有system shutdown的内容
通过集群成员启动(恢复)
- 运行gsyncher将内存中的重做日志缓冲区的内容与磁盘上的重做日志文件同步。 通过执行gsyncher生成的日志保存在$ SUNDB_DATA / trc文件夹中。
- 整理内存
ipcs -m | grep $LOGNAME | awk ‘{print "ipcrm -m " $2}’ | sh -v
ipcs -q | grep $LOGNAME | awk ‘{print "ipcrm -q " $2}’ | sh -v
ipcs -s | grep $LOGNAME | awk ‘{print "ipcrm -s " $2}’ | sh -v - 启动数据库(LOCAL OPEN)
$ gsql sys gliese --as sysdba
gSQL > startup - join集群系统
gSQL> alter system join database;
ERR-42000(16405): of the total ‘1’ tables in the database, ‘1’ tables need to be rebalanced
System altered. - 数据rebalance及查看数据
gSQL> alter database rebalance;
Database altered.
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




