资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

linux常用数据库命令 linux数据库指令

DB2数据库在linux操作系统的指令有哪些?

DB2数据库命令简介 1.启动数据库 DB2start 2.停止数据库 DB2stop DB2数据库在linux相关指令之3.连接数据库 DB2 connect to o_yd user DB2 using pwd 4.读数据库管理程序配置 DB2 get dbm cfg 5.写数据库管理程序配置 DB2 update dbm cfg using 参数名 参数值 6.读数据库的配置 DB2 connect to o_yd user DB2 using pwd DB2 get db cfg for o_yd 7.写数据库的配置 DB2 connect to o_yd user DB2 using pwd DB2 update db cfg for o_yd using 参数名 参数值 8.关闭所有应用连接 DB2 force application all DB2 force application ID1,ID2,,,Idn MODE ASYNC (DB2 list application for db o_yd show detail) 9.备份数据库 DB2 force application all DB2 backup db o_yd to d: (DB2 initialize tape on \.tape0) (DB2 rewind tape on \.tape0) DB2 backup db o_yd to \.tape0 10.恢复数据库 DB2 restore db o_yd from d: to d: DB2 restore db o_yd from \.tape0 to d: DB2数据库在linux相关指令之11.绑定存储过程 DB2 connect to o_yd user DB2 using pwd DB2 bind c:dfplus.bnd 拷贝存储过程到服务器上的C:sqllibfunction目录中 12.整理表 DB2 connect to o_yd user DB2 using pwd DB2 reorg table ydd DB2 runstats on table ydd with distribution and indexes all 13.导出表数据 DB2 export to c:dftz.txt of del select * from dftz DB2 export to c:dftz.ixf of ixf select * from dftz 14.导入表数据 import from c:123.txt of del insert into ylbx.czyxx DB2 import to c:dftz.txt of del commitcount 5000 messages c:dftz.msg insert into dftz DB2 import to c:dftz.ixf of ixf commitcount 5000 messages c:dftz.msg insert into dftz DB2 import to c:dftz.ixf of ixf commitcount 5000 insert into dftz DB2 import to c:dftz.ixf of ixf commitcount 5000 insert_update into dftz DB2 import to c:dftz.ixf of ixf commitcount 5000 replace into dftz DB2 import to c:dftz.ixf of ixf commitcount 5000 create into dftz (仅IXF) DB2 import to c:dftz.ixf of ixf commitcount 5000 replace_create into dftz (仅IXF) 15.执行一个批处理文件 DB2 -tf 批处理文件名 (文件中每一条命令用 ;结束) 16.自动生成批处理文件 建文本文件:temp.sql select 'runstats on table DB2.' || tabname || ' with distribution and detailed indexes all;' from syscat.tables where tabschema='DB2' and type='T'; DB2 -tf temp.sqlrunstats.sql 17.自动生成建表(视图)语句 在服务器上:C:sqllibmisc目录中 DB2 connect to o_yd user DB2 using pwd DB2look -d o_yd -u DB2 -e -p -c c:o_yd.txt DB2数据库在linux相关指令之18.其他命令 grant dbadm on database to user bb 19select * from czyxx fetch first 1 rows only 20DB2look -d ylbx -u DB2admin -w -asd -a -e -o a.txt21. 显示当前用户所有表 list tables 22.列出所有的系统表 list tables for system 23.查看表结构 DB2 describe select * from user.tables (实习编辑:HJ)

为桃江等地区用户提供了全套网页设计制作服务,及桃江网站建设行业解决方案。主营业务为成都网站设计、做网站、桃江网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!

linux下如何进入mysql(linux进入mysql数据库命令)

1、linux怎么进入mysql数据库。

2、Linux怎么进入数据库。

3、linux 进去mysql。

4、centos怎么进入mysql数据库。

1."linux怎么进入mysql数据库,为您提供linux怎么进入mysql数据库图文信息,打开linux服务器,然后在桌面的空白处点击右键。

2.在弹出的下拉选项里,点击打开终端。

3.使用命令servicemysqldstart即可启动mysql数据库。

4.可以通过mysql-uuser-ppasswd命令连接数据库,查看mysql是否启动成功。

在Linux上用命令怎么连接数据库

以常见的mysql和oracle这两种数据库为例:

一、连接mysql(mysql服务已开启)

1、mysql数据库安装在本机,则直接敲入命令mysql

-u

root

-p即可。

2、mysql数据库不是安装在本机,则需要加参数,常用参数如下:

1),-h,指定目标ip地址

2),-u,指定登录用户名。

3),-p,指定密码,密码可以接在-p后面输入mysql

-uroot

-p123456。也可以mysql

-uroot

-p回车等提示输入密码时输入,这样输入密码没有回显。

二、连接oracle数据库

1、若当前用户为root用户,则需要执行命令

su

-

oracle切换至oracle用户;若当前用户为oracle用户则此步骤省略。

2、若oracle安装在本机,则在oracle用户下直接执行sqlplus

username/password(username,password替换成真实的用户名和密码),若提示connected则表示连接成功;

3、若oracle安装在其他机器,则在oracle用户下执行sqlplus

username/password@//host:port/sid。host为oracle所在机器的ip或者机器名,port为端口号,通常为1521,sid指oracle的实例名。

扩展资料:

linux下操作数据库(以mysql为例)的其他命令

一、linux下查看mysql服务的命令两种方式:

1、[root@localhost

bin]ps

-ef|grep

mysql

2、[root@localhost

bin]netstat

-nlp

二、linux下启动mysql服务的两种方式:

1、命令方式:

[root@localhost

bin]cd

/usr/bin

[root@localhost

bin]./mysqld_safe

2、服务方式:

[root@localhost

~]service

mysql

start

如果服务在启动状态,直接重启服务用以下命令:[root@localhost

~]service

mysql

restart

三、linux下关闭mysql服务的两种方式:

1、命令方式:

[root@localhost

~]mysqladmin

-u

root

shutdown

2、服务方式:

[root@localhost

~]service

mysql

stop

参考资料:mysql官方文档


名称栏目:linux常用数据库命令 linux数据库指令
文章分享:http://cdkjz.cn/article/doijecj.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220