Lately, I met a case that the range filter predicates due to wrong cardinality issue. Let’s check the following query. 最近遇到一個由於範圍過濾導致錯誤基數而引起的效能問題。讓我們來看下面的查詢: The real records number is around 38,000,000. 真實的記錄數大約3千8百萬 The explain plan shows 728
基本的安裝過程參考網上的一些安裝說明即可。把安裝過程中的對Linux的一些配置說明一下,基本就是對Oracle使用者目錄下的.bash_profile進行配置。把我在RedHat EL4下的oracle使用者的.bash_profile設定檔張貼如下:[oracle@s002 ~]$ more .bash_profile# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then
安裝完Oracle 資料庫後啟時,遇到ora-01102錯誤。oracle@r05a11016.yh.com:/home/oracle>sqlplus "/as sysdba"SQL*Plus: Release 11.2.0.2.0 Production on Fri Apr 15 16:17:39 2011Copyright (c) 1982, 2010, Oracle. All rights reserved.Connected to an idle
最近在幫HR抓加班記錄的統計資料。HR希望能by周統計加班時數。但Oracle的日期Function Compute周時是周日算第一天,周六算最後一天。而中國人的習慣是周一算第一天,周日算最後一天。而且,Oracle的函數返回的是第幾周,是個數字,HR還要再根據資料推算是那個日期段。自己編寫了一個符合我們要求的小函數,傳回值也科學很多,呵呵! FUNCTION get_wk (p_date IN DATE) RETURN
1. 複製表結構及其資料:create table table_name_new as select * from table_name_old2. 只複製表結構:create table table_name_new as select * from table_name_old where 1=2;或者:create table table_name_new like table_name_old --這個可能因版本而已,我當時測試的時候沒有成功3.
Indexing null values安裝關聯式資料庫理論, null表示未知,Oracle b-tree index是不包含null的。考慮如下表:create table tt (t_id number, t_name varchar2(10));create index tt_idx on tt(t_name);select * from tt where t_name is null是不會使用index