查詢某個使用者具有的角色:select grantee,granted_role from dba_role_privs where grantee='WJW';查詢某個使用者具有的系統許可權:select grantee,privilege from dba_sys_privs where grantee='WJW';查詢某個角色中具有什麼系統許可權:select privilege from role_sys_privs where
1、查詢第幾行的記錄select sal from emp where rownum=1; //查詢得到第一行記錄select sal from emp where rownum=5; //不可以查詢到第五行記錄,因為rownum 總是從1開始查詢的,故這種方式不可以直接得到第幾行的記錄。若想得到第五行記錄,應採用如下方式:select r,sal from (select rownum r,sal from emp) where r=
備份錯誤1:RMAN-03009: backup 命令 (ORA_DISK_1 通道上,在 07/28/2012 10:23:22上)ORA-19602: 無法按 NOARCHIVELOG 模式備份或複製活動檔案原因是:自動歸檔沒有開啟解決方案: 1、開啟歸檔 a. 關閉資料庫shutdown immediate b. startup mount c. alter database archivelog d. alter database open 2、禁止歸檔 a.
1.建立預存程序SQL> create or replace function get_sal3(name varchar2) 2 return number is 3 v_sal number(6,2); 4 begin 5 select sal into v_sal from emp where upper(ename)=upper(name); 6 return v_sal; 7 end; 8 /函數已建立。SQL> var salary
--根據系統日期查資料(sysdate)select * from t_br_salesdtl a where a.fstoreid=191 and a.ftime>=to_date(to_char(sysdate-1,'yyyy-mm-dd'),'yyyy-mm-dd ')--根據給定的日期查資料(eg:2012-07-01至2012-07-03)第一種方法:select * from t_br_salesdtl a where a.fstoreid=191 and
有人問怎麼判斷今天是星期幾?select to_char(sysdate,'d') from dual 很顯然這句並不能完成要求的功能,因為這隻是顯示當前為本星期的第幾天,而老外把星期天當作每個星期的第一天,那麼變通的方法就是求前一天為該周的第幾天,不就相當於今天為星期幾了麼:select to_char(sysdate - 1,'d') from dual中午顯示方法: SQL> select to_char(sysdate,'day') day from dual;DAY----
摘自:http://blog.csdn.net/xuanxingmin/article/details/4266327 Oracle的Case語句現在Oracle支援兩種CASE表示方式,一種Oracle稱為simple CASE(簡單形式),另外一種為searched CASE(查詢形式)。simple CASE相當於使用函數Decode,但是Case一般用於操作更為複雜的語句。CASE的形式更易於閱讀。simple CASE的表示形式為: CASE expr WHEN
---使用oracle使用者,進入sqlplus 刪除使用者再建立一個使用者並賦權--許可權中要有synonym 否則imp dmp檔案的時候,會出錯su - oraclesqlplus / as sysdbadrop user base cascade;create user base identified by zdsoft default tablespace tbs_base;grant connect,resource,create table,create view,execute
Oracle建立使用者_授權_並匯入資料完整的過程建立使用者、建立資料表空間、授權、建表l 建立使用者 create user bbs identified by bbs123; l 建立資料表空間 create tablespace ts_bbs datafile 'E:/bbs/bbs_data.dbf' size 100m; 資料表空間目錄必須手動先建立好 l 將資料表空間分配給使用者 alter user bbs default