db2 查看创建了多少个数据库

db2 查看创建了多少个数据库,第1张

select name from sysibmsystables where type='T' and creator='DB2ADMIN' 
type:数据库表用T表示;数据库视图用V表示 
creator:数据库对象的创建者 
select   tabname   from   syscattables   where   tabschema   =   current   schema   ;//   获取当前模式下面的所有用户

数据库中还有大量系统表的,所以我觉得你查某些模式下的表比较好:
select count() from syscattables where tabschema='GP'
GP为某用户模式。
当然也可以用
select count() from syscattables where tabschema='GP'
查出所有表的数量。
再查出有多少张系统表,就是在SYSIBM、SYSTOOLS下的表数目。相减就可以了。
我用的是DB2 V97。

查看当前用户:
select
user()
;
查看用户的权限:
show
grants
for
'username'@'localhost'
查看当前用户的权限:
show
grants
;
修改
root
用户的密码
set
password
for
'root'@'localhost'
=
password('新密码');
或者:
update
user
set
password
=
password('newpass')
where
user
=
'root';
flush
privileges
;
privileges;


欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/yw/13383272.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-07-25
下一篇 2023-07-25

发表评论

登录后才能评论

评论列表(0条)

保存