linux db(linux系统有哪些)

很多朋友对于linux db和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.sql>runstats.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上咱装DB2

我网上复制来的,可以稍微看下,其实DB2也有安装脚本的

安装DB2

DB2的安装可以算是再各个数据库里面最简单的了。除了sqlite。

下载安装包,解压

[root@Enterprise tmp]# tar xvf DB2_V82_PE_LNX_32_NLV.tar

解开以后的文件都被放置在当前目录下的pe文件夹中。

开始安装:

[root@Enterprise tmp]# cd pe

[root@Enterprise pe]# ls

db2 db2_deinstall db2_install db2setup doc

[root@Enterprise pe]#./db2_install

Specify one or more of the following keywords,

separated by spaces, to install DB2 products.

选择自己要安装的产品,输入名字后回车。等待安装完成。

我们现在需要做的是,对数据库的初始化工作。包括安装授权文件和创建一个实例并运行它。

首先,我们安装授权文件。

不安装授权文件的话,则是评估版,九十天后就要过期。授权文件,在安装包已经有了。我们用下面的命令安装它:

[root@Enterprise pe]#/opt/IBM/db2/V8.2/adm/db2licm-a/tmp/pe/db2/lic

ense/db2pe.lic

如果没有db2pe.lic文件。可以去网上找找。

我们需要创建一个用户。

[root@Enterprise pe]# useradd db2inst1

[root@Enterprise pe]# passwd db2inst1

开始创建实例:

[root@Enterprise pe]#/opt/IBM/db2/V8.2/instance/db2icrt-u db2inst1 db2inst1

这样,我们就创建了一个实例db2ins1。

[root@Enterprise pe]# su db2inst1

[db2inst1@Enterprise pe]$ db2start

07/26/2007 16:45:10 0 0 SQL1063N DB2START processing was successful.

SQL1063N DB2START processing was successful.

这样我们数据库就启动成功。

[db2inst1@Enterprise pe]$ db2

(c) Copyright IBM Corporation 1993,2002

Command Line Processor for DB2 SDK 8.2.0

You can issue database manager commands and SQL statements from the command

prompt. For example:

db2=> connect to sample

db2=> bind sample.bnd

For general help, type:?.

For command help, type:? command, where command can be

the first few keywords of a database manager command. For example:

? CATALOG DATABASE for help on the CATALOG DATABASE command

? CATALOG for help on all of the CATALOG commands.

To exit db2 interactive mode, type QUIT at the command prompt. Outside

interactive mode, all commands must be prefixed with'db2'.

To list the current command option settings, type LIST COMMAND OPTIONS.

For more detailed help, refer to the Online Reference Manual.

db2=>

创建一个最简单的数据库

db2=> create database testdb

DB20000I The CREATE DATABASE command completed successfully.

查看本instance下有哪些database

db2=> list database directory

System Database Directory

Number of entries in the directory= 2

Database 1 entry:

Database alias= TESTDB

Database name= TESTDB

Local database directory=/home/db2inst1

Database release level= a.00

Comment=

Directory entry type= Indirect

Catalog database partition number= 0

Alternate server hostname=

Alternate server port number=

Database 2 entry:

Database alias= OMNIDB

Database name= OMNIDB

Local database directory=/home/db2inst1/data

Database release level= a.00

Comment=

Directory entry type= Indirect

Catalog database partition number= 0

Alternate server hostname=

Alternate server port number=

linux怎么安装mongodb

Linux平台安装MongoDB

MongoDB提供了 linux各发行版本 64位的安装包,你可以在官网下载安装包。

下载地址:

下载完安装包,并解压tgz(以下演示的是 64位 Linux上的安装)。

MongoDB的可执行文件位于 bin目录下,所以可以将其添加到PATH路径中:

<mongodb-install-directory>为你 MongoDB的安装路径。如本文的/usr/local/mongodb。

创建数据库目录

MongoDB的数据存储在data目录的db目录下,但是这个目录在安装过程不会自动创建,所以你需要手动创建data目录,并在data目录中创建db目录。

以下实例中我们将data目录创建于根目录下(/)。

注意:/data/db是 MongoDB默认的启动的数据库路径(--dbpath)。

命令行中运行 MongoDB服务

你可以再命令行中执行mongo安装目录中的bin目录执行mongod命令来启动mongdb服务。

注意:如果你的数据库目录不是/data/db,可以通过--dbpath来指定。

MongoDB后台管理 Shell

如果你需要进入MongoDB后台管理,你需要先打开mongodb装目录的下的bin目录,然后执行mongo命令文件。

MongoDB Shell是MongoDB自带的交互式Javascript shell,用来对MongoDB进行操作和管理的交互式环境。

当你进入mongoDB后台后,它默认会链接到 test文档(数据库):

由于它是一个JavaScript shell,您可以运行一些简单的算术运算:

现在让我们插入一些简单的数据,并对插入的数据进行检索:

第一个命令将数字 10插入到 runoob集合的 x字段中。

MongoDb web用户界面

MongoDB提供了简单的 HTTP用户界面。如果你想启用该功能,需要在启动的时候指定参数--rest。

MongoDB的 Web界面访问端口比服务的端口多1000。

如果你的MongoDB运行端口使用默认的27017,你可以在端口号为28017访问web用户界面,即地址为:。

阅读剩余
THE END