Time of Update: 2015-09-23
標籤:Oracle 中可以用(+)來代替左串連和右串連,有意思的事加號在左面是右串連,加號在右面是做連結,如下
Time of Update: 2015-09-23
標籤: /// <summary> /// 執行多條SQL語句,實現資料庫事務。 /// </summary> /// <param name="SQLStringList">(key為sql語句,value是該語句的OracleParameter[])</param> /// <returns></returns> public
Time of Update: 2015-09-22
標籤: 類比Oracle效能診斷藝術做了兩個實驗樣品。書上說的不承擔RELIES_ON。果緩衝的失效操作(result_cache RELIES_ON(test1,test2))。實驗證明不正確,函數f1()並沒有使用RELIES_ON,但表上的變化影響到了函數。C:\Documents and Settings\guogang>sqlplus gg_test/[email protected]_ggSQL*Plus: Release 10.2.0.1.
Time of Update: 2015-09-22
標籤:execute the following commands by using system account login oracle: >sqlplus system/[email protected]:1522/xe;SQL*Plus: Release 12.1.0.1.0 Production on Tue Sep 22 20:16:29 2015Copyright (c) 1982, 2013, Oracle. All rights reserved.
Time of Update: 2015-09-21
標籤:今天遇到一個資料庫同步問題,主庫被關閉,重啟主庫後,備庫不能正常同步主庫資料。只有當手動切換歸檔日誌的時候,備庫才能和主庫一致。這個問題的解決方案:重啟備庫,重新應用歸檔日誌。操作步驟如下://關閉備庫監聽器lsnrctl stop//關閉備庫sqlplus / as sysdbaalter database recover managed standby database cancel;shutdown immediate;//啟動備庫startup nomount;alter
Time of Update: 2015-09-21
標籤:oracle sqlSelect * From Table(dbms_xplan.display_cursor(sql_id => ‘9s7pt2ay4t3jg‘)); Declare l_Result_Name Varchar2(30); l_Task_Name Varchar2(36) := ‘Task_Name_9s7pt2ay4t3jg_1‘; l_Sqlid
Time of Update: 2015-09-21
標籤: 設定oracle中date的會話格式為 ‘yyyy-mm-dd hh24:mi:ss‘alter session set nls_date_format=‘yyyy-mm-dd hh24:mi:ss‘; 設定oracle中timestamp的會話格式為 ‘yyyy-mm-dd hh24.mi.ss.ff’alter session set nls_timestamp_format=‘yyyy-mm-dd
Time of Update: 2015-09-23
標籤:1、擷取系統時間、目前時間 select sysdate from dual2、日期函數 在sql語句中使用日期計算時,必須使用日期函數將字串轉為日期型,不像sql server 中直接用字串就可以了 to_date("字串","轉換的格式") to_char(日期,"轉換格式" )
Time of Update: 2015-09-21
標籤: 該指數是一個有力的武器,以提高資料庫的查詢效能。沒有索引,喜歡同樣的標籤庫沒有書籍,找書,他們想預訂比登天還難。中,尤其是在批量的DML的情形下會產生對應的片段。以及B樹高度會發生對應變化。因此能夠對這些變化較大的索引進行重構以提高效能。N久曾經Oracle建議我們定期重建那些高度為4。已刪除的索引條目至少佔有現有索引條目總數的20%的這些表上的索引。但Oracle如今強烈建議不要定期重建索引。詳細能夠參考文章:Oracle
Time of Update: 2015-09-21
標籤:引: 為了舉例說明,這裡建立了一張成績表,如所示: 比較: 1、sql中,這兩個函數我們僅能使用case,代碼及結果如下: select name,
Time of Update: 2015-09-22
標籤:1.不返回結果集,有輸入,輸出參數 /// <summary> /// 執行預存程序 /// </summary> /// <param name="storedProcName">預存程序名</param> /// <param name="sql">執行的sql語句</param> /// <param name="sql2"
Time of Update: 2015-09-21
標籤:Linux設定Oracle環境變數 方法一:直接運行export命令定義變數,該變數只在當前的shell(BASH)或其子shell(BASH)下是有效,shell關閉了,變數也就失效了,再開啟新shell時就沒有這個變數,需要使用的話還需要重新定義。 以設定oracle環境變數為例 export ORACLE_BASE=/data/app/oracle; export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1;
Time of Update: 2015-09-21
標籤:Oracle 查看錶空間的使用方式或資料表空間的大小,應該如何?呢?下面就為您介紹實現 Oracle 查看錶空間方面的語句。 1、查看錶空間的使用方式 Java代碼
Time of Update: 2015-09-21
標籤:oracle閃回create table t1 as select * from dba_objects;[email protected]> select sysdate from dual;SYSDATE-------------------2015-09-20 14:54:101 row selected.[email protected]> delete from t1;0 rows
Time of Update: 2015-09-20
標籤:1. 修改表中的資料:UPDATE語句:文法:UPDTAE table_nameSET column1 = value1,...[WHERE conditions](2),無條件的更新(沒有where條件的更新):SQL> update userinfo set userpwd=‘111111‘;已更新4行。SQL> select userpwd from
Time of Update: 2015-09-20
標籤:1. 向表中添加資料(Insert 語句):添加的文法:INSERT INTO table_name(column1,column2,column3,......) VALUES(value1,value2,value3,...)其中table_name之後的欄位是可以省略的,只是VALUES的每個欄位都必須和定義的欄位所匹配。(1).首先建立一張表:SQL> create table userinfo( 2 id number(6,0), 3 username
Time of Update: 2015-09-23
標籤:今天有時間將oracle資料庫的筆記整理一下。在開發過程中,多多少少會涉及一些資料庫方面的東西,將這些東西整理下來還是有必要滴。/*第一步:建立資料庫執行個體*/可根據oracle內建的配置執行個體的步驟一步一步建好。/*第二步:建立資料表空間*/用管理員身份登入後,CREATE TABLESPACE TSP_TEST_PROVINCEDATAFILE ‘C:/app/Administrator/oradata/test/TSP_TEST_PROVINCE.dbf‘ SIZE
Time of Update: 2015-09-20
標籤:兩種方法:1. 在建立表的時候將資料從其他表中複製過來(並且表的結構也複製過來):文法: CREATE TABLE table_nameASSELECT column1,......|* FROM table_old;SQL>SQL> create table userinfo_new 2 AS 3 SELECT * from userinfo;表已建立。SQL> desc userinfo_new; 名稱
Time of Update: 2015-09-20
標籤:1. 刪除資料:delete語句:文法:DELETE FROM table_name;(1),無條件刪除:SQL> create table testdel 2 as select * from userinfo;表已建立。SQL> delete from testdel;已刪除4行。SQL> select * from testdel;未選定行SQL> (2),有條件的刪除:SQL> select username from userinfo;
Time of Update: 2015-09-20
標籤:例子:session 2:SQL> connect test/testConnected.select * from v$mystat where rownum=1;143select b.spid,a.sid,a.serial# from v$session a,v$process b where a.paddr =b.addr and a.sid =143;?session 1: 針對對應的session,開啟10046事件。alter session set