搜尋此網誌

2010年12月22日 星期三

BULLYING

BULLYING is a operation when strong man ask weaker money and do something bad .
It is a Normal status in high school . why kind of emotions let bullying more common on Taiwan Education. it is a shame thing. especially some one don't interrupter up that kind of things.

2010年11月28日 星期日

南韓戰術的可運用戰術

1. 食物戰.. 在前線放大量食物 , US 派 F-16 炸對方糧運, 使前方士兵無糧 , 南韓 誘使北方士兵
投降
2. 地下電台 去傳播訊息 像是南台灣 的地下電台 那樣作法
3. 全球之鷹進入平壤去拍攝金正日的情況,一定要使金正日神話破滅

2010年11月21日 星期日

Tim Lincecum 投球機制分析

Lincecum 投球機制影片

這是一篇介紹 Lincecum 投球機制
對於一個投手跨步角度 對球速 的影響 ,
這也說明為何 Lincecum 才180左右的身高可以投出 150 以上的球,還可以投完後不用冰手
因為他是用上下半身旋轉的力量將球的速度 帶出,自由腳踏地後 軸心腳帶出去的 HIP SPEED , 上身旋轉的力量,加上手臂旋轉的力量 將球投出至150以上的速度...
反觀台灣選手投球 下半身 臀部移動旋轉 的力量完全沒用到 ,抬腳也抬不高 無法將臀部力量往上傳的手去
--- 美國投球 是有3個馬達在運作, 上下半身體旋轉的力量加上手
--日本是上半身加手臂 再多加個半個下半身
---台灣只有 上半身加手.. 而且上半身 還不完整 啊

2010年11月3日 星期三

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的原因

2010年9月26日 星期日

FLASHBACK QUERY

FLSHBACK-DATA-REFERENCES 參考文件

Select * from xxxx-table VERSIONS BETWEEN
TIMESTAMP MINVALUE AND MAXVALUE ;

2010年9月23日 星期四

2010年9月19日 星期日

PYTHON-LOOP 

#!/usr/bin/python
flag = 0
while flag ==0: 當值等於0時才會執行
  num = raw_input("Enter number:")
  print "you type",num
  flag = raw_input("Enter value:") #使用者輸入資料
  if flag == quit:
    break :跳出迴圈
print "good bye"

在PYTHON 的設定 縮排可用TAB或空白.. 但不能混用
如用空白 ,請空4格

2010年8月24日 星期二

Rman 下誤刪arch logs 導致備份不成時的作法

rman (id/passwd@instance name)
allocate channel for maintenance type disk;
change archivelog all crosscheck;
release channel;
change archivelog all crosscheck

轉文Pivoting INSERT

http://www.oracleabc.com/forums/viewtopic.php?p=100
A data warehouse can receive data from many different sources. Some of these source systems may not be relational databases and may store data in very different formats from the data warehouse. For example, suppose that you receive a set of sales records from a nonrelational database having the form:

product_id, customer_id, weekly_start_date, sales_sun, sales_mon, sales_tue,
sales_wed, sales_thu, sales_fri, sales_sat

The input table looks like the following:

SELECT * FROM sales_input_table;

PRODUCT_ID CUSTOMER_ID WEEKLY_ST SALES_SUN SALES_MON SALES_TUE SALES_WED SALES_THU SALES_FRI SALES_SAT
---------- ----------- --------- ---------- ---------- ---------- -------------------- ---------- ----------
111 222 01-OCT-00 100 200 300 400 500 600 700
222 333 08-OCT-00 200 300 400 500 600 700 800
333 444 15-OCT-00 300 400 500 600 700 800 900

In your data warehouse, you would want to store the records in a more typical relational form in a fact table sales of the sh sample schema:

prod_id, cust_id, time_id, amount_sold

Note:
A number of constraints on the sales table have been disabled for purposes of this example, because the example ignores a number of table columns for the sake of brevity.

Thus, you need to build a transformation such that each record in the input stream must be converted into seven records for the data warehouse's sales table. This operation is commonly referred to as pivoting, and Oracle Database offers several ways to do this.

The result of the previous example will resemble the following:

SELECT prod_id, cust_id, time_id, amount_sold FROM sales;

PROD_ID CUST_ID TIME_ID AMOUNT_SOLD
---------- ---------- --------- -----------
111 222 01-OCT-00 100
111 222 02-OCT-00 200
111 222 03-OCT-00 300
111 222 04-OCT-00 400
111 222 05-OCT-00 500
111 222 06-OCT-00 600
111 222 07-OCT-00 700
222 333 08-OCT-00 200
222 333 09-OCT-00 300
222 333 10-OCT-00 400
222 333 11-OCT-00 500
222 333 12-OCT-00 600
222 333 13-OCT-00 700
222 333 14-OCT-00 800
333 444 15-OCT-00 300
333 444 16-OCT-00 400
333 444 17-OCT-00 500
333 444 18-OCT-00 600
333 444 19-OCT-00 700
333 444 20-OCT-00 800
333 444 21-OCT-00 900

Example 14-7 Pivoting

The following example uses the multitable insert syntax to insert into the demo table sh.sales some data from an input table with a different structure. The multitable INSERT statement looks like the following:

INSERT ALL INTO sales (prod_id, cust_id, time_id, amount_sold)
VALUES (product_id, customer_id, weekly_start_date, sales_sun)
INTO sales (prod_id, cust_id, time_id, amount_sold)
VALUES (product_id, customer_id, weekly_start_date+1, sales_mon)
INTO sales (prod_id, cust_id, time_id, amount_sold)
VALUES (product_id, customer_id, weekly_start_date+2, sales_tue)
INTO sales (prod_id, cust_id, time_id, amount_sold)
VALUES (product_id, customer_id, weekly_start_date+3, sales_wed)
INTO sales (prod_id, cust_id, time_id, amount_sold)
VALUES (product_id, customer_id, weekly_start_date+4, sales_thu)
INTO sales (prod_id, cust_id, time_id, amount_sold)
VALUES (product_id, customer_id, weekly_start_date+5, sales_fri)
INTO sales (prod_id, cust_id, time_id, amount_sold)
VALUES (product_id, customer_id, weekly_start_date+6, sales_sat)
SELECT product_id, customer_id, weekly_start_date, sales_sun,
sales_mon, sales_tue, sales_wed, sales_thu, sales_fri, sales_sat
FROM sales_input_table;