Rename a data file after restoring

Hello
I entered incorrect name for a data file by mistake.

the value of newname for datafile 145 to ' / PATH/datafile1.dbf ';
the value of newname for datafile 146 to ' / PATH/datafile2.dbf ';

But that's the real name of the two

DataFile 145 /PATH/datafile2.dbf
DataFile 146 /PATH/datafile1.dbf


Trying hard I did:

change the database file rename ' / PATH/datafile1.dbf ' to ' / PATH/datafile2.dbf ';
change the database file rename ' / PATH/datafile2.dbf ' to ' / PATH/datafile1.dbf ';

But I got this error after alter renaming:
ERROR on line 1:
ORA-01511: Error renaming data/log files
ORA-01523: cannot rename the data file ' / PATH/datafile2.dbf '-record already in the database


How can I return the names after the two data files are restored and renamed.

Published by: Paul Vidal on May 29, 2012 15:14

the value of newname for datafile 145 to ' / PATH/datafile1.dbf ';
the value of newname for datafile 146 to ' / PATH/datafile2.dbf ';

But that's the real name of the two

DataFile 145 /PATH/datafile2.dbf
DataFile 146 /PATH/datafile1.dbf

Trying hard I did:

change the database file rename ' / PATH/datafile1.dbf ' to ' / PATH/datafile2.dbf ';
change the database file rename ' / PATH/datafile2.dbf ' to ' / PATH/datafile1.dbf ';

But I got this error after alter renaming:
ERROR on line 1:
ORA-01511: Error renaming data/log files
ORA-01523: cannot rename the data file ' / PATH/datafile2.dbf '-record already in the database

How can I return the names after the two data files are restored and renamed.

His as an example, you have two glasses of water, you want to exchange the water in each glass, then you need extra glass here.
Thus, rename one of the files with a different name.

change the database file rename ' / PATH/datafile1.dbf ' to ' / PATH/datafile1_dummy.dbf ';
change the database file rename ' / PATH/datafile2.dbf ' to ' / PATH/datafile1.dbf ';
change the database file rename ' / PATH/datafile1_dummy.dbf ' to ' / PATH/datafile2.dbf ';

But make sure that you have files at the level of the BONE also...

Tags: Database

Similar Questions

  • Restore files after restoring the image using Windows backup

    Running W7 pro 64-bit. Had the problems of virus/malware, finally restored my discs from image system, dated 2 weeks ago and then restore backup files dated Windows from yesterday.

    When I go to save / restore my files, the update does not list a backup happened 2/14, the date of the restored image. When I go to manage Windows backup disk space, and then select backup period to remove the last date is 3/1, when I did the last backup. The date & time system is running with a date of 3/2.

    How can I fix it?

    Hello

    Thank you for visiting Microsoft Community.

    As I understood it, you experience the problem with changes to date during the restoration of files after restoring the image using Windows backup on the system.

    Certainly, I understand your concern.

    I suggest refer you to the articles below and check if that helps.

    Backup and restore: frequently asked questions

    http://Windows.Microsoft.com/en-us/Windows/back-up-restore-FAQ#1TC=Windows-7

    Restore files from a backup

    http://Windows.Microsoft.com/en-us/Windows/restore-files-backup#1TC=Windows-7

    Note: The article above will help you restore backed up version of the files that are lost, damaged, or changed accidentally. You can also restore files individual, groups of files, or all files that you have saved.

    Recovery and data backup

    https://msdn.Microsoft.com/en-us/library/bb727010.aspx?f=255&MSPPError=-2147217396

    I hope this information is useful.

    Please let us know if you need more help, we will be happy to help you.

    Thank you.

  • Defining the new path for the data files for restoring using the VALUE of NEWNAME FOR DATABASE

    Version: 11.2.0.3 Linux

    Today, I had to do a restore RMAN to a new server and I came across the post following RTO on the VALUE of NEWNAME FOR DATABASE

    ALTER database open resetlogs upgraded;         error to throw

    So, I thought to use it to indicate the new location of the data files to restore.

    That's what I did
    ===================

    Restore the control file and catalog items to backup using the command of CATALOGUE START WITH. Then I started the restoration
    $ rman target / cmdfile=restore.txt
    
    Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jul 26 04:40:41 2012
    
    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
    
    connected to target database: SPIKEY (DBID=2576163333, not open)
    
    RMAN> run
    2>  {
    3>  SET NEWNAME FOR DATABASE TO '/fnup/hwrc/oradata/spikey';
    4>  restore database  ;
    5>  }
    6>
    7>
    8>
    executing command: SET NEWNAME
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of set command at 07/26/2012 04:40:43
    RMAN-06970: NEWNAME '/fnup/hwrc/oradata/spikey' for database must include %f or %U format
    
    Recovery Manager complete.
    Don't know how it worked for Levi without %f or %U. So, I added %f
     $ vi restore.txt
     $ cat restore.txt
    run
     {
     SET NEWNAME FOR DATABASE TO '/fnup/hwrc/oradata/spikey/%f';
     restore database  ;
     }
    
    
     $ rman target / cmdfile=restore.txt
    
    Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jul 26 04:45:45 2012
    
    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
    
    connected to target database: SPIKEY (DBID=2576163333, not open)
    
    RMAN> run
    2>  {
    3>  SET NEWNAME FOR DATABASE TO '/fnup/hwrc/oradata/spikey/%f';
    4>  restore database  ;
    5>  }
    6>
    7>
    8>
    executing command: SET NEWNAME
    
    Starting restore at 26-JUL-12
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=19 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 00001 to /fnup/hwrc/oradata/spikey/1
    channel ORA_DISK_1: restoring datafile 00002 to /fnup/hwrc/oradata/spikey/2
    channel ORA_DISK_1: restoring datafile 00003 to /fnup/hwrc/oradata/spikey/3
    channel ORA_DISK_1: restoring datafile 00004 to /fnup/hwrc/oradata/spikey/4
    channel ORA_DISK_1: restoring datafile 00005 to /fnup/hwrc/oradata/spikey/5
    channel ORA_DISK_1: restoring datafile 00006 to /fnup/hwrc/oradata/spikey/6
    channel ORA_DISK_1: restoring datafile 00007 to /fnup/hwrc/oradata/spikey/7
    channel ORA_DISK_1: restoring datafile 00008 to /fnup/hwrc/oradata/spikey/8
    channel ORA_DISK_1: restoring datafile 00009 to /fnup/hwrc/oradata/spikey/9
    channel ORA_DISK_1: reading from backup piece /u07/bkpfolder/SPIKEY_full_01nh0028_1_1_20120725.rmbk
    channel ORA_DISK_1: errors found reading piece handle=/u07/bkpfolder/SPIKEY_full_01nh0028_1_1_20120725.rmbk
    channel ORA_DISK_1: failover to piece handle=/u07/dump/bkpfolder/SPIKEY_full_01nh0028_1_1_20120725.rmbk tag=SPIKEY_FULL
    channel ORA_DISK_1: restored backup piece 1
    channel ORA_DISK_1: restore complete, elapsed time: 00:01:56
    Finished restore at 26-JUL-12
    
    Recovery Manager complete.
    As you can see, RMAN restore data files to the desired location. But the data file names ended up as
    1
    2
    3
    .
    .      
    .
    9
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -----------| Holy Cow |-----------------------------


    So I had to rename each file as below
    $ mv 1 /fnup/hwrc/oradata/spikey/system01.dbf
    $ mv 2 /fnup/hwrc/oradata/spikey/sysaux01.dbf
    $ mv 3 /fnup/hwrc/oradata/spikey/undotbs01.dbf
    I would have been better in execution of the order for each data below file
    SET NEWNAME FOR DATAFILE
    Now, I think, there is no advantage in using NEWNAME SET of DATABASE to. Only the disadvantages. I did anything wrong above?

    Martin;

    On the issue of the VALUE of NEWNAME FOR DATABASE, you must specify at least one of the first three of the following substitution variables to avoid collisions of names: %b f % U. see semantic entry for TO 'filename' for a description of the possible substitution variables.

    You use %f

    %b
    
    Specifies the filename without the fully qualified directory path. For example, the datafile name /oradata/prod/financial.dbf is transformed to financial.dbf. This variable enables you to preserve the names of the datafiles while you move them to different directory. During backup, it can be used for the creation of image copies. The variable cannot be used for OMF datafiles or backup sets.
    
    %f
    
    Specifies the absolute file number of the datafile for which the new name is generated. For example, if datafile 2 is duplicated, then %f generates the value 2.
    
    %U
    
    Specifies a system-generated unique filename. The name is in the following format: data-D-%d_id-%I_TS-%N_FNO-%f. The %d variable specifies the database name. For example, a possible name might be data-D-prod_id-22398754_TS-users_FNO-7.
    

    Source - E10643-01

    Backup and recovery reference

    http://docs.Oracle.com/CD/E14072_01/backup.112/e10643/rcmsynta2014.htm

    I see CKPT and I agree on that!

    Best regards

    mseberg

  • How do I reduce the data file after the moving images to another data file

    All,

    I did a test of simepl to see how should I reduce my data file after the transfer of the objects thereof.

    I had an image in my data file USER_image, which is about 9 GB in size. I created the new data under the new tablpespace file and moved all the images in this new space of tables. So my old tablespace of image with its data file is now empty. At least there is not all user objects.

    Now I tried to resize the old datafile (USER_image) to a smaller value, but I keep this error
    "ORA-03297: file contains data beyond the value required to RESIZE.

    The file size is 9 GB and I tried to resize to 8 GB but it still does not allow me.

    Is it possible to resize a data file after moving all its purpose?
    I'm something wrong or missing something?

    Thanks in advance.

    If you old image tablespace is indeed empty (you need to run a statement against DBA_SEGMENTS to check) then you can bring it, data files included.
    After this, you can create a 'new' tablespace with the old name and desired data file sizes.

  • of MSHS - cannot rename the data files

    I have a MSHS (encryoted MSH) - 5 last lines in this script - I have a command shell that renames the data files. for example

    Shell ren f:\data\abc_morning.txt abc_20100912_morning.txt
    Shell ren d:\data\def_afternoon.txt abc_20100912_afternoon.txt
    Shell ren t:\data\abc_evening.txt abc_20100912_evening.txt

    These commands work fine in the MSH script, but get the "File not found" error in file MSHS. Has anyone else ran into this problem?

    MSHS command also asked how to rename the data files as Shell REN does not work?

    It's really simple:

    MSH scriptname.msh

    That's all.

    Kind regards

    Cameron Lackpour

    Edited by: CL, Sep 13, 2010 16:37
    Adding an extension to the scriptname.

  • Rename a data file

    One of a tablespace data files received the fake name (deviating naming convention standards established by our Organization). Now, I want to rename it... What are all the options that I have... I don't want to stop the database... The database is running on Oracle 9i on HP Unix... Enjoy your suggestions...

    ALTER database datafile '' in offline mode.
    Rename the data file
    change the database file rename "" to "";
    ALTER database datafile '' online;

    HTH

    Enrique

    PS: If the database has increased, then you must recover the data file before you can put it online:
    RMAN > recover datafile 'new name of datafile.

    Published by: Enrique Orbegozo on October 14, 2008 08:59

  • After you rename the data file, cannot start database

    Oracle 11 g 2
    OEL 5 (ASM)
    Network infrastructure (cluster install) - no CARS yet

    Something interesting happened. Perhaps this question might be more suited to the "ASM" section, but that's.

    I gave a data in ASM file an alias with the following command (the ASM instance):
    SQL> alter diskgroup DATA add alias '+DATA/oradb/datafile/users01.dbf' for '+DATA/oradb/datafile/users.253.795630487';
    
    Diskgroup altered.
    Then, as mentioned in Note: 564993.1, we need to update the database as well with the new alias. However, when I went to the stopping and starting of the database, I received the following:
    SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup mount;
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    It's strange. Nothing has changed except the alias being added to the data file. This is all before operation. That's happened?

    I think that it may have to do with the different ASMOPER, ASMADMIN, ASMDBA groups that have been installed as part of the installation of the grid Infrastructure. In addition, the listener is running out of the GI home.

    All my variables environment (e.g. ORACLE_SID, ORACLE_HOME, etc.) are defined.

    Any ideas?

    Thank you.

    Hello
    When you connect with tnsnames alias while the database is down the listner did not know the service, so you must start the database on the server database with sqlplus / as sysdba. After starting the registry of data base with the listener and your connection works again.
    Alternativ you can add a service to your listener.ora to connect with him while he is arrested, as long as you do not have it you must use local connect which means sqlplus / as sysdba.

    concerning
    Peter

  • Rename a data file in a physical standby

    Hi all

    I have the following problem.

    Oracle Enterprise Linux 64-bit 11.2.0.2.0

    Primary and standby are configured with standby_file_management = MANUAL

    I added a tablespace with a primary data file a few days ago.

    Today, I realized sleep did not change due to the following error:


    ORA-01111: name for the data file 13 is unknown - rename it to the correct file

    ORA-01110: data file 13: ' / oracle1/11.2.0.2/dbs/UNNAMED00013'

    ORA-01157: cannot identify/lock data file 13 - see DBWR trace file

    ORA-01111: name for the data file 13 is unknown - rename it to the correct file

    ORA-01110: data file 13: ' / oracle1/11.2.0.2/dbs/UNNAMED00013'

    According to the MOS it says I should rename database in standby mode, but it does not allow me to do so, it is said that dB must be open; but I can't open it because it is a standby DB.

    Even if I want to open read-only, it says:

    SQL > ALTER DATABASE OPEN read-ONLY.

    ALTER DATABASE OPEN READ ONLY

    *

    ERROR on line 1:

    ORA-10458: standby database requires recovery

    ORA-01157: cannot identify/lock data file 13 - see DBWR trace file

    ORA-01111: name for the data file 13 is unknown - rename it to the correct file

    ORA-01110: data file 13: ' / oracle1/11.2.0.2/dbs/UNNAMED00013'

    /Oracle1/11.2.0.2/DBS/UNNAMED00013 data file does not exist

    How can I solve it?

    Thank you very much.

    Hello;

    My friend CKPT has a post on it:

    Without file NAME in standby mode after the addition of new files to primary ORA-01111, ORA-01110

    http://www.Oracle-CKPT.com/unnamed-file-in-standby-after-adding-new-file-to-primary-ora-01111-ora-01110-ora-01157/

    Sound also cover in the book he co-authored:

    Oracle Data Guard 11 GR 2 Administration beginner & #039; s Guide | Packt Publishing

    Best regards

    mseberg

  • My application doesn't open or create a .dat file after I made it executable!

    I had an application that stores data in a .dat file. It works fine until I do the VI an executable.

    Even if my program did not find the .dat in the first time, must be created, but it is not!

    What I need to for my VI to use in executable mode .dat file. I need it because I have to run the VI without LABVIEW 8.6 installed.

    Thank you!

    PS. Sorry for my bad English! I'm Brazilian!

    Why my executable does not work when you use the constant path of the current VI?

    (See also)

  • easy transfer can be used to reload the data files after formatting hard drive?

    I have been informed by level microsoft 2 I have to reformat my hard drive to fix the problem with windows backup (snapshot won't work).  easy transfer will copy all THE data files, including OUTLOOK 2007 on hard drive and then I can reinstall on reformatted drive.

    Easy transfer copy some things but not all things. He does more that can make a simple copy/paste (such as the settings for example) but, for example, not programs transfer (those who need to be put back in place).  Here is a description of what it does (and does not): http://support.microsoft.com/kb/928635.  It will transfer Outlook 2007 PDF files and other personal data if they are selected - you need to know which files you need and where to select them - but it won't transfer the program (which must be put back in place).  It must be run before you reformat the hard disk to collect data and then you can transfer everything what you have registered once the system is re-installled.  You would do the re-setup prior to the transfer.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Don't recharge files after restoring Vista 32 bit

    I had vista 64 bit OS and got disorders pilot so I restored it to 32 bits after a backup to an external hard drive, now I can't restore the files as the restoration Center shows no backup is available. Please help I need these files soon.

    Original title; Novice needs help.

    Hi Bluesman123,

    Please take a look at the following information through MRMic of a previous post:

    I got exactly the same problem on Vista 32 bit. The second time I tried to restore from my external hard drive, I got the error "data too small area."

    After you have reinstalled Vista, I wanted to make a backup. To avoid a conflict between the backup of previous installation and the new facility, I renamed the backup folder (for example, MICPC to MICPC-OLD). Later, I got the error trying to restore my old backup. On a whim, I renamed the old folder its original name (OLD of MICPC to MICPC) and that fixed it (or at least restore now works).

    It turns out that I never needed to rename the folder in the first place because when I reinstalled Vista, I added in some way a dash in my name of the computer (MIC - PC) makes it different from the old (MICPC) one anyway.

    I hope this helps!

  • Merger VMDK file after restoring from time machine recognized not

    Hello

    I'm having a problem with Fusion 3.1 recognizes no not my Virtual Machine copied from time machine. I did what I did and the below error code.

    Question: I just installed a new hard drive and performed a clean installation of Fusion 3.1. After that, I used time machine to restore my virtual machine to Windows 7 x 64 at the previous address. I then open vmware fusion and looked for the virtual machine and click Open. The virtual tried to start but I received the following error message:

    Could not open the file "/ users / / Documents/Windows 7 x64.vmwarevm/Windows 7 x64.vmdk ': the system cannot find the specified file.

    I checked the contents of the package, Windows 7 x64.vmwarevm and the file is there. I don't know why he is not recognized. I have attached a screenshot of the file hard text, text log file and the contents of the package.

    Thanks for your help.

    Dmillz80 wrote:

    WoodyZ - is there a way I can rebuild this section?

    If you can find the file "Windows 7 x 64 - s010.vmdk" within the structure of the backup folder Time Machine which is closest to you, you might get lucky, but really all depends on what exactly in this segment of the disc.  I use the find command in a Terminal to find this file because I do not think that you will find with Spotlight.  If you can find the file "Windows 7 x 64 - s010.vmdk", then in an attempt to at least be able to mount the drive with VMDKMounter in order to try to recover all the data, you can you can always replace the file "Windows 7 x 64 - s010.vmdk" with a segment of fake or another as duplicate file "Windows 7 x 64 - s011.vmdk" and rename it file "Windows 7 x 64 - s010.vmdk.  FWIW, it will really depend on exactly what was in the file "Windows 7 x 64 - s010.vmdk" about what you might be able to recover with VMDKMounter or even to start the Virtual Machine.  I actually had the results mixed in the past where only data could be retrieved and cases where all data have been recovered and in some of these cases, the Virtual Machine is bootable and in some not so it all comes down to what was in the missing segment.

    At this point you have nothing to lose and everything to win then to give a try.

  • can not find restored files after restoring backup hard drive

    I had a problem with my computer so I reset my PC back to factory setting. Before doing anything, I backed up all my documents/pictures in an external hard drive.

    After successfully resetting my PC to factory setting, I ran restore backup files... I took me 4 hours to restore. Restore files has been a success.

    When I restart my PC, I couldn't find anything my back upwards. I don't know that there have been restored as I have only 50 G to 200G left of my C drive.

    I tried to look for documents, but I can't find anything.

    What happened to all my backup files?

    Hello

    Where you are restoring the data?

    Check if the files are hidden.

  • Where are my files after restoring?

    I have a HP Pavilion Elite running Vista. After a reboot, it got stuck in an infinite loop trying to install an update, this message "Configuring updates: stage 3 of 3...» 0% complete"then close. After trying I finally had to do a full recovery that finally rebooted the computer, but all my data appear to be locked in the Factory Image Restore points of driving in a marked RECOVERY partition. How can I retrieve my files?

    Hi Akslider. The instructions to restore the backed up files are in this document: How to restore the backup files. I'm not sure that understand your question about why it happened, you can specify what you ask?

  • Can't see the data partition after restoring the system

    Hello.

    I had installed Windows 7 on my computer and I had two operating systems of windows operating system. And I wanted to boom volume but I couldn't and I downloaded a program and crashed my both operating systems. And after that I used the hp recovery cd use cmd, System Restore. And after that, I got all the workers. But now I can't see my data partition. I can see the computer Manager, but I can't access it.  Please help Microsoft. :(

    Is the partition on the same drive as Vista?  If so I would try to extend the Vista partition to include the space in this partition "missing."  Maybe this process will add space on your system drive, and at least you will have access to it (even if it is not a separate partition that you wish).  I don't know if this will work if the system is not seen as a partition, but I guess it's worth a try.

    After that, my only suggestion is to backup your data and do a clean boot from the drive and format the drive and reset the partitions in the installation process.  This should solve this problem.  I wish I had a less drastic recommendation, but honestly, I know of no other way to solve this problem (if it does not solve the problem).

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

Maybe you are looking for

  • iMac no arranca

    Hola, tengo a imac 27 "Core i5 Intel con cuatro nucleos has 3, 1 mhz, 2011 con tarjeta grafica Radeon 6970 M, Pronto al trabajar en photoshop is empezo a apagar the pantalla, luego actualice a mac osx sierra y al iniciar the pantalla sale verde, is l

  • Thunderbird freezes several times

    I use a computer laptop w/W8.1. Recently Tbird freezes several times and even if I reboot often it does not solve the problem. Freezes appear to be random and not tied to a particular action. More annoying than dangerous.

  • 3D XYZ chart

    Hello world I wonder if it is possible to plot a 3D graph, if I have X Y and Z (for example X = (a, b, c, d), (e, f, g, h) = Y, Z =(i,j,k,l)). I have try it intrigues with different function which could trace mesh or curve, but I prefer to have just

  • Can I upgrade to vista without deleting my xp programs and files?

    upgrade Can I upgrade to vista without deleting my xp programs and files? I don't want to lose my programs/files downloaded, but I don't want to argue with remove them and reinstall later

  • Unable to connect to the mail server

    When I initially try to access online e-mail I get this error message Can't send or receive messages on behalf of ec.rr.com pop server. The pop server host ec.rr.com is not found. Please check that you have entered the server name correctly. Windows