How to add datafile to standby database

Hi,
We have standby database on another site and we are using manual recovery. How to add datafile to standby database after datafile is added to primary database.
We are on Oracle 9i R2.
Please help.
Thanks in advance

Hi,
When you recover the standby database after you added a datafile to the production, you will get an error that the file that needs recovery does not exist.
At this point you can connect to the standby and issue:
alter database create datafile '<original_name>' as '<new_name>';the new name is optional if the location of the files are the same.
After that, you can continue recovering the standby database.
Liron Amitzi
Senior DBA consultant
[www.dbsnaps.com]
[www.orbiumsoftware.com]

Similar Messages

  • 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
    GirishA

    http://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'

  • Error when trying to recover datafile from standby database to primary

    hi friends,
    getting problem with restoring datafile from backupset taken on standby database to primary database.
    os: windows server 2003
    db: oracle 11gR1(11.1.0.6)
    i've configured standby database on two different hosts.
    host1 - primary (db_uinque_name= prod)
    host2 - standby (db_uniue_name= prodsby)
    I've configure both database with recovery catalog. I take backup on standby database. users' datafile of primary database has been lost.i'm trying to restore from the backupsets taken on standby database.
    with the help of - http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/rman.htm#BAJCEFEG
    on primary
    c:\>rman target sys/password catalog rcat/password
    rman>list backup for db_unique_name prodsby;
    display the backupsets
    rman>restore datafile 4;
    Starting restore at 06-NOV-08
    starting full resync of recovery catalog
    full resync complete
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=1051 device type=DISK
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 11/06/2008 12:12:18
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    also use to tag to restore the datafile
    rman>restore datafile 4 from tag='base0_prodsby';
    Starting restore at 06-NOV-08
    using channel ORA_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 11/06/2008 11:27:21
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    i'm getting above errors when try to restore the datafile.
    when i issue the following command.
    BACKUP AS COPY DATAFILE 4 AUXILIARY FORMAT 'C:\app\Administrator\oradata\prod\USERS01.DBF';
    Starting backup at 06-NOV-08
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=1068 device type=DISK
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00004 name=C:\APP\ADMINISTRATOR\ORADATA\prod\USERS01.
    DBF
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/06/2008 12:49:
    15
    ORA-17628: Oracle error 19505 returned by remote Oracle server
    please friends, try to help me to solve the problem.
    Thanks,
    Vihang

    hi.
    Its not necessary its a otherway around to recover datafile from this backupset and apply archivelogs to make datafile consistent.
    yes, it ain't the right way to restore backup to primary location.
    so how would i connect to standby database with primary and recovery catalog.
    i need to connect to recovery catalog and primary site because i need to restore to primary location and recovery catalog contain all metadata and backupsets related information.
    i also tried the following steps from oracle documentation.
    Connect to the standby database as the target database:
    CONNECT TARGET sys@standby
    You are prompted for a password:
    target database Password: password
    Connect to the primary database as the auxiliary database:
    CONNECT AUXILIARY sys@primary
    You are prompted for a password:
    target database Password: password
    Back up the datafile on the standby host across the network to a location on the primary host. For example, suppose that /disk1/df2.dbf is the name of datafile 2 on the standby host. Suppose that /disk8/datafile2.dbf is the name of datafile 2 on the primary host. The following command would copy datafile 2 over the network to /disk9/df2copy.dbf:
    BACKUP AS COPY DATAFILE 2 AUXILIARY FORMAT '/disk9/df2copy.dbf';
    Starting backup at 06-NOV-08
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=1068 device type=DISK
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00004 name=C:\APP\ADMINISTRATOR\ORADATA\prod\USERS01.
    DBF
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/06/2008 12:49:
    15
    ORA-17628: Oracle error 19505 returned by remote Oracle server
    getting this error.

  • How to add datafile in asm

    Hi,
    Can anybody let me know how to add datafile using ASM
    DB- ORACLE 10.2
    OS-RHEL

    SQL> select name from v$asm_diskgroup;
    NAME
    DATA1
    DATA
    Above we are having two asm diskgorup
    SQL> alter tablespace users add datafile ‘+data1′ size 5M;
    Tablespace altered.
    SQL> select name from v$datafile;
    NAME
    +DATA1/nonasmtoasm/datafile/system.259.721108803
    +DATA1/nonasmtoasm/datafile/undotbs1.261.721108865
    +DATA1/nonasmtoasm/datafile/sysaux.260.721108841
    +DATA1/nonasmtoasm/datafile/users.262.721108873
    +DATA1/nonasmtoasm/datafile/users.269.721187971                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to make a physical standby database in the read_only state in 11g?

    In 10g, we can make a physical standby database in the read_only state. But in 11g, no a read_only state for a physical standby database. How to make a physical standby database in the read_only state in 11g?

    Hi
    read-only mode (for 11g physical standby)
    A mode in which a database can be opened that allows queries, but disallows modifications.
    A physical standby database can be opened read-only so that queries may be performed. If a license for the Oracle Active Data Guard option has been purchased, a physical satndby database can be open while redo apply is active. This capability is known as Real-time Query.
    For more details have a look at:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/manage_ps.htm#SBYDB00706
    Hipe this Helps
    Regards

  • How to sync primary and standby database in 11GR2 on linux

    Hi ,
    How to sync primary and standby database in 11GR2 on linux . Both my primay and standby are 3 node cluster each.
    Can you please suggest a good link and brief steps .
    Thanks

    Are you trying to setup a new standby or sync an existing standby database?
    OK I see it
    "standby is behind the primary"
    So you have a gap.
    I would check both alert logs for a cause. You might find something like this
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor.Look for ORA-00308 and ORA-27037 and ORA-16055.
    There's no sense fixing the gap unless the cause is fixed too.
    Also check out this post from a few days ago its dealing with similar issues.
    How to sync the standby database with the primary?
    If you find this helpful please mark it so.
    Edited by: mseberg on Jul 20, 2011 4:37 PM

  • Restoring and recovering datafiles in standby database

    Hi,
    oracle version : 8i(8.1.7.0.0)
    os : sun solaris
    I have scenerio where i lost some of the datafiles in standby database(physical standby) and i do have standby cold backup 3 months older since database size is 1TB is can i restore the the only lost files from cold backup and recover using archivelog files. since i only lost 4 data files of size 4gb each it will be faster compare to restoring the whole TB size database.
    appreciated for valuable inputs.
    Thanks
    Prakash GR

    Normal copy command can do your work:
    sys@SANTU> startup
    ORACLE instance started.
    Total System Global Area  535662592 bytes
    Fixed Size                  1334380 bytes
    Variable Size             180355988 bytes
    Database Buffers          348127232 bytes
    Redo Buffers                5844992 bytes
    Database mounted.
    Database opened.
    sys@SANTU> archive log list
    Database log mode              Archive Mode
    Automatic archival             Enabled
    Archive destination            USE_DB_RECOVERY_FILE_DEST
    Oldest online log sequence     4
    Next log sequence to archive   6
    Current log sequence           6
    sys@SANTU> host copy D:\APP\SANTOSKU\ORADATA\SANTU\USERS01.DBF d:\
            1 file(s) copied.
    sys@SANTU> shu immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    *Renamed the datafile 'D:\APP\SANTOSKU\ORADATA\SANTU\USERS01.DBF' to 'D:\APP\SANTOSKU\ORADATA\SANTU\USERS011.DBF'*
    sys@SANTU> startup
    ORACLE instance started.
    Total System Global Area  535662592 bytes
    Fixed Size                  1334380 bytes
    Variable Size             180355988 bytes
    Database Buffers          348127232 bytes
    Redo Buffers                5844992 bytes
    Database mounted.
    ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
    ORA-01110: data file 4: 'D:\APP\SANTOSKU\ORADATA\SANTU\USERS01.DBF'
    sys@SANTU> host move  d:\USERS01.DBF D:\APP\SANTOSKU\ORADATA\SANTU\
    sys@SANTU> shu immediate
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.
    sys@SANTU> startup
    ORACLE instance started.
    Total System Global Area  535662592 bytes
    Fixed Size                  1334380 bytes
    Variable Size             180355988 bytes
    Database Buffers          348127232 bytes
    Redo Buffers                5844992 bytes
    Database mounted.
    ORA-01113: file 4 needs media recovery
    ORA-01110: data file 4: 'D:\APP\SANTOSKU\ORADATA\SANTU\USERS01.DBF'
    sys@SANTU> recover datafile 'D:\APP\SANTOSKU\ORADATA\SANTU\USERS01.DBF';
    Media recovery complete.
    sys@SANTU> alter database open;
    Database altered.
    sys@SANTU>N.B. I have not done the demo on standby database.
    but just i want to know is this procedure is valid that is instead of taking the lost datafiles from production can i use lost datafiles from standby database to recover other standby database.That would be fine.
    Regards,
    S.K.
    Edited by: Santosh Kumar on Oct 8, 2009 11:09 AM

  • How to add an existing content database to new Site collection

    Hi All,
    Can anyone help to figure out how can I add existing content database to a new site collection in SharePoint 2013 foundation.
    We have more than 40 site collections under one web application, and only one site collection is returning 404 error. When checked in the central admin to view all site collections, the details on the right side of the site is not visible, and unable
    to delete it. The database is not corrupt, as I tried to add the same content database to a new web application, and it works perfectly in a new web app.
    As we couldn't find any solution, the only option we thought of was to blow the site collection and create a new one and add the exisiting database, but I am unaware as to how can I add existing database to new create site collection. Can anyone help
    me with this please?
    Regards,
    DJ

    It's working....
    The current database was corrupt I guess, (not sure though). Took old backup file and tested to see if it's working. After the test was successful...
    Removed the current database in CA
    Delete the current database in SQL server
    Restored the working backup file in SQL server
    Added the content db in CA
    That's it... the site collection is working now...
    Regards,
    DJ

  • How to apply archive in Standby Database?

    Hello,
    My Database are running in linux plateform. I am seeing that archives which are generating are not copying to standby server & not applying.
    Can anybody suggest me how to copy archive from primary database(ASM file system) to standby Database & apply those archives?
    Thanks

    Hi,
    I am having similar problem. The primary logs are shipping on to standby but are not getting applied.
    Here are the outputs:
    From primary
    SQL > select thread#,max(sequence#) from v$archived_log where archived='YES' group by thread#;
    THREAD# MAX(SEQUENCE#)
    1 27908
    2 28476
    3 31643
    select max(sequence#) from gv$archived_log;
    MAX(SEQUENCE#)
    31643
    From Standby
    SQL > select thread#,max(sequence#) from v$archived_log where applied ='YES' group by thread#;
    THREAD# MAX(SEQUENCE#)
    1 26862
    2 27580
    3 30874
    select max(sequence#) from v$archived_log;
    MAX(SEQUENCE#)
    31643
    Any help is appreciated.
    Thanks in advance.

  • Restore datafile to standby database

    dear all,
    i have a standby database which use raw devices under solaris 9.
    and a primary database which use filesystem under solaris 9 too.
    recently i have a problem which is nologging issue. see ML 290161.1
    my question is how we know that when restore to raw devices through rman, will it replace file in the raw?
    or should I create new raw and directing my new restore to new raw?
    regards
    ujang

    dear all,
    i have a standby database which use raw devices under solaris 9.
    and a primary database which use filesystem under solaris 9 too.
    recently i have a problem which is nologging issue. see ML 290161.1
    my question is how we know that when restore to raw devices through rman, will it replace file in the raw?
    or should I create new raw and directing my new restore to new raw?
    regards
    ujang

  • How to monitor 8i physical standby databases ?

    Hi guys,
    It seems easy to create and monitor standby databases for 9i and 10g instances through OEM 10, but what about 8i standby db ?
    Has everything to be done manually : creation, monitoring, maintenance ?
    It is at least possible to monitor redo transport and applying for example with an older version of OEM ?
    thanks for your help
    Antoine

    10g EM is the first version, which really monitors (almost) the whole landscape. Previous versions don't deal with Dataguard configurations. 10g EM still can monitor an 8i (must be at least 8.1.7.4) database, but on a very basic level. Remember 8i is desupported for a long time now. 9i is also desupported, but many sites still use it, that can't be ignored by Oracle.
    Werner

  • How to add a row to database  from tableModel

    hi friends,
    i wnt to know that is it possible that when i add some rows in a table which has been created by a table model to add those rows to database like what happen in MS Access when u add rows and close the window the rows are automatically added to database
    i want to know where to add the listener for that and which listener to use ?

    thanks Andre,
    but i have solved my problem in a different way, i have used
    method SetValueAt() of AbstractTableModel which i have used to
    create the table
    actaully my question was little confusing, i wanted
    to add rows as soon as the user has finished entering
    a new row...it would be better if it could be done for
    every cell but that would be more complex...

  • How to add datafile from previous installation to a new one

    Hello,
    I have a new installation Oracle 11g 11.1.0.6 (64b), in addition to that i have a copy (all files - 'cold backup') of my previous installation Oracle 11g 11.1.0.6 (32b). I don't have any backup from expdp or rman. How can I import data from the old installation to the new one? Is there any simple way? When i just overwrite users01.dbf (tablespace users) i get an error when i start my instance:
    ORA-01203: wrong incarnation of this file - wrong creation SCN
    When I overwrite all *.dbf files, control files (*.ctl) and redo logs (*.log) and then when i try connect i get an error:
    ORA-00604: error occurred at recursive SQL level 1
    Does anybody can help me? Any help is highly appreciate.

    856270 wrote:
    Hello,
    I have a new installation Oracle 11g 11.1.0.6 (64b), in addition to that i have a copy (all files - 'cold backup') of my previous installation Oracle 11g 11.1.0.6 (32b). I don't have any backup from expdp or rman. How can I import data from the old installation to the new one? Is there any simple way? When i just overwrite users01.dbf (tablespace users) i get an error when i start my instance:
    ORA-01203: wrong incarnation of this file - wrong creation SCN
    When I overwrite all *.dbf files, control files (*.ctl) and redo logs (*.log) and then when i try connect i get an error:
    ORA-00604: error occurred at recursive SQL level 1
    Does anybody can help me? Any help is highly appreciate.You should do export / import the data using datapump, or transportable tablespace, or through a database link (DBLINK). The method you are trying to do is NOT a solution.

  • How can I create a Standby Database going from AIX to Solaris

    Hello All,
    I need to create a read-only replica of my Oracle 9i database on AIX to a 9i or greater database on Solaris. The replica must recieve the changes to the master database on an interval. The standard DataGuard solution does not support mixed operating systems.
    Is there another way to create the replica? I would prefer not to create triggers on the master tables.
    Your input is appreciated.
    Thanks

    Hi,
    If you just wants to have replication, try materialised view. Hope this will work.
    Regards
    Jomo

  • How to create physical standby database without dataguard

    Hi,
    Can anyone please help me how to create Physical Standby Database without dataguard. As i am using Oracle 10.2.0.1 Standard Edition for production databases.
    Please find the specifications of my server :
    Database : Oracle 10.2.0.1(Standard Edition)
    Server : Linux 4.0(32 bit machine)
    As we know that Dataguard cannot be created in Standard Edition as we dont have that option in this edition. So please help me how to create the physical standby database.
    Thanks in advance.
    Regards,
    Farooq

    Hello,
    I hope this link helps you out...
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/rcmbackp.htm
    http://www.dbasupport.com/oracle/ora10g/manual_standby.shtml
    Thanks & Regards
    Pratik Lakhpatwala
    Jr Oracle DBA
    Edited by: Pratik.L on Dec 31, 2009 12:03 PM

Maybe you are looking for

  • Dynamic Selection on report not working

    Dear all, I have several reports on which the dynamic selection is not working. For instance, the report CN43N. The report is outputting all data in a year i.e it is disregarding the condition I specified in the dynamic selection fields. Is there som

  • Creating a FM Book and then Flash RoboHelp starting from PDF

    At our business we have an SOP (Standard Operating Procedures). There are about 20 chapters. We create them in Publisher and then convert to PDF and then post on our internal Wiki for all to see. This works for us. However, one of the chapters is 49

  • IPad WiFi Disconnect Issue

    I can connect my new iPad to my wiFi router (Actiontec) but after several minutes connection is lost. I need to re-sign in. I worked with Verizon to reset router per Apple instructions (kb/T53304) but nothing helped. Switching from WEP to WPA or WPA2

  • PDF Preview / Pages do not match Aperture

    I am preparing to buy a softcover book. I prepared the book using Aperture 2.1.2, softcover. In Aperture the reverse side of the cover is blank, with page 1 starting on the right, turning the page you get page 2 on the left, 3 on the right, and so on

  • Export to Excel from Analysis - 500 row limit?

    We are encountering this issue where we are not able to export more than 500 rows from the results of the analysis in OBIEE 11g. In EM, there is a setting to limit the number of Excel rows to import and it's set to 10000. Does anyone else have this i