随笔分类 -  Oracle

摘要:清空表 oracle --truncate truncate table gh_qytc_ls; //从一个表插入到另外一个表 insert into gh_qytc_ls SELECT * FROM gh_qytc tc; 快速copy一张表数据到另外一张表 1、创建一个临时表,字段和要用的表相同 create table gh_qyghgx_temp as select *... 阅读全文
posted @ 2018-12-27 11:49 张永光 阅读(3298) 评论(0) 推荐(0)
摘要:1 用distinct关键字只能过滤查询字段中所有记录相同的(记录集相同),而如果要指定一个字段却没有效果,另外distinct关键字会排序,效率很低 。 2 select distinct name from t1 能消除重复记录,但只能取一个字段,现在要同时取id,name这2个字段的值。 3 select distinct id,name from t1 可以取多个字段,但只能消... 阅读全文
posted @ 2018-12-27 11:40 张永光 阅读(4139) 评论(0) 推荐(0)
摘要:SELECT t1.Table_Name AS "表名称", t3.comments AS "表说明", t1.Column_Name AS "字段名称", t1.Data_Type AS "数据类型", t1.Data_Length AS "长度", t1.NullAble AS "是否为空", t2.Comments AS "字段说明", t1.Data_Def... 阅读全文
posted @ 2018-12-27 11:39 张永光 阅读(420) 评论(0) 推荐(0)
摘要:创建oracle数据库用户 sqlplus /nolog SQL> conn / as sysdba; SQL>create user username identified by password SQL> grant dba to username; create user bim_dev identified by bim_dev grant dba to bim_dev ... 阅读全文
posted @ 2018-12-27 11:38 张永光 阅读(146) 评论(0) 推荐(0)
摘要:Winserver 和 linxu 下的备份还原命令是相同的 基本格式: imp和exp不适合大文件备份,如果文件超过20个G,这种方式效率会很低,如果文件过大,可以采用Rman方式进行备份还原 exp bim_dev/bim_dev@ounion file=c:\bim_dev.dmp owner=bim_dev imp bim_dev/bim_dev@ounion file=c:\... 阅读全文
posted @ 2018-12-27 11:36 张永光 阅读(161) 评论(0) 推荐(0)