Time of Update: 2015-12-23
標籤:Oracle 擷取本周、本月、本季、本年的第一天和最後一天--本周select trunc(sysdate, ‘d‘) + 1 from dual;select trunc(sysdate, ‘d‘) + 7 from dual;--本月select trunc(sysdate, ‘mm‘) from dual;selec
Time of Update: 2015-12-23
標籤:REGEXP_INSTR函數讓你搜尋一個Regex模式字串。函數使用輸入字元集定義的字元進行字串的計算。它返回一個整數,指示開始或結束匹配的子位置,這取決於return_option參數的值。如果沒有找到匹配,則函數返回0。文法Oracle資料庫中的REGEXP_INSTR函數的文法是:REGEXP_INSTR (source_char, pattern [, position [, occurrence [, return_option [, match_parameter ] ] ]
Time of Update: 2015-12-23
標籤:【轉】Oracle - 資料庫的執行個體、資料表空間、使用者、表之間關係完整的Oracle資料庫通常由兩部分組成:Oracle資料庫和資料庫執行個體。 1) 資料庫是一系列物理檔案的集合(資料檔案,控制檔案,聯機日誌,參數檔案等); 2)
Time of Update: 2015-12-22
標籤:【轉】oracle的substr函數的用法oracle的substr函數的用法 取得字串中指定起始位置和長度的字串 substr( string, start_position, [ length ] ) 如: substr(‘This is a test‘, 6, 2)
Time of Update: 2015-12-22
標籤:manager oracle 空間名稱 首先詢問對方資料庫的資料表空間名稱和大小,然後在你的oracle中建立相應資料表空間,最後使用命令匯入、匯出資料。補充:1.要建立一個資料庫;Oracle資料匯入匯出imp/exp就相當於oracle資料還原與備份。exp命令可以把資料從遠端資料庫伺服器匯出到本地的dmp檔案,imp命令可以把dmp檔案從本地匯入到遠處的資料庫伺服器中。
Time of Update: 2015-12-18
標籤:1.root 使用者下修改ORATAB(將N該為Y):[[email protected] ~]# vim /etc/oratab mytest:/oracle/product/11.2.0/db_1:Y2.oracle 使用者下修改:[[email protected] ~]$cd $ORACLE_HOME/bin[[email protected] bin]$ vim dbstart找到 ORACLE_HOME_LISTNER=$1 這行,
Time of Update: 2015-12-18
標籤:PL/SQL Exception 拋出和處理1.獲得EXCEPTION 具體資訊:1 dbms_output.put_line(‘error code is: ‘||sqlcode);2 --輸出異常號3 dbms_output.put_line(‘error message is: ‘||sqlerrm);4 --輸出異常內容5 dbms_output.put_line(‘error position is: ‘||DBMS_UTILITY.FORMAT_ERROR_BACKTRACE)
Time of Update: 2015-12-22
標籤:Oracle從未歸檔日誌改成歸檔日誌:SQL> shutdown immediate;資料庫已經關閉。已經卸載資料庫。Oracle 常式已經關閉。SQL> startup mount;Oracle 常式已經啟動。資料庫裝載完畢。SQL> alter database archivelog;資料庫已更改。SQL> alter database ope
Time of Update: 2015-12-21
標籤:Oracle的取整和四捨五入函數——floor,round,ceil,trunc使用說明(2011-04-06 16:10:35)轉載▼標籤:談分類: 漸行漸遠 FLOOR——對給定的數字取整數位SQL> select floor(2345.67) from dual;FLOOR(2345.67)--------------2345CEIL--返回大於或等於給出數位最小整數SQL> select ceil(3.1415927)
Time of Update: 2015-12-17
標籤:一、查看select a.tablespace_name,a.bytes/1024/1024 "sum MB",(a.bytes-b.bytes)/1024/1024 "used MB",b.bytes/1024/1024 "free MB",round (((a.bytes-b.bytes)/a.bytes)*100,2) "used%" from(select tablespace_name,sum(bytes) bytes from dba_data_files group by
Time of Update: 2015-12-21
標籤:一、ORACLE 物理體繫結構原理結構圖各部分解釋:PGA: 私人記憶體區,僅供當前發起使用者使用。三個作用使用者登入後的session資訊會儲存在PGA。運行排序。假設記憶體不夠,oracle會在暫時資料表空間中完畢儲存使用者許可權資訊SGA: 包括共用池,資料緩衝區,日誌緩衝區以及一些相關的進程。DATABASE:
Time of Update: 2015-12-19
標籤:oracle 如果沒有啟動監聽服務,是不能被遠端存取的,如果使用oci或者sql developer就會出錯。啟動TNS監聽:lsnrctl start 查看TNS監聽:lsnrctl status 停止TNS監聽:lsnrctl stop oracle遠程登入:sqlplus
Time of Update: 2015-12-18
標籤:Database Audit1、是否開啟審計功能查詢show parameter auditNAME
Time of Update: 2015-12-19
標籤:for語句是一個可預置迴圈次數的迴圈控制語句,他是一個迴圈計數器,通常是一個整形變數,通過這個迴圈計數器來控制迴圈執行的次數文法如下:for variable_counter_name in [erverse] lower_limit...upper_limit loopplsql_sentence;end loop;variable_counter_name :表示一個變數,通常為整數類型,用來作為計數器,預設情況下計數器的值會迴圈遞增,當在迴圈中使用reverse關鍵字時候,
Time of Update: 2015-12-17
標籤:1) select * from T1 where exists(select * from T2 where T1.a=T2.a) ; T1資料量小而T2資料量非常大時,T1<<T2 時,1) 的查詢效率高。2) select * from T1 where T1.a in (select T2.a from T2) ; T1資料量非常大而T2資料量小時,T1>>T2 時,2)
Time of Update: 2015-12-16
標籤:extproc或plsextproc預設安裝時,會安裝一個PL/SQL外部程式(ExtProc)條目在listener.ora中,是oracle為調用外部程式預設配置的監聽,它的名字通常是ExtProc或PLSExtProc650) this.width=650;" class="selectsearch-hide" id="selectsearch-icon" alt="搜尋"
Time of Update: 2015-12-16
標籤:oracle模組1、ExtProc 或 PLSExtProc模組的移除路徑:#cd /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/samples/#ls#vi
Time of Update: 2015-12-19
標籤:1、查看是否為歸檔模式 SQL> archive log list;Database log mode No Archive ModeAutomatic archival DisabledArchive destination USE_DB_RECOVERY_FILE_DESTOldest online log sequence 16Current log sequence 18
Time of Update: 2015-12-17
標籤:if...then...elsif實現多分支判斷語句其文法如下:if <condition_expression1> thenplsql_sentence_1;elseif<condition_expression2> thenplsql_sentence_2;...elseplsql_sentence_n;end if;最後一個else後邊是沒有條件的,這個比較重要。具體樣本:declare v_month int:=2;begin if v_month>
Time of Update: 2015-12-21
標籤: 情境:對2千萬個資料,修改他們的名字加上尾碼“生日”。普通sql: update calendar_info set title =concat(title, ‘生日‘) where specialtype = 1 and not regexp_like(title, ‘生日‘);最佳化sql:declaretype rid_Array is table of rowid index by binary_integer;v_rid