[数据库] 达梦数据库常用命令汇总

1695 0
Honkers 2025-3-8 04:58:06 | 显示全部楼层 |阅读模式
  • 查看达梦数据库最大连接数
  1. SQL> select SF_GET_PARA_VALUE(2,'MAX_SESSIONS');
  2. 行号 SF_GET_PARA_VALUE(2,'MAX_SESSIONS')
  3. ---------- -----------------------------------
  4. 1 65000
  5. 已用时间: 1.006(毫秒). 执行号:5994100.
复制代码
  • 查看达梦数据库当前连接数
  1. SQL> select count(*) from v$sessions where state='ACTIVE';
  2. 行号 COUNT(*)
  3. ---------- --------------------
  4. 1 1
复制代码
  • 查看达梦授权到期时间
  1. select expired_date from v$license;
复制代码
  • 达梦数据库版本查看
  1. select id_code();
  2. select * from v$version;
  3. select * from v$instance;
复制代码
  • 删所有schema
    drop SCHEMA COOPPER CASCADE;
    drop SCHEMA KINGSOFT_QING CASCADE;

  • 达梦数据登录命令

  1. ./disql sysdba/xxx@localhost:5236
复制代码
  • 查询所有schema
  1. select distinct object_name TABLE_SCHEMA from all_objects where object_type = 'xxxx';
复制代码
  • 查询指定用户下的schema
  1. select distinct object_name TABLE_SCHEMA from all_objects where object_type = 'xxx' AND OWNER='SYSDBA';
复制代码
  • 查询表空间
  1. select tablespace_name from dba_tablespaces;
复制代码
  • 查询所有表
  1. select TABLE_NAME from dba_tables;
复制代码

查看会话数

  1. select 'ACTIVE_SESS:' as SESS,count(1) as COUNT from v$sessions where state='ACTIVE' union all
  2. select 'CURRENT_SESS:',count(1) from v$sessions union all
  3. select 'MAX_SESS:',para_value from v$dm_ini where para_name='MAX_SESSIONS';
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2026 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行