1、select 'Drop table '||table_name||';' from all_tables where owner='要刪除的使用者名稱(注意要大寫)'; 2、刪除所有表以使用者test為例for example:declare cursor cur1 is select table_name from dba_tables where owner='TEST';begin for cur2 in cur1
Oracle有使用某個索引嗎?(如何監控)Does Oracle use my index or not? One can use the index monitoring feature to check if indexes are used by an application or not. When the MONITORING USAGE property is set for an index, one can query the v$object_usage to see if
原文:http://hi.baidu.com/%B1%CF%C0%F6%C3%F4/blog/item/a1ce3a08cb3990d263d986e3.html DataBaseConfig.xmlCode highlighting produced by Actipro CodeHighlighter
1、建立預存程序 create or replace procedure test(var_name_1 in type,var_name_2 out type) as --聲明變數(變數名 變數類型) begin --預存程序的執行體 end test; 列印出輸入的時間資訊 E.g: create or replace procedure test(workDate in Date) is begin dbms_output.putline('The
create user [username] identified by [password] 建立新的使用者 grant 許可權1、許可權2...to 使用者 給建立使用者權限 ex:grant create session to [username] 此時只能串連到資料庫 grant connect,resource to [username] 此時許可權能滿足要求 alter user [username] identified by [password] 修改使用者密碼
1.對查詢進行最佳化,應盡量避免全表掃描,首先應考慮在 where 及 order by 涉及的列上建立索引。2.應盡量避免在 where 子句中對欄位進行 null 值判斷,否則將導致引擎放棄使用索引而進行全表掃描,如: select id from t where num is null 可以在num上設定預設值0,確保表中num列沒有null值,然後這樣查詢: select id from t where num=03.應盡量避免在 where
Some和any表示滿足其中一個的意義,一般來講some用在“=”的比較從句中. All則表示滿足其其中所有的查詢結果的含義.select ename,salFrom empWhere sal > any(select sal from emp where deptno = 10);select ename,salFrom empWhere sal > some(select sal from emp where deptno = 10);select ename,salFrom