db2 CREATE DATABASE XYZ
db2 DROP DATABASE XYZ
这些 db2 命令不支持在 db2cmd/db2clp 上为机器登录用户以外的特定用户执行时指定用户名/密码.因此导致异常
These db2 commands which doesn't provide support to specify username/password while executing on db2cmd/db2clp for a specific user other than machine logged-in user. Hence result a exception
SQL1092N 请求的命令或操作失败,因为用户标识没有执行请求的命令或操作的权限."
"SQL1092N The requested command or operation failed because the user ID does not have the authority to perform the requested command or operation."
当通过选择以不同用户身份运行"来运行相同的命令时,它可以正常工作.
And when the same commands run as by choosing 'Run as different user', it works properly.
在 CLP 中,您可以首先使用所需的任何用户 ID ATTACH 到实例,然后发出 CREATE DATABASE 命令.
From the CLP you can first ATTACH to the instance using whatever user ID you need, and then issue the CREATE DATABASE command.
如果实例在您的本地机器上运行,您只需像这样附加:
If the instance is running on your local machine, you just attach like this:
$ db2 attach to db2inst1 user db2inst1
Enter current password for db2inst1:
Instance Attachment Information
Instance server = DB2/LINUXX8664 9.7.5
Authorization ID = DB2INST1
Local instance alias = DB2INST1
如果实例在远程服务器上运行,则附加到您在数据库目录中定义的节点名称":
If the instance is running on a remote server, you attach to the "node name" that you have defined in your database catalog:
$ db2 list db directory
System Database Directory
Number of entries in the directory = 1
Database 1 entry:
Database alias = SAMPLE
Database name = SAMPLE
Node name = SRV01
Database release level = d.00
Comment =
Directory entry type = Remote
Catalog database partition number = -1
Alternate server hostname =
Alternate server port number =
在本例中,list database directory 的输出中显示的节点名称为 SRV01,因此您可以使用以下命令进行附加:db2 attach to srv01 user <用户名>.
In this example, the Node Name shown in the output from list database directory is SRV01, so you would attach using: db2 attach to srv01 user <username>.
这篇关于为机器登录用户以外的特定用户运行创建/删除 DB2 数据库命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何检测 32 位 int 上的整数溢出?How can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
return 语句之前的局部变量,这有关系吗?Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
如何将整数转换为整数?How to convert Integer to int?(如何将整数转换为整数?)
如何在给定范围内创建一个随机打乱数字的 intHow do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
java的行为不一致==Inconsistent behavior on java#39;s ==(java的行为不一致==)
为什么 Java 能够将 0xff000000 存储为 int?Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)