Lost Control file
Hi all,
I have lost my control file and don't have the backup.
Now database is not opening .
can any body help to startup data database?
Thanks in advance.
HI
change your parameter accordingly.
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "ORADB" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/redo/oradb/redo01.log' SIZE 50M,
GROUP 2 '/redo/oradb/redo02.log' SIZE 50M,
GROUP 3 '/redo/oradb/redo03.log' SIZE 50M
DATAFILE
'/oradata/oradb/system01.dbf',
'/oradata/oradb/undotbs01.dbf',
'/oradata/oradb/sysaux01.dbf',
'/oradata/oradb/users01.dbf',
'/oradata/oradb/example01.dbf'
CHARACTER SET WE8ISO8859P1
RECOVER DATABASE
ALTER SYSTEM ARCHIVE LOG ALL;
ALTER DATABASE OPEN;
ALTER TABLESPACE TEMP ADD TEMPFILE '/oradata/oradb/temp01.dbf'
SIZE 23068672 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
Regards
Upul Indika.
Similar Messages
-
Queries on DATABASE OPEN RESETLOGS and lost Control Files
Hi I have some queries on RESETLOGS I would be keen to hear some answers on
Q1. If I am doing a PITR and I end in ALTER DATABASE OPEN RESETLOGS, what happens about any Archived Redo Log files ( still in situ ) that were from the original source database but were at a future point in time ? Are they just ignored by any future restore ( since their log sequence number will be different ? ) and eventually over written or purged out ?
Q2. When you create a new incarnation using RESETLOGS can you Flashback Database to before this ?
Q3. If I have lost all my Control Files and have not created a backup control file or done a backup to trace of the control file, can I simply restore one of the actual control files from my last backup and use RECOVER DATABASE USING BACKUP CONTROLFILE AUTO; or will this only work with a bonafide backup control file ( i.e. one created via ALTER DATABASE BACKUP CONTROLFILE TO ‘<file spec>’; )
Q4. When I issue RECOVER DATABASE USING BACKUP CONTROLFILE AUTO;
Do I have to ALTER DATABASE OPEN RESETLOGS at the end of the recovery ? I have seen this documented but I am not sure why I would need to reset the redo logs and instead simply open the database ?
Q5. If I am running the CREATE CONTROL FILE command from an ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
Do I need to use the NORESETLOGS or RESETLOGS ? How do I know which to use ?
thanks,
JimJimbo wrote:
Hi I have some queries on RESETLOGS I would be keen to hear some answers on
Q1. If I am doing a PITR and I end in ALTER DATABASE OPEN RESETLOGS, what happens about any Archived Redo Log files ( still in situ ) that were from the original source database but were at a future point in time ? Are they just ignored by any future restore ( since their log sequence number will be different ? ) and eventually over written or purged out ?
what happens when you try it?
Q2. When you create a new incarnation using RESETLOGS can you Flashback Database to before this ?
what happens when you try it?
Q3. If I have lost all my Control Files and have not created a backup control file or done a backup to trace of the control file, can I simply restore one of the actual control files from my last backup and use RECOVER DATABASE USING BACKUP CONTROLFILE AUTO; or will this only work with a bonafide backup control file ( i.e. one created via ALTER DATABASE BACKUP CONTROLFILE TO ‘<file spec>’; )
what happens when you try it?
Q4. When I issue RECOVER DATABASE USING BACKUP CONTROLFILE AUTO;
Do I have to ALTER DATABASE OPEN RESETLOGS at the end of the recovery ? I have seen this documented but I am not sure why I would need to reset the redo logs and instead simply open the database ?
what happens when you try it?
Q5. If I am running the CREATE CONTROL FILE command from an ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
Do I need to use the NORESETLOGS or RESETLOGS ? How do I know which to use ?
what happens when you try it? -
Suppose I restored a database and am about to recover it. I realize all control files are lost on disk as well as on tape. Prior to the database crash that needed the recovery, I have no text based control files created(as a backup using ALTER DATABASE BACKUP CONTROLFILE TO TRACE). I have no copies of the binary and text based control files at all... . There are a bunch of datafiles on several disks that look like they are part of the database, but some may actually not be.
But all my datafiles that were part of the database are good copies and that's what I need to recover and do have it. How do I go about the restore ?
ThanksHI,
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "taj"
NORESETLOGS [archivelog/noarchivelog]
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 10
MAXINSTANCES 1
MAXLOGHISTORY 113
LOGFILE
GROUP 1 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\TAJ\REDO01.LOG' SIZE 10M,
GROUP 2 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\TAJ\REDO02.LOG' SIZE 10M,
GROUP 3 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\TAJ\REDO03.LOG' SIZE 10M
DATAFILE
'D:\ORACLE\PRODUCT\10.1.0\ORADATA\TAJ\SYSTEM01.DBF' SIZE xxx,
'D:\ORACLE\PRODUCT\10.1.0\ORADATA\TAJ\USERS01.DBF' SIZE
xxx,
CHARACTER SET [chracater_set]regards
Taj -
Lost control file, how to recover them
Hi All,
I have Oracle 11G running on RHEL 5.2 server and unexpectedly I can't start database after a server reboot. I have executed the following commands,
sqlplus /as sysdba
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/db_1/dbs/inittestdb.ora'
SQL>
and then
SQL> startup pfile='/u01/app/oracle/admin/testdb/pfile/init.ora.1024201018143'
ORACLE instance started.
Total System Global Area 1269366784 bytes
Fixed Size 2212976 bytes
Variable Size 754977680 bytes
Database Buffers 503316480 bytes
Redo Buffers 8859648 bytes
ORA-00205: error in identifying control file, check alert log for more info
Here are the alert log messages,
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/testdb/control02.ctl'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/testdb/control01.ctl'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-205 signalled during: ALTER DATABASE MOUNT...
[oracle@trace]$ ls -l /u01/app/oracle/oradata/testdb
total 0
There are are no control files in the directory and I couldn't find them on the disk. Unfortunately, I do not have backups for dbs (this is a staging server). Is there any way we can recover those files or fix the problem ?
Could someone please help us on this?
ThanksMahesh Menon wrote:
[oracle@trace]$ ls -l /u01/app/oracle/oradata/testdb
total 0
He is not having any files in that location... not only control files, but the datafiles too.. in that case how is it possible ??? thats why I mentioned like that...
And yes, if the datafiles and redos are located in another location then we can recreate the controlfile.
But since it is a test system, I dont think there will be files in another location...
Please take it that I am not arguing with the GURUS and EXPERTS here..Well thought-out arguments are appreciated!
Perhaps the answer is to ls -l /u01/app/oracle/oradata
Maybe it's TESTDB or some for some other reason testdb really isn't the sid.
If it's a staging environment, where do things come from? If the data files are found on the staging server, but no controlfiles, perhaps alter database backup controlfile to trace on the source server might give something to work with. -
Hi
My database is running on solaris 10. database verrison is 10.2.0.3.0
when connecting ot db after databases get started. it throws error
ORA-00205: error in identifying control file, check alert log for more info
and when I checked in alert log file
Thu Dec 25 18:39:04 2008
Errors in file /testdb/..n/../admin/../udump/mft_ora_7988.trc:
ORA-19502: write error on file "/oradb/../../arch/arch1_2162_623164752_MFT.log", blockno 30721 (blocksize=512)
ORA-27063: number of bytes read/written is incorrect
after browsing google I infer that we lost control file.
I dont have it backup
how do i recover it
Thanks in advance.Do you have backup control file or auto backup control file by rman or not.
If you have backup, try recover controlfile from rman backup( you should know DBID).
Anyway If you don't have rman backup. so recreate controlfile (if you have backup control file to trace, you can use it):
1. Take a full backup of the database, including all datafiles and redo
log files.
2. Connect / as sysdba or as sys user and do a STARTUP NOMOUNT.
3. Issue the CREATE CONTROLFILE statement.
More information on Oracle.
http://www.oracle.com/pls/db102/homepage
Example:
CREATE CONTROLFILE REUSE DATABASE "TESTDB" NORESETLOGS NOARCHIVELOG
MAXLOGFILES 50
MAXLOGMEMBERS 3
MAXDATAFILES 300
MAXINSTANCES 8
MAXLOGHISTORY 500
LOGFILE
GROUP 1 '/oradata/testdb/log1.dbf' SIZE 100M,
GROUP 2 '/oradata/testdb/log2.dbf' SIZE 100M,
GROUP 3 '/oradata/testdb/log3.dbf' SIZE 100M
DATAFILE
'/oradata/testdb/system01.dbf' SIZE 400M,
'/oradata/testdb/sysaux01.dbf' SIZE 500M,
'/oradata/testdb/undotbs01.dbf' SIZE 100M ;
4. Perform media recovery on the database.
RECOVER DATABASE
5. Open the database.
ALTER DATABASE OPEN;
Good Luck. -
Cannot recover control file in Oracle10g
Dear friends ,
I have to delete my three control files for testing purpose in ORacle 10g .Before Deleting , I take a backup with control file and spfile using following way :
script :
run
allocate channel t1 type disk;
backup format 'df_%t_%s_%p'
(database);}
AND OUTPUT of RMAN ,
RMAN> show all;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'C:\TEMP\ctrl_file%F';
Now when I run the restore script then it shows follwing error :
RMAN> set DBID=1178861114;
executing command: SET DBID
RMAN> restore controlfile from autobackup db_recovery_file_dest='C:\TEMP\CTRL_FILEC-1178861114-20080413-00';
Starting restore at 13-APR-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=158 devtype=DISK
recovery area destination: C:\TEMP\CTRL_FILEC-1178861114-20080413-00
database name (or database unique name) used for search: ORCL
channel ORA_DISK_1: no autobackups found in the recovery area
channel ORA_DISK_1: looking for autobackup on day: 20080413
channel ORA_DISK_1: looking for autobackup on day: 20080412
channel ORA_DISK_1: looking for autobackup on day: 20080411
channel ORA_DISK_1: looking for autobackup on day: 20080410
channel ORA_DISK_1: looking for autobackup on day: 20080409
channel ORA_DISK_1: looking for autobackup on day: 20080408
channel ORA_DISK_1: looking for autobackup on day: 20080407
channel ORA_DISK_1: no autobackup in 7 days found
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 04/13/2008 10:35:34
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece
I dont know why my control files are not backed up ? can anybody plz help me ?I can't say why what you did didn't work but I can say that using RMAN is not the best way to recover lost control files.
Lets assume you have three control files located on three different drives. It is impossible to accidentally delete all three so the best solution to losing one is to shutdown the database and copy an existing one to the location where a file has gone missing and rename it to the name of the deleted file.
Failing that you should always have a script created using:
BACKUP CONTROLFILE TO TRACE;I would only use the control files backed up by RMAN to create an auxiliary database such as a standby or for testing. -
I have executed the following commands as I was not sure about the control file backup :-
1) ALTER DATABASE BACKUP CONTROLFILE TO '/DBJPC/control.bkp';
2)ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
could anybody tell me whether these two statements override my database's previous configuration of control file backup or not (I think yes...) ??? If yes, is there any chances of database non-availability??? Finally, is there any drawbacks to run these two commands ...Hi
>>I'm new in Oracle and using Oracle 10G Enterprise Edition (10.2.0.1.0) on Red Hat Linux 32bits OS. I worked as a J2EE developer and there is no DBA in my office right now. So, I'm working as a stop gap person.
In that case you should not think about the recovery scenario.. However you can play with your test database on your personal m/c. but before doing this please read first.
>>I cann't find whether RMAN is used for control file back up or not and that's the reason to execute those queries. Are these files (backup of control files) automatically backed up or not (I think not).
Connect with RMAN and the type the command
RMAN> SHOW ALL;
>>Lastly, in case of damage/lost control files, this command will work or not- cp '/DBJPC/control.bkp' <location of control file>;
No, It wont work.. these are the trace file format(readable) while your database control file are binary
Start from here :Backup and Recovery
HTH -
Restore Backup control file doubt ?
when restoring backup control file why we need to set the DBID first?
Thankx..When using a recovery catalog and attempting to restore a lost control file, you encounter an error if there are other databases are registered in the recovery catalog with the same name as your target database. To resolve this error, you must uniquely identify the database by DBID for the restore operation. This requires determining the correct DBID for your database, and then using the SET DBID command to identify the target database before the RESTORE CONTROLFILE.
-
Lost all Control files (Want to Recover)
Hi
I have a database in archive log mode and we take a rman hot backup everyday. We are not using the recovery catalog. I lost all the control files
few days ago. I have a control file to trace and that was generated 20 days ago. This is our test database. I want to recover it. I don't know if we have
done any physical changes or not after the creation of this text file to create a control file. Database is still up and running.
Any help will be appreciated?
Thanks in AdvanceIf the control is restored from the rman backup lets say it is 3 days old, then how to update the same control file with the current database statistics.
--Luckys. -
Hi,
I'm in a problem, please some one guide me how to do it.
Our Production DB (9.2.0.1.0) is running on Solaris 9. We have a major crash of hard disk.
I have a cold backup of Sunday & now all the datafiles are in tact. Data files are in external storage.
I have lost my all of the control files.
I have restored the control file from the cold backup.
I'm able to go till mount stage & after that is throwing an error the datafiles are not in sync.
Any one can suggest how to go further to get it done.
Regards
SunilCsae2:
I tried the UNTIL CANCEL option & got a different error:
SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL
ORA-00279: change 729716 generated at 06/14/2007 11:15:54 needed for thread 1
ORA-00289: suggestion : D:\ORACLE\ORADATA\DB6\ARCH\DB6119.ARC
ORA-00280: change 729716 for thread 1 is in sequence #119
It successfully applied till sequence no:122
After that it applied the sequence no 123 & thow the error.
ORA-00279: change 729945 generated at 06/14/2007 11:54:06 needed for thread 1
ORA-00289: suggestion : D:\ORACLE\ORADATA\DB6\ARCH\DB6123.ARC
ORA-00280: change 729945 for thread 1 is in sequence #123
ORA-00278: log file 'D:\ORACLE\ORADATA\DB6\ARCH\DB6122.ARC' no longer needed
for this recovery
ORA-00308: cannot open archived log 'D:\ORACLE\ORADATA\DB6\ARCH\DB6123.ARC'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\DB6\DATAFILES\SYSTEM1.DBF'
ORA-01112: media recovery not started
SQL> ALTER DATABASE OPEN RESETLOGS;
ALTER DATABASE OPEN RESETLOGS
ERROR at line 1:
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\DB6\DATAFILES\SYSTEM1.DBF'
Sunil -
Lost 2 of 3 Control Files for 8i - Can I recover?
I had a hard drive crash and lost 2 of my 3 CONTROL files for my 8.1.6 database. I do have a backup, but I also have a 9i database on this machine and am afraid I will have to reinstall both of them. Is there a way that I will be able to restore my database (aka rebuild the control files) from just ONE Control File?
Any help would be much appreciated. ThanksThat's the reason you have 3 control files - so that you can recover from losing one of them. In theory (and also in practice) all 3 control files are exact copies of each other. Just copy the remaining one to the location(s) where Oracle is expecting to see the other 2 controlfiles.
-
Hi,
i took binary backup of control file on sunday, let's assume.
on moday i added 2 new datafile and deleted 1 exist datafile.
tuesday i lost controlfile, if i use backup of controlfile which took on sunday, so what will happen for added and deleted datafile as backup of control file not having info for the same.
Please suggest some post or document for the same.
Thanks,
MarkExample if you are not using RMAN: http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/recoscen.htm#i1006194
-
Control file lost and datafile addeed restore/recovery with no data loss
Here i have tried to the following
created new table called t2 and made sure data went to a specific tablespace...
took a level 0 backup
removed the control file
added couple of datafile to above tablespace and then inserted more data
then went out to restore control file and the database...but datafile still could not be opened ?? what did i do wrong here....
SQL> @datafile
-- list of datafile
Tablespace File Typ Tablespac File Stat Used MB Free MB FILE_MB MAXMB Datafile_name FILE_ID AUT
UNDOTBS1 Datafile ONLINE AVAILABLE 16 84 100 1,024 /data/trgt/undotbs01.dbf 3 YES
USERS Datafile ONLINE AVAILABLE 1153 895 2048 3,072 /data3/trgt/user02.dbf 5 YES
CNT_TST Datafile ONLINE AVAILABLE 1 9 10 0 /data3/trgt/cnt_tst01.dbf 7 NO
SYSAUX Datafile ONLINE AVAILABLE 626 35 660 32,768 /data/trgt/sysaux01.dbf 2 YES
USERS Datafile ONLINE AVAILABLE 2031 17 2048 2,048 /data3/trgt/move/users01.dbf 4 YES
SYSTEM Datafile ONLINE AVAILABLE 712 58 770 32,768 /data/trgt/system01.dbf 1 YES
USERS Datafile ONLINE AVAILABLE 65 35 100 32,768 /data3/trgt/users03.dbf 6 YES
7 rows selected.
-- new table is created called t2 and its going into TS called cnt_tst
SQL> CREATE TABLE TEST.T2
C1 DATE,
C2 NUMBER,
C3 NUMBER,
C4 VARCHAR2(300 BYTE)
TABLESPACE cnt_tst; 2 3 4 5 6 7 8
Table created.
-- data inserted
SQL> INSERT INTO
test.T2
SELECT
FROM
(SELECT
SYSDATE,
ROWNUM C2,
DECODE(MOD(ROWNUM,100),99,99,1) C3,
RPAD('A',300,'A') C4
FROM
DUAL
CONNECT BY
LEVEL <= 10000)
; 2 3 4 5 6 7 8 9 10 11 12 13 14 15
10000 rows created.
SQL> commit;
Commit complete.
-- to check of cnt_tst has any free space or not, as we can see its full
SQL> @datafile
Tablespace File Typ Tablespac File Stat Used MB Free MB FILE_MB MAXMB Datafile_name FILE_ID AUT
UNDOTBS1 Datafile ONLINE AVAILABLE 16 84 100 1,024 /data/trgt/undotbs01.dbf 3 YES
USERS Datafile ONLINE AVAILABLE 1153 895 2048 3,072 /data3/trgt/user02.dbf 5 YES
SYSAUX Datafile ONLINE AVAILABLE 626 35 660 32,768 /data/trgt/sysaux01.dbf 2 YES
USERS Datafile ONLINE AVAILABLE 2031 17 2048 2,048 /data3/trgt/move/users01.dbf 4 YES
SYSTEM Datafile ONLINE AVAILABLE 712 58 770 32,768 /data/trgt/system01.dbf 1 YES
USERS Datafile ONLINE AVAILABLE 65 35 100 32,768 /data3/trgt/users03.dbf 6 YES
CNT_TST Datafile ONLINE AVAILABLE 10 0 10 0 /data3/trgt/cnt_tst01.dbf 7 NO
7 rows selected.
SQL> select count(*) from test.t2;
COUNT(*)
10000
1 row selected.
-- to get a count and max on date
SQL> select max(c1) from test.t2;
MAX(C1)
29-feb-12 13:47:52
1 row selected.
SQL> -- AT THIS POINT A LEVEL 0 BACKUP IS TAKEN (using backup database plus archivelog)
SQL> -- now control files are removed
SQL> select name from v$controlfile;
NAME
/ctrl/trgt/control01.ctl
/ctrl/trgt/control02.ctl
2 rows selected.
SQL>
SQL> ! rm /ctrl/trgt/control01.ctl
SQL> ! rm /ctrl/trgt/control02.ctl
SQL> ! ls -ltr /ctrl/trgt/
ls: /ctrl/trgt/: No such file or directory
SQL>
-- new datafile is added to CNT_TST TABLESPACE and new data is added as well
SQL> ALTER TABLESPACE CNT_TST ADD DATAFILE '/data3/trgt/CNT_TST02.dbf' SIZE 100M AUTOEXTEND OFF;
Tablespace altered.
SQL> ALTER SYSTEM CHECKPOINT;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> /
System altered.
SQL> ALTER TABLESPACE CNT_TST ADD DATAFILE '/data3/trgt/CNT_TST03.dbf' SIZE 100M AUTOEXTEND OFF;
Tablespace altered.
SQL> INSERT INTO
test.T2
SELECT
FROM
(SELECT
SYSDATE,
ROWNUM C2,
DECODE(MOD(ROWNUM,100),99,99,1) C3,
RPAD('A',300,'A') C4
FROM
DUAL
CONNECT BY
LEVEL <= 10000)
; 2 3 4 5 6 7 8 9 10 11 12 13 14 15
10000 rows created.
SQL> /
10000 rows created.
SQL> commit;
Commit complete.
SQL> INSERT INTO
test.T2
SELECT
FROM
(SELECT
SYSDATE,
ROWNUM C2,
DECODE(MOD(ROWNUM,100),99,99,1) C3,
RPAD('A',300,'A') C4
FROM
DUAL
CONNECT BY
LEVEL <= 40000)
; 2 3 4 5 6 7 8 9 10 11 12 13 14 15
40000 rows created.
SQL> commit;
Commit complete.
SQL> @datafile
-- to make sure new datafile has been registered with the DB
Tablespace File Typ Tablespac File Stat Used MB Free MB FILE_MB MAXMB Datafile_name FILE_ID AUT
CNT_TST Datafile ONLINE AVAILABLE 9 91 100 0 /data3/trgt/CNT_TST03.dbf 9 NO
UNDOTBS1 Datafile ONLINE AVAILABLE 16 84 100 1,024 /data/trgt/undotbs01.dbf 3 YES
USERS Datafile ONLINE AVAILABLE 1153 895 2048 3,072 /data3/trgt/user02.dbf 5 YES
CNT_TST Datafile ONLINE AVAILABLE 9 91 100 0 /data3/trgt/CNT_TST02.dbf 8 NO
SYSAUX Datafile ONLINE AVAILABLE 626 35 660 32,768 /data/trgt/sysaux01.dbf 2 YES
USERS Datafile ONLINE AVAILABLE 2031 17 2048 2,048 /data3/trgt/move/users01.dbf 4 YES
SYSTEM Datafile ONLINE AVAILABLE 712 58 770 32,768 /data/trgt/system01.dbf 1 YES
USERS Datafile ONLINE AVAILABLE 65 35 100 32,768 /data3/trgt/users03.dbf 6 YES
CNT_TST Datafile ONLINE AVAILABLE 10 0 10 0 /data3/trgt/cnt_tst01.dbf 7 NO
9 rows selected.
-- now the count and max ... note count before backup was 10000 and max(c1) was diff
SQL> select count(*) from test.t2;
COUNT(*)
70000
1 row selected.
SQL> select max(c1) from test.t2;
MAX(C1)
29-feb-12 13:58:25
1 row selected.
SQL> -- now restore starts
SQL> shutdown abort;
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@berry trgt]$ rman
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Feb 29 14:01:48 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
RMAN> connect catalog rman/pass@rcat
connected to recovery catalog database
RMAN> connect target /
connected to target database (not started)
RMAN> startup nomount;
Oracle instance started
Total System Global Area 188313600 bytes
Fixed Size 1335388 bytes
Variable Size 125833124 bytes
Database Buffers 58720256 bytes
Redo Buffers 2424832 bytes
RMAN> restore controlfile from autobackup;
Starting restore at 29-FEB-12 14:02:37
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
recovery area destination: /backup/trgt/flash_recovery_area
database name (or database unique name) used for search: TRGT
channel ORA_DISK_1: no AUTOBACKUPS found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20120229
channel ORA_DISK_1: AUTOBACKUP found: /backup/trgt/backup/cont_c-3405317011-20120229-09
channel ORA_DISK_1: restoring control file from AUTOBACKUP /backup/trgt/backup/cont_c-3405317011-20120229-09
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=/ctrl/trgt/control01.ctl
output file name=/ctrl/trgt/control02.ctl
Finished restore at 29-FEB-12 14:02:39
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> recover database;
Starting recover at 29-FEB-12 14:02:55
Starting implicit crosscheck backup at 29-FEB-12 14:02:55
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
Crosschecked 96 objects
Finished implicit crosscheck backup at 29-FEB-12 14:02:57
Starting implicit crosscheck copy at 29-FEB-12 14:02:57
using channel ORA_DISK_1
Finished implicit crosscheck copy at 29-FEB-12 14:02:57
searching for all files in the recovery area
cataloging files...
no files cataloged
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 13 is already on disk as file /redo_archive/trgt/online/redo01.log
archived log for thread 1 with sequence 14 is already on disk as file /redo_archive/trgt/online/redo02.log
archived log for thread 1 with sequence 15 is already on disk as file /redo_archive/trgt/online/redo03.log
archived log file name=/redo_archive/trgt/archive/1_10_776523284.dbf thread=1 sequence=10
archived log file name=/redo_archive/trgt/archive/1_10_776523284.dbf thread=1 sequence=10
archived log file name=/redo_archive/trgt/archive/1_11_776523284.dbf thread=1 sequence=11
archived log file name=/redo_archive/trgt/archive/1_12_776523284.dbf thread=1 sequence=12
archived log file name=/redo_archive/trgt/online/redo01.log thread=1 sequence=13
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/29/2012 14:02:59
ORA-01422: exact fetch returns more than requested number of rows
RMAN-20505: create datafile during recovery
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/redo_archive/trgt/online/redo01.log'
ORA-00283: recovery session canceled due to errors
ORA-01244: unnamed datafile(s) added to control file by media recovery
ORA-01110: data file 9: '/data3/trgt/CNT_TST03.dbf'
RMAN> -- wnet to session 2 and renamed datafile from unammed-- wnet to session 2 and renamed datafile for unammed file
SQL> select name from v$datafile;
NAME
/data/trgt/system01.dbf
/data/trgt/sysaux01.dbf
/data/trgt/undotbs01.dbf
/data3/trgt/move/users01.dbf
/data3/trgt/user02.dbf
/data3/trgt/users03.dbf
/data3/trgt/cnt_tst01.dbf
/oracle/app/product/11.2.0/dbhome_1/dbs/UNNAMED00008
/oracle/app/product/11.2.0/dbhome_1/dbs/UNNAMED00009
9 rows selected.
SQL> alter database create datafile '/oracle/app/product/11.2.0/dbhome_1/dbs/UNNAMED00008' as '/data3/trgt/CNT_TST02.dbf';
Database altered.
SQL> alter database create datafile '/oracle/app/product/11.2.0/dbhome_1/dbs/UNNAMED00009' as '/data3/trgt/CNT_TST03.dbf';
Database altered.
SQL> select name from v$datafile;
NAME
/data/trgt/system01.dbf
/data/trgt/sysaux01.dbf
/data/trgt/undotbs01.dbf
/data3/trgt/move/users01.dbf
/data3/trgt/user02.dbf
/data3/trgt/users03.dbf
/data3/trgt/cnt_tst01.dbf
/data3/trgt/CNT_TST02.dbf
/data3/trgt/CNT_TST03.dbf
9 rows selected.after above was done, went back to session 1 and tried recovered the DB
RMAN> recover database;
Starting recover at 29-FEB-12 14:06:16
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 13 is already on disk as file /redo_archive/trgt/online/redo01.log
archived log for thread 1 with sequence 14 is already on disk as file /redo_archive/trgt/online/redo02.log
archived log for thread 1 with sequence 15 is already on disk as file /redo_archive/trgt/online/redo03.log
archived log file name=/redo_archive/trgt/online/redo01.log thread=1 sequence=13
archived log file name=/redo_archive/trgt/online/redo02.log thread=1 sequence=14
archived log file name=/redo_archive/trgt/online/redo03.log thread=1 sequence=15
media recovery complete, elapsed time: 00:00:00
Finished recover at 29-FEB-12 14:06:17
RMAN> alter database open resetlogs;
database opened
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
starting full resync of recovery catalog
full resync complete
RMAN> exit
Recovery Manager complete.
[oracle@berry trgt]$
[oracle@berry trgt]$
[oracle@berry trgt]$ sq
SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 29 14:07:18 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter session set NLS_DATE_FORMAT="dd-mon-yy hh24:mi:ss:
2
SQL>
SQL> alter session set NLS_DATE_FORMAT="dd-mon-yy hh24:mi:ss";
Session altered.
SQL> select count(*) from test.t2;
select count(*) from test.t2
ERROR at line 1:
ORA-00376: file 8 cannot be read at this time
ORA-01110: data file 8: '/data3/trgt/CNT_TST02.dbf'
SQL> select max(c1) from test.t2;
select max(c1) from test.t2
ERROR at line 1:
ORA-00376: file 8 cannot be read at this time
ORA-01110: data file 8: '/data3/trgt/CNT_TST02.dbf'
SQL> alter database datafile 8 online;
alter database datafile 8 online
ERROR at line 1:
ORA-01190: control file or data file 8 is from before the last RESETLOGS
ORA-01110: data file 8: '/data3/trgt/CNT_TST02.dbf'
{code}
so what did i do wrong in my recovery that i could not get my data?? how can i avoid this?? and restore my DB?
Edited by: user8363520 on Feb 29, 2012 12:24 PMuser8363520 wrote:
Here i have tried to the following
created new table called t2 and made sure data went to a specific tablespace...
took a level 0 backup
removed the control file
added couple of datafile to above tablespace and then inserted more data
then went out to restore control file and the database...but datafile still could not be opened ?? what did i do wrong here....
SQL> @datafile
-- list of datafile
Tablespace File Typ Tablespac File Stat Used MB Free MB FILE_MB MAXMB Datafile_name FILE_ID AUT
UNDOTBS1 Datafile ONLINE AVAILABLE 16 84 100 1,024 /data/trgt/undotbs01.dbf ; 3 YES
USERS Datafile ONLINE AVAILABLE 1153 895 2048 3,072 /data3/trgt/user02.dbf ; 5 YES
CNT_TST Datafile ONLINE AVAILABLE 1 9 10 0 /data3/trgt/cnt_tst01.dbf ; 7 NO
SYSAUX Datafile ONLINE AVAILABLE 626 35 660 32,768 /data/trgt/sysaux01.dbf ; 2 YES
USERS Datafile ONLINE AVAILABLE 2031 17 2048 2,048 /data3/trgt/move/users01.dbf ; 4 YES
SYSTEM Datafile ONLINE AVAILABLE 712 58 770 32,768 /data/trgt/system01.dbf ; 1 YES
USERS Datafile ONLINE AVAILABLE 65 35 100 32,768 /data3/trgt/users03.dbf ; 6 YES
7 rows selected.
-- new table is created called t2 and its going into TS called cnt_tst
SQL> CREATE TABLE TEST.T2
C1 DATE,
C2 NUMBER,
C3 NUMBER,
C4 VARCHAR2(300 BYTE)
TABLESPACE cnt_tst; 2 3 4 5 6 7 8
Table created.
-- data inserted
SQL> INSERT INTO
test.T2
SELECT
FROM
(SELECT
SYSDATE,
ROWNUM C2,
DECODE(MOD(ROWNUM,100),99,99,1) C3,
RPAD('A',300,'A') C4
FROM
DUAL
CONNECT BY
LEVEL <= 10000)
; 2 3 4 5 6 7 8 9 10 11 12 13 14 15
10000 rows created.
SQL> commit;
Commit complete.
-- to check of cnt_tst has any free space or not, as we can see its full
SQL> @datafile
Tablespace File Typ Tablespac File Stat Used MB Free MB FILE_MB MAXMB Datafile_name FILE_ID AUT
UNDOTBS1 Datafile ONLINE AVAILABLE 16 84 100 1,024 /data/trgt/undotbs01.dbf ; 3 YES
USERS Datafile ONLINE AVAILABLE 1153 895 2048 3,072 /data3/trgt/user02.dbf ; 5 YES
SYSAUX Datafile ONLINE AVAILABLE 626 35 660 32,768 /data/trgt/sysaux01.dbf ; 2 YES
USERS Datafile ONLINE AVAILABLE 2031 17 2048 2,048 /data3/trgt/move/users01.dbf ; 4 YES
SYSTEM Datafile ONLINE AVAILABLE 712 58 770 32,768 /data/trgt/system01.dbf ; 1 YES
USERS Datafile ONLINE AVAILABLE 65 35 100 32,768 /data3/trgt/users03.dbf ; 6 YES
CNT_TST Datafile ONLINE AVAILABLE 10 0 10 0 /data3/trgt/cnt_tst01.dbf ; 7 NO
7 rows selected.
SQL> select count(*) from test.t2;
COUNT(*)
10000
1 row selected.
-- to get a count and max on date
SQL> select max(c1) from test.t2;
MAX(C1)
29-feb-12 13:47:52
1 row selected.
SQL> -- AT THIS POINT A LEVEL 0 BACKUP IS TAKEN (using backup database plus archivelog)
SQL> -- now control files are removed
SQL> select name from v$controlfile;
NAME
/ctrl/trgt/control01.ctl
/ctrl/trgt/control02.ctl
2 rows selected.
SQL>
SQL> ! rm /ctrl/trgt/control01.ctl
SQL> ! rm /ctrl/trgt/control02.ctl
SQL> ! ls -ltr /ctrl/trgt/
ls: /ctrl/trgt/: No such file or directory
SQL>
-- new datafile is added to CNT_TST TABLESPACE and new data is added as well
SQL> ALTER TABLESPACE CNT_TST ADD DATAFILE '/data3/trgt/CNT_TST02.dbf' SIZE 100M AUTOEXTEND OFF;
Tablespace altered.
SQL> ALTER SYSTEM CHECKPOINT;
System altered. Upto this i was clear, but now i cann't understand when you actually dropped the control file from you database(in running stat) how can you perform "alter system checkpoint" and other "alter tablespace.." command? Once controlfile is inaccessible, oracle database is not suppose to function. -
In case of Control File Failure, Create Control File cmd how get scn?
The following lines i picked from the
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5033895918209
======================================================
1. We can use the 'alter database rename ' at mount stage to rename any datafile. Or is it not possible to rename the system datafile like this? Why?
2. What happens to the SCN information in the controlfile when a controlfile is recreated? How will the database sync the SCN with that of the datafiles?
If I issue a 'backup controlfile to <file>' at 8 am and then restore that controlfile binary backup at 10 am and try to open the database, it will give me a control file old error. I understand that it is because the SCN is not in sync. But if I issue a 'backup controlfile to trace' at 8 am and use that script to recreate a new controlfile at 10 am, why doesn't I get the error? Where does it get the SCN information then?
So what is the use of taking a binary copy of the controlfile. Looks like having a 'backup controlfile to trace' script is better than a binary backup. Do you agree? Why/whynot?
Followup August 16, 2002 - 2pm US/Eastern:
1) you could but I just always did it with the create controlfile statement.
When moving system -- I do it that way
When moving ANY OTHER tablespace -- i just offline it, move the files, rename the files online it.
2) it just happens.
The control file you create will read the files to figure out what is up.
I agree, I've never used a binary controlfile backup myself.
=========================================================
My Question- In the Point2 above "Where does it get the SCN information and how control file do SCN Sync with data files?
"1. The CREATE CONTROLFILE reads SCNs from the DataFiles. If the
database was last shutdown, all the datafiles are "non-fuzzy" and have the same
SCN (as of the shutdown checkpoint), If the database or some of the files are from
are hot backup, you cannot open the database because the SCN of some files is
older (lower) than others -- that is why a RECOVER (DATABASE or DATAFILE) is
required.
See http://web.singnet.com.sg/~hkchital/Incomplete_Recovery_with_BackupControlfile.doc
2. I'm not sure I agree with Tom Kyte's response
"I agree, I've never used a binary controlfile backup myself. "
to the question
"So what is the use of taking a binary copy of the controlfile. Looks like having a 'backup controlfile to trace' script is better than a binary backup. Do you agree? Why/whynot?"
If you have lost your database (storage/filesystem failure) and all your datafiles are lost,
you cannot simply do a CREATE CONTROLFILE from a Trace -- because the
CREATE CONTROLFILE has to read and verify all the datafiles specified in the
CREATE statement. If you have an RMAN Repository, you can use that to restore
your database files but otherwise, the RMAN information about backups and backupsets
are in the binary controlfile.
That is why it is important to take binary controlfile backups either manually or
using RMAN or using CONFIGURE CONTROLFILE AUTOBACKUP ON. -
How to recover datafile.when control file auto backup is off
hi friend
i took hot backup of my database using following command
rman>backup database;
in my case controlfile auto backup is off.
and i have lost my all controlfiles as well as datafiles except spfile.
i have recovered control file using dbms_backup_restore package.
know i am able to mount database using following command
rman> startup mount;
when i wrote following command
rman> restore database;
i got following error
RMAN-06023: no backup or copy of datafile name found to restore
enven i have backup of datbase.
can anybody tell me how to recover datafiles in this case.
thanking you
sohailhi,
I think you might have a problem here as the error from RMAN is described in the following metalink note
Doc ID: Note:100565.1
You should change you backup script to be something like
rman {
backup database include current controlfile;
do you have any earlier backups of your database?
regards
Alan
Maybe you are looking for
-
Span to 2 monitors w/ExpressCard PCI-Express Video Card? Possible?Probable?
Hey guys. I had screen-real-estate envy a few months ago and talked myself into thinking I could live without a laptop and just drag my new 20" iMac around once every week or two when I do Keynote Teaching. The sucker's 25lbs and has sharp edges and
-
This must be a simple fix, but for the life of me I can't figure it out. I just entered George Michael's CD, Faith into a new playlist. The playlist is set to sort albums by TITLE and then ARTIST. No matter what I do, this particular album will not g
-
Can't send email after 3.0 upgrade
I can receive but not send email after the 3.0 upgrade. Also, the stock and weather buttons never update. Email is my important issue. Any ideas?
-
my app account has been deleted from appstore,and i can't download purchased items on my new imac what should i do?i purchased aperture 3 and final cut pro
-
Can't open a domain.sites.2
I transfered a domain file from another computer. i opened it up on my snow leopard macbook and was able to go back and forth from current domain and to my new transferred domain. All of a sudden, I am getting a "can't open domain.sites.2" I can open