RE: Ergh..banging head against a wall here (sqlplus...recover..until time...sysdate)
- From: "Ric Van Dyke" <ric.van.dyke@xxxxxxxxxx>
- To: <ChrisDavid.Taylor@xxxxxxxxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
- Date: Tue, 3 Aug 2010 09:10:18 -0500
Don't you need a to_date around the to_char?
Something like:
recover database using backup controlfile until time
to_date(to_char(sysdate,'YYYY-DD-MM:HH24:MI:SS')-5/1440);
-----------------------
Ric Van Dyke
Hotsos Enterprises
-----------------------
Hotsos Symposium
March 6 - 10, 2011
You have to be there, yea I'm talking to you.
________________________________
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Taylor, Chris David
Sent: Tuesday, August 03, 2010 9:59 AM
To: 'oracle-l@xxxxxxxxxxxxx'
Subject: Ergh..banging head against a wall here
(sqlplus...recover..until time...sysdate)
Ok, I'm trying to setup an automated job to recover a database within
sqlplus. Everything works fine until I try to add an "UNTIL TIME" with
SYSDATE. Is there no way to configure UNTIL TIME with SYSDATE?
This works:
SQL> recover database using backup controlfile until time
'2010-02-08:08:54:00';
Here's what I'm trying (and need) to do:
/* sysdate -5 minutes */
SQL> recover database using backup controlfile until time
to_char(sysdate,'YYYY-DD-MM:HH24:MI:SS')-5/1440;
ORA-00285: TIME not given as a string constant
I've tried:
SQL> recover database using backup controlfile until time
'to_char(sysdate,'YYYY-DD-MM:HH24:MI:SS')-5/1440';
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
SQL> recover database using backup controlfile until time
''to_char(sysdate,'YYYY-DD-MM:HH24:MI:SS')-5/1440'';
ORA-01840: input value not long enough for date format
SQL> recover database using backup controlfile until time
'''to_char(sysdate,'YYYY-DD-MM:HH24:MI:SS')-5/1440''';
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
So, how can I get SYSDATE -5/1440 into this "UNTIL TIME" ?
Chris Taylor
Sr. Oracle DBA
Ingram Barge Company
Nashville, TN 37205
Office: 615-517-3355
Cell: 615-663-1673
Email: chris.taylor@xxxxxxxxxxxxxxx
CONFIDENTIALITY NOTICE: This e-mail and any attachments are confidential
and may also be privileged. If you are not the named recipient, please
notify the sender immediately and delete the contents of this message
without disclosing the contents to anyone, using them for any purpose,
or storing or copying the information on any medium.
Other related posts: