Oracle常用SQL集锦
2014-03-11 08:55
288 查看
1.创建用户
create user username
identified by "12345678"
default tablespace --表空间
temporary tablespace --表空间-临时
profile DEFAULT;
-- Grant/Revoke role privileges
grant dba to username with admin option;
-- Grant/Revoke system privileges
grant unlimited tablespace to username with admin option;
1.循环
begin
for rec in (select t.telphone ,t.id, t.message,t.name from T_SYS_SMS t where t.telphone like '13688%')
loop
DBMS_OUTPUT.put_line(rec.message || 'test ' || rec.name);
end loop;
end;
修改新增表空间 alter tablespace DZJC add datafile 'E:\oracle\product\10.2.0\oradata\db\dzjc001' size 12048M;
ORA-12505 错误JDBC连不上,PL/SQl连的上的时候,Service_NAME和instance_name
可以通过select intance_name from $instance查询当前的名称。
可能是双击热备份情况,或者ORACLE服务名称和示例不一样的情况。
修改游标大小
alter system set open_cursors=2000 scope=both;
查找前十条性能差的sql.
SELECT * FROM (select PARSING_USER_ID,EXECUTIONS,SORTS,
COMMAND_TYPE,DISK_READS,sql_text FROM v$sqlarea
order BY disk_reads DESC )where ROWNUM<10 ;
exp p_hai/12345@192.9.207.34/orcl file=d:\haigang_0727.dmp full=n
exp dz/dz@192.9.207.34/orcl file=d:\dzt.dmp full=n tables=(DEPT,EMP,BONUS,SALGRADE,T1,T2,T3,T4,T) query=\"where rownum<=5000\"
--查询某个父节点下面的所有子节点
select distinct * from T_SYS_MENU m
start with id in ('20061115000000001')--父节点ID
connect by prior id = m.parentid
create user username
identified by "12345678"
default tablespace --表空间
temporary tablespace --表空间-临时
profile DEFAULT;
-- Grant/Revoke role privileges
grant dba to username with admin option;
-- Grant/Revoke system privileges
grant unlimited tablespace to username with admin option;
1.循环
begin
for rec in (select t.telphone ,t.id, t.message,t.name from T_SYS_SMS t where t.telphone like '13688%')
loop
DBMS_OUTPUT.put_line(rec.message || 'test ' || rec.name);
end loop;
end;
修改新增表空间 alter tablespace DZJC add datafile 'E:\oracle\product\10.2.0\oradata\db\dzjc001' size 12048M;
ORA-12505 错误JDBC连不上,PL/SQl连的上的时候,Service_NAME和instance_name
可以通过select intance_name from $instance查询当前的名称。
可能是双击热备份情况,或者ORACLE服务名称和示例不一样的情况。
修改游标大小
alter system set open_cursors=2000 scope=both;
查找前十条性能差的sql.
SELECT * FROM (select PARSING_USER_ID,EXECUTIONS,SORTS,
COMMAND_TYPE,DISK_READS,sql_text FROM v$sqlarea
order BY disk_reads DESC )where ROWNUM<10 ;
exp p_hai/12345@192.9.207.34/orcl file=d:\haigang_0727.dmp full=n
exp dz/dz@192.9.207.34/orcl file=d:\dzt.dmp full=n tables=(DEPT,EMP,BONUS,SALGRADE,T1,T2,T3,T4,T) query=\"where rownum<=5000\"
--查询某个父节点下面的所有子节点
select distinct * from T_SYS_MENU m
start with id in ('20061115000000001')--父节点ID
connect by prior id = m.parentid
相关文章推荐
- ORACLE的客户端如何连接到数据库(百度知道)
- 杀掉oracle在线用户脚本分享
- oracle 常用脚本
- 建议贴:给新手的Oracle学习路线
- all about oracle block corruption
- oracle sql_tunne ORACLE提供的sql优化
- Oracle q' 简化单引号转义
- Oracle重置过期的密码
- oracle pl sql while循环游标
- oracle 的常用语句
- 【转】Orion - oracle提供的测试io性能的工具
- oracle pl sql 隐式游标SQL
- oracle pl sql fetch游标
- oracle developer插入数据格式
- oracle pl sql for循环游标
- Oracle 11g系列:数据表对象
- oracle 使用order by 对汉字进行多字段排序
- Oracle创建一个用户教程
- Oracle 11g系列:数据库
- oracle数据库体系结构的研究