-- 系统信息查询
getconf LONG_BIT # 获取系统位数
cat /etc/os-release | grep "PRETTY_NAME" # 查询操作系统
cat /proc/version # 查询系统
lscpu # 查询CPU型号
cat /proc/cpuinfo|grep "physical id"|sort|uniq|wc -l # CPU个数
free -h #查询内存
df -h #快速查看所有磁盘空间
du -sh * #查询目录下所有项目的大小
fdisk -l #查询所有物理磁盘
netstat -tunlp | grep <进程名或端口号> #查询端口号
hostname -I #查询本机ip
history | grep disql #查询disql命令历史
./disql -id #查询数据库版本序列号
-- DM数据库信息查询脚本
SELECT BANNER FROM V$VERSION;
SELECT '检查时间' AS 信息类型, CAST((SELECT CURRENT_TIMESTAMP) AS VARCHAR(100)) AS 详细信息
UNION ALL
SELECT '当前数据库检查检查用户', CAST((select USER) AS VARCHAR(100))
UNION ALL
SELECT '数据库版本', CAST((select build_version from v$instance) AS VARCHAR(100))
UNION ALL
SELECT '授权类型', CAST((select server_type from v$license) AS VARCHAR(100))
UNION ALL
SELECT '文件序列号', CAST((SELECT SERIES_NO FROM V$LICENSE) AS VARCHAR(100))
UNION ALL
SELECT '服务器颁布类型', CAST((SELECT SERVER_SERIES FROM V$LICENSE) AS VARCHAR(100))
UNION ALL
SELECT '有效日期', CAST((SELECT EXPIRED_DATE FROM V$LICENSE) AS VARCHAR(100))
UNION ALL
SELECT '用户名称',
CAST((SELECT AUTHORIZED_CUSTOMER FROM V$LICENSE) AS VARCHAR(100))
UNION ALL
SELECT '授权用户数',
CAST((SELECT AUTHORIZED_USER_NUMBER FROM V$LICENSE) AS VARCHAR(100))
UNION ALL
SELECT '服务器版本号',
CAST((SELECT SVR_VERSION FROM V$INSTANCE) AS VARCHAR(100))
UNION ALL
SELECT '服务器启动时间',
CAST((SELECT START_TIME FROM V$INSTANCE) AS VARCHAR(100))
UNION ALL
SELECT '页大小',
CAST((SELECT PAGE()) AS VARCHAR(100))
UNION ALL
SELECT '簇大小',
CAST((SELECT SF_GET_EXTENT_SIZE()) AS VARCHAR(100))
UNION ALL
SELECT '大小写敏感',
CAST((SELECT CASE_SENSITIVE()) AS VARCHAR(100))
UNION ALL
SELECT '字符集',
CAST((SELECT UNICODE()) AS VARCHAR(100))
UNION ALL
SELECT '库状态',
CAST((SELECT STATUS$ FROM V$INSTANCE) AS VARCHAR(100))
UNION ALL
SELECT '当前节点的模式',
CAST((SELECT MODE$ FROM V$INSTANCE) AS VARCHAR(100));
SELECT '归档类型',ARCH_TYPE FROM V$DM_ARCH_INI;
select arch_status from v$arch_status where arch_type='LOCAL';
select CASE WHEN PARA_VALUE=1 THEN '是
' ELSE '否' end "是否开启归档" from v$dm_ini where para_name='ARCH_INI';
SELECT CASE WHEN PARA_VALUE=1 THEN (SELECT WM_CONCAT(ARCH_TYPE) FROM V$DM_ARCH_INI) ELSE '未启归档' END "数据库归档类型" from v$dm_ini where para_name='ARCH_INI';
SELECT '归档文件大小',TO_CHAR(WM_CONCAT(ARCH_FILE_SIZE)) FROM V$DM_ARCH_INI;
SELECT '归档上限',WM_CONCAT(ARCH_NAME||':'||ARCH_SPACE_LIMIT||' ') FROM V$DM_ARCH_INI;
SELECT '备份是否开启',CASE COUNT(0) WHEN 0 THEN '未开启' ELSE '已开启' END FROM V$BACKUPSET;
获取本机IP地址:hostname -I
获取某进程端口信息:lsof -i -P -n | grep 程序名
查询系统中的错误码信息:SELECT * FROM V$err_info;
文章
阅读量
获赞