oracle
maypol
这个作者很懒,什么都没留下…
展开
-
if not exits
sqlif not exists (select * from uuv_user where userid=UR1100017647) insert into uuv_user (userid, username,displayname,telephone) values(UR1100017647, suxf,苏肖飞,)oracle insert原创 2010-03-11 20:55:00 · 639 阅读 · 0 评论 -
利用redolog日志查看删除的表结构
SQL> select member from v$logfile;MEMBER--------------------------------------------------------------------------------/home/ora10g/oradata/orcl/redo03.log/home/ora10g/oradata/orcl/redo02.log转载 2013-01-24 18:30:33 · 2010 阅读 · 0 评论 -
oracle恢复已被commit删除的内容
*1.FLASHBACK QUERY*/ --闪回到15分钟前 select * from orders as of timestamp (systimestamp - interval '15' minute) where ...... 这里可以使用DAY、SECOND、MONTH替换minute,例如: SELECT * FROM orders AS OF TIMESTA转载 2013-01-24 17:40:57 · 4675 阅读 · 1 评论 -
oracle quota
创建用户导入数据create user dldb identified by dldb default tablespace DLDATAgrant connect,resource,create view to dldb;revoke unlimited tablespace from dldbalter user dldb quota unlimited on DLDATA原创 2012-11-17 15:02:52 · 402 阅读 · 0 评论 -
oracle linux 常用
修改链接数show parameter processesalter system set processes=2000 scope=spfile;查看连接个数select count(*) from v$session where status='ACTIVE';Too many open files in systemecho "9234560">/proc原创 2012-11-17 15:17:53 · 332 阅读 · 0 评论 -
oracle quota
创建用户导入数据create user dldb identified by dldb default tablespace DLDATAgrant connect,resource,create view to dldb;revoke unlimited tablespace from dldbalter user dldb quota unlimited on DLDATA原创 2012-11-17 15:02:48 · 422 阅读 · 0 评论 -
删除数据库不可用连接
#!/usr/bin/kshecho "start delete link"querysessionnum=`sqlplus / as sysdba Select count(*) from v\\$session where status='INACTIVE'; Select sid,SERIAL# from v\\$session where status='INACTIVE'原创 2011-12-29 17:35:51 · 354 阅读 · 0 评论 -
ORACLE数据库表空间操作
1.查看数据库表的使用空间select tablespace_name,sum(bytes)/1024/1024 from dba_data_files group by tablespace_name;2.查看数据库剩余表空间SELECT tablespace_n转载 2011-09-29 09:13:13 · 401 阅读 · 0 评论 -
删除表数据并插入临时表
语句先判断要删除表的对象是否存在,如果存在则插入一条新数据,如果不存在则先创建一个删除表,再插入相应数据表对象:TableName 删除表对象:TableName_deled主键ID:pCol 其它列名:Fields if (!TableName.Contains("_deled")) {原创 2010-03-16 12:10:00 · 827 阅读 · 0 评论 -
查询及删除重复记录的方法
(一)1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断select * from peoplewhere peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)2、删除表中多余的重复记录,重复记录是根据单个字段(p原创 2010-03-15 10:15:00 · 345 阅读 · 0 评论 -
oracle数字字段判断
select nvl2(replace(translate(69584.00.00,.0123456789,000000000000),0,),否,是) IsNumber from dual;select id,nvl2(replace(translate(id,.0123456789,000000000000),0,),否,是) I原创 2010-03-15 10:14:00 · 427 阅读 · 0 评论 -
SQLServer和Oracle的常用函数对比
1.绝对值 S:select abs(-1) valueO:select abs(-1) value from dual2.取整(大) S:select ceiling(-1.001) value O:select ceil(-1.001) value from dual3.取整(小) S:select floor(-1.001) value O:selec原创 2010-03-12 13:32:00 · 515 阅读 · 0 评论 -
ORACLE带参全连接
select * from ( select cw2.NO WHOLENO,sp1.ARGUMENTNAME TYPENAME,sp2.ARGUMENTNAME BRANDNAME,sp3.ARGUMENTNAME STYLENAME,sp4.ARGUMENTNAME DEPART,so.OPERATORNAME USERNAME from COM_WHOLE_IN原创 2010-03-12 10:07:00 · 324 阅读 · 0 评论 -
Oracle Connect By用法
Oracle Connect By用法 oracle中的select语句可以用START WITH...CONNECT BY PRIOR子句实现递归查询,connect by 是结构化查询中用到的,其基本语法是:select ... from where start with connect by ;:过滤条件,用于对返回的所有记录进行过滤。:查询结果原创 2010-03-12 10:05:00 · 226 阅读 · 0 评论 -
自动序列 sequences
select RECORD_ID.NEXTVAL as id from dual原创 2010-03-11 20:17:00 · 367 阅读 · 0 评论 -
数据库常用操作3
查数据库中表的任n行的记录:select * from ( select rownum x ,tab.* from tab) where x in (2,3); 查询出数据库中表大于1000的记录: select * from ( select rownum x ,tab.* from tab) where x>1000如何插入'字>select '''' from dual;转载 2013-01-22 14:52:05 · 491 阅读 · 0 评论