RENAMING DATAFILE
Hello All,
We use Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit on Solaris 10.
I ran out of space in one of the mount points and when i checked al the files were oracle datafiles.
so i thought of moving datafile and rename it.
This is the steps i followed and the error thrown....
1)shutdown the database
2)cp /u02/oradata/DWH/temp01.dbf /u01/oradata/DWH/temp01.dbf
3)startup nomount
4)alter database mount
5)alter database rename file '/u02/oradata/DWH/users01.dbf' to '/u01/oradata/DWH/temp01.dbf';
Database altered.
6)alter database open;
alter database open
ERROR at line 1:
ORA-01122: database file 4 failed verification check
ORA-01110: data file 4: '/u01/oradata/DWH/temp01.dbf'
ORA-01251: Unknown File Header Version read for file number 4
Where am i doing the mistake....
Thanks in advance
Vijay G
"ALTER DATABASE RENAME FILE" doesn't move Oracle files. It assumes that you have already done so at the OS level (e.g. using "mv" or "cp" on Unix/Linux).
The command only updates the controlfile because the controlfile tracks the physical structure of the database.
You had already done a
cp /u02/oradata/DWH/temp01.dbf /u01/oradata/DWH/temp01.dbfso your ALTER DATABASE command should have been_
ALTER DATABASE RENAME FILE '/u02/oradata/DWH/temp01.dbf' TO '/u01/oradata/DWH/temp01.dbf' ; Since you've issued the wrong command, the controlfile now "thinks" that '/u01/oradata/DWH/temp01.dbf' is the USERS datafile !
You could, first try reversing your ALTER DATABASE command as
ALTER DATABASE RENAME FILE '/u01/oradata/DWH/temp01.dbf' TO '/u02/oradata/DWH/users01.dbf' ;Assuming that temp01.dbf is a TEMPFile and not DATAFILE, you could drop it and add TEMPFILE '/u01/oradata/DWH/temp01.dbf' to the TEMP Tablespace.
Similar Messages
-
Hi
I tried to rename a datafile by making the datafile and table space offline,
I am getting the following error messages
SQL> alter tablespace usersdata rename datafile '/home/oracle/DB11G/usersdata03.dbf' to '/home/oracle/DB11G/usersdata04.dbf';
alter tablespace usersdata rename datafile '/home/oracle/DB11G/usersdata03.dbf' to '/home/oracle/DB11G/usersdata04.dbf'
ERROR at line 1:
ORA-01525: error in renaming data files
ORA-01141: error renaming data file 8 - new file
'/home/oracle/DB11G/usersdata04.dbf' not found
ORA-01110: data file 8: '/home/oracle/DB11G/usersdata03.dbf'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Y ITS NOT HAPPENING ???????
Thnaks in adv..##how to move datafiles.
1. Shut down the database E.G: shutdown immediate
2. Move datafiles by OS commands. mv /oracle/product/dbs/test02.dbf /oracle/oradata/ORALOG/test02.dbf
3. Startup the database in mount state e.g: startup mount
4. Rename that file e.g: alter database rename file '/oracle/product/dbs/test02.dbf' to '/oracle/oradata/ORALOG/test02.dbf';
5. Open the database e.g: alter database open
http://www.oracle-base.com/articles/misc/RenamingOrMovingOracleFiles.php
Regards
Asif Kabir -
Is it posisble to use DB_FILE_NAME_CONVERT to rename datafile names
Hi,
I want to clone a database on the same server.
My datafiles start with the name of the SID, for examplel: /u04/oradata/ORACP/ORACP_applic_data_01.dbf'
I want to use "duplicate fom active database", but with the parameter DB_FILE_NAME_CONVERT i can only change the directory to clone the datafile to, but the datafile itself is not renamed.
I am correct?
Is the only way to solve this, to use SET NEWNAME for all the datafiles to clone?
Any help is appreciated.
Reagrds,
HarryHarry;
Turns out I have a better document :
http://www.visi.com/~mseberg/rman/create_a_duplicate_database_on_the_same_host.html
I understand your concern, as far as suggestions double check everything. Thinking RMAN won't overwrite a MOUNTED file.
*"To restore a datafile, either mount the database, or keep it open and take the datafile to be restored offline."*
Source - Database Backup and Recovery Advanced User's Guide.
When NOFILENAMECHECK is used with the DUPLICATE command, RMAN does not validate the filenames during restoration. Last I heard you don't use NOFILENAMECHECK when using the same host.
See - Restoring and Recovering Database Files - Database Backup and Recovery User's Guide 11g Release 2 (11.2) E10642-03
Best Regards
mseberg
Edited by: mseberg on Jan 9, 2013 12:38 PM -
Renaming datafiles in control files with database mounted but not open
Hi,
I moved a database (physical files) from one server to another. I need to modify the contents of the control files since the directory structure of the servers are not the same (and I can't change that).
I know I can use ALTER DATABASE BACKUP CONTROLFILE TO TRACE to produce a script that I can than modify and run with the instance started, database mounted but not open, and that will recreate the control files. I don't want to do that.
I was also told I can modify the datafile entries in the control files by starting the instance, mounting but not opening the database. Then I can issue the (this is the part I need help with) ALTER DATABASE RENAME FILE <file1> to <file2>. When I tried this it complains that <file1> is not found. Obviously the command I used is not the right one,,, what is the right command for what I want to do.
Thanks,
GabrielMove all datafiles from one directory to an other without recreate controlfile :
SYS@DEMO102> select file_name from dba_data_files
2 union
3 select member from v$logfile
4 union
5 select file_name from dba_temp_files
6 union
7 select name from v$controlfile;
FILE_NAME
E:\ORACLE\ORADATA\DEMO102C\CONTROL01.CTL
E:\ORACLE\ORADATA\DEMO102C\CONTROL02.CTL
E:\ORACLE\ORADATA\DEMO102C\CONTROL03.CTL
E:\ORACLE\ORADATA\DEMO102C\EXAMPLE01.DBF
E:\ORACLE\ORADATA\DEMO102C\REDO01.LOG
E:\ORACLE\ORADATA\DEMO102C\REDO02.LOG
E:\ORACLE\ORADATA\DEMO102C\REDO03.LOG
E:\ORACLE\ORADATA\DEMO102C\SYSAUX01.DBF
E:\ORACLE\ORADATA\DEMO102C\SYSTEM\SYSTEM01.DBF
E:\ORACLE\ORADATA\DEMO102C\TBS102_1.DBF
E:\ORACLE\ORADATA\DEMO102C\TBS102_2.DBF
E:\ORACLE\ORADATA\DEMO102C\TEMP01.DBF
E:\ORACLE\ORADATA\DEMO102C\UNDOTBS01.DBF
E:\ORACLE\ORADATA\DEMO102C\USERS01.DBF
14 rows selected.
SYS@DEMO102> create pfile='E:\oracle\admin\DEMO102\pfile\pfile102.ora' from spfile;
File created.
SYS@DEMO102> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.Here, I move all datafiles mentionned above, and modify my pfile for new controlfile directory. Then :
SYS@DEMO102> startup pfile=E:\oracle\admin\DEMO102\pfile\pfile102.ora
ORACLE instance started.
Total System Global Area 272629760 bytes
Fixed Size 1288940 bytes
Variable Size 163579156 bytes
Database Buffers 100663296 bytes
Redo Buffers 7098368 bytes
Database mounted. --Note that we are in mount state
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: 'E:\ORACLE\ORADATA\DEMO102C\SYSTEM\SYSTEM01.DBF'
SYS@DEMO102> alter database rename file 'E:\ORACLE\ORADATA\DEMO102C\USERS01.DBF' to 'E:\ORACLE\ORADATA\demo102\USERS01.DBF';
Database altered.
SYS@DEMO102> alter database rename file 'E:\ORACLE\ORADATA\DEMO102C\SYSAUX01.DBF' to 'E:\ORACLE\ORADATA\demo102\SYSAUX01.DBF';
Database altered.
SYS@DEMO102> alter database rename file 'E:\ORACLE\ORADATA\DEMO102C\UNDOTBS01.DBF' to 'E:\ORACLE\ORADATA\demo102\UNDOTBS01.DBF';
Database altered.
SYS@DEMO102> alter database rename file 'E:\ORACLE\ORADATA\DEMO102C\SYSTEM\SYSTEM01.DBF' to 'E:\ORACLE\ORADATA\demo102\SYSTEM\SYSTEM01.DBF';
Database altered.
SYS@DEMO102> alter database rename file 'E:\ORACLE\ORADATA\DEMO102C\EXAMPLE01.DBF' to 'E:\ORACLE\ORADATA\demo102\EXAMPLE01.DBF';
Database altered.
SYS@DEMO102> alter database rename file 'E:\ORACLE\ORADATA\DEMO102C\TBS102_1.DBF' to 'E:\ORACLE\ORADATA\demo102\TBS102_1.DBF';
Database altered.
SYS@DEMO102> alter database rename file 'E:\ORACLE\ORADATA\DEMO102C\TBS102_2.DBF' to 'E:\ORACLE\ORADATA\demo102\TBS102_2.DBF';
Database altered.
SYS@DEMO102> alter database rename file 'E:\ORACLE\ORADATA\DEMO102C\REDO01.LOG' to 'E:\ORACLE\ORADATA\demo102\REDO01.LOG';
Database altered.
SYS@DEMO102> alter database rename file 'E:\ORACLE\ORADATA\DEMO102C\REDO02.LOG' to 'E:\ORACLE\ORADATA\demo102\REDO02.LOG';
Database altered.
SYS@DEMO102> alter database rename file 'E:\ORACLE\ORADATA\DEMO102C\REDO03.LOG' to 'E:\ORACLE\ORADATA\demo102\REDO03.LOG';
Database altered.
SYS@DEMO102> alter database rename file 'E:\ORACLE\ORADATA\DEMO102C\TEMP01.DBF' to 'E:\ORACLE\ORADATA\demo102\TEMP01.DBF';
Database altered.
SYS@DEMO102> alter database open;
Database altered.
SYS@DEMO102> create spfile from pfile='E:\oracle\admin\DEMO102\pfile\pfile102.ora';
File created.
SYS@DEMO102> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@DEMO102> startup
ORACLE instance started.
Total System Global Area 272629760 bytes
Fixed Size 1288940 bytes
Variable Size 163579156 bytes
Database Buffers 100663296 bytes
Redo Buffers 7098368 bytes
Database mounted.
Database opened.
SYS@DEMO102> select file_name from dba_data_files
2 union
3 select member from v$logfile
4 union
5 select file_name from dba_temp_files
6 union
7 select name from v$controlfile;
FILE_NAME
E:\ORACLE\ORADATA\DEMO102\CONTROL01.CTL
E:\ORACLE\ORADATA\DEMO102\CONTROL02.CTL
E:\ORACLE\ORADATA\DEMO102\CONTROL03.CTL
E:\ORACLE\ORADATA\DEMO102\EXAMPLE01.DBF
E:\ORACLE\ORADATA\DEMO102\REDO01.LOG
E:\ORACLE\ORADATA\DEMO102\REDO02.LOG
E:\ORACLE\ORADATA\DEMO102\REDO03.LOG
E:\ORACLE\ORADATA\DEMO102\SYSAUX01.DBF
E:\ORACLE\ORADATA\DEMO102\SYSTEM\SYSTEM01.DBF
E:\ORACLE\ORADATA\DEMO102\TBS102_1.DBF
E:\ORACLE\ORADATA\DEMO102\TBS102_2.DBF
E:\ORACLE\ORADATA\DEMO102\TEMP01.DBF
E:\ORACLE\ORADATA\DEMO102\UNDOTBS01.DBF
E:\ORACLE\ORADATA\DEMO102\USERS01.DBF
14 rows selected.
SYS@DEMO102> Nicolas. -
Problem after rename datafile belongs to SYSTEM tablespace
Hi
I've renamed one file belongs to SYSTEM tablespace.
Then I brought database online and dropped the old file, now I can open database,
but I can't run backup.
I delete previous one so I can't restore that file from backup, I have the file because I clonned db,
but when I restore file and run recover from RMAN database got recovered.
After that I still can't run backup.
Do you have idea what to do???
SYS@orcl >select * from v$recover_file;
FILE# ONLINE ONLINE_
ERROR CHANGE#
TIME
14 OFFLINE OFFLINE
OFFLINE NORMAL 0RMAN> report schema;
Report of database schema
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
1 500 SYSTEM YES /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_48fprop3_.dbf
2 245 UNDOTBS1 YES /u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_48fprovo_.dbf
3 260 SYSAUX NO /u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_48fpropg_.dbf
4 40 USERS NO /u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_48fprowb_.dbf
5 100 EXAMPLE NO /u01/app/oracle/oradata/ORCL/datafile/o1_mf_example_48fpw04c_.dbf
6 100 DBA1 NO /u01/app/oracle/oradata/ORCL/datafile/dba1.dbf
7 5 TEST NO /u01/app/oracle/oradata/ORCL/datafile/test_reorg0
9 10 UNDO1 YES /u01/app/oracle/oradata/ORCL/datafile/undo01.dbf
10 10 VAL NO /u01/app/oracle/oradata/ORCL/datafile/val.dbf
11 100 INVENTORY NO /u01/app/oracle/oradata/ORCL/datafile/o1_mf_inventor_4tts3q24_.dbf
14 260 SYSAUX NO /u01/app/oracle/oradata/o2_mf_sysaux_48fpropg_.dbf
15 500 SYSTEM YES /u01/app/oracle/oradata/ORCL/datafile/o2_mf_system_48fprop3_.dbf
17 100 RCVCAT NO /u01/app/oracle/oradata/ORCL/datafile/rcvcat01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
1 61 TEMP 32767 /u01/app/oracle/oradata/ORCL/datafile/o1_mf_temp_48fpvnpt_.tmp -
How to rename datafiles?
Hi folks,
I have created datafiles thru Oracle 9i Admin wizard as DATA01.ORA Here, point to be noted is the data file extension (.ORA) which was shown as the default extension when I created the file. But after creating this, I have seen the existing data files with extensions as USERS.DBF, SYSTEM.DBF and so on.
What could be the impact if we have data files with .ORA extension? How do I rename this extension to .DBF without loosing the data on it?
Thank you,
MMSThere is no impact to having files named .ora vs .dbf
It is a matter of convention more than anything.
If you really want to rename all the datafiles the easiest approach is probably
sqlplus /nolog
connect sys/change_on_install as sysdba;
alter database backup controlfile to trace;
shutdown immediate;
(If on NT stop the OracleService'SID' for your DB)
Find the 'udump' directory and find the most recent ORA000????.trc file.
This contains a script which will recreate the controlfile via sql.
Now, with the DB shutdown rename all datafiles listed in the ORA000??? file to .dbf or .whatever
(Dont forget the TEMPFILE entries at the end.
Edit the ORA000????.trc file to reflect the new datafile names.
Delete everything before 'STARTUP' in that script.
Save in a directory as cr_NEWDB.sql
start service (if NT)
sqlplus /nolog
connect sys/change_on_install as sysdba
@cr_NEWDB.sql
If everything went well all files will be renamed.
This is also heavily documented in
http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a96521/dfiles.htm -
ALTER DATABASE RENAME DATAFILE, what really needs to bu run later?
Hi!
If I "alter database" and move some datafiles to newly added luns, do I need to run:
On DB side:
1) perl adcfgclone.pl dbTechStack (according new luns!)
2) If 1) is yes, then probably have to run "perl adcfgclone.pl dbconfig $CONTEXT_FILE"?
On APPS side:
1) Autoconfig?
Second question. If on on new LUN is only having archived log files (no db datafiles are on that lun), should they be involved in Number of DATA_TOP's on the target system?
THXIf I "alter database" and move some datafiles to newly added luns, do I need to run:
On DB side:
1) perl adcfgclone.pl dbTechStack (according new luns!)
2) If 1) is yes, then probably have to run "perl adcfgclone.pl dbconfig $CONTEXT_FILE"?
On APPS side:
1) Autoconfig?Damir,
Could you please elaborate more? Why would you need to run perl adcfgclone.pl if you alter the database and add more datafiles?
Second question. If on on new LUN is only having archived log files (no db datafiles are on that lun), should they be involved in Number of DATA_TOP's on the target system?When cloning, it is not required to copy the archivelog files. DATA_TOPs should point to the mount points where datafiles are located. -
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. -
Error during recover datafile - ORA-01422: exact fetch returns more than ..
Hi,
we have got actual a serious problem in our database. Some days ago we created a new datafile for a tablespace in the wrong directory:
ALTER TABLESPACE "ANZSIIDX" ADD DATAFILE '/oralunadata/anzora8/ANZSIIDX08.dbf' SIZE 500M
We recognized our mistake and generated the datafile with the same name in teh right directory:
ALTER TABLESPACE "ANZSIIDX" ADD DATAFILE '/oralunaindex/anzora8/ANZSIIDX08.dbf' SIZE 500M
We set the "wrong" datafile offline in order to rename and replace this in file in the right directory:
alter database datafile '/oralunadata/anzora8/ANZSIIDX08.dbf' offline;
ALTER TABLESPACE 'ANZSIIDX'
RENAME DATAFILE '/oralunadata/anzora8/ANZSIIDX08.dbf',
TO '/oralunaindex/anzora8/ANZSIIDX09.dbf';
After this we wanted to bring the datafile online again with a recovery but
this fails with teh strange error-message:
SQL> recover datafile 109;
ORA-00604: error occurred at recursive SQL level 1
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 20
ORA-00279: change 10322956311023 generated at 04/10/2013 18:51:23 needed for
thread 1
ORA-00289: suggestion : /oralunaarchiv/anzora8/anzora8_1_315326_636567403.arc
ORA-00280: change 10322956311023 for thread 1 is in sequence #315326
A similar thing happens with our RMAN backup from last weekend, which failed:
channel c4: backup set complete, elapsed time: 00:32:33
input datafile fno=00109 name=/oralunadata/anzora8/ANZSIIDX08.dbf
input datafile fno=00103 name=/oralunaindex/anzora8/ITOPROTOKOLLEIDX01.dbf
input datafile fno=00097 name=/oralunadata/anzora8/ITOPROTOKOLLE03.dbf
input datafile fno=00096 name=/oralunadata/anzora8/ITOPROTOKOLLE02.dbf
channel c4: specifying datafile(s) in backupset
channel c4: starting compressed incremental level 0 datafile backupset
continuing other job steps, job failed will not be re-run
ORA-00600: internal error code, arguments: [krbbfmx_notfound], [109], [12801], [], [], [], [], []
ORA-01422: exact fetch returns more than requested number of rows
ORA-00604: error occurred at recursive SQL level 1
Has anybody an idea, how can we bring back the datafile online in order to run succesfull an RMAN backup?
Actually we see just the workaraound to move the objects from the affected tablespace to new tablespace
and the drop the empty tablespace what would be quite time consuming and not really practicable for us.
kind regards,
MarcoHi,
actual we see this in v$datafile:
/oralunaindex/anzora8/ANZSIIDX01.dbf 15 ANZSIIDX 10737418240 1310720 AVAILABLE 15 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX02.dbf 46 ANZSIIDX 10737418240 1310720 AVAILABLE 46 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX03.dbf 58 ANZSIIDX 10737418240 1310720 AVAILABLE 58 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX04.dbf 65 ANZSIIDX 10737418240 1310720 AVAILABLE 65 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX05.dbf 78 ANZSIIDX 10737418240 1310720 AVAILABLE 78 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX06.dbf 85 ANZSIIDX 10737418240 1310720 AVAILABLE 85 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX07.dbf 88 ANZSIIDX 10737418240 1310720 AVAILABLE 88 NO 0 0 0 10737352704 1310712 ONLINE
/oralunaindex/anzora8/ANZSIIDX09.dbf 109 ANZSIIDX AVAILABLE 109 RECOVER
/oralunaindex/anzora8/ANZSIIDX08.dbf 110 ANZSIIDX 10737418240 1310720 AVAILABLE 110 NO 0 0 0 10737352704 1310712 ONLINE
We dont use RMAN-Catalog for backup the information is only stored in the controlfile.
The recovery datafile command with full path including for the datafile failed with the same error message:
SQL> connect / as sysdba
Connected.
SQL> recover datafile '/oralunaindex/anzora8/ANZSIIDX09.dbf';
ORA-00604: error occurred at recursive SQL level 1
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 20
ORA-00279: change 10322956311023 generated at 04/10/2013 18:51:23 needed for
thread 1
ORA-00289: suggestion : /oralunaarchiv/anzora8/anzora8_1_315326_636567403.arc
ORA-00280: change 10322956311023 for thread 1 is in sequence #315326
I guess it is a bug of oracle which will sometimes occur when you give two datafiles the same name in different directories that this poduces errors as above in the RMAN inerface(packages)!?
Maybe we could force to set he tablespace offline, rename the new added datafiles and ry to bring the tablespace online but nobody knows if it works really and we get the tablespace online again?
Therefore at the moment maybe it's the best way to move the objects away from this tablespace and than drop them, isn't it?
regards,
Marco -
Relocating datafiles on standby database after mount point on stanby is ful
Hi,
We have a physical standby database.
The location of datafiles on primary database are at /oracle/oradata/ and the location of datafiles on standby database are at /oracle/oradata/
Now we are facing a situation of mount mount getting full on standby database so we need to move some tablespaces to another location on standby.
Say old location is /oracle/oradata/ and new location is /oradata_new/ and the tablespaces to be relocated are say tab1 and tab2.
Can anybody tell me whether following steps are correct.
1. Stop managed recovery on standby database
alter database recover managed standby database cancel;
2. Shutdown standby database
shutdown immediate;
3. Open standby database in mount stage
startup mount;
4. Copy the datafiles to new location say /oradata_new/ using os level command
4. Rename the datafile
alter database rename file
'/oracle/oradata/tab1.123451.dbf', '/oracle/oradata/tab1.123452.dbf','/oracle/oradata/tab2.123451.dbf',''/oracle/oradata/tab2.123452.dbf'
to '/oradata_new/tab1.123451.dbf', '/oradata_new/tab1.123452.dbf','/oradata_new/tab2.123451.dbf',''/oradata_new/tab2.123452.dbf';
5. Edit the parameter db_file_name_convert
alter system set db_file_name_convert='/oracle/oradata/tab1','/oradata_new/tab1','/oracle/oradata/tab2','/oradata_new/tab2'
6. Start a managed recovery on standby database
alter database recover managed standby database disconnect from session;
I am littelbit confused in step 5 as we want to relocate only two tablespaces and not all tablespaces so we have used.
Can we use db_file_name_convert like this i.e. does this work for only two tablespaces tab1 and tab2.
Thanks & Regards
GirishAhttp://download.oracle.com/docs/cd/B19306_01/server.102/b14239/manage_ps.htm#i1010428
8.3.4 Renaming a Datafile in the Primary Database
When you rename one or more datafiles in the primary database, the change is not propagated to the standby database. Therefore, if you want to rename the same datafiles on the standby database, you must manually make the equivalent modifications on the standby database because the modifications are not performed automatically, even if the STANDBY_FILE_MANAGEMENT initialization parameter is set to AUTO.
The following steps describe how to rename a datafile in the primary database and manually propagate the changes to the standby database.
To rename the datafile in the primary database, take the tablespace offline:
SQL> ALTER TABLESPACE tbs_4 OFFLINE;
Exit from the SQL prompt and issue an operating system command, such as the following UNIX mv command, to rename the datafile on the primary system:
% mv /disk1/oracle/oradata/payroll/tbs_4.dbf
/disk1/oracle/oradata/payroll/tbs_x.dbf
Rename the datafile in the primary database and bring the tablespace back online:
SQL> ALTER TABLESPACE tbs_4 RENAME DATAFILE 2> '/disk1/oracle/oradata/payroll/tbs_4.dbf'
3> TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
SQL> ALTER TABLESPACE tbs_4 ONLINE;
Connect to the standby database, query the V$ARCHIVED_LOG view to verify all of the archived redo log files are applied, and then stop Redo Apply:
SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
SEQUENCE# APP
8 YES
9 YES
10 YES
11 YES
4 rows selected.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Shut down the standby database:
SQL> SHUTDOWN;
Rename the datafile at the standby site using an operating system command, such as the UNIX mv command:
% mv /disk1/oracle/oradata/payroll/tbs_4.dbf /disk1/oracle/oradata/payroll/tbs_x.dbf
Start and mount the standby database:
SQL> STARTUP MOUNT;
Rename the datafile in the standby control file. Note that the STANDBY_FILE_MANAGEMENT initialization parameter must be set to MANUAL.
SQL> ALTER DATABASE RENAME FILE '/disk1/oracle/oradata/payroll/tbs_4.dbf'
2> TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
On the standby database, restart Redo Apply:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
2> DISCONNECT FROM SESSION;
If you do not rename the corresponding datafile at the standby system, and then try to refresh the standby database control file, the standby database will attempt to use the renamed datafile, but it will not find it. Consequently, you will see error messages similar to the following in the alert log:
ORA-00283: recovery session canceled due to errors
ORA-01157: cannot identify/lock datafile 4 - see DBWR trace file
ORA-01110: datafile 4: '/Disk1/oracle/oradata/payroll/tbs_x.dbf' -
After renaming data file it failes during database open
Hi,
I took RMAN full back.
Then i renamed datafile then restored and recovered. It goes fine.
But during the daabase open it fails with
ORA-01113: file 6 needs media recovery
ORA-01110: data file 6: '+OBTDG1/qa112asm/datafile/users02.dbf'
Any specific reason for that?
=======================================================
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jul 22 01:19:30 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
RMAN> backup database;
connected to target database: QA112ASM (DBID=3746246770)
RMAN>
Starting backup at 22-JUL-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=145 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+OBTDG1/qa112asm/datafile/system01.dbf
input datafile file number=00003 name=+OBTDG1/qa112asm/datafile/rbs01.dbf
input datafile file number=00002 name=+OBTDG1/qa112asm/datafile/sysaux01.dbf
input datafile file number=00004 name=+OBTDG1/qa112asm/datafile/temp01.dbf
input datafile file number=00005 name=+OBTDG1/qa112asm/datafile/tools01.dbf
input datafile file number=00006 name=+OBTDG1/qa112asm/datafile/users01.dbf
input datafile file number=00007 name=+OBTDG1/qa112asm/datafile/vindx.dbf
channel ORA_DISK_1: starting piece 1 at 22-JUL-10
channel ORA_DISK_1: finished piece 1 at 22-JUL-10
piece handle=/qa/obj/oracle/obt/output/QA112ASM/obt_standby_03_protection_tui/dttmp/back08ljcr97_1_1 tag=TAG20100722T011934 co
mment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 22-JUL-10
channel ORA_DISK_1: finished piece 1 at 22-JUL-10
piece handle=/qa/obj/oracle/obt/output/QA112ASM/obt_standby_03_protection_tui/dttmp/back09ljcra0_1_1 tag=TAG20100722T011934 co
mment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 22-JUL-10
RMAN> shutdown immediate
Oracle instance shut down
RMAN> startup mount
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 275615744 bytes
Fixed Size 2168944 bytes
Variable Size 184551312 bytes
Database Buffers 83886080 bytes
Redo Buffers 5009408 bytes
RMAN>run(
*run {*
set newname for datafile '+OBTDG1/QA112ASM/users01.dbf' to '+OBTDG1/QA112ASM/users02.dbf' ;
restore datafile '+OBTDG1/QA112ASM/users01.dbf';
recover datafile '+OBTDG1/QA112ASM/users01.dbf' noredo;
switch datafile '+OBTDG1/QA112ASM/users02.dbf' ;
RMAN>
2> 3> 4> 5> 6>
executing command: SET NEWNAME
Starting restore at 22-JUL-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=137 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00006 to +OBTDG1/QA112ASM/datafile/users02.dbf
channel ORA_DISK_1: reading from backup piece /qa/obj/oracle/obt/output/QA112ASM/obt_standby_03_protection_tui/dttmp/back08ljc
r97_1_1
channel ORA_DISK_1: piece handle=/qa/obj/oracle/obt/output/QA112ASM/obt_standby_03_protection_tui/dttmp/back08ljcr97_1_1 tag=T
AG20100722T011934
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 22-JUL-10
Starting recover at 22-JUL-10
using channel ORA_DISK_1
Finished recover at 22-JUL-10
datafile 6 switched to datafile copy
input datafile copy RECID=2 STAMP=724987222 file name=+OBTDG1/qa112asm/datafile/users02.dbf
RMAN> alter database open;
RMAN>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 07/22/2010 01:20:23
ORA-01113: file 6 needs media recovery
ORA-01110: data file 6: '+OBTDG1/qa112asm/datafile/users02.dbf'
=======================================================
Edited by: user13310502 on Jul 23, 2010 4:49 AMas you can see..
RMAN> sql "alter tablespace andreas offline";
sql statement: alter tablespace andreas offline
RMAN> run
2> {
3> set newname for datafile 8 to '+FRA';
4> restore datafile 8;
5> recover datafile 8;
6> switch datafile 8;
7> }
executing command: SET NEWNAME
Starting restore at 23-JUL-10
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 00008 to +FRA
channel ORA_DISK_1: reading from backup piece +FRA/remtest/backupset/2010_07_23/nnndf0_tag20100723t135242_0.3112.725118763
channel ORA_DISK_1: restored backup piece 1
piece handle=+FRA/remtest/backupset/2010_07_23/nnndf0_tag20100723t135242_0.3112.725118763 tag=TAG20100723T135242
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 23-JUL-10
Starting recover at 23-JUL-10
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 23-JUL-10
datafile 8 switched to datafile copy
input datafile copy recid=7 stamp=725118807 filename=+FRA/remtest/datafile/andreas.3113.725118805
RMAN> sql "alter tablespace andreas online";
sql statement: alter tablespace andreas online
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 07/23/2010 13:53:33
RMAN-11003: failure during parse/execution of SQL statement: alter tablespace andreas online
ORA-01113: file 8 needs media recovery
ORA-01110: data file 8: '+FRA/remtest/datafile/andreas.3113.725118805'
RMAN> run
2> {
3> set newname for datafile 8 to '+FRA';
4> restore datafile 8;
5> switch datafile 8;
6> recover datafile 8;
7> }
executing command: SET NEWNAME
Starting restore at 23-JUL-10
using channel ORA_DISK_1
channel ORA_DISK_1: restoring datafile 00008
input datafile copy recid=8 stamp=725118807 filename=+DATA/remtest/datafile/andreas.349.725036143
destination for restore of datafile 00008: +FRA
channel ORA_DISK_1: copied datafile copy of datafile 00008
output filename=+FRA/remtest/datafile/andreas.3114.725118849 recid=9 stamp=725118849
Finished restore at 23-JUL-10
datafile 8 switched to datafile copy
input datafile copy recid=10 stamp=725118850 filename=+FRA/remtest/datafile/andreas.3114.725118849
Starting recover at 23-JUL-10
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 23-JUL-10
RMAN> sql "alter tablespace andreas online";
sql statement: alter tablespace andreas online -
How to online datafile of rollback segment of NO archive log available
I set offline datafile of rool back segement and rename it
but when I try to online , get error to recover
I try to recover but unfortunately all archive log was deleted ( kind of cron job in unix aotu delete these file)
Pls advice how can I set this data file online without the archive log ( while databse still up and running) Oracle version is 8i not possible to drop datafile by sql.
in roll back segment I have 3 data files as below and the rb04.dbf is offline
usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs01.dbf
/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs03.dbf
/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf
sequence of what I did is below:
SQL> alter database datafile '/usr/Systems/1354RM_1/databases/dbsnml/data/rbs04.dbf' offline;
Database altered.
SQL> alter tablespace RBS rename datafile '/usr/Systems/1354RM_1/databases/dbsnml/data/rbs04.dbf' to '/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf';
Tablespace altered.
SQL> alter database datafile '/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf' online;
alter database datafile '/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf' online
ERROR at line 1:
ORA-01113: file 13 needs media recovery
ORA-01110: data file 13:
'/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf'
SQL> recover datafile '/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf';
ORA-00279: change 71449081 generated at 12/23/2008 20:18:05 needed for thread 1
ORA-00289: suggestion :
/usr/Systems/1354RM_1_7.1_Master/OSRES/data/warm_repl/WarmArchive/arch_1_455922.
arc
ORA-00280: change 71449081 for thread 1 is in sequence #455922
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
ORA-00308: cannot open archived log
'/usr/Systems/1354RM_1_7.1_Master/OSRES/data/warm_repl/WarmArchive/arch_1_455922
.arc'
ORA-27037: unable to obtain file status
HP-UX Error: 2: No such file or directory
Additional information: 3SQL> alter tablespace RBS rename datafile '/usr/Systems/1354RM_1/databases/dbsnml/data/rbs04.dbf' to '/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf';Did you rename the file at OS level after you issued above command? Oracle will not rename the file at OS level.
Other than that, if you plan to change rollback segment tablespace, better create a new one and create new rollback segment in new tablespace and drop the old one. -
ORA-01511:error in renaming data file & ORA-01516: nonexistent data file
Hi all,
DB version is 10.2.0.2 and Applications 12.0.6 on RHEL 4
While creating data file mistakenly we created with '?' as follows:
"/d01/CRP/db/apps_st/data/tx_?data53.dbf"
After that we tried to rename those data file using below steps but we are geting error message as follows:
1.SQL>ALTER TABLESPACE APPS_TS_TX_DATA OFFLINE NORMAL; at DB in OPEN stage
2.$mv /d01/CRP/db/apps_st/data/tx_?data53.dbf /d01/CRP/db/apps_st/data/tx_data53.dbf
3.ALTER TABLESPACE APPS_TS_TX_DATA RENAME DATAFILE '/d01/CRP/db/apps_st/data/tx_?data53.dbf' TO '/d01/CRP/db/apps_st/data/tx_data53.dbf';
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01516: nonexistent log file, datafile, or tempfile
"/d01/CRP/db/apps_st/data/tx_?data53.dbf"
After that we tried to revert back by moving to original name usinf os commnds i.e tx_?data53.dbf and tried to open the database as follows but getting error message as follows:
SQL> startup mount
ORACLE instance started.
Total System Global Area 1073741824 bytes
Fixed Size 1264892 bytes
Variable Size 440402692 bytes
Database Buffers 620756992 bytes
Redo Buffers 11317248 bytes
Database mounted.
SQL> recover database;
Media recovery complete.
SQL> alter database open ;
alter database open
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
Please help us t oresolve the Issue
Edited by: 912734 on Feb 15, 2012 2:43 AMErrors in alert log file:
ALTER TABLESPACE APPS_TS_TX_DATA RENAME DATAFILE '/d01/CRP/db/apps_st/data/tx_?data53.dbf' TO '/d01/CRP/db/apps_st/data/tx_data53.dbf'
Wed Feb 15 15:38:58 2012
ORA-1525 signalled during: ALTER TABLESPACE APPS_TS_TX_DATA RENAME DATAFILE '/d01/CRP/db/apps_st/data/tx_?data53.dbf' TO '/d01/CRP/db/apps_st/data/tx_data53.dbf'...
Wed Feb 15 15:40:10 2012
ALTER TABLESPACE APPS_TS_TX_DATA RENAME DATAFILE '/d01/CRP/db/apps_st/data/tx_ data53.dbf' TO '/d01/CRP/db/apps_st/data/tx_data53.dbf'
Wed Feb 15 15:40:10 2012
ORA-1525 signalled during: ALTER TABLESPACE APPS_TS_TX_DATA RENAME DATAFILE '/d01/CRP/db/apps_st/data/tx_ data53.dbf' TO '/d01/CRP/db/apps_st/data/tx_data53.dbf'...
ALTER TABLESPACE APPS_TS_TX_DATA ONLINE
Wed Feb 15 15:41:09 2012
Errors in file /d01/CRP/db/tech_st/10.2.0/admin/CRP2_oraapps/bdump/crp2_dbw0_1605.trc:
ORA-01157: cannot identify/lock data file 11 - see DBWR trace file
ORA-01110: data file 11: '/d01/CRP/db/apps_st/data/tx_
data53.dbf'
ORA-27037: unable to obtain file status -
Oracle datafile moving soft links
hi,
i need to move my datafile from one location to other location. actually in database the data files are confiured with softlinks..
so how can i move my data file (physicl location )from one location to other physical location,
i thinking
1. put the tablespace offline .
2. move the datafile from one location to other.
my doublt is how i alter the link location to point to new location.
should i create new link to point this new location and
3.alter tablespace rename datafile <old link> to <new link >
put the tablespace online .
is any method i can alter the link to point to new location so that i can avoid step 3.
thanks
adityaYou need to do 1, 2 but not 3.
Instead you need to drop the old link and create a new link to point to the new location of the datafile.
The name is unchanged as far as the DB is concerned, but you need to make sure the tablespace is offline while making the change. -
How to move a specific tablespace datafile from one directory to another
Database: 10.2.0.1
OS : Generic
Problem Description : How to move a specific tablespace datafile from one directory to another considering that the database is on Oracle Dataguard setup
** Oracle is working on this issue, but in parallel is opening the topic to the Community so that Community members can add their perspective, experience or knowledge. This will further enhance all knowledge bases including My Oracle Support and My Oracle Support Communities **
Edited by: ram_orcl on 16-Aug-2010 21:21Dear ram_orcl,
Please follow the procedures here;
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14239/manage_ps.htm#i1034172
8.3.4 Renaming a Datafile in the Primary Database
When you rename one or more datafiles in the primary database, the change is not propagated to the standby database. Therefore, if you want to rename the same datafiles on the standby database, you must manually make the equivalent modifications on the standby database because the modifications are not performed automatically, even if the STANDBY_FILE_MANAGEMENT initialization parameter is set to AUTO.
The following steps describe how to rename a datafile in the primary database and manually propagate the changes to the standby database.
1.
To rename the datafile in the primary database, take the tablespace offline:
SQL> ALTER TABLESPACE tbs_4 OFFLINE;
2.
Exit from the SQL prompt and issue an operating system command, such as the following UNIX mv command, to rename the datafile on the primary system:
% mv /disk1/oracle/oradata/payroll/tbs_4.dbf
/disk1/oracle/oradata/payroll/tbs_x.dbf
3.
Rename the datafile in the primary database and bring the tablespace back online:
SQL> ALTER TABLESPACE tbs_4 RENAME DATAFILE 2> '/disk1/oracle/oradata/payroll/tbs_4.dbf'
3> TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
SQL> ALTER TABLESPACE tbs_4 ONLINE;
4.
Connect to the standby database, query the V$ARCHIVED_LOG view to verify all of the archived redo log files are applied, and then stop Redo Apply:
SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
SEQUENCE# APP
8 YES
9 YES
10 YES
11 YES
4 rows selected.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
5.
Shut down the standby database:
SQL> SHUTDOWN;
6.
Rename the datafile at the standby site using an operating system command, such as the UNIX mv command:
% mv /disk1/oracle/oradata/payroll/tbs_4.dbf /disk1/oracle/oradata/payroll/tbs_x.dbf
7.
Start and mount the standby database:
SQL> STARTUP MOUNT;
8.
Rename the datafile in the standby control file. Note that the STANDBY_FILE_MANAGEMENT initialization parameter must be set to MANUAL.
SQL> ALTER DATABASE RENAME FILE '/disk1/oracle/oradata/payroll/tbs_4.dbf'
2> TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
9.
On the standby database, restart Redo Apply:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
2> DISCONNECT FROM SESSION;
If you do not rename the corresponding datafile at the standby system, and then try to refresh the standby database control file, the standby database will attempt to use the renamed datafile, but it will not find it. Consequently, you will see error messages similar to the following in the alert log:
ORA-00283: recovery session canceled due to errors
ORA-01157: cannot identify/lock datafile 4 - see DBWR trace file
ORA-01110: datafile 4: '/Disk1/oracle/oradata/payroll/tbs_x.dbf'Hope That Helps.
Ogan
Maybe you are looking for
-
I bought the hdmi and didn't realize you can only use it for iPad 2. I want to be able to watch Netflix through my iPad 1. And also play my apps on my big screen is there any cable out that will let me do this on my iPad 1.
-
Unable to install ISE 1.1.1 on VMware vSphere 5
Dear friends, I'm trying to install ISE 1.1.1 VM on my vSphere 5 environment but I get no success. I met hardware requirements (2 CPUs, 4 GB of RAM, 100 GB disk and 1 NIC), but I'm always stuck on the attached print screen (traceback and invalid ELF
-
When I import .vob files, PE4 only imports the first two thirds of the file. I don't think I had this problem the last time I worked with .vob files, so it may be specific to the three I'm working with. The quality is fine, it just cuts off early.
-
How to install adobe out of dat Flash.
How do I update my adobe out of date flash
-
Is there any sql statement to see all the data dictionary tables like all_tables,all_indexes,user_resource_limits,user_mview_logs,user_tab_privs etc thanks