搜尋此網誌

2010年10月26日 星期二

Cholera outbreak 霍亂爆發

Cholera-prounce

tsunami it is Japaneses  word.


Cholera  outbreak

2010年10月19日 星期二

免簽證的英文

Fiji grants has granted visa-free privileges.

2010年10月18日 星期一

Myers-Briggs Personality test

intuitive
sensing
Extroverted
introverted

High and lows

Usage: how is your high and lows this weekend ?
explain : highs and lows means  did you have any good things and bad things.
From : weekly staff meeting  , in the meeting have many trend charts  . each index have high and low

ENGLISH-NEWS


How the Phoenix Rescue Capsule Works

這是之前智利礦坑的事件 !!
要來說說 那個字 Capsule 
膠囊(MEDICINE)
但由於型狀相似 也被用於太空
以上是名詞
在形容詞 則是 濃縮,概要 
也可以當 Vt. 來用跟 ADJ 同義 ..

Reference: 

http://www.foxnews.com/scitech/2010/10/12/phoenix-rescue-capsule-save-chilean-miners/

心智圖-ORACLE IOT,CLUSTER TABLE



REFERENCE 
http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/clustrs003.htm

2010年10月14日 星期四

CREATE MV

-如有建SYNONYM 要先行DROP 掉
--drop SYNONYM FPDB5001 ;
--drop SYNONYM FPDB5003 ;
--drop SYNONYM FPDB5007 ;
--drop SYNONYM FPDB5008 ;
--drop SYNONYM FPDB5013 ;
--drop SYNONYM FPDB5015 ;
--drop SYNONYM FPDB5016 ;
--drop SYNONYM KADB1017 ;
Grant Create MATERIALIZED VIEW to XXX<==先給權限給使用者
這樣USER才能 建MV
--建MV START WITH TO_DATE 是指定何時開始作的時間,將裡面的時間先行改掉
CREATE MATERIALIZED VIEW FPDB5001 TABLESPACE "IDB_III_IPMIS" REFRESH complete START WITH to_date('02-06-2011 23:50:00','MM-dd-yyyy hh24:mi:ss') NEXT sysdate + 1 AS select * from FPDB5001@LINKACER;
CREATE MATERIALIZED VIEW FPDB5003 TABLESPACE "IDB_III_IPMIS" REFRESH complete START WITH to_date('02-06-2011 23:50:00','MM-dd-yyyy hh24:mi:ss') NEXT sysdate + 1 AS select * from FPDB5003@LINKACER;
CREATE MATERIALIZED VIEW FPDB5007 TABLESPACE "IDB_III_IPMIS" REFRESH complete START WITH to_date('02-06-2011 23:50:00','MM-dd-yyyy hh24:mi:ss') NEXT sysdate + 1 AS select * from FPDB5007@LINKACER;
CREATE MATERIALIZED VIEW FPDB5008 TABLESPACE "IDB_III_IPMIS" REFRESH complete START WITH to_date('02-06-2011 23:50:00','MM-dd-yyyy hh24:mi:ss') NEXT sysdate + 1 AS select * from FPDB5008@LINKACER;
CREATE MATERIALIZED VIEW FPDB5013 TABLESPACE "IDB_III_IPMIS" REFRESH complete START WITH to_date('02-06-2011 23:50:00','MM-dd-yyyy hh24:mi:ss') NEXT sysdate + 1 AS select * from FPDB5013@LINKACER;
CREATE MATERIALIZED VIEW FPDB5015 TABLESPACE "IDB_III_IPMIS" REFRESH complete START WITH to_date('02-06-2011 23:50:00','MM-dd-yyyy hh24:mi:ss') NEXT sysdate + 1 AS select * from FPDB5015@LINKACER;
CREATE MATERIALIZED VIEW FPDB5016 TABLESPACE "IDB_III_IPMIS" REFRESH complete START WITH to_date('02-06-2011 23:50:00','MM-dd-yyyy hh24:mi:ss') NEXT sysdate + 1 AS select * from FPDB5016@LINKACER;
CREATE MATERIALIZED VIEW KADB1017 TABLESPACE "IDB_III_IPMIS" REFRESH complete START WITH to_date('02-06-2011 23:50:00','MM-dd-yyyy hh24:mi:ss') NEXT sysdate + 1 AS select * from KADB1017@LINKACER;
CREATE MATERIALIZED VIEW KADB1023 TABLESPACE "IDB_III_IPMIS" REFRESH complete START WITH to_date('02-06-2011 23:50:00','MM-dd-yyyy hh24:mi:ss') NEXT sysdate + 1 AS select * from KADB1023@LINKACER;
COMMIT

select * from user_mview_refresh_times;

--測試中 先DROP 掉 ,重建算時間
--drop MATERIALIZED view FPDB5001;
--drop MATERIALIZED view FPDB5003;
--drop MATERIALIZED view FPDB5007;
--drop MATERIALIZED view FPDB5008;
--drop MATERIALIZED view FPDB5013;
--drop MATERIALIZED view FPDB5016;
--drop MATERIALIZED view FPDB5015;
--drop MATERIALIZED view KADB1017;
--drop MATERIALIZED view KADB1023;

---改使用SESSION 時間顯示方式
alter session set nls_date_format = 'dd.mm.yyyy hh24:mi:ss';
select * from user_mview_refresh_times;

2010年10月11日 星期一

I saw a pictuer on my friend's fb

A true farm village on pic

turmeric ~ it is a good food chinese name is薑黃

MV NOTES

References MVIEWS
CREATE Materialized view xxx.yyy REFRESH COMPLETE START WITH date() SYSDATE WITH PRIMARY KEY 
 AS SELECT * FROM @ACERLINK

2010年10月10日 星期日

TCPDUMP USAGE METHOD

TCPDUMP is a usage tool , when you want to trace  a connection or connections .
for example
 tcpdump -i eth1 udp
#-i mean which interface . such as  -i  eth1, eth0
#in different os . have different  interface name

ORA-ERRORS

ORA-16401:

archivelog rejected by RFS
Cause: An attempt was made to re-archive an existing archivelog. This usually happens because either a multiple primary database or standby database(s) or both are trying to archive to this standby database.
Action: See alert log and trace file for more details. No action is necessary; this is an informational statement provided to record the event for diagnostic purposes.

調校一個DBLINK 連線時間太久

由於我方(政府機關機房)的DB 要連線去 另一個政府機關的ORACLE DB 去作DBLINK, 可是反映說連線動作時間太久,  經過思索一番認為是FW及IPS  檢查封包時間太久(是可以過)
due to a dataflow change , origin they sync data  to 2 Database from local government  to two Bureau under Ministry of Economic Affair. one of  database local on in my office . another one is main database on
other government  machines farm. now is change 3 tier layout just keep one database . our database is canceling soon. we need create a dblink  to their db. but when we test . to slow .
so I think it will be TCP/IP head check  spend many time.
原本(ORIGIN Response  time ) need : 16 MINS .
after  addition IP and port to white list on FW.  it from 16 mins to 13 Mins.then
I ask soc to add 2 ip on 2 IPS . it from 13 mins to 7mins .
still to slow .

2010年10月9日 星期六

SINGLE ROW-FUNCTIONS

SINGLE ROW-FUNCTIONS
可以用於 SELECT NVL(), 或Where xx=nvl(),order by
可以修改 資料型態
--
http://ist.marshall.edu/ist466/functions.html
--
Any arithmetic operation on a NULL value results in a NULL. The same model is true for most functions as well. Only functions

    * NVL
    * NVL2
    * CONCAT
    * DECODE
    * DUMP
    * and REPLACE

can return non-NULL value when called with a NULL argument.

JOIN 的技巧

可分為LEFT JOIN 及 RIGHT JOIN ,nature join
在現今的ORACLE ANSI SQL 有2個方式 作
1. 用 select x.e, i.x from iae i , xxo x  where i.id=x.id;
2. 在新版的 要加關鍵字 ON 
3. nature join
在範例要求用新版的ANSI SQL 規範來作答 所以要用 ON

2010年10月6日 星期三

GROUPING

不同於GROUP BY 放 在FROM .. WHERE 之後 (其實功用也不同)
Grouping 可以SELECT 當時就可以將 欄位GROUPING 起來
並且可以將 GROUPING 出來的欄位 匯整起來,如有相同類別及資料就會SHOW 出1 , 如有NULL 就會出現 0 .
參考來源:http://www.remote-dba.net/pl_sql/t_sql_grouping.htm

範例
:
SELECT
   deptno,
   job,
   count(*),
   sum(sal),
GROUPING(Job)
FROM
   emp
GROUP BY
   ROLLUP(deptno,job);

2010年10月4日 星期一

太神奇..一本小說的封面及女主角 都跟大陸名模周韋彤一樣!!

.可是小說出版日期比較早哦... 寫真比較晚出的!!

2010年10月3日 星期日

Grouping


---http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/functions064.htm


Purpose

GROUPING distinguishes superaggregate rows from regular grouped rows. GROUP BY extensions such as ROLLUP and CUBE produce superaggregate rows where the set of all values is represented by null. Using the GROUPING function, you can distinguish a null representing the set of all values in a superaggregate row from a null in a regular row.

The expr in the GROUPING function must match one of the expressions in the GROUP BY clause. The function returns a value of 1 if the value of expr in the row is a null representing the set of all values. Otherwise, it returns zero. The datatype of the value returned by the GROUPING function is Oracle NUMBER. Refer to the SELECT group_by_clause for a discussion of these terms.

Examples

In the following example, which uses the sample tables hr.departments and hr.employees, if the GROUPING function returns 1 (indicating a superaggregate row rather than a regular row from the table), then the string "All Jobs" appears in the "JOB" column instead of the null that would otherwise appear:

SELECT
DECODE(GROUPING(department_name), 1, 'All Departments', department_name) AS department,
DECODE(GROUPING(job_id), 1, 'All Jobs', job_id) AS job,
COUNT(*) "Total Empl",
AVG(salary) * 12 "Average Sal"
FROM employees e, departments d
WHERE d.department_id = e.department_id
GROUP BY ROLLUP (department_name, job_id)
ORDER BY department, job, "Total Empl", "Average Sal";

DEPARTMENT JOB Total Empl Average Sal
------------------------------ ---------- ---------- -----------
Accounting AC_ACCOUNT 1 99600
Accounting AC_MGR 1 144000
Accounting All Jobs 2 121800
Administration AD_ASST 1 52800
Administration All Jobs 1 52800
All Departments All Jobs 106 77479.2453
Executive AD_PRES 1 288000
Executive AD_VP 2 204000
Executive All Jobs 3 232000
Finance All Jobs 6 103200
Finance FI_ACCOUNT 5 95040
. . .

詭異的SEQUENCE 考題

奇怪我在實作時 .. 建了同樣一個SEQUENCE  出來是從100 不是從1 啊


~而後問了前輩~
他指出是CYCLE的原因