Database backup and Restore do not bring latest Schema/Data.

Hi,
I have scheduled a Full SQL backup for a LIVE database every evening. Now, if I restore this backup to Test environment, it does not bring the changes from LIVE. The script I am using is:
BACKUP DATABASE [XXX_Applications] 
TO  DISK = N'\\XXXX\XXX_Applications.bak' WITH NOFORMAT, 
NOINIT, 
NAME = N'XXXX_Applications-Full Database Backup',
SKIP, 
NOREWIND, 
NOUNLOAD, 
COMPRESSION, 
STATS = 10
GO
declare @backupSetId as int
select @backupSetId = position from msdb..backupset where database_name=N'XXXX_Applications' 
and backup_set_id=(select max(backup_set_id) from msdb..backupset 
where database_name=N'XXXX_Applications' )
--Check for backupSetId  NULL
RESTORE VERIFYONLY FROM  DISK = N'\\XXXX\XXX_Applications.bak' 
WITH  FILE = @backupSetId,  NOUNLOAD,  NOREWIND
I had to manually go to SSMS->Tasks->SQL Backup. Restoring the manual backup brought all the latest changes from live.
Not sure what might be the issue with scripted backup.How do I make sure that Backup generated is correct?
Shady

BACKUP DATABASE [XXX_Applications] 
TO  DISK = N'\\XXXX\XXX_Applications.bak' WITH NOFORMAT, 
NOINIT, 
Hello Shady,
NOINIT means the backup file stays as it is and the new backup is appended to the backup file. With the default RESTORE Syntax you restore the first backup in the file, not the latest backup; therefore you get old data/Schema.
Change it to INIT to clear the backup file first before the backup is added or address the latest backup in the RESTORE command.
Olaf Helper
[ Blog] [ Xing] [ MVP]

Similar Messages

  • 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

  • Not able to sign into Blackberry Protect. Backup and Restore function not working. "Your device isn't associated with a Blackberry ID"

    Not able to sign into Blackberry Protect.  Backup and Restore function not working. Message is: "Your device isn't associated with a Blackberry ID."  My Blackberry Messenger and Blackberry World is working fine so I am sure its not an ID issue on the phone.  I can sign into Link, Blackberry.com and Protect.  I see my device in Protect but cannot send messages or view it on a map.  Times out with cannot reach device message.  BB Protect on Device has a swirling circle beside the on/of switch.  Cannot turn off.  
    I have deleted Link and re-installed.
    I have reset phone to default(factory) and signed in. 
    OS level is 10.2.1.3062
    BB Link is 1.2.3.56
    Solved!
    Go to Solution.

    I managed to figure this out myself. I had to delete the device from the Blackberry Protect website.  protect.blackberry.com.  I wiped my device again and signed in with my Blackberry ID.  I dont know if the step of wiping was necessary as I did not try my backup with the current configuration on the device following the delete.  Restore is in progress for me!

  • Backup and restore buttons not working

    Hi,
    Any button in my backup and restore centre with a shield next to it (for UAC) is not working. Identical to this thread:
    https://social.technet.microsoft.com/Forums/windows/en-US/6a138e65-2834-41ac-bd40-c2344e20b824/backup-and-restore-panel-buttons-not-working
    A fair way down that page, Lokesh replies but I don't have any of the software that he mentions in his post. Is anyone able to help?

    Hi,
    According to the Lokesh's reply, this problem is probably caused by 3rd plugin in Windows Explorer Shell. UAC dialog couldn't be prompt correctly.
    To resolve this problem, you can try to use ShellExViewer instead to make troubleshoot, please follow the content of the link below for more details:
    https://social.technet.microsoft.com/Forums/windows/en-US/5353106e-5b19-4a26-8446-72bedf40b169/rightclick-context-menu-in-desktop-appearing-slow-win-81?forum=w8itprogeneral
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Backup and Restore app not functioning?

    Hello,
    I just factory reset my z3 because stamina mode wasn't working and I wanted to give it a go to see if factory reset would work. I used the built in Backup and Restore app to backup my messages (conversations) to my SD card (everything else was backed up through Google already). Well, every time I hit the restore option it finds the file and acts like it is restoring, only to leave me with nothing. And every time I reset my phone it alerts me that a backup is detected and wants to do a restore.
    Any ideas?

    Try to transfer this backup to internal storage and restore
    For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled.   Richard P. Feynman

  • HT4946 How can you reset a lost password in the itunes backup and restore? Not the apple id and password.

    How do you reset a lost password in the backup and restore section of ITUNES?

    Contact the iTunes Store customer support department through the form at the bottom of their web page and explain the problem to them.

  • Most of my bookmarks disappeared and restore does not bring them back. How do I get my bookmarks back and how do I keep this from happening again?

    The folder that I added to the bookmarks menu has disappeared (along with the subfolders in it). The bookmarks I have that were not organized in a folder (just listed on the bookmarks menu) are still on the bookmarks menu. Tags from the lost bookmarks are still there, but they are empty.
    The "recently bookmarked" option just lists the bookmarks I had added to the bookmark menu (but not put in folders) and the default bookmarks from Mozilla and Windows Live. There were many things in the lost bookmarks that were more recent than these.
    I tried restoring from an automatic backup and that didn't work. My browser history seems accurate though.
    I only have one firefox profile.

    I don't think it is the corrupt localstore.rdf file since none of the problems listed in that article are happening. The disappeared folder and bookmarks do not appear in the sidebar or in the menu.
    I can still add bookmarks and the back/forward navigation still works. I do not want to do anything that will delete my history.
    I downloaded the places.sqlite extension suggested and tried "Rebuild Indices." That did not bring my missing bookmarks back.
    I had it do the "Deep Check" preset and this is what it told me
    > Integrity check
    + The database is sane
    > Coherence check
    + The database is coherent
    > Orphans expiration
    + Database cleaned up
    > Vacuum
    Initial database size is 40960 KiB
    + The database has been vacuumed
    Final database size is 40960 KiB
    > Statistics
    Database size is 40960 KiB
    user_version is 12
    page_size is 4096
    cache_size is 43181
    journal_mode is wal
    synchronous is 1
    History can store a maximum of 58957 unique pages
    Table moz_bookmarks has 104 records
    Table moz_bookmarks_roots has 5 records
    Table moz_keywords has 0 records
    Table sqlite_sequence has 0 records
    Table moz_favicons has 2015 records
    Table moz_annos has 113 records
    Table moz_anno_attributes has 13 records
    Table moz_items_annos has 34 records
    Table moz_places has 53400 records
    Table moz_historyvisits has 85428 records
    Table moz_inputhistory has 448 records
    Table sqlite_stat1 has 15 records
    Index sqlite_autoindex_moz_bookmarks_roots_1
    Index sqlite_autoindex_moz_keywords_1
    Index sqlite_autoindex_moz_favicons_1
    Index sqlite_autoindex_moz_anno_attributes_1
    Index sqlite_autoindex_moz_inputhistory_1
    Index moz_bookmarks_itemindex
    Index moz_bookmarks_parentindex
    Index moz_bookmarks_itemlastmodifiedindex
    Index moz_places_faviconindex
    Index moz_places_hostindex
    Index moz_places_visitcount
    Index moz_places_frecencyindex
    Index moz_places_lastvisitdateindex
    Index moz_historyvisits_placedateindex
    Index moz_historyvisits_fromindex
    Index moz_historyvisits_dateindex
    Index moz_annos_placeattributeindex
    Index moz_items_annos_itemattributeindex
    Index moz_places_url_uniqueindex
    Index moz_bookmarks_guid_uniqueindex
    Index moz_places_guid_uniqueindex
    Trigger moz_bookmarks_beforedelete_v1_trigger

  • SQL Server Database backup and restore issue

    Hi
    I am trying to take a backup of the database and using restore to create  its copy on the same server
    Basically I am following this approach
    http://stackoverflow.com/questions/3912221/ms-sql-2008-create-a-copy-of-the-database-without-the-data 
    Using the restore command is giving me the following error
    RESTORE DATABASE [TargetDB]
    FROM DISK = N'D:\backup.bak' WITH FILE = 1,
    MOVE N'OriginalDB' TO N'D:\sql data\TargetDB.mdf',
    MOVE N'OriginalDB' TO N'C:\SQL Data\TargetDB_1.ldf',
    NOUNLOAD, STATS = 33
    Logical file "ORIGINALDB" is not part of database "TARGETDB" . Use RESTOREFILELIST only to list
    plz suggest as I checked the syntax is fine too as per
    https://technet.microsoft.com/en-us/library/ms190447%28v=sql.105%29.aspx
    I am using SQL Server 2012 

    LogicalName cant be same for mdf and ldf. verify again with FILELISTONLY. Also you have put wrong logical name 
    MOVE N'OriginalDB' TO N'D:\sql data\TargetDB.mdf'
    Please paste the output of
    RESTORE FILELISTONLY FROM DISK = 'D:\backup.bak'

  • Backup and restore the fields in the same date format...

    In the form, there is one date field , the value is entered by using jquery, datepicker. The sceanrio is, after I picking the date value in date field , then I decided to click the back button, moved the precious form then forward again that date field form.. My query is I need to restore and backup the Same format I entered previously..
    Query is When i hit back and forward again the date format will be changed from "2010/02/21" to "2010-01-21 00:0:0 +5:30".
    The below codes were used for picking the date field in the form..
    <script type="text/javascript">
    $(document).ready(function() {
    $(function(){
    $(".date").datepicker({ dateFormat: 'yy/mm/dd' });
    });

    Hi Benjamin,
    you could restore database with new name using below script
    RESTORE
    DATABASEWSS_Content_NewFROMDISK='C:\Program
    Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup\WSS_Content.bak'
    WITH
    MOVE'WSS_Content'TO'C:\Program
    Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\WSS_Content_New.mdf',
    MOVE'WSS_Content_log'TO'C:\Program
    Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\WSS_Content_Newt_log.ldf'
    Regards,
    Regards, <b>Khalil Kothia, PMP </b>
    Blog

  • Erasing old backups using Thinadvantage backup and restore software

    I want to erase 3 old backups on my external USB disk  using the Lenovo backup and restore software  (T500 with latest Lenovo toolbox and other software.)  Everytime I click on "delete" on the line of the backup it goes into "not responding" and forces me to exit the software using the task manager.   The software seems to be hung up, because when I want to disconnect the disk (safely remove hardware) I get a message that "the disk is in use by some software- shut down the software first".  OF course, nothing is running so I have to shut down the computer before disconnecting.   When I start up and reconnect the disk, I have problems disconnecting the disk, even if I haven't used it.   
    Is the problem with the disk or with the software?   Would formatting the disk clear up the problem?  
    Thanks in advance,    Ben . 
    Solved!
    Go to Solution.

    Bent500, welcome to the forum,
    could you try deleting the last backup made on it's own first and when it's finished the others.  Sounds a little crazy, but this works on most occasions.
    Andy  ______________________________________
    Please remember to come back and mark the post that you feel solved your question as the solution, it earns the member + points
    Did you find a post helpfull? You can thank the member by clicking on the star to the left awarding them Kudos Please add your type, model number and OS to your signature, it helps to help you. Forum Search Option T430 2347-G7U W8 x64, Yoga 10 HD+, Tablet 1838-2BG, T61p 6460-67G W7 x64, T43p 2668-G2G XP, T23 2647-9LG XP, plus a few more. FYI Unsolicited Personal Messages will be ignored.
      Deutsche Community     Comunidad en Español    English Community Русскоязычное Сообщество
    PepperonI blog 

  • Automate backup and restore

    Hi All,
    I want to automate backup and restore operation in T-sql script I need to give resource server,database and backup file location as input and then I need to restore that backup in differenet server so I want to give destination server as input too.
    Could somebody help me on it.
    Thanks

     From Google : 
    http://www.sqlservercentral.com/blogs/powersql-by-prashanth-jayaram/2013/08/19/sqlcmd-database-backup-and-restore-automation-quickest-and-simplest-method/
    http://social.technet.microsoft.com/wiki/contents/articles/23800.fully-automated-sql-server-restore-script.aspx
    https://sqlwhisper.wordpress.com/2014/01/31/restore-script/
    Hope it Helps!!

  • What are the commands using in SAP ECC 6.0 ehp on SYBASE Database? Backup and restore commands?

    Hi All,
    What are the commands using in SAP ECC 6.0 ehp on SYBASE Database? Backup and restore commands?

    Hi Jayachander,
    Have a look at these sap notes:
    For taking backup: Schedule from DB13 and get the exact command from Logs
    1841993 - SYB: How to schedule backups in DBA Cockpit
    1887068 - SYB: Using external backup and restore with SAP Sybase ASE
    How to restore DB
    1611715 - SYB: How to restore a Sybase ASE database server (Windows)
    Divyanshu

  • Backup and Restore of DQS (Data Quality Service SQL 2012) Databases

    We are currently using DPM 2010 running on Server 2008 R2 as our backup solution.  We will soon be leveraging the Data Quality Services in SQL 2012 along with the Master Data Service.  
    In the SQL 2012 documentation from Microsoft it states, “The backup and restore operations of the DQS databases must be synchronized.” 
    Otherwise the restored Data Quality Server will not be functional.  Currently I believe that DPM will run serialized backups of databases from one SQL server. 
    I was hoping someone could point me towards some documentation for backing up DQS with DPM. 
    Is anybody currently doing this?  If so have you been successful restoring?

    LogicalName cant be same for mdf and ldf. verify again with FILELISTONLY. Also you have put wrong logical name 
    MOVE N'OriginalDB' TO N'D:\sql data\TargetDB.mdf'
    Please paste the output of
    RESTORE FILELISTONLY FROM DISK = 'D:\backup.bak'

  • Backup and restore a olite database.

    Hi,
    i would like to know, if is it possible to backup and restore a olite database on a MUC (mobile unite computer).
    Is there a war we can export/import, datapump or generate a xml file and put it back in the database on demand.
    Some clients can be more then two weeks between a synchro. We would like to backup the database on the MUC itself incase of a corruption and be able to restore it, and do the syn before the corruption or problem append.
    We are just looking for a solution and not lost any data upadte or insert by the client (not do a complet refresh before the crash).
    Thanks
    Ron

    The Oracle Database Lite Load Utility (olload) enables you to load data from an
    external file into a table in Oracle Database Lite, or to unload (dump)
    data from a table in Oracle Database Lite to an external file. Please see the Client Guide in Oracle Lite 10.3.0.2.0

  • HT4528 My apps store will not go online with verizon network, but on wifi it works. I am on an iphone 4, verizon.  I tried to do a complete, backup and restore on the phone 1 day before i noticed this problem,  The backup finished the RESTORE would fail c

    My apps store will not go online with verizon network, but on wifi it works. I am on an iphone 4, verizon.  I tried to do a complete, backup and restore on the phone 1 day before i noticed this problem,  The backup finished but the RESTORE would fail I had an error, could not access Apple server ( some server name I cant remember).
    I have plenty of space available on the iphone,
    8gb free,
    ios version- 6.1.3 ( 10B329)
    carrier - Verizon 14.0
    Modem Firmware - 3.0.04
    Can someone help.
    I tried doing my backup restore on the same computer as I once did a year ago. and THis time I cant do the restore on the iphone.
    computer osx is 10.5.8
    itunes version 10.
    I do not wish to go to ios 7 at this time.

    Settings > General > Reset > Reset Network Settings.
    Basic troubleshooting is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.
    If the issue continues, contact the carrier to troubleshoot the network connectivity issues.

Maybe you are looking for

  • Can't import shared libary into Itunes on Win 7 64 bit

    I have installed itunes 9 onto win7 64 bit and have turned on home sharing. I can see the library from my macbook pro. However, I cannot drag the any content from my mac shared library to my library on my windows pc. How can I solve this issue? HELP!

  • Settinf selection fields in Report painter

    hi, i need to know how to select fields in report painter as selection fields or input fields? i just have an idea of library where we select fields. but how to select selection screen fields?

  • What it means iwl3945: Could not read microcode: -2 ?

    My iwl3945 module work fine ( intel pro/wireless 3945abg ). I put it in /etc/rc.conf 1) MODULES=( ... iwl3945 ...) 2) wlan0="dhcp" INTERFACES=(lo wlan0 ...) and in /etc/conf.d/wireless 1) wlan_wlan0="wlan0 mode managed essid MariaTeresa channel 7 ap

  • Customer Sales per Internal Order

    We book Sales through a JV. All my debit and credit posting to a customer are with reference to a Internal order . Now i want a report wherein i can get to know that how much is the debit and credit in a customer account per internal order. My proble

  • Bar chart color

    I have the following code snippet that uses JFreeChart to plot a bar chart and it works perfectly fine. I was wondering if there was a way to choose what color you want the bars to be? For right now, it always defaults to red and I just can't figure