Query: Tablespace backup Vs Full database backup

Which is an better option- Tablespace Backup or Full database backup.What are the adv and disadv of each?
Rgds,

RMAN> backup tablespace users;
Starting backup at 27-AUG-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u02/oradata/TEST/datafile/o1_mf_users_6o06qs2q_.dbf
channel ORA_DISK_1: starting piece 1 at 27-AUG-11
channel ORA_DISK_1: finished piece 1 at 27-AUG-11
piece handle=/u02/fra/TEST/backupset/2011_08_27/o1_mf_nnndf_TAG20110827T163233_75l0015r_.bkp tag=TAG20110827T163233 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-AUG-11

Similar Messages

  • Urgent -- need to restore table from full database backup

    Hello,
    Can somebody tell me the process for restoring just a table from a full database backup?
    I did a full online database backup yesterday, and one of my tables got ruined today. I need to restore it as soon as possible, but I don't know how. When I tried flashback tables, it said that feature wasn't enabled. Should I restore the datafile or the tablespace?
    Thanks much,
    Nora

    If you only want to recover the table and not the other objects in the tablespace, and assuming the table was damaged by a user statement (and not, say, block corruption), you would need to recover your backup to a different system, export the table that was damaged, and import the table into your real production database. If you can recover the entire tablespace to an earlier point in time, or if you can lose some committed changes to other database objects, you may have other options.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Full database backup and restore

    I have a doubt on the syntax for a full database backup and restore. For a single schema, the syntax for backup & restore is :-
    exp JISPREPCORBILLINGPRD501/JISPREPCORBILLINGPRD501 owner=JISPREPCORBILLINGPRD501 STATISTICS=none
    log=JISPREPCORBILLINGPRD501_exp.log grants=y constraints=Y rows=y compress=N
    file=JISPREPCORBILLINGPRD501
    imp <userid/password> file=<export dump file location> fromuser=<export user name> touser=<import user name>
    grants=y constraints=Y rows=y log=<import log file location>
    I hope, my question is clear.
    Please, help in solving the doubt.
    regards

    hi,
    thanks, for your answer. I took a export of one schema of the database. But, when I tried to import the schema to the destination database, it showed
    imported with errors with the existence of functions showing. The commands used by me for export and import are as follows:-
    exp JISPREPCORBILLINGPRD501/JISPREPCORBILLINGPRD501 owner=JISPREPCORBILLINGPRD501 STATISTICS=none log=JISPREPCORBILLINGPRD501_exp.log grants=y constraints=Y rows=y compress=N file=JISPREPCORBILLINGPRD501
    imp JISPREPCORBILLINGPRD501/JISPREPCORBILLINGPRD501 file=JISPREPCORBILLINGPRD501 fromuser=JISPREPCORBILLINGPRD501 touser=JISPREPCORBILLINGPRD501 grants=y constraints=Y rows=y log=JISPREPCORBILLINGPRD501_imp.log
    Do, we need to drop the existing schema before importing or somethinig else. Please, help.
    regards

  • Full Database Backup

    Hi people,
    I´ve the next doubt about the backups of MS SQL Server.
    If I make a full database backup, the transaction log (SIDLOG1) are backed? Or I´ve to do the backup of transactional log separated?
    In the note Note 44449 - Backup strategies with the SQL server, says this:
    "If you run a complete database backup, the contents of the transaction log are saved (database dump), but the log is not shortened. The transaction log is only shortened when you save the log (transaction dump)."

    A FULL SQL backup includes all of the changes that are contained in the LOG file, so that the backup is recoverable to any point in time from the beginning to the end of the time it takes to backup the database.  However, it does NOT truncate the log file because you may still need a log backup in order to be recoverable to a point in time AFTER the FULL backup mentioned earlier, or if you have to utilize a different FULL backup in the event the other backup is corrupted, lost, etc.
    For example:
    Full backup A taken 11/8/2010, begin 8:00 AM, completed 9:00 AM.
    Transaction Log backup 1 taken 11/8/2010, 11:00 AM
    Transaction Log backup 2 taken 11/8/2010, 3:00 PM
    Transaction Log backup 3 taken 11/8/2010, 7:00 PM
    Full backup B taken 11/9/2010, begin 8:00 AM, completed 9:00 AM.
    Transaction Log backup 4 taken 11/9/2010, 11:00 AM
    Transaction Log backup 5 taken 11/9/2010, 3:00 PM
    Transaction Log backup 6 taken 11/9/2010, 7:00 PM
    If you need to recover to point in time 11/9/2010 at 8:30 AM, all you need is Full backup B.
    If you need to recover to point in time 11/9/2010 at 5:00 PM, you need Full backup B, and Transaction Logs 4, 5, and 6.
    If you need to recover to point in time 11/9/2010 at 5:00 PM, and Full backup B is corrupted, you need Full backup A, and Transaction Logs 1, 2, 3, 4, 5, and 6.
    If Full backup B had truncated the log, then you would not be recoverable to any point in time after 7:00 PM on 11/8/2010.

  • Full Database Backup in DB13 for MS SQL Server databases

    Hello,
    We have some SAP systems using the MS SQL Server database. I want to know if it is possible to setup the Full Database Backup option in transaction DB13 to store the files in a hard disk space.
    I already did this type of configuration in SAP systems in Oracle databases and for this I used the init<SID>.sap where we can put all the configuration, for instance the disk path where we want to save the backup files! But for MS SQL Server databases, in DB13, I don´t know how to do that, when I add the "Full Database Backup" option in DB13, this show me some options but only for tape, but I don´t want to store the backup files in tapes, I want to store/save the files on the server disk itself or else to an external disk but I don´t see where I can set this way of storage!
    This is what you see in DB13 (when using a MS SQL Server database) in "Full Database Backup" and as you see I only have options for TAPE not for a disk or other type of storage! How can I do that? (if that is possible):
    Can you help me please?
    Kind regards,
    samid raif

    Hello Raja
    Sorry for the delay of my answer! Many thanks for that tip, it helps a lot and it solve the last error/problem that I reported here, in fact, the problem was we had named the device with two words containing a space. So we removed that space from the backup device (in SQL management studio) with one word only and the job runs successfully without any errors!
    It works in Development and Quality systems but in our Production system (AM1) the Full backup option in DB13 stopped with the following error, in fact the error is on verification of backup, it means that the Full backup finished with success, but when it does the backup verification, the job in DB13 stops with an error, the following one:
    ***************************** SQL Job information   ******************************
    Jobname:    SAP CCMS Full DB Backup of AM1 [20140417103726-4-103726]
    Type:       TSQL
    DB-Name:    AM1
    For Run:    20140417  10:37:26
    **************************** Job history information  *****************************
    Stepname:   CCMS-step 1
    Command:    declare @exeStmt nvarchar(2000) exec am1.sap_backup_databases @dbList=
                "AM1",@r3Db="AM1",@bDev="fullprd",@expDays= 27,@jobName= "SAP CCMS Ful
                l DB Backup of AM1 [20140417103726-4-103726]",@bkupChecksum="Y",@bkupT
                ype="F",@nativeBkup="N",@exeDate = "20140417103726",@bkupSim = "N",@fo
                rmat = 0,@init = 0,@bkupDb = "AM1",@unload = 0,@exeStmt = @exeStmt OUT
                PUT
    Status:     (success)
    Message:    3014
    Severity:                                                                                                                                                                                                                                                    0
    Duration:   4  hours(s)  41 min(s) 22 sec(s)
    Last msg:   Executed as user: am1. Processed 7434328 pages for database 'AM1', fil
                e 'A01DATA1' on file 1. [SQLSTATE 01000] (Message 4035)  Processed 315
                1504 pages for database 'AM1', file 'A01DATA2' on file 1. [SQLSTATE 01
                000] (Message 4035)  Processed 4574152 pages for database 'AM1', file
                'A01DATA3' on file 1. [SQLSTATE 01000] (Message 4035)  Processed 44363
                92 pages for database 'AM1', file 'A01DATA4' on file 1. [SQLSTATE 0100
                0] (Message 4035)  Processed 25598 pages for database 'AM1', file 'A01
                LOG1' on file 1. [SQLSTATE 01000] (Message 4035)  BACKUP DATABASE succ
                essfully processed 19621974 pages in 16881.638 seconds (9.521 MB/sec).
                 [SQLSTATE 01000] (Message 3014).  The step succeeded.
                        <------------- End of Job Step History --------------->
    Stepname:   CCMS-step 2
    Command:    declare @exeStmt nvarchar(2000) exec am1.sap_verify_backups @nativeBku
                p = "N",@bkupSim = "N",@bDev = "fullprd",@bkupChecksum = "Y",@exeDate
                = "20140417103726",@unload = 1,@dbCnt =1,@exeStmt = @exeStmt OUTPUT
    Status:     (failure)
    Message:    3201
    Severity:                                                                                                                                                                                                                                                   16
    Duration:   0  hours(s)  8  min(s) 30 sec(s)
    Last msg:   Executed as user: am1. Cannot open backup device 'fullprd(\\10.0.0.45\
                backupsap\prd\prdfullqua.bak)'. Operating system error 1265(error not
                found). [SQLSTATE 42000] (Error 3201).  The step failed.
                        <------------- End of Job Step History --------------->
    **************************** Job history information  *****************************
    Can you help me please with this one!? Can you tell me why in verification it stops with that error?
    Kind regards,
    samid raif

  • DB13 Full Database Backup - Error

    Hello Everybody,
    Got this error with DB13 Full Database Backup.
    2006-05-28 07:20:13.92 spid91    BackupMedium::ReportIoError: read failure on backup device '
    ERB-HQ-BK2\SAPBK\DVE.BAK'.
    Operating system error 59(An unexpected network error occurred.).
    2006-05-28 07:20:13.93 spid91    Internal I/O request 0x0000000089028080: Op: Read, pBuffer: 0x00000000069D0000, Size: 65536, Position: 111032779264, UMS: Internal: 0x89029FE8, InternalHigh: 0x89028140, Offset: 0xDA11C200, OffsetHigh: 0x19, m_buf: 0x00000
    000069D0000, m_len: 65536, m_actualBytes: 0, m_errcode: 59, BackupFile:
    ERB-HQ-BK2\SAPBK\DVE.BAK
    Best Regards.
    Darwin

    Darwin,
    Seems like the system is not recognizing your backup device. Have you verified that it installed/configured properly.

  • Parrallelization of RMAN Full Database Backup Confusion

    Hi,
    I am running Oracle 10gR2 on Solaris 5.10 on sparc machine having 16 CPUs.
    I am using following RMAN script to take full database backup:
    #!/bin/bash
    ORACLE_HOME=/u01/app/oracle/product/10g
    PATH=$ORACLE_HOME/bin:$PATH
    ORACLE_SID=mtcedwp
    export ORACLE_HOME ORACLE_SID PATH
    rman target / <<EOF
    run
    CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
    CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 8;
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    ALLOCATE CHANNEL d1 DEVICE TYPE DISK;
    ALLOCATE CHANNEL d2 DEVICE TYPE DISK;
    ALLOCATE CHANNEL d3 DEVICE TYPE DISK;
    ALLOCATE CHANNEL d4 DEVICE TYPE DISK;
    ALLOCATE CHANNEL d5 DEVICE TYPE DISK;
    ALLOCATE CHANNEL d6 DEVICE TYPE DISK;
    ALLOCATE CHANNEL d7 DEVICE TYPE DISK;
    ALLOCATE CHANNEL d8 DEVICE TYPE DISK;
    BACKUP TAG ATHEER_FULL_DB DATABASE FORMAT '/u01/BACKUPS/WEEKLY_DB_BACKUP/backup_%U';
    CROSSCHECK BACKUPSET;
    CROSSCHECK BACKUP;
    DELETE NOPROMPT OBSOLETE;
    RELEASE CHANNEL d1;
    RELEASE CHANNEL d2;
    RELEASE CHANNEL d3;
    RELEASE CHANNEL d4;
    RELEASE CHANNEL d5;
    RELEASE CHANNEL d6;
    RELEASE CHANNEL d7;
    RELEASE CHANNEL d8;
    EOFWill the above script take the 8-way parrallel backup? or do I need to configure location for every channel separately?
    regards

    This channel can be allocated manually or can be pre-configured by using
    automatic channel allocation.
    The number of allocated channels determines the maximum degree of
    parallelism that is used during backup restore or recovery. For example if
    you allocate 8 channels for a backup operation 8 background processes for the
    operation can run concurrently.
    Parallelism of backup sets allocates multiple channels and assigns
    files to specific channels. You can configure parallel backups by setting a
    PARALLELISM option of the CONFIGURE command to a value greater than 1 or by
    manually allocating multiple channels.
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmconc1.htm#i1012864

  • Command - Take a full database backup

    Hi,
    I have to simulate a database failure. However prior to doing so, I have to take a "Take a full database backup". How do I execute this command? It is my understanding that this is different from selecting "Backup database"
    Thanks in advance for the help!
    Edited by: 976505 on Dec 18, 2012 12:17 PM

    Pl do not post duplicate threads - Oracle 11g XE - Backup

  • Problem with full database backup.

    This is what I got after execute backup full database statement
    "RMAN-03009: failure of backup command on ORA_DISK_1 channel at 03/03/2009 14:15:15
    ORA-19502: write error on file "/u01/app/oracle/backup/ORCL/ora_df680537660_s2_s1", blockno 25985 (blocksize=8192)
    ORA-27072: File I/O error
    Linux Error: 2: No such file or directory
    Additional information: 4
    Additional information: 25985
    Additional information: 483328"
    I have quite the same problem with create tablespace, I can't create tablespace 512m, but I can create the same tablespace only 100m.
    I think it must be somethink with storage???

    Starting backup at 03-MAR-09
    using channel ORA_DISK_1
    input datafile fno=00015 name=/u01/app/oracle/oradata/o2_mf_system_48fprop3_.dbf
    input datafile fno=00003 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_48fpropg_.dbf
    input datafile fno=00014 name=/u01/app/oracle/oradata/o2_mf_sysaux_48fpropg_.dbf
    input datafile fno=00005 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_example_48fpw04c_.dbf
    input datafile fno=00017 name=/u01/app/oracle/oradata/ORCL/datafile/rcvcat01.dbf
    input datafile fno=00002 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_48fprovo_.dbf
    input datafile fno=00016 name=/u01/app/oracle/oradata/inventory03.dbf
    input datafile fno=00011 name=/u01/app/oracle/oradata/ORCL/datafile/inventory01.dbf
    input datafile fno=00012 name=/u01/app/oracle/oradata/ORCL/datafile/inventory02.dbf
    input datafile fno=00006 name=/u01/app/oracle/oradata/ORCL/datafile/ts01.dbf
    input datafile fno=00008 name=/u01/app/oracle/oradata/ORCL/datafile/ts02.dbf
    input datafile fno=00001 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_48fprop3_.dbf
    channel ORA_DISK_1: specifying datafile(s) in backupset
    channel ORA_DISK_1: starting full datafile backupset
    input datafile fno=00009 name=/u01/app/oracle/oradata/ORCL/datafile/undo01.dbf
    channel ORA_DISK_1: starting piece 1 at 03-MAR-09
    input datafile fno=00013 name=/u01/app/oracle/oradata/ORCL/datafile/val01.dbf
    input datafile fno=00007 name=/u01/app/oracle/oradata/ORCL/datafile/test_reorg0
    input datafile fno=00004 name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_48fprowb_.dbf
    input datafile fno=00010 name=/u01/app/oracle/oradata/ORCL/datafile/ts01b.dbf
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 03/03/2009 14:15:15
    ORA-19502: write error on file "/u01/app/oracle/backup/ORCL/ora_df680537660_s2_s1", blockno 25985 (blocksize=8192)
    ORA-27072: File I/O error
    Linux Error: 2: No such file or directory
    Additional information: 4
    Additional information: 483328
    Additional information: 25985
    Directory exist because I can backup single tablespace, into the same directory, I just can't backup whole database.
    Edited by: val75 on Mar 3, 2009 1:57 PM

  • Restore a single table from full database backup

    Hi,
    I have a full database (10.2.0.1) backup with RMAN.
    Suddenly a table got truncated. How to get back that table without restoring and recovering the full database (Point in time recovery) since if I restore the database to an earlier time then the other transactions will hamper.
    Also creating a standby database and import export the table will solve my problem. But is there any other way to restore the lost table.
    Thanks in advance.

    No other way to restore the data if you don't want do point in time recovery. If you drop the table then you can restore it from the recyclebin but for the truncate operation it won't help. If you have enabled the flash back table for that particular table then you can restore the data for only that table.
    Regards
    Asif Kabir

  • Tablespace Restore From Whole Database Backup

    Hi
    I tooks whole database backup.
    BACKUP DATABASE;
    Note:- No saperate tablespaces backup.
    After that, if required I use to restore saprate tablespace from above backup.
    RESTORE TABLESPACE tb_1;
    RECOVER TABLESPACE tb_1;
    Is this tecnique recomanded or not?
    Wishes
    Jawad

    There's no need to recover the whole database, if only one component has a failure. Tablespace recovery will only work, if the database runs in archivelog mode.

  • Estimating the backup size for full database backup?

    How to estimate the backup file size for the following backup command?
    Oracle 10g R2 on HPUX
    BACKUP INCREMENTAL LEVEL 0 DATABASE;
    Thank you,
    Smith

    Depends on the number of used blocks, block size etc. You could probably get a rough formula for backup size based on the contents of dba_tab_statistics (subtract empty_blocks), dba_ind_statistics etc.

  • Database backup problem in DB13

    Dear All,
    <b>When we take backup from the command prompt using Brbackup or Brarchive it executes the backup process successfully, but when I schedule the same thing in the DBA calendar it shows that job finished but it actually  does not take the backup. I have given all parameter required for the backup in the DBA calendar like eg, the  scheduled time, the tape generic name, archive type.</b>
    Can anybody guide what is going wrong ...because of that I am not able to schedule backup using DB13 tcode.
    At present I am using Brtools( Brbackup) to take the backup.
    Thanks in adv.
    Bhaskar

    Dear Mr. Fidel,
    Thanks for your reply.
    My operating system is Windows 2003.
    I am loged in with <SID>adm.
    When I use DB13 to schedule the backup (online full database backup) it completes sucussfully......but if I choose to schedule backup(online full database + redo logs file) after taking backup of the database when it to take redo logs file give an error message as:-----
    <b>I am giving lines where the error occurs...</b>
    BR0280I BRBACKUP time stamp: 2007-06-27 19.32.19
    BR0063I 43 of 43 files processed - 120279.500 MB of 120279.500 MB done
    BR0204I Percentage done: 100.00%, estimated end time: 19:32
    BR0001I **************************************************
    BR0280I BRBACKUP time stamp: 2007-06-27 19.32.23
    BR0340I Switching to next online redo log file for database instance MRP ...
    BR0321I Switch to next online redo log file for database instance MRP successful
    BR0117I ARCHIVE LOG LIST after backup for database instance MRP
    Parameter                      Value
    Database log mode              Archive Mode
    Automatic archival             Enabled
    Archive destination            F:\oracle\MRP\oraarch\MRParch
    Archive format                 ARC%S_%R.%T
    Oldest online log sequence     3173
    Next log sequence to archive   3176
    Current log sequence           3176       SCN: 33992945
    Database block size            8192       Thread: 1
    BR0018I Waiting for the next offline redo log file...
    BR0017E Offline redo log file E:\oracle\MRP\102\RDBMS\ARC03175_0603728372.001 not found
    BR0056I End of database backup: bdvoqpkp.ant 2007-06-27 19.32.28
    BR0280I BRBACKUP time stamp: 2007-06-27 19.32.28
    BR0054I BRBACKUP terminated with errors
    thanks.

  • [Forum FAQ] How do I restore the CDC enabled database backups (FULL + DIFF) while maintaining the CDC integrity

    Question
    Background: When restoring Full + DIFF backups of a Change Data Capture (CDC) enabled database to a different SQL server, the CDC integrity is not being maintained. We did RESTORE the databases with the KEEP_CDC option.
    How do I successfully restore the CDC enabled database backups (FULL + DIFF) while maintaining the CDC integrity?
    Answer
    When restoring a CDC enabled database on a different machine that is running SQL Server, besides using use the KEEP_CDC option to retain all the CDC metadata, you also need to add Capture and Cleanup jobs. 
    In addition, as you want to restore FULL + DIFF backups of a CDC enabled database, you need to note that the KEEP_CDC and NoRecovery options are incompatible. Use the KEEP_CDC option only when you are completing the recovery. I made a test to display
    the whole process that how to restore the CDC enabled database backups (FULL + DIFF) on a different machine.
    Create a database named ’CDCTest’ in SQL Server 2012, then enable the CDC feature and take full+ differential backups of the database.
    -- Create database CDCTest
    CREATE DATABASE [CDCTest] ON  PRIMARY
    ( NAME = N'CDCTest ', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\ CDCTest.mdf' , SIZE = 5120KB ,
    MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
     LOG ON
    ( NAME = N'CDCTest _log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\ CDCTest _log.LDF' , SIZE = 3840KB ,
    MAXSIZE = 2048GB , FILEGROWTH = 10%)
    GO
    use CDCTest;
    go
    -- creating table
    create table Customer
    custID int constraint PK_Employee primary key Identity(1,1)
    ,custName varchar(20)
    --Enabling CDC on CDCTest database
    USE CDCTest
    GO
    EXEC sys.sp_cdc_enable_db
    --Enabling CDC on Customer table
    USE CDCTest
    GO
    EXEC sys.sp_cdc_enable_table
    @source_schema = N'dbo',
    @source_name = N'Customer',
    @role_name = NULL
    GO
    --Inserting values in customer table
    insert into Customer values('Mike'),('Linda')
    -- Querying CDC table to get the changes
    select * from cdc.dbo_customer_CT
    --Taking full database backup
    backup database CDCTest to disk = 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup\ CDCTest.bak'
    insert into Customer values('David'),('Jane')
    -- Querying CDC table to get the changes
    select * from cdc.dbo_customer_CT
    --Taking differential database backup
    BACKUP DATABASE CDCTest TO DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup\ CDCTestdif.bak' WITH DIFFERENTIAL
    GO
    Restore Full backup of the ‘CDCTest’ database with using KEEP_CDC option in a different server that is running SQL Server 2014.
    Use master
    Go
    --restore full database backup
    restore database CDCTest from disk = 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\Backup\CDCTest.bak' with keep_cdc
    Restore Diff backup of the ‘CDCTest’ database.
    Restore Database CDCTest From Disk = 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\Backup\CDCTest.bak'
        With Move 'CDCTest' To 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\DATA\CDCTest.mdf',
            Move 'CDCTest _log' To 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\DATA\CDCTest _log.LDF',
            Replace,
            NoRecovery;
    Go
    --restore differential database backup
    restore database CDCTest from disk = 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\Backup\CDCTestdif.bak' with keep_cdc
    Add the Capture and Cleanup jobs in the CDCTest database.
    --add the Capture and Cleanup jobs
    Use CDCTest
    exec sys.sp_cdc_add_job 'capture'
    GO
    exec sys.sp_cdc_add_job 'cleanup'
    GO
    insert into Customer values('TEST'),('TEST1')
    -- Querying CDC table to get the changes
    select * from cdc.dbo_customer_CT
    Reference
    Track Data Changes (SQL Server)
    Restoring a SQL Server database that uses Change Data Capture
    Applies to
    SQL Server 2014
    SQL Server 2012
    SQL Server 2008 R2
    SQL Server 2008
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Question
    Background: When restoring Full + DIFF backups of a Change Data Capture (CDC) enabled database to a different SQL server, the CDC integrity is not being maintained. We did RESTORE the databases with the KEEP_CDC option.
    How do I successfully restore the CDC enabled database backups (FULL + DIFF) while maintaining the CDC integrity?
    Answer
    When restoring a CDC enabled database on a different machine that is running SQL Server, besides using use the KEEP_CDC option to retain all the CDC metadata, you also need to add Capture and Cleanup jobs. 
    In addition, as you want to restore FULL + DIFF backups of a CDC enabled database, you need to note that the KEEP_CDC and NoRecovery options are incompatible. Use the KEEP_CDC option only when you are completing the recovery. I made a test to display
    the whole process that how to restore the CDC enabled database backups (FULL + DIFF) on a different machine.
    Create a database named ’CDCTest’ in SQL Server 2012, then enable the CDC feature and take full+ differential backups of the database.
    -- Create database CDCTest
    CREATE DATABASE [CDCTest] ON  PRIMARY
    ( NAME = N'CDCTest ', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\ CDCTest.mdf' , SIZE = 5120KB ,
    MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
     LOG ON
    ( NAME = N'CDCTest _log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\ CDCTest _log.LDF' , SIZE = 3840KB ,
    MAXSIZE = 2048GB , FILEGROWTH = 10%)
    GO
    use CDCTest;
    go
    -- creating table
    create table Customer
    custID int constraint PK_Employee primary key Identity(1,1)
    ,custName varchar(20)
    --Enabling CDC on CDCTest database
    USE CDCTest
    GO
    EXEC sys.sp_cdc_enable_db
    --Enabling CDC on Customer table
    USE CDCTest
    GO
    EXEC sys.sp_cdc_enable_table
    @source_schema = N'dbo',
    @source_name = N'Customer',
    @role_name = NULL
    GO
    --Inserting values in customer table
    insert into Customer values('Mike'),('Linda')
    -- Querying CDC table to get the changes
    select * from cdc.dbo_customer_CT
    --Taking full database backup
    backup database CDCTest to disk = 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup\ CDCTest.bak'
    insert into Customer values('David'),('Jane')
    -- Querying CDC table to get the changes
    select * from cdc.dbo_customer_CT
    --Taking differential database backup
    BACKUP DATABASE CDCTest TO DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup\ CDCTestdif.bak' WITH DIFFERENTIAL
    GO
    Restore Full backup of the ‘CDCTest’ database with using KEEP_CDC option in a different server that is running SQL Server 2014.
    Use master
    Go
    --restore full database backup
    restore database CDCTest from disk = 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\Backup\CDCTest.bak' with keep_cdc
    Restore Diff backup of the ‘CDCTest’ database.
    Restore Database CDCTest From Disk = 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\Backup\CDCTest.bak'
        With Move 'CDCTest' To 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\DATA\CDCTest.mdf',
            Move 'CDCTest _log' To 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\DATA\CDCTest _log.LDF',
            Replace,
            NoRecovery;
    Go
    --restore differential database backup
    restore database CDCTest from disk = 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\Backup\CDCTestdif.bak' with keep_cdc
    Add the Capture and Cleanup jobs in the CDCTest database.
    --add the Capture and Cleanup jobs
    Use CDCTest
    exec sys.sp_cdc_add_job 'capture'
    GO
    exec sys.sp_cdc_add_job 'cleanup'
    GO
    insert into Customer values('TEST'),('TEST1')
    -- Querying CDC table to get the changes
    select * from cdc.dbo_customer_CT
    Reference
    Track Data Changes (SQL Server)
    Restoring a SQL Server database that uses Change Data Capture
    Applies to
    SQL Server 2014
    SQL Server 2012
    SQL Server 2008 R2
    SQL Server 2008
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

  • Undo tablespace currupt and no clean backup

    Hello,
    We are facing critical problem with database. We have not any clean backup and database in no archive log mode. Suddenly database is shutdown and when we are trying to open database it is giving error:-
    ORA-01172: recovery of thread 1 stuck at block 350230 of file 3
    ORA-01151: use media recovery to recover block, restore backup if needed
    File 3 is Undo file.
    Is there any way to open database?
    Thanks in advance and please reply us ASAP.

    1) First, follow Howardjr recomendations and allways do a backup first.
    2) Open a SR with Metalink to help with your problem
    3) If you want to try something here are some options, but never skip the point 1 previously explained.
    Well, you have two possible scenarios, one supported other unsupported.
    This is an inconsistency issue..
    Solution
    ============
    *1]Supported Solution:*
    Restore-Incomplete recovery the DB from backup or rebuild the DB using an export dump.
    *2]Internal (Not-supported) Solution:*
    Update undo$ to change the status$ = 1 (undo segment is dropped) for the corrupted undo segment.
    Caution:
    This is NOT a supported solution. Therefore ensure that a full database cold backup is taken bbefore doing this data-dictionary patching.
    Steps to do the patching:
    1) First ensure that a full database backup is taken.
    2) Modify/add the following parameters in initSID.ora:
    undo_management=manual
    job_queue_processes =0
    aq_tm_processes=0
    systemtrig_enabled=false
    3) Shutdown
    4) Startup restrict pfile
    5) set transaction use rollback segment system;
    if set transaction above fails, then not to proceed further.
    6) Update undo$ to change the status$ = 1 (undo segment is dropped) for
    the corrupt undo segment.
    update undo$ set status$ = 1
    where us# = <'undo segment id'>
    and ts#=<'tablespace id'>
    and file#=<'file id'>
    and block# = <'block id'>
    and status$=2;
    or
    update undo$ set status$ = 1
    where name = <'corrupt undo segment name'>
    and status$=2;
    This will update only 1 row. Rollback the update if more than 1 row is updated.
    7) Commit;
    8) Shutdown abort
    9) Set back in init.ora parameters modified in Step 2.
    Startup restrict
    10) Drop the corrupt undo tablespace using command:
    drop tablespace <corrupt undo tablespace name> including contents;
    11) Create new undo tablespace.
    In initSID.ora, set undo_management=auto, undo_tablespace=<'new undo tablespace name'>
    Restart the instance.
    12) Take a backup.
    *Parameter offlinerollback_segments is not useful:*
    Trying to drop the corrupt undo segment or the undo tablespace by setting parameters undo management=manual and offline_rollback_segments in initSID.ora will fails with error: ORA-00600 [ktssdrp1].
    To see the information about the corrupt block use this query:
    select us#, name, ts#, file#, block#,status$ from undo$
    where (ts#, file#, block#) not in
    (select ts#, file#, block# from seg$ where type# in (1,10)) and status$ > 1;I had the same problem some time ago, and the unsupported solution works great, but never try it without a full backup first.
    Cheers,
    Francisco Munoz Alvarez
    http://oraclenz.wordpress.com
    Edited by: F.Munoz Alvarez on Nov 30, 2012 11:03 AM

Maybe you are looking for

  • Replacing HD on MacBook Pro

    I own a MacBook Pro with a 250 GB 5400 RPM HD. Am I able to replace it with a HGST Travelstar 7K1000 2.5-Inch 1TB 7200 RPM SATA III 32MB Cache Internal Hard Drive 0J22423?  I don't know a whole lot on replacing hard drives and I didn't know if I need

  • Propagation is too slow

    I preapared replication between two databases 11g release 1. Everything works fine but propagation is too slow. Propagation of a single row takes from 2 to 40 seconds. Why there are such differences? I tried few different values for job_queue_interva

  • Jpg could not be converted

    Hi, I send an email to the iprint appliance from thunderbird with a jpg file inside the email. Then i received this error message : Failed to print the job. Error occurred during document conversion. Job List Document: EmailBody.txt Status: Error in

  • CS4 or 5 install breaks DVD formatting in Win7?

    Searching for the reason I cannot get Windows 7 (64-bit Home Premium) to format a CD or DVD before burning I came across a refererence to such problems started by CS4 or 5 installs. Strange connection, but I believe this was Sony engineers making the

  • I keep getting an "unknown error" in App Store

    Help please! when I try to purchase an App from the store it gives me an "unknown error" and won't let me purchase anything. can anyone help?