為了把事情變成簡單化,我在多個Oracle資料上建立統一的檢查資料庫賬戶,並且賬戶只能訪問特定的幾個視圖(需要查詢的sql已產生視圖),具體做法如下: root>sqlplus / as sysdba 用DBA的許可權進入資料庫,需要建立一個賬戶 http://www.jb51.net/article/20367.htm SQL>create user dbmonitor identified by "ty_sd_s"; 給賬戶授權 SQL>grant
1 The syntax of the SQL statement is verified. SQL的語法檢查 2 The data dictionary is searched to verify table and column definitions. 從資料字典檢查表名和欄位名 3 The data dictionary is searched to verify security privileges on relevant objects. 從資料字典中檢查許可權 4 Parse
查看錶空間的名稱及大小複製代碼 代碼如下:SQL>select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size from dba_tablespaces t, dba_data_files d where t.tablespace_name = d.tablespace_name group by t.tablespace_name; 查看錶空間物理檔案的名稱及大小: 複製代碼 代碼如下:SQL>select
1.intersect為取多個查詢結果的交集; 2.查詢兩個基本時間段內表記錄的SQL語句; select * from shengjibiao t where t.createtime between to_date('2009-7-26','yyyy-MM-dd') and to_date('2009-7-29','yyyy-MM-dd') --也可以用>,<,>=,<= update shengjilogin t set t.starttime=to_date('2
提叻一個程式碼片段,要人協助解釋一下。 程式碼片段如下: 複製代碼 代碼如下:declare type t_indexby is table of number index by binary_integer; type t_nesteed is table of number; type t_varray is varray(10) of number; v_indexby t_indexby; v_nested t_nested; v_varray t_varray; begin
相關代碼如下: 1. 建立sequence: 複製代碼 代碼如下:CREATE SEQUENCE SEQU_DATA_DATAINFO INCREMENT BY 1 START WITH 1 NOCYCLE NOCACHE NOORDER; 2. 建立觸發器: 複製代碼 代碼如下:create or replace TRIGGER TRIG_TEST BEFORE INSERT ON TABLE1 FOR EACH ROW DECLARE tmpVar NUMBER; BEGIN tmpVar
1.串連本機資料庫 A. 本機若有靜態IP,oracle安裝好後,就能串連本機oracle資料庫。 B. 安裝oracle時,本機沒有靜態IP(即顯示網線沒有插好的時候)。 修改 NETWORK\admin檔案中的 tnsnames.ora 、listener.ora檔案中 HOST 為本機電腦名稱。 如果電腦名稱沒設定好,就去修改 WINDOWS\system32\drivers\etc\ hosts檔案。 2.串連它機伺服器 a. 開啟執行個體服務和監聽器。 b.
複製代碼 代碼如下:select a.f_username from ( SELECT /*+parallel(gu,4)*/distinct gu.f_username FROM t_base_succprouser gu where gu.f_expectenddate > (select trunc(sysdate,'Y')FROM DUAL) and gu.f_lotid=1 and gu.f_playid=4 and gu.f_paymoney>=1500 ) A