/*速度和效率。使用預存程序的速度顯然更快。在效率上,如果應用一次需要做一系列sql操作,則需要往返於php與oracle,不如把該應用直接放到資料庫教程方以減少往返次數,增加效率。但是在internet應用上,速度是極度重要的,所以很有必要使用預存程序*///建立一個test表create table test (id number(16) not null,name varchar2(30) not null,primary key (id));//插入一條資料insert into
1.根據Q193893,我們需要在Oracle裡面建立兩個視圖。 Information about using Oracle with Microsoft Transaction Server and COM+ componentshttp://support.microsoft.com/?id=193893 根據我們以往的經驗,我們可以嘗試用SYS帳號運行Oracle內建的指令碼。指令碼的預設路徑在:C:oracleora92dbmsadminxaview.sql 請在SQL
如果我們的項目要從Oracle遷移到Mysql,但MySQL的instr函數只能尋找子串是否在父串中,沒法按照出現的次數進行尋找。這裡我自己寫了一個,以便遷移。當然我這裡僅僅針對的是遷移,可能沒有完全實現原有函數的細節。Oracle 裡用了幾次如下的調用,SQL> select instr('This is belong to you, but not to me.','to',1,1) as pos from dual;
union 對兩個結果集進行並集操作,不包括重複行,同時進行預設規則排序;union all 對兩個結果集進行並集操作,包括重複行,不進行排序union all 要比union快很多,所以,如果可以確認合并的兩個結果集中不包含重複的資料的話,那麼就使用union all,如下:盡量使用union all,因為union需要進行排序,去除重複記錄,效率低union 如果表有多個索引列的時候,用union 替換 where 中的or 效率會提高不少。索引列使用or會造成全表掃描。如果有column
一個徹底的包含資料檔案和內容的集聯刪除被發出,如果使用手工,恐怕DBA們都會極其謹慎的拼字這樣的命令:Wed May 02 10:46:09 2012/* OracleOEM */ DROP TABLESPACE "WNDT" INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTSWed May 02 10:46:23 2012Errors in file
如何開啟/關閉oracle的歸檔如果是OPS/RAC環境,需要先把parallel_server = true注釋掉,然後執行如下步驟,最後用這個參數重新啟動 1、開啟歸檔 a. 關閉資料庫shutdown immediate b. startup mount c. alter database archivelog d. alter database opne 2、禁止歸檔 a. 關閉資料庫shutdown immediate b. startup mount c.
D:>set NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1 D:>set 直接打set命令可以查看環境變數 2、 在D:下建立a.sql檔案,內容如下: create or replace procedure test1(i in number) as begin dbms_output.put_line('輸入參數是'||to_char(i)); end; 3、 D:>wrap iname=a.sql
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 322.CHR給出整數,返回對應的字元;SQL> select chr(54740) zhao,chr(65) chr65 from
Oracle串連出現ora-12154配置好rac後,兩個節點用tnsping都可以ping通,但用sqlplus串連都出現以下錯誤,不知道哪裡出了問題[oracle@rac2 admin]$ lsnrctl statusLSNRCTL for Linux: Version 9.2.0.4.0 - Production on 04-MAR-2008 08:32:26Copyright (c) 1991, 2002, Oracle Corporation. All rights