如何判断数据库是否已激活? [英] how to tell if database is activated?
问题描述
我想要我们的日常品质&策略测试框架还测试我们的数据库是否被激活。但是,我还没有找到一个很好的方法来实现
- 每种方法都有问题:
1.在[db]上获取数据库的快照] - 我无法判断数据库是否已激活 - 或者是否已通过连接取消激活
2.列出活动数据库 - 同样如上所述
3.激活数据库并检查返回代码 - 但我不一定
想激活它们 - 我只想知道它们是否不是。
所以,任何关于如何判断数据库是否被激活的建议或
而不是其他人在系统上,并且没有实际激活它?
谢谢
肯
kenfar写道:
我想要我们的日常品质&策略测试框架还测试我们的数据库是否被激活。但是,我还没有找到一个很好的方法来实现
- 每种方法都有问题:
1.在[db]上获取数据库的快照] - 我无法判断数据库是否已激活 - 或者是否已通过连接取消激活
2.列出活动数据库 - 同样如上所述
这就是要走的路。如果数据库未激活,则没有
连接。
-
Knut Stolze
DB2信息集成开发
IBM德国
Knut Stolze写道:
kenfar写道:
我想要我们的日常品质&策略测试框架还测试我们的数据库是否被激活。但是,我还没有找到一个很好的方法来实现
- 每种方法都有问题:
1.在[db]上获取数据库的快照] - 我无法判断数据库是否已激活 - 或者是否已通过连接取消激活
2.列出活动数据库 - 同样如上所述
这就是要走的路。如果未激活数据库,则它没有
连接。
不幸的是,这并没有区分明确激活的数据库和仅具有连接的数据库:
----测试#1:没有连接的去激活数据库 - 应该返回rc为2
1. db2 connect reset
2. db2 deactivate database rptmart
3. db2 list应用程序 - 确认没有其他人在上面
4. db2 list active databases
SQL1611W Database System Monitor没有返回任何数据。
echo
?
2
结果=测试通过
----测试#2:带连接的去激活数据库 - 应该返回rc为2
1. db2 connect reset
2. db2 deactivate database rptmart
3. db2 connect to rptmart
4. db2 list active databases
< snip>
echo
I''d like our daily quality & policy testing framework to also test if
our databases are activated. However, I haven''t found a good way to do
this yet - every approach has issues:
1. get snapshot for database on [db] - I can''t tell if the database is
activated - or if it is inactivated by has a connection
2. list active databases - same as above
3. activate database and check return code - but I don''t necessarily
want to activate them - i just want to know if they aren''t.
So, any suggestions for how to just tell if a database is activated or
not while others are on the system, and without actually activating it?
Thanks
Ken
kenfar wrote:
I''d like our daily quality & policy testing framework to also test if
our databases are activated. However, I haven''t found a good way to do
this yet - every approach has issues:
1. get snapshot for database on [db] - I can''t tell if the database is
activated - or if it is inactivated by has a connection
2. list active databases - same as aboveThat''s the way to go. If a database is not activated, it does not have a
connection.
--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Knut Stolze wrote:kenfar wrote:
I''d like our daily quality & policy testing framework to also test if
our databases are activated. However, I haven''t found a good way to do
this yet - every approach has issues:
1. get snapshot for database on [db] - I can''t tell if the database is
activated - or if it is inactivated by has a connection
2. list active databases - same as above
That''s the way to go. If a database is not activated, it does not have a
connection.Unfortunately, this does not distinguish between a database that was
explicitely activated and one that merely has a connection:
---- test #1: deactivated db with no connection - should return rc of 2
1. db2 connect reset
2. db2 deactivate database rptmart
3. db2 list applications - confirm nobody else is on
4. db2 list active databases
SQL1611W No data was returned by Database System Monitor.
echo
?
2
RESULT = test passed
---- test #2: deactivated db with a connection - should return rc of 2
1. db2 connect reset
2. db2 deactivate database rptmart
3. db2 connect to rptmart
4. db2 list active databases
<snip>
echo
这篇关于如何判断数据库是否已激活?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!