oracle 学习摘录

(1)oracle插入回车换行符

SQL>insert into A t(t.name) values('aaaaa'||chr(10)||chr(13)||'ccccc'); 

  已创建 1 行。

  SQL> select * from A t;

  aaaaa

 

  ccccc

 

在做查询时,有时需要显示行号

 select  a.rowid,a.* from ord_sales_order a  显示为字符串,该字符串和数据存储的位置有关

select  rownum,a.* from ord_sales_order a  显示为递增的数字

(3)在字段后的(+)是什么意思?,如“ where A.AREA_CODE = B.AREA_CODE(+);” ?

这个是用在sql语句条件里面的,+在左边,就是右关联,在右边就是左关联,老式写法,建议改为left join , right join

 

(4) greatest函数

http://www.linuxidc.com/Linux/2014-07/103980.htm

 

(5)大数据添加记录-谨慎操作

3亿条数据的一个表插入新字段,并赋予默认值,如何做

http://www.itpub.net/thread-1577033-3-1.html

oracle如何向正在运行的表添加一个字段

http://zhidao.baidu.com/link?url=rKZU3Zdb0ejnZ7R5HV7qB9DEzttVFbHj4Duh_L1e7eyiealLf61D6MaYEGijmza97zdnaBPa1_GTZqu9v-KIgG2xz_Uz2nQE_q2OpwPygZq

在有500万条记录的表中,再重新添加一个字段该怎么添加

http://www.itpub.net/thread-1302914-1-1.html

 

(6)在线重定义

http://blog.itpub.net/11676357/viewspace-1052296/

http://blog.sina.com.cn/s/blog_69e7b8d701019dvz.html

http://www.cnblogs.com/hfliyi/p/3626302.html

http://blog.csdn.net/xionglang7/article/details/7671930

 

(7)存储过程

http://www.cnblogs.com/liliu/archive/2011/06/22/2087546.html

重新编译对象的语法

alter object_type object_name compile;

http://bbs.chinaunix.net/thread-3647142-1-1.html

 

(8)异常:Encountered the symbol xxxx

当你执行完begin.....end语句后,接着执行DDL语句,报如上异常,在end后加符号"/";

参考:http://www.itpub.net/thread-1222908-1-1.html

 

(9)oracle批量insert all

http://blog.csdn.net/indexman/article/details/28496901

 

(10)查看表索引

select * from user_indexes where table_name='表名';

 

(11)多索引字段与单索引字段效率与区别

 http://blog.csdn.net/liqfyiyi/article/details/13290201

 

(12)表名命名规则

1、必须以字母开头
2、长度不能超过30个字符
3、避免使用Oracle的保留字
4、只能使用如下字符 A-Z,a-z,0-9,#$等

 

(13)新建表的数据从已知表获取

create table TEMP_INFO as
select name, id,sex from ATEST;

 

(14)连接远程数据库

 

(15)客户端下载

instantclient_11_2

 

posted @ 2015-07-06 12:14  浪荡云流  阅读(224)  评论(0编辑  收藏  举报