HOW TO CONVERT SCN TO DATE AND DATE INTO SCN

Database SCN number some time is very important

1) particularly when you are doing rman recovery

2) Filling gaps of archive logs between primary server and Physical standby server. Below SQL queries will give SCN for particular date and date to get SCN.

SQL>select current_scn from v$database;
7705798324

SQL> select timestamp_to_scn(to_timestamp('24/09/2012 14:24:54','DD/MM/YYYY HH24:MI:SS')) as scn from dual; 
SCN ---------- 7705798324 SQL>
SQL> select scn_to_timestamp(7705798324) as timestamp from dual; 
24-SEP-12 02.24.52.000000000 PM
About these ads

About Sher khan

Oracle DBA, OCE Oracle 10g RAC and 11g Performance & Tuning, Oracle 11g OPN certified Specialist, OCP Certified in Oracle 9i,10g and 11g. And working in Oracle products since 2004. Currently working in U.A.E Email: sher487@hotmail.com
This entry was posted in rman. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s