database restore

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

database restore

satish
Dear Erman,

we are performing a database refresh.we are instructed to perform ram duplicate using until scn.could you please provide some queries which is helpful to put the correct scn during rman duplicate.

Thanks for all the support
Reply | Threaded
Open this post in threaded view
|

Re: database restore

ErmanArslansOracleBlog
Administrator
You will basically use " UNTIL SCN " clause in your rman script.
There are plenty of documents for this.

For finding the right SCN, you can use TIMESTAMP_TO_SCN function.

Reply | Threaded
Open this post in threaded view
|

Re: database restore

ErmanArslansOracleBlog
Administrator
You can even use a date to find the relevant scn ->

select timestamp_to_scn(to_timestamp('20/05/2018 18:24:54','DD/MM/YYYY HH24:MI:SS')) as scn from dual;
Reply | Threaded
Open this post in threaded view
|

Re: database restore

satish
Dear Erman,

Thanks for the update

could you please let us know why we are unable to get the scn

SQL> SELECT DATABASE_NAME, TIMESTAMP_TO_SCN('20-MAY-18 05:56:12 PM') FROM DUAL;
SELECT DATABASE_NAME, TIMESTAMP_TO_SCN('20-MAY-14 05:56:12 PM') FROM DUAL
                      *
ERROR at line 1:
ORA-08180: no snapshot found based on specified time
ORA-06512: at "SYS.TIMESTAMP_TO_SCN", line 1
 
Reply | Threaded
Open this post in threaded view
|

Re: database restore

ErmanArslansOracleBlog
Administrator
It is related with undo_retention. The information in undo is overwritten.

Read the documentation:

The association between an SCN and a timestamp when the SCN is generated is remembered by the database for a limited period of time. This period is the maximum of the auto-tuned undo retention period, if the database runs in the Automatic Undo Management mode, and the retention times of all flashback archives in the database, but no less than 120 hours. The time for the association to become obsolete elapses only when the database is open. An error is returned if the SCN specified for the argument to SCN_TO_TIMESTAMP is too old.