1.C:\>sqlplus "sys/test123 as sysdba" //以管理員身份登陸2.如果沒有執行個體,則可以用這個進行串連C:\>sqlplus/nolog然後登陸SQL>connect sys/test1234 as sysdba //sys必須以sysdba(管理員身份登陸) SQL>startup //啟動執行個體 SQL>startup mount
ORACLE-合并查詢結果 最近遇到了一個問題,需要將查詢出來的結果中某一欄位的值合并起來顯示,通過自己的努力有了個Workaround,記下來以備後忘。下面是資料庫中的資料存在形式,用普通的語句查詢如下Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Select Iq_No,Report_No from Iq_Body 查詢出的結果:Iq_No
1、Where子句中的串連順序: ORACLE採用自下而上的順序解析WHERE子句。 根據這個原理,表之間的串連必須寫在其他WHERE條件之前, 那些可以過濾掉最大數量記錄的條件必須寫在WHERE子句的末尾。 舉例: (低效)select … from table1 t1 where t1.sal > 300 and t1.jobtype = '0001' and 20 < (select count(*) from table1 t2 where t2.
--分頁select * from(select t1.ename ,rownum rn from (select * from emp) t1 where rownum<=10) where rn>=6; --開發一個包create or replace package tespackage astype test_cursor is ref cursor;end tespackage;--分頁預存程序create or replace procedure
create or replace view v_timedimension asselect to_date(a.STARTTIME,'yyyy-mm-dd hh24:mi:ss') as starttime ,substr(a.starttime,1,4) as year, substr(a.starttime,1,7) as month, substr(a.starttime,1,10) as day, --substr(a.starttime,1,13)||':00:00' as
SQL中的單記錄函數1.ASCII返回與指定的字元對應的十進位數;SQL> select ascii('A') A,ascii('a') a,ascii('0') zero,ascii(' ') space from dual; A A ZERO SPACE--------- --------- --------- --------- 65 97 48
1.sid:網站標識符(site identifie)2.spfile:伺服器參數檔案,儲存參數檔案3.查詢資料庫參數當前值(見Oracle database reference手冊): select value from v$parameter where name='pga_aggregate_target' 或 show parameter pga_agg(支援模糊比對)例如:SQL> show parameter memory;NAME