Oracle常用Sql语句
1. 创建视图:
CREATE OR REPLACE VIEW SM_V_UNIT_AUTH AS
SELECT T2.UNIT_ID,
T2.SUPER_UNIT_ID,
T1.AUTH_ID,
T1.AUTH_NAME,
T1.AUTH_TYPE,
T1.AUTH_DESC,
T1.CREATE_UNIT,
T1.CREATE_DATE,
(SELECT UNIT_NAME from SM_T_UNIT C WHERE C.UNIT_ID=T1.CREATE_UNIT) CREATE_UNIT_NAME,
T1.VALID_FLAG,
T1.UNIT_NAME,
T1.EDITABLE,
T1.AUTHABLE
from
(SELECT A.*,
B.UNIT_ID,
B.UNIT_NAME,
(SELECT UAR1.EDITABLE from SM_T_UNIT_AUTH_REL UAR1 WHERE UAR1.AUTH_ID = A.AUTH_ID
AND UAR1.UNIT_ID = B.UNIT_ID) AS EDITABLE,
(SELECT UAR1.AUTHABLE from SM_T_UNIT_AUTH_REL UAR1 WHERE UAR1.AUTH_ID = A.AUTH_ID
AND UAR1.UNIT_ID = B.UNIT_ID) AS AUTHABLE from SM_T_AUTH A,SM_T_UNIT B
WHERE A.AUTH_ID IN (SELECT UAR1.AUTH_ID from SM_T_UNIT_AUTH_REL UAR1
WHERE UAR1.UNIT_ID = B.UNIT_ID)
ORDER BY A.AUTH_NAME) T1,SM_T_UNIT T2 where T1.UNIT_ID=T2.UNIT_ID
;
==========================================================================================
==========================================================================================
2. 创建存储过程:
create or replace procedure sm_sp_update_unitAuthRel is
cursor cur_unitAuthRels is select * from sm_t_unit_auth_rel uar where uar.editable = 'F';
v_unitAuthRel sm_t_unit_auth_rel%rowtype;
v_today varchar2(10);
v_validdate varchar2(10);
begin
open cur_unitAuthRels;
v_today :=to_char(sysdate,'yyyy-mm-dd');
loop
&
相关文档:
Oracle OFS FS10755 报错问题的解决方法
在某些情况下,重装或重配 OFS 时,比如验证群集,或移动群集组时,会报 FS10755 错, 错误信息如下:
Oracle OFS error - FS10755: Error Creating the OracleFsWorker COM object After Oracle OFS installed, the verification could not pa ......
一、设置初始化参数 job_queue_processes
sql> alter system set job_queue_processes=n;(n>0)
job_queue_processes最大值为1000
查看job queue 后台进程
sql>select name,description from v$bgprocess;
二,dbms_job package 用法介绍
包含以下子过程:
......
查询及删除重复记录的SQL语句
1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断
select * from people
where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)
2、删除表中多余的重复记录,重复记录是根据 ......
转自:http://tech.it168.com/a2009/1023/788/000000788673.shtml
1、范围
本文讨论的是Oracle数据库提供的数据复制机制,所讨论的解决方案全部与平台无关。
2、介绍
复制是目标数据库与源数据库之间数据保持同步的一种机制,复制可以分成不同的类型,如:
2.1数据库内的复制
在这种情况下,一个 ......