重新配置ISVD实例
2025 年 6 月 9 日激活ISVA功能模块
2025 年 6 月 11 日环境:DB2 11.5.8 Redhat Linux 8.9
启动db2start时报错:
06/09/2025 16:49:22 0 0 SQL1042C An unexpected system error occurred.
SQL1032N No start database manager command was issued. SQLSTATE=57019
原因:
用于启动数据库实例的数据库管理程序无法以 root 身份执行,因为包含这些数据库管理程序的文件系统是使用 nosuid 选项挂载时,会返回此消息。
排查问题的步骤:
Db2diag.log中可以看到错误如下:
SQL1641N The db2start command failed because one or more database
manager program files was prevented from executing with root
privileges by file system mount settings.
查看mount的磁盘,发现/home挂载时带了nosuid参数:
/dev/mapper/data-data on /opt type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)
/dev/mapper/rhel-home on /home type xfs (rw,nosuid,nodev,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)
原因:
Linux 环境中,对于根用户安装的实例,数据库管理器可执行程序被称为“执行时设置用户 ID”(setuid)程序。setuid 程序以程序所有者的权限执行,而不是以运行该程序的用户的权限执行。例如,像 db2start 这样的数据库管理器程序归 root 所有,因此无论运行 db2start 命令的用户具有何种权限,它都以 root 权限执行。
程序在已挂载的文件系统上以 setuid 权限运行的能力是通过在挂载文件系统时使用 nosuid 选项来配置的。使用 nosuid 选项挂载文件系统可防止程序以 setuid 权限运行。
解决方案:
1.编辑/etc/fstab,重新挂载数据库相关文件(包括 sqllib 目录和 db2start 程序)所在的文件系统,不要使用 nosuid 选项。
2.重新运行 db2start 命令。
因此,建议用户重新挂载文件系统,不要使用 nosuid 选项:
设备 /dev/mapper/rhel-home 挂载在 /home 目录,类型为 xfs(读写、禁止设置用户 ID、禁止设备节点、相对时间戳、安全标签、扩展属性 2、64 位索引节点、日志缓冲区 8 个、日志块大小 32k、不启用配额)
With a root-installed instance in UNIX and Linux environments, several database manager executable programs are what is known as “set user ID upon execution” (setuid) programs. A setuid program executes with the privileges of the owner of the program, instead of the privileges of the user than ran the program. For example, database manager programs such as the db2start program are owned by root, and therefore executes with root privileges regardless of what the privileges are of the user who runs the db2start command.
The ability of programs to run with setuid privileges on a mounted file system is configured using the nosuid option when the file system is mounted. Mounting a file system with the nosuid option prevents programs from running with setuid privileges.
This message is returned in UNIX and Linux environments when database manager programs that are needed to start a database instance were not able to execute as root because the file system on which the the database manager programs are located was mounted with the nosuid option.
User Response:
1.Remount the file system on which the database product files, including the sqllib directory and the db2start program, are located without the nosuid option.
2.Re-run the db2start command.
Therefore, the user is suggested to remount the file system without nosuid option:
/dev/mapper/rhel-home on /home type xfs (rw,nosuid,nodev,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)