oracle基本操作
describe TABLE_NAME; --描述
----------------------------------------------------------------
create table as select XXXXXX
insert into TABLE_NAME (reac_1,reac_2.....) values(v1,v2)
insert into TABLE_NAME (select * from ..........)
update TABLE_NAME set reac_1=v1,................... where .....
delete from TABLE_NAME where ...................
----------------------------------------------------------------
select [all|distinct top n[percent]] with ties SELECT_LIST
[into[NEW_TABLE_NAME]]
[from {TABLE_NAME,....}][(OPTIMIZWE_HINTS)]
[where CLAUSE]
[group by CLAUSE]
[order by CLAUSE]
[compute CLAUSE]
[for browse]
--distinct 检索唯一的表列值
----------------------------------------------------------------
= != <> like and or between XXX and XXX in(XX,XX) union (合并查询)
----------------------------------------------------------------
alter table TABLE_NAME add REAC_NAME REAC_TYPE --改变列(添加列)
EG: alter table scott.emp add name_my char(10) NULL;
alter table TABLE_NAME modify(name_my char(10)) --改变列长度
alter table TABLE_NAME DROP COLUMN name_my --drop列
--------------------------
--函数-----------
---------------------------
asin() 反正玄 acos()反余玄 atan()反正切 atb2(,)反正切
sin()正玄 cos()余玄 tan()正切 cot()余切
exp()指数 power(a,b)a的b次方根 sort()平方根 square()平方
log()自然对数 log10()对数 abs()绝对值
ceiling(a)大于a的最小整数 floor(a)小于a的最大整数
rand()0-1的随机数 pi()3.14159 sign(a) a<0,=0,>0时,返回-1,0,1
count()合计 sum()求和 max() min()
----------------------------------------------------------------
ascii()求asc值 unicode()求unicode值 initcap()首字母变大写
str(a,l,d)转化为字符串,a为数值,l为长,d为保留小数位数
len()求长 left(a,l) right(a,l)
相关文档:
语法:TRANSLATE(expr,from,to)
expr: 代表一串字符,from 与 to 是从左到右一一对应的关系,如果不能对应,则视为空值。
举例:
select translate('abcbbaadef','ba','#@') from dual (b将被#替代,a将被@替代)
select translate('abcbbaadef','bad','#@') from dual (b将被#替代,a将被@替代,d对应的值是空 ......
今天客户的一套RAC环境出现问题
双节点RAC环境中,一个节点因为锁竞争而挂起,shutdown之后无法启动。
故障出现时我正在路上,匆匆回到家中,处理故障。
解决之后查找故障原因。
检查当时的AWR信息发现Top 5 Timed Events显示如下信息:
Top 5 Timed Events &nb ......
--使用DBA创建两个用户
create user gubo identified by gubo;
create user gubo2 identified by gubo;
--给两个用户连接权限
grant create session to gubo;
grant create session to gubo2;
--给其中一个用户访问表空间的权限
grant unlimited tablespace to gubo;
--连接其中用户,创建表
--conn gubo
......
第一部分 基本概念
一、 ......