查看当前有多少个数据库 | Database 1 entry: |
创建数据库 | DB20000I |
创建schema | [db2inst1@oc5873237464 elsa]$ db2 create schemaTESTschema DB20000I |
更改密码 | [root@oc5873237464 html]# passwd db2inst1 Changing password for user db2inst1. You can now choose the new password. A valid password should be a mix of upper and lower caseletters, digits, and other characters. password with characters from at least 2 of these 4 classes. An upper case letter that begins the password and a digitthat ends it do not count towards the number of character classesused, unless disable_firstupper_lastdigit_check option is enabled. Enter new password: Re-type new password: |
登入db2inst1用户 | [root@oc5873237464 html]# su db2inst1 |
链接TEST2数据库 | [db2inst1@oc5873237464 html]$ db2 connect toTEST2 |
显示TEST2的表格空间 | [db2inst1@oc5873237464 html]$ db2 listtablespaces |
列出当前数据库里的表 | [db2inst1@oc5873237464 html]$ db2 listtables Table/View ------------------------------- --------------- ------------------------------- |
查看表内部数据 | [db2inst1@oc5873237464 elsa]$ db2 select * fromUSER_PROFILE USER_ID ----------- ----------------------------------------------------------------------------------------------------- ------------------ ---------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- -------- |
看表的状态 | [db2inst1@oc5873237464 ~]$ db2 load query tableSR.USER_PROFILE Tablestate: 除了Set Integrity Pending还有Normal状态。 |
删除数据库 | [db2inst1@oc5873237464 xxx]$ db2 drop dbTEST2(Database Name) DB20000I |
列出schema中的tables | [db2inst1@oc5873237464 xxx]$ db2 list tables forschema Table/View ------------------------------- --------------- ------------------------------- A B C D E |
停掉所有应用 | [db2inst1@ocxxx xxxx]$ db2 force application all DB20000I The FORCE APPLICATION command completed successfully. DB21024I This command is asynchronous and may not be effective immediately. |
DB2命令
最新推荐文章于 2020-07-16 19:16:18 发布