易截截图软件、单文件、免安装、纯绿色、仅160KB

db2,oracle,mysql常用命令比较


《oracle,db2,mysql类比》作为三种数据库一个类比,目的在于通过类比,了解现在数据库相似点与异同点,同时可以帮助大家在了解一种数据库,能够迅速地学会其他数据库。初步定义为oracle,db2,mysql三种数据库,以后可能还是追加informix,sysbase,sql server等数据库。
本篇作为首篇,目的是让大家对这三种数据库常用的知识点有一个感知的认识。
一、常用知识点
1、查看可以登陆的数据库:
oracle:查看tnsname.ora 或者 echo $ORACLE_SID
db2:
mysql:show databases --查看当前数据库:select database()
2、查看用户表,视图,表索引,表列,
oracle:
select table_name from user_tables;
select view_name from user_views;
select constraint_name,constraint_type from user_constraints where table_name='';
select column_name from all_tab_columns where table_name='';
db2:
list tables or select tabname from syscat.tables;
select view_name from syscat.views;
describe indexes for table table_name;
select tabname from syscat.columns where tabname='';
mysql:information_schema
select table_name from information_schema.tables where table_schema='USER'; or show tables;
select table_name from information_schema.views where table_schema='USER'; or show table status where comment='view';
select constraint_name,constraint_type from information_schedma.table_constraints where table_name='';
select index_name,table_name from information_schema.statistics where table_name='';
select column_name from information_schedma.columns where table_name='' and table_schema='USER';
3、查看表空间
oracle:select name from v$tablespace
db2: list tablespaces
mysql:
4、查看表结构
oracle:describe table_name
db2:describe table table_name
mysql:describe table_name
5、取前n行数据
oracle:select * from table_name where rownum<n
db2:select * from table_name fetch first n rows only
mysql:select * from table_name limit n
6、load数据
oracle: sqlldr username/passwd control=ctr.ctl data=data.txt
db2:load from data.txt of del insert into table_name
mysql:load data local infile 'e:Mysqlmysql.txt' into table test lin


相关文档:

Oracle启动过程详解 介绍及命令,还有关闭

Oracle启动过程介绍及命令,还有关闭。
写在前面:启动数据库前,请先启动监程序。
lsnrctl start
启动的三个步骤,依次为1.创建并启动实例、2.装载数据库、3.打开数据库。
可以通过命令startup来实现。
startup 命令格式
startup [ nomount | mount | open | force ] [ restrict ] [ pfile=filename ];
方法1 -- st ......

这篇文章阐述了如何管理oracle ERP的interface表


这篇文章阐述了如何管理oracle ERP的interface表
这篇文章阐述了如何管理oracle ERP的interface表
http://blog.oraclecontractors.com/?p=212
There are a number of tables used by Oracle Applications that should have no rows in them when all is running well, and if any, only a few rows that are in error. ......

cmd命令对oracle备份恢复

oracle的导入导出命令直接用cmd就可以完成,导出的文件地址就是cmd的地址,cmd的原始地址可以改,运行cd ..退回到上级目录  cd空格加目录名 是到下级目录 输入D:回车就可以直接到d盘
exp 用户名/密码@数据库名 file=需要保存的文件.dmp tables=(A表,B表....) log=日志.log
exp jjeto_eim_user/jjetoeimuser@EIM ......

Oracle审计功能


Oracle审计功能
审计是对选定的用户动作的监控和记录,通常用于:
u          审查可疑的活动。例如:数据被非授权用户所删除,此时安全管理员可决定对该 数据库的所有连接进行审计,以及对数据库的所有表的成功地或不成功地删除进行审计。
u    &n ......

Mysql的字符串函数

前注:对于针对字符串位置的操作,第一个位置被标记为1。
ASCII(str) 返回字符串str的最左面字符的ASCII代码值。如果str是空字符串,返回0。如果str是NULL,返回NULL。
mysql> select ASCII('2');
-> 50
mysql> select ASCII(2);
-> 50
mysql> select ASCII('dx');
-> 1 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号