doT.sYs

January 21, 2009

Oracle Tips

Filed under: Oracle, Database

Here are some helpful tips to remember when dealing with oracle.

I. Use the “flashback technology” when you accidentally commit a mistake with your production data.
(altering entire table contents, corrupted table data, or worst dropping unintended table).

- First thing to do is to enable flashback on your database.

ALTER DATABASE FLASHBACK ON;

- Restoring database to its good state.

FLASHBACK DATABASE TO RESTORE POINT bef_damage;

- Restoring dropped table.

FLASHBACK TABLE [TABLE_NAME] TO BEFORE DROP;

- Restoring table to its good state.

FLASHBACK TABLE [TABLE_NAME] TO TIMESTAMP TO_TIMESTAMP('[DATE_TIME]');

II. Manipulate date and time display
Aside from to_date and to_timestamp functions , you could also alter the date and time display in your database through the use of this code below.

ALTER SESSION SET NLS_DATE_FORMAT = '[DATE_FORMAT]'

Comments »

The URI to TrackBack this entry is: http://keeve.blogsome.com/2009/01/21/oracle-tips/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.



Blog Redesigned by Karen Eve R. Eso