FLASHBACK Database : rman vs sql command differnces
I am new to Oracle and want understand the difference and which is the correct way of flashing back the database?
RMAN command vs SQL Command on using FLASHBACK DATABASE
SQL> FLASHBACK DATABASE TO RESTORE POINT BEFORE_ONLINE_TEST; {CODE} Vs rman> run{
flashback database to restore point BEFORE_TEST_320130313;
sql "alter database open resetlogs"; }
Referring this article on http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmflash.htm#BGBDCAFA it says we can use both RMAN and SQL command for database flashback.
Questions:
1. Difference between using RMAN and SQL command on database flashback?
2. When to use RMAN or SQL on the database flashback?
3. Which is the Oracle recommended or best way ?
Edited by: Sivaprasad S on Mar 15, 2013 7:26 PM
Edited by: Sivaprasad S on Mar 15, 2013 7:26 PM
Edited by: Sivaprasad S on Mar 15, 2013 7:27 PM
Edited by: Sivaprasad S on Mar 15, 2013 7:27 PM
Edited by: Sivaprasad S on Mar 15, 2013 7:28 PM
Edited by: Sivaprasad S on Mar 15, 2013 7:29 PM
When I issue the SQL Plus command of
SQL> flashback database to restore point BEFORE_TEST_20130313 ;
flashback database to restore point BEFORE_TEST_20130313
ERROR at line 1:
ORA-38754: FLASHBACK DATABASE not started; required redo log is not available
ORA-38762: redo logs needed for SCN 87612483975 to SCN 87612485856
ORA-38761: redo log sequence 1 in thread 1, incarnation 3 could not be accessedHowever on running this on RMAN
RMAN>
list backup of archivelog scn between 87612483975 and 87612485856
RMAN> ;
starting full resync of recovery catalog
full resync complete
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
5212758 19.75M SBT_TAPE 00:00:04 13-MAR-2013 16:36:17
BP Key: 5212765 Status: AVAILABLE Compressed: NO Tag: TAG20130313T163611
Handle: <TestDB_60:809973373:1>.al Media: 945c30b6:506c6cd2:3a14:0001
List of Archived Logs in backup set 5212758
Thrd Seq Low SCN Low Time Next SCN Next Time
1 1 87612468290 13-MAR-2013 13:28:19 87612484321 13-MAR-2013 16:36:06
1 2 87612484321 13-MAR-2013 16:36:06 87612484339 13-MAR-2013 16:36:09
BS Key Size Device Type Elapsed Time Completion Time
5212759 896.50M SBT_TAPE 00:00:17 13-MAR-2013 16:36:30
BP Key: 5212766 Status: AVAILABLE Compressed: NO Tag: TAG20130313T163611
Handle: <TestDB_59:809973373:1>.al Media: 945c30b6:506c6cbd:39f5:0001
List of Archived Logs in backup set 5212759
Thrd Seq Low SCN Low Time Next SCN Next Time
1 5 87612363812 12-MAR-2013 14:22:26 87612659040 13-MAR-2013 03:04:08
run {
allocate CHANNEL dev_2 TYPE 'SBT_TAPE' format '%U' PARMS 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8)';
allocate CHANNEL dev_3 TYPE 'SBT_TAPE' format '%U' PARMS 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8)';
allocate CHANNEL dev_4 TYPE 'SBT_TAPE' format '%U' PARMS 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8)';
flashback database to restore point BEFORE_TEST_20130313;
sql "alter database open resetlogs";
release channel dev_2;
release channel dev_3;
release channel dev_4;
starting media recovery
archived log for thread 1 with sequence 2 is already on disk as file +DG_PERF_FLASH_02/TestDB/archivelog/2013_03_14/thread_1_seq_2.3612.810054205
archived log for thread 1 with sequence 3 is already on disk as file +DG_PERF_FLASH_02/TestDB/archivelog/2013_03_14/thread_1_seq_3.1588.810054205
channel dev_2: starting archived log restore to default destination
channel dev_2: restoring archived log
archived log thread=1 sequence=1
channel dev_2: reading from backup piece <TestDB_60:809973373:1>.al
channel dev_2: piece handle=<TestDB_60:809973373:1>.al tag=TAG20130313T163611
channel dev_2: restored backup piece 1
channel dev_2: restore complete, elapsed time: 00:00:46
channel dev_2: deleting archived log(s)
archived log file name=+DG_PERF_FLASH_02/TestDB/archivelog/2013_03_15/thread_1_seq_1.2969.810106317 RECID=49 STAMP=810106318
media recovery complete, elapsed time: 00:00:05
Finished flashback at 10-MAR-2013 05:32:07
database reset to incarnation 5215723
When we issue the SQL Plus command, if there is need of old database backup of archive log, how does that SQL Plus communicate with rman recovery catalog and retrieve?
Similar Messages
-
How: multiple insert stmt's in Database Express edition SQL commands GUI?
I have installed the Express 10g version today and played around with it for a while.
If I go to the SQL commands GUI and enter one insert like this:
INSERT INTO pageit (PagID, PagParent, PagName, PagActive) VALUES (19, 17, 'Mango tree', 1)
then it works nicely:
But if I do this:
INSERT INTO pageit (PagID, PagParent, PagName, PagActive) VALUES (20, 17, 'Grape trees', 1);
INSERT INTO pageit (PagID, PagParent, PagName, PagActive) VALUES (21, 16, 'Animals', 1);
Then it says:
ORA-00911: invalid character
Looks like semicolon is not allowed,
but if I remove the semicolon then it says;
ORA-00905: missing keyword
Is there a way to use multiple insert statements in one go in this GUI at all?
If not, could someone please recommend how I do this.
I have exported thousands of insert lines from MySql and I would like to get them into my newly created Oracle table without having to type one line at the time in this gui.
Any suggestions?
Then if there is a nice WEB GUI like phpmyadmin for Oracle then I would like to know about that to? (Preferably free)I've not done a lot with the express edition, so there may be tools I'm not aware of. There is a dedicated Express Edition forum that may be more helpful for some of these questions.
I would normally use the command-line SQL*Plus to run a script with a large number of SQL statements. I'd generally prefer, though, to get a comma-separated data file from the other system and load that into Oracle using SQL*Loader for efficiency reasons.
In Oracle, you would normally only want a single database on a single physical machine. I know in SQL Server that what they call a "database" is roughly equivalent to a "schema" in Oracle, which is created by creating a new user.
Justin -
Passing Params & Formulas to SQL Command & Strd Proc in CR 11.5 & 2008 - 1
I am working with CR 11.5 and heavily use SQL Command rewrites and Stored Procedures (SPs)with the usual limitation that only single parameter values can be passed into SPs, and Parameters must be created within the SQL Command editor (and cannot be referenced to those generated in Field Explorer, or can they?)
I understand from BE/CR's sales material for CR 2008 that multiple values can now be used under these conditions. As I recall, Multivalue Parameters are actually arrays that can be made into comma delimited strings.
Local StringVar StringExpression;
Local NumberVar ArrayCount := Count({?Code});
Local NumberVar i;
if ArrayCount = 0
then StringExpression := ""
else
StringExpression := {?Code}[1];
i := 2;
While i <= ArrayCount Do
StringExpression := StringExpression + ", " + {?Code}<i>;
i := i + 1;
See part 2 for continuation....Here is my use case (since most of my reports are against very large databases, running "tuned" SQL Commands is essential).
SELECT
PERSON.PatientName,
PROBLEM.Code,
PROBLEM.Description
LASTLABS.HDID,
RPTOBS.ObsDate,
RPTOBS.ObsValue
FROM
((PERSON INNER JOIN
PROBLEM ON
PERSON.PId = PROBLEM.PId) LEFT OUTER JOIN
LASTLABS ON
(PERSON.PId = LASTLABS.PId AND
LASTLABS.HDID IN (28, 53, 67, 102) LEFT OUTER JOIN -- Paramaterize
RPTOBS ON
(LASTLABS.HDID = C.HDID AND
LASTLABS.MaxObsDate = RPTOBS.ObsDate AND
LASTLABS.PId = RPTOBS.PId AND
RPTOBS.Change IN (2, 5, 7)) -- Paramaterize
WHERE
(PROBLEM.Code LIKE '249%' OR -- Paramaterize
PROBLEM.Code LIKE '250%' OR -- Paramaterize
PROBLEM.Code IN ('V77.1', 'V80') -- Paramaterize
What I am looking for is a Parameterized form as follows....
SELECT
PERSON.PatientName,
PROBLEM.Code,
PROBLEM.Description
PROBLEM.Qualifier,
LASTLABS.HDID,
RPTOBS.ObsDate,
RPTOBS.ObsValue
FROM
((PERSON INNER JOIN
PROBLEM ON
PERSON.PId = PROBLEM.PId) LEFT OUTER JOIN
LASTLABS ON
(PERSON.PId = LASTLABS.PId AND
LASTLABS.HDID ({?HDID_In_Param}) LEFT OUTER JOIN -- Paramaterize
RPTOBS ON
(LASTLABS.HDID = RPTOBS.HDID AND
LASTLABS.MaxObsDate = RPTOBS.ObsDate AND
LASTLABS.PID = RPTOBS.PID AND
RPTOBS.Change ({?Change_In_Param})) -- Paramaterize
WHERE
(PROBLEM.Code {?Code_Like_Param} OR -- Paramaterize
PROBLEM.Code {?Code_In_Param}) -- Paramaterize
Is this possible? Has it been thought of yet. Has passing in well-constructed @formulas been considered? -
I have a database with fields containing large amounts of text. I wish to be able to search the text in the database using a sql command. I have a number of problems:
1. I will not know in advance how many words the user will be searching for eg 'Holidays' or 'Holidays in England' so how can I split these up and search effectively?
2. What is the SQL command to use to check in the database field to see if it has any of the related strings?
Any help would be greatly appreciated.1.Use StringTokenizer to split the words in your search string
StringTokenizer st = new StringTokenizer("query_string"," ");
2.Suppose it has 2 tokens then, construct a query like this, (You can use st.countTokens() to get the token count)
Select * from table where col1 like '%token1%' or col1 like '%token2%'
Hope this helps.
Sudha -
Recover Database in RMAN vs SQL*PLUS
Hello,
Oracle 11.2.0.1, Oracle Linux 5.5 UEK.
I recently did a "recover database" in sql*plus, but an attempt to open the database gave ORA-01113, complaining the system tablespace requried more recovery. Then I used RMAN (nocatalog) and after the same "recover database" command I was able to open the database.
It seems there are differences between SQL*PLUS and RMAN "recover database" command. I have not been able to locate the chapter in the Oracle documentation that explains the difference. I have some ideas, but...
Thanks.
h3. Solution Summary:
The recover command in RMAN compared to SQL*Plus implements a more user friendly processing logic based on the current detected scenario. For instance, a RMAN recover database command may actually perform a "recover database using backup controlfile until cancel" and automatically apply all archived and online redo logs if available. The same can be achieved with the recover command in SQL*plus, but will have to be done manually.
Edited by: Dude on Jan 7, 2011 12:30 PMDude wrote:
I did not remove any datafiles or redo logs. it is the same restore operation as before, and again RMAN "recovery database" succeeds, whereas SQL recover has trouble. This tells me something is different between the two methods. For one, RMAN does not requrie to specify "using backup controlfile".
Maybe someting about "resetlogs" that that RMAN recover can handle and SQL recover not?No,problem is there.If you using rman execute RECOVER DATABASE it also will apply online logs(if available) also and as result you will get complete recovery however you must open database with resetlogs option due to you recovered database using backup controlfile.So also you can recover and open database applying this online logs.After executing RECOVER DATABASE USING BACKUP CONTROLFILE you have to pass full path of online log then press ENTER so log will apply and you can open database with RESETLOGS.See below
C:\Documents and Settings\chinar>rman target sys/sm
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Jan 7 17:47:49 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
Oracle instance started
Total System Global Area 138412032 bytes
Fixed Size 1247708 bytes
Variable Size 71304740 bytes
Database Buffers 58720256 bytes
Redo Buffers 7139328 bytes
RMAN> restore controlfile from 'D:\oracle\product\10.2.0\flash_recovery_area\T\B
ACKUPSET\2011_01_07\O1_MF_NCSNF_TAG20110107T171001_6LG48JR5_.BKP'
2> ;
Starting restore at 07-JAN-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\T\CONTROL01.CTL
output filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\T\CONTROL02.CTL
output filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\T\CONTROL03.CTL
Finished restore at 07-JAN-11
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> restore database;
Starting restore at 07-JAN-11
Starting implicit crosscheck backup at 07-JAN-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 07-JAN-11
Starting implicit crosscheck copy at 07-JAN-11
using channel ORA_DISK_1
Finished implicit crosscheck copy at 07-JAN-11
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\T\BACKUPSET\2011_01_07\O
1_MF_NCSNF_TAG20110107T171001_6LG48JR5_.BKP
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\T\SYSTEM01.DBF
restoring datafile 00002 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\T\UNDOTBS01.DBF
restoring datafile 00003 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\T\SYSAUX01.DBF
restoring datafile 00004 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\T\USERS01.DBF
channel ORA_DISK_1: reading from backup piece D:\ORACLE\PRODUCT\10.2.0\FLASH_REC
OVERY_AREA\T\BACKUPSET\2011_01_07\O1_MF_NNNDF_TAG20110107T171001_6LG45BXS_.BKP
channel ORA_DISK_1: restored backup piece 1
piece handle=D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\T\BACKUPSET\2011_01_07
\O1_MF_NNNDF_TAG20110107T171001_6LG45BXS_.BKP tag=TAG20110107T171001
channel ORA_DISK_1: restore complete, elapsed time: 00:01:04
Finished restore at 07-JAN-11
RMAN> recover database;
Starting recover at 07-JAN-11
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 7 is already on disk as file D:\ORACLE\PRODUCT\10.
2.0\ORADATA\T\REDO02.LOG
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\T\REDO02.LOG thread=1 sequ
ence=7
media recovery complete, elapsed time: 00:00:03
Finished recover at 07-JAN-11
RMAN> exit
Recovery Manager complete.
C:\Documents and Settings\chinar>sqlplus sys/sm as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 7 17:51:31 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> alter database open;
alter database open
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
SQL> And above you see lines as
archive log thread 1 sequence 7 is already on disk as file D:\ORACLE\PRODUCT\10.
*2.0\ORADATA\T\REDO02.LOG*
archive log filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\T\REDO02.LOG thread=1 sequ
ence=7
It means RMAN apply these.So you can apply these using SQLPLUS ALSO.In additionally you can see that from alert log as
alter database recover if needed
start until cancel using backup controlfile
Media Recovery Start
parallel recovery started with 2 processes
ORA-279 signalled during: alter database recover if needed
start until cancel using backup controlfile
Fri Jan 07 17:50:34 2011
alter database recover logfile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\T\REDO02.LOG'
Fri Jan 07 17:50:34 2011
Media Recovery Log D:\ORACLE\PRODUCT\10.2.0\ORADATA\T\REDO02.LOG
Fri Jan 07 17:50:34 2011
Incomplete recovery applied all redo ever generated.
Recovery completed through change 665263
Completed: alter database recover logfile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\T\REDO02.LOG'And finally you see clearly that even if you execute RECOVER DATABASE from RMAN it actually execute RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE (from alert.log start until cancel using backup controlfile)
And these is not any difference.
Hope that help you and you got answer. -
You want to know the amount of space the transaction log for the Customer database is using. Which T-SQL command would you use?
Forced me to do a little research.
DBCC SQLPERF(logspace)
See also
http://stackoverflow.com/questions/198343/how-can-i-get-the-size-of-the-transaction-log-in-sql-2005-programmatically
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
Can we rollback catcpu.sql using flashback database?
Hello all,
Can we use FLASHBACK DATABASE to roll back the changes made by the catcpu.sql/catpatch.sql used for upgradation/patching? [ I am aware that oracle provides rollback sql's but just curious. ]
TIA,
JJKeep in mind, catpatch is only the second part of the patching process, before that you already patched the software. If you want to have a complete rollback, follow the instructions in the readme file.
Werner -
I am attempting to write a SQL command for a Crystal report that links tables from two different databases, both of them Progress databases.I keep getting syntax errors that the table from the other db (meaning not the one I opened in DB Expert) can't be found. If someone has experience with Progress or otherwise has any ideas it would be greatly appreciated.
I'm not familiar with Progress, but does it have something like MS SQL's OPENQUERY using Linked Servers (which allows you to query a different DB server from the one you're connected to)? If not, you'll probably have to use two different SQL Commands to base the report on, then use Crystal to link the returned data sets. (I'm assuming "a different database" means "a different database server", not a different database on the same server instance...)
HTH,
Carl -
Sql Commands for Backup and restore database
Hi,
What are the SQL commands used for database backup nad restore?
Is it possible to use these command in pl/sql block or it is used only
from sql plus?
Thanks
Jobin .SPhttp://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/intro005.htm
-
I tried to execute in Rman this SQL statement
sql 'alter session set NLS_DATE_FORMAT='MM-DD-YYYY'';
but rman gives me an error.
MM is a "bad identifier"...
I know that single quotes make some trouble....but I tried all
escape sequences (duoble quotes, Backslash etc)
None of them worked....
what can i do???
thx in advance.From Oracle8i Recovery manager User's Guide and Reference,
p. 10-150
If the string that RMAN passes to PL/SQL contains a filename,
then the filename must be enclosed in duplicate single
quotes and the entire string following the sql parameter
must be enclosed in double quotes.
Try
RMAN> sql "alter session set nls_date_format=''DD-MON-YY''";
Regards,
Sev -
After Flashback database can I use my backups?
I performed a flashback database and then opened the database with
alter database open resetlogs;
Now when I try the following command in rman I get this message:
RMAN> list backup
2> ;
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
435 Incr 1 9.36M DISK 00:00:11 30-AUG-09
BP Key: 440 Status: AVAILABLE Compressed: NO Tag: TAG20090830T170015
All the backups are still there but it tells me a new incarnation of the database has been registered in the recovery catalog.
My question is: Do I need to do anything different from now on? Also can my existing backups still be used if needed?
thanks in advance,
RichardFor u question ist take a rman backup.
RMAN> backup database;
Starting backup at 31-AUG-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=140 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
input datafile fno=00003 name=F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF
input datafile fno=00005 name=F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF
input datafile fno=00002 name=F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF
input datafile fno=00004 name=F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 31-AUG-09
channel ORA_DISK_1: finished piece 1 at 31-AUG-09
piece handle=F:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2009_08_31\O1_MF_NNNDF_TAG20090831T131520_59PY48QX_.BKP tag=TAG20090831T131520 comment=
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 31-AUG-09
channel ORA_DISK_1: finished piece 1 at 31-AUG-09
piece handle=F:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2009_08_31\O1_MF_NCSNF_TAG20090831T131520_59PY5R4D_.BKP tag=TAG20090831T131520 comment=
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 31-AUG-09
After that …..
SQL> create table y (id number);
Table created.
SQL> select to_char(sysdate,'dd-mm-yy hh24:mi:ss') from dual;
TO_CHAR(SYSDATE,'
31-08-09 13:23:03
SQL> drop table y
2 ;
Table dropped.
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 226495364 bytes
Database Buffers 377487360 bytes
Redo Buffers 7135232 bytes
Database mounted.
SQL> flashback database to timestamp to_timestamp('31-08-09 13:23:03','dd-mm-yy hh24:mi:ss');
Flashback complete.
SQL> alter database open resetlogs;
Database altered.
SQL> desc y
Name Null? Type
ID NUMBER
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 226495364 bytes
Database Buffers 377487360 bytes
Redo Buffers 7135232 bytes
Database mounted.
SQL> select name from v$datafile;
NAME
F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF
F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF
F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF
SQL> host del F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
SQL> alter database open;
alter database open
ERROR at line 1:
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: 'F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF'
Then I restore old backup from rman
RMAN> restore database;
Starting restore at 31-AUG-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=154 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
restoring datafile 00002 to F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF
restoring datafile 00003 to F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF
restoring datafile 00004 to F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
restoring datafile 00005 to F:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF
channel ORA_DISK_1: reading from backup piece F:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2009_08_31\O1_MF_NNNDF_TAG20090831T131520_59PY48QX_.BK
channel ORA_DISK_1: restored backup piece 1
piece handle=F:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2009_08_31\O1_MF_NNNDF_TAG20090831T131520_59PY48QX_.BKP tag=TAG20090831T131520
channel ORA_DISK_1: restore complete, elapsed time: 00:00:46
Finished restore at 31-AUG-09
RMAN> recover database;
Starting recover at 31-AUG-09
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 22 is already on disk as file F:\ORACLE\PRODUCT\10.2.0\ARC\ARC00022_0693947048.001
archive log thread 1 sequence 23 is already on disk as file F:\ORACLE\PRODUCT\10.2.0\ARC\ARC00023_0693947048.001
archive log filename=F:\ORACLE\PRODUCT\10.2.0\ARC\ARC00022_0693947048.001 thread=1 sequence=22
archive log filename=F:\ORACLE\PRODUCT\10.2.0\ARC\ARC00023_0693947048.001 thread=1 sequence=23
media recovery complete, elapsed time: 00:00:06
Finished recover at 31-AUG-09
Then I back sqlplus
SQL> alter database open;
Database altered.
SQL> desc y
Name Null? Type
ID NUMBER
So answer your question is , YES you can restore from you old backup , not need to do anything else.
Regards
Liakat hossain -
Can I use flashback database to flashback a pluggable database?
Hi All,
I created a container database and then created a pluggable database.
In the pluggable 12.1 datbase, I loaded the user data.
I performed the below
sqlplus / as sysdba;
create restore point CLEAN_DB guarantee flashback database;
And I performed the transactions on the pdb.
Now my intention is to restore to the restore point CLEAN_DB as created from the above step.
If I perform the below, will it restore my pdb to the initial state?
flashback database to restore point CLEAN_DB;
Regards,
Kamal.Hi,
You cannot use FLASHBACK DATABASE for pluggable database.
Flashback query/versions queryis UNDO based and work in PDB’s
Flashback transaction query/flashback transactionis UNDO and REDO based and work in PDB’s
Flashback data archiveUNDO gernerated archives
Flashback table
before drop –> Rename segment name of recylebin, which is based on UNDO, work in PDB’s
flashback table to –> is UNDO based, work in PDB’s
Flashback databasedoesn’t work in PDB’s:
RMAN> flashback pluggable database prmdb01 to time "to_date('23:00 20-11-2013','hh24:mi dd-mm-yyyy')";
Starting flashback at 25-NOV-13
using channel ORA_DISK_1
using channel ORA_DISK_2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of flashback command at 11/20/2013 23:00:00
RMAN-05108: Command is not supported for pluggable database
Regards
Mahir M. Quluzade
p.s. Command exists but not supporting, may be next release come support. -
How to create backup using sql commands
can i create a backup using sql/sqlplus commands
I would actually advice you to use RMAN, instead of backup using sql commands, but if you want or have a requirment to do so..
First off all you should ensire that your databasse is in archilog mode.. (ALL PRODUCTION DATABASES should be in archivelog mode)
you can do it using sql*plus
archive log list
Then if you would like to make a cold backup (the only one posible in noarchivelog mode)
ypu have to
shutdown immediate
copy all database files (you don't need to copy redo logs) to another device
startup - to startup database
Actually I will suggest that your read User manager Recovery guide from oracle documentation
tahiti.oracle.com
Best Regards
Krystian Zieja / mob -
I am using the following commands.
RMAN> sql "alter session set nls_date_format=''dd-mon-yyyy HH24:MI:SS''";
2> report unrecoverable database;
3> report need backup days 2 database;
4> list backup;
5> EXIT;
BS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------
6249525 Full 68G SBT_TAPE 01:38:05 *25-OCT-2010*
BP Key: 6249547 Status: AVAILABLE Tag: TAG20101025T040741
Even after setting nls_date_format, completion time in list backup command is not returning exact time..it is returning just the date..
how to get completion time in RMAN LIST BACKUP COMMAND with hour,minute and second details...please let me know
I am using catalog database...target database version 9i and catalog db version is 10g.
Thanks,
dbNLS_DATE_FORMAT at OS level
I tied this export NLS_DATE_FORMAT=DD-MON-YYYY HH24:MI:SS is throwing error
NLS_DATE_FORMAT=DD-MON-YYYY: is not an identifier, please tell me what i am missing? -
Unable to do flashback database!!
Hi all,
I have enabled flashback database and created a restore point with guaranteed flashback database so that i can do a flashback database. When i do a flashback database, its says it needs archivelogs to do recovery. The flashback log usually will have all modified data in a flashback log files to use it for flashbacking a database. why its asking for archivelogs when all the modified data is present in flashback log itself? kindly clarify me.
Regards,
Pradeep. VHi,
Flashback database required the Archive log files.
"Flashback Database is similar to conventional point-in-time recovery in its effects. It enables you to return a database to its state at a time in the recent past. Flashback Database is much faster than point-in-time recovery because it does not require restoring datafiles from backup and requires applying fewer changes from the archived redo logs."
"No file in the fast recovery area is eligible for deletion if it is required to satisfy a guaranteed restore point. However, archived redo logs required to satisfy a guaranteed restore point may be deleted after they are backed up to disk or tape. When you use the RMAN FLASHBACK DATABASE command, if the archived redo logs required to satisfy a specified guaranteed restore point are not available in the fast recovery area, then they are restored from the backups."
Ref Doc:Using Flashback Database and Restore Points
HTH
Maybe you are looking for
-
Fixed 30 Days calculation for any month..Not working fine when Split Occurs
Hello Everybody, I am stuck with an issue..which is creating problem when there is a split..in Normal Conditions it's working fine...Kindly help me out on the same. We have to calculate the Salary on 30 Days fixed basis and not on calender days... <b
-
I paid for in app credits of $1000000 for $10 in the App Store. My balance has depleted accordingly but the app doesn't reflect the credit. There also isn't a way to check in the app. It is Tiger Woods 2012 from ea sports.
-
Dear All, We are generating bank statement pdf output based on RTF Template, and send to customer through email bursting option. Can we validate the pdf output that the pdf having data or not? Because some time pdf has delivered to customer without d
-
Samba configuration on solarisintel 8
hai i heve downloaded and installed samba server on my intel solaris 8 .. can any one help me to configure the server so that i can login from a widows desktop. help.. appriciated. konkani
-
Hi, I'm using TES 5.3.1 and I'm working on an FTP transmission to a bank. They have asked that the file be sent SFTP in either ASCII or EBCDIC, but using the integrated FTP job, it only allows Binary when transferring SFTP. Is there something I'm m