摘要:一、ORACLE的启动和关闭 1、在单机环境下 要想启动或关闭ORACLE系统必须首先切换到ORACLE用户,如下 su - oracle a、启动ORACLE系统 oracle>svrmgrl SVRMGR>connect internal SVRMGR>startup SVRMGR>quit b...
阅读全文
摘要:--Oracle分页算法一 select*from( selectpage.*,rownumrnfrom(select*fromhelp)page --20=(currentPage-1)*pageSize+pageSize whererownum10; --Oralce分页算法二 --20=(cu...
阅读全文
摘要:以命名的异常命名的系统异常 产生原因ACCESS_INTO_NULL 未定义对象CASE_NOT_FOUND CASE 中若未包含相应的 WHEN ,并且没有设置ELSE 时COLLECTION_IS_NULL 集合元素未初始化CURSER_ALREADY_OP...
阅读全文
摘要:存储过程 1CREATEORREPLACEPROCEDURE存储过程名 2IS 3BEGIN 4NULL; 5END;行1: CREATEORREPLACEPROCEDURE是一个SQL语句通知Oracle数据库去创建一个叫做skeleton存储过程,如果存在就覆盖它;行2: IS关键...
阅读全文
摘要:1.查看临时表空间使用情况 Select f.tablespace_name ,sum(f.bytes_free + f.bytes_used) /1024/1024/1024 "total GB" ,sum((f.bytes_free + f.bytes_used) - nvl(p.bytes_u...
阅读全文
摘要:1.查询有enqueue等待的事件SELECT b.SID, b.serial#, b.username, machine, event, wait_time,CHR (BITAND (p1, -16777216) / 16777215)|| CHR (BITAND (p1, 16711680) /...
阅读全文
摘要:机器情况p4:2.4内存:1Gos:windows2003数据库:mssqlserver2000目的:查询性能测试,比较两种查询的性能SQL查询效率stepbystep--setp1.--建表createtablet_userinfo(useridintidentity(1,1)primarykey...
阅读全文
摘要:存储过程创建语法: create or replace procedure 存储过程名(param1 in type,param2 out type)as变量1 类型(值范围);变量2 类型(值范围);Begin Select count(*) into 变量1 from 表A where列名=pa...
阅读全文
摘要:--分页select * from(select t1.ename ,rownum rn from (select * from emp) t1 where rownum=6;--开发一个包create or replace package tespackage astype test_cursor...
阅读全文
摘要:system表空间增大是正常的,但急剧增大是不合理的。1有可能是用户对象错误的放在系统表空间中2也可能是system表空间的UNDO过大3还有可能和高级复制的空间使用有关可通过如下语句查看一下是不是有应用的段放到了SYSTEM中:select OWNER,SEGMENT_NAME,SEGMENT_T...
阅读全文
摘要:ORACLE操作表时”资源正忙,需指定nowait"的解锁方法问题:执行 drop table table_name 时,提示”资源正忙,需指定nowait"由于TB_PROJECT为设置主键造成只能查询而无法修改和删除的问题导致PL/SQL无响应,从而对此表一直处于锁定状态分析:表示table_n...
阅读全文
摘要:ORACLE日期时间函数大全 TO_DATE格式(以时间:2007-11-02 13:45:25为例) Year: yy two digits 两位年 显示值:07 yyy three digits 三位年 显示值:007 yyyy four digits 四位年 显示值:2007 Month...
阅读全文
摘要:ORACLE纯SQL实现多行合并一行感谢网友@OctoberOne、@ericqliu的指点,在ORACLE10中可使用以下方法:SELECT n_sec_code, wmsys.wm_concat (c_researcher_code) as resultFROM m_researcher_sto...
阅读全文
摘要:临时表和正式表有什么区别?临时表有什么作用?建立临时表有哪几种方法?临时表一般存储在临时表空间分两种,事务级和会话级一般用来存储临时需要的数据事务级的临时表在事务提交后自动删除,会话级临时表在会话结束后删除会话级create global temporary table tablename(col1...
阅读全文
摘要:停止服务:在开始->运行中键入cmd打开命令提示符 在命令提示符下中键入 sqlplus /nolog connect sys/password as sysdba shutdown immediate 将数据库关闭 然后在开始->程序->管理工具->服务 将oracl...
阅读全文
摘要:1. 复制表结构及其数据:create table table_name_new as select * from table_name_old2. 只复制表结构:create table table_name_new as select * from table_name_old where 1=...
阅读全文
摘要:-- 表create table test (names varchar2(12), dates date, num int, dou double);-- 视图create or replace view vi_test asselect * from test...
阅读全文
摘要:1. 复制表结构及其数据:create table table_name_new as select * from table_name_old2. 只复制表结构:create table table_name_new as select * from table_name_old where 1=...
阅读全文
摘要:http://www.cnblogs.com/helong/articles/2086483.html
阅读全文
摘要:http://www.cnblogs.com/zhw511006/archive/2010/04/29/1724546.html#2963758
阅读全文