1.Linux常用命令
1.1.进入DB2数据库的命令
查看市端复制服务:ps –ef|grep capture
显示系统多少位:uname -a
查看省端复制服务:ps –ef|grep apply
db2 list db directory 查看库
db2level 查看版本
db2 list tablespaces for detail 查看表空间
db2 list tables 查看表
db2 list tables for schema XXX 查看具体某个表
db2 describe table X140581.SYS_USERLOG 查看表结构
db2 connect reset(重新连接)
1. su - db2inst1 切换用户名
2. db2 connect to dbname 进入数据库
3. db2 "select * from config_mine" 执行数据库的命令
4. db2 –tvf ttt.sql (SQL文件不能放在root目录下,放在db2用户目录下。
5. 查看schema下所有的数据表
db2 list tables for schema cschema
6. 设置当前数据库的模式为cschema
db2 "set current schema cschema"
1.2.进入POSTGRES数据库的命令
[root@localhost ~]# psql -U postgres –l 查看数据库中的数据库
1.psql -U postgres -d gisdb //进入gisdb库,出现gisdb=#
2.在出现gisdb=#后面执行 select * from gis_mine; //一定要记住最后的";"号。
3.执行psql -U postgres 后,执行create database gisdb; //创建数据库
postgres=# alter user postgres password '123456'; 修改数据库密码