Jennifer Lin’s Weblog

January 27, 2008

Proverbs

Filed under: Life — jennyca @ 2:13 am

学习英语如逆水行舟不进则退。坚持每天学习,是学好英语的关键。

循序渐进,贵在坚持!

天道酬勤

自强不息 厚德载物

坚韧卓绝之人,必能成就万事

兴趣是最好的老师。没有必胜的秘籍,没有方程式遵循。要赢 – 只有全身心的投入!– 晶晶小妹

去除浮躁,认真学习,不断积累,寻找机遇

Pain past is pleasure.(过去的痛苦就是快乐。)[无论多么艰难一定要咬牙冲过去,将来回忆起来一定甜 蜜无比。]

While there is life, there is hope.(有生命就有希望/留得青山在,不怕没柴烧。)

Wisdom in the mind is better than money in the hand.(脑中有知识,胜过手中有金钱。)

Storms make trees take deeper roots.(风暴使树木深深扎根。)[ 感激敌人,感激挫折!]

Nothing is impossible for a willing heart.(心之所愿,无所不成。) [坚持一个简单的信念就一定会成功。]

The shortest answer is doing.(最简单的回答就是干。) [想说流利的英语吗?那么现在就开口!心动不如嘴动。]

All things are difficult before they are easy.(凡事必先难后易。)[放弃投机取巧的幻想。]

God helps those who help themselves.(天助自助者。)

Four short words sum up what has lifted most successful individuals above the crowd: a little bit more.(四个简短的词汇概括了成功的秘诀:多一点点!)[比别人多一点努力、多一点自律、多一点决心、多一点 反省、多一点学习、多一点实践、多一点疯狂,多一点点就能创造奇迹!]

Two heads are better than one.(三个臭皮匠,顶个诸葛亮。)

Misfortunes tell us what fortune is.(不经灾祸不知福。)

If a thing is worth doing it is worth doing well.(如果事情值得做,就值得做 好。)

Nothing great was ever achieved without enthusiasm.(无热情成就不了伟业。)

Actions speak louder than words.(行动比语言更响亮。)

Knowing something of everything and everything of something.(通百艺而专一长。)

When work is a pleasure , life is joy ! When work is duty , life is slavery .(Maxim Gorky , Russian writer )工作是一种乐趣时,生活是一种享受!工作是一种义务时,生活则是一种苦役。(俄国作家 高尔基. M.)

You have to believe in yourself. That’s the secrets of success.
你必须相信你自己,这是成功的秘诀。

Achievments provides the only real pleasure in life. 有所成就是人生唯一的真正乐趣。

Diamond cuts diamond. 强中自有强中手。

No cross, no crown. 未经苦难,得不到荣冠。
Constant dropping wears away a stone.滴水穿石。

Always be a first-rate version of yourself, instead of a second-rate version of somebody else. – Judy Garland
永远做自己的一流版本,永不做他人的二流版本。——朱迪·嘉兰(Judy Garland,美国30~50年代著名影星)

Work banishes those three great evils : boredom , vice, and poverty.(Voltaire , French philosopher )工作撵跑三个魔鬼:无聊、堕落和贫穷。 (法国哲学家 伏尔基泰)

My philosophy of life is work . (Thomas Alva Edison , American inventor)我的人生哲学就是工作。 (美国发明家 爱迪生 . T . A .)

It is no use doing what you like ; you have got to like what you do .(Winston Churchill , British prime minister)不能爱哪行才干哪行,要干哪行爱哪行。 (美国首相 丘吉尔. W.)

And gladly would learn , and gladly teach .( Chaucer , British poet)

勤于学习的人才能乐意施教。(英国诗人, 乔叟)

Do what you say,say what you do. 做你说过的,说你能做的.

Never, never, never, never give up (Winston Churchill)
永远不要、不要、不要、不要放弃。(英国首相 丘吉尔)

If not now, When? If not me, Who? 时不我待,舍我其谁!- 马云

Sow a thought; reap an action;
sow an action; reap a habit;
sow a habit; reap a character;
sow a character; reap a destiny.
美国 著名心理学家、哲学家(William James,1842 – 1910) 威廉·詹姆士

播下一个行动,收获一种习惯;
播下一种习惯,收获一种性格;
播下一种性格,收获一种命运。

Give me health and a day, and I will make the pomp of emperors ridiculous.

The first wealth is health. 健康是最大的财富。

Emerson, Ralph Waldo

Don’t stir up trouble when you were free, don’t afraid when you need to face. 没事别惹事,有事别怕事。

我的哲学:当你勇敢面对困难时,困难就会退却。- Isaac Asimo

January 23, 2008

Managing Oracle Synonyms

Filed under: Schema Objects mgt — jennyca @ 4:15 am

http://www.dba-oracle.com/concepts/synonyms.htm

Creating Synonyms

A synonym is named, and points to a specific object. For example, in the ROBERT schema we can create a private synonym for SCOTT.EMP using the create synonym command:

SQL> CREATE SYNONYM emp FOR SCOTT.EMP;

Note that we said that this was a private synonym. That means that only the ROBERT user can use the synonym. We can also create public synonyms using the create public synonym command as seen here:

SQL> CREATE PUBLIC SYNONYM emp FOR SCOTT.EMP;

Generally good DBA’s try to avoid public synonyms. They do make management of the database a bit easier, but they also have security and performance issues associated with them. Hence, try not to use public synonyms unless you have to.

You can have a public and private synonym of the same name. In fact, you can have a public and private synonym called EMP in the SCOTT schema and have a table called EMP in the same schema. In cases where you have multiple synonyms and/or a table present, it can get confusing which object you are using (this is another reason we hate public synonyms). There is an order of precedence with regards to the use of synonyms and local objects. This is:

1. Local objects will always be accessed first.

2. If a local object does not exist, the object with a private synonym will be accessed.

3. If a private synonym does not exist or the object does not exist, then the public synonym will be used.

Note that a synonym can be created for an object that does not exist, and an object with an associated synonym can be dropped without removing the synonym. This can cause all sorts of interesting problems for DBA’s, so be careful.

Removing Synonyms

The drop synonym command is used to drop public and private synonyms. Here is an example of dropping a private synonym and a public synonym with the drop synonym command:

SQL> — Drop public synony
SQL> DROP PUBLIC SYNONYM emp;
SQL> — Drop private synonym
SQL> DROP SYNONYM emp;
http://www.adp-gmbh.ch/ora/concepts/synonyms.html

 

 

January 22, 2008

Finding Foreign Key Constraints in Oracle

Filed under: Oracle Dev — jennyca @ 4:36 am

http://www.databasejournal.com/features/oracle/article.php/3665591

Many times developers find it difficult to delete records from parent tables when child records reference those tables through foreign key (referential integrity) constraints.

Constraints validate the data; without constraints, we are just storing invalid data.

For a developer to identify and disable foreign key constraints is a difficult task. Most of the time, the application’s ER diagrams are not available to the developers. A brief description on the foreign key (referential integrity) constraints will go a long way in identifying and disabling these constraints.

Unless a primary/unique key constraint is enabled on the parent key column, Oracle does not allow enabling a foreign key constraint on a child key column. Primary/unique keys on the parent key column will not allow duplicate values.

A table can have only one primary key constraint. A table can have multiple unique key constraints.

The enabled foreign key constraint will not allow inserting child records in the table, unless a matching record is found in the parent table.

In essence, constraints safeguard and validate the data.

Each parent record can have multiple child records, but each child can relate to ONLY one parent record. That is why Oracle wants a PRIMARY/ UNIQUE KEY index created on the PRIMARY KEY column of the PARENT TABLE. It is not mandatory to have such an index created on the CHILD KEY column in the CHILD TABLE.

The parent table can not be truncated, nor deleted, when foreign key(referential integrity) constraints are referencing them.

SQL> select owner,constraint_name,constraint_type,table_name,r_owner,r_constraint_name
  2  from all_constraints where constraint_type in ('P','U') and table_name='TEMP_JP1';

The r_constraint_name( primary/unique constraint name in the parent table) column in the all_constraints view is referenced by the constraint_name (foreign key(referential integrity) constraint in the child table), when the constraint_type is ‘R’. Using this definition, let us find out all the foreign key(referential integrity) constraints referencing the TEMP_JP1 table:

SQL> select owner,constraint_name,constraint_type,table_name,r_owner,r_constraint_name
  2   from all_constraints
  3  where constraint_type='R'
  4  and r_constraint_name in (select constraint_name from all_constraints
  5  where constraint_type in ('P','U') and table_name='TEMP_JP1');

Foreign key constraints can only be enabled on a child table, when a PRIMARY/UNIQUE KEY constraint is enabled on the parent table.

As long as the foreign key constraints are enabled on the child tables, the data in the parent table is protected.

If we need to manipulate the data in the parent table, TEMP_JP1, first disable the foreign key(referential integrity) constraints on the child tables that are referencing the parent table.

A ready built script to identify and disable/enable foreign key constraints on child tables:

SQL> select 'alter table '||a.owner||'.'||a.table_name||
  2          ' disable constraint '||a.constraint_name||';'
  3          from all_constraints a, all_constraints b
  4          where a.constraint_type = 'R'
  5          and a.r_constraint_name = b.constraint_name
  6          and a.r_owner  = b.owner
  7          and b.table_name = 'TEMP_JP1';

Please be careful: Both Primary / Unique key indexes do not allow duplicates in the column. All primary key indexes are unique. A table can have only one Primary key index and can have multiple unique key indexes. One main difference is that you can not insert NULL values into a primary key constraint enabled column, whereas you can insert NULL values into a unique key constraint enabled column.

January 16, 2008

成功学

Filed under: Life — jennyca @ 5:30 am

成功一定有方法, 失败一定有原因.

1. Born to win! 天生我才必有用, 千金散尽还复来!

2. Self confident. You must believe in yourself that is the secret of success.

3. Set goal and deadline, master fundamental concepts first.

4. ABP: Always Be Positive. How? Problem is challenge or chance. Winners aim at the goals; losers see the obstacles.

5. Study/work hard until you succeed. Try my best to force myself to do more to improve myself everyday. [English/Oracle]

6. Prepared Resume and Interview well while studying and in advanced.

7. Never, never give up! Remember, 20/80 rule. 量变到质变. For example, 邓亚萍, the world pingpong champion and got a doctor degree in English major as well. 坚韧卓绝的人, 必能成就万事! I will be one of them.

学习五大步骤

Filed under: Study — jennyca @ 5:28 am
  1. 初步了解
  2. 重复 (重复为学习之母)
  3. 开始使用
  4. 融会贯通
  5. 再次加强

January 14, 2008

ALTER TABLESPACE OFFLINE vs. ALTER DATABASE DATAFILE OFFLINE

Filed under: Oracle DBA — jennyca @ 8:11 pm

http://www.quest-pipelines.com/pipelines/dba/tips06.htm

There is a big difference between:

  • Taking the tablespace offline and
  • Taking the datafiles offline

ALTER TABLESPACE … OFFLINE

  1. Does a checkpoint on the datafiles
  2. Takes the datafiles offline

ALTER DATABASE DATAFILE … OFFLINE does not perform a checkpoint, so that if the database is open, you may need to perform media recovery when bringing it online.

That is the reason why:

  • You cannot do ‘alter database datafile … offline’ if you are in noarchivelog (but tablespace offline works)
  • You cannot do ‘alter tablespace … offline’ if database is read-only (but datafile offline works)

Note that in both cases, you can check the STATUS column from v$datafile to see if the file is online, offline or needs recovery.

Blog at WordPress.com.