How to catch output message on backup completion/failure?

Hello. The problem is as follows. SQL Express 2008 R2,
backup is made by the means of bat file and sp. Need to have a table that would
hold columns like 'date_of_backup', 'duration', 'message' (the one that appears
on 'messages' tab in the result area after backup completion/failure). Didn't
manage to find sufficient info on this topic. Please, help me resolve this
issue. I will be very grateful for assistance. This is an example of real
message that I want to catch:
Server: Msg 911, Level 16, State 11, Line 1
Database 'not_existing_db' does not exist. Make sure that the name is
entered correctly.
Server: Msg 3013, Level 16, State 1, Line 1
BACKUP
DATABASE is terminating abnormally.

Hi GeorgeKochkin,
As Shanky post, you can review or monitor the single database backups via the above scripts. You also can find the backup history for all the databases on a single instance. The following script shows the database backups status, history of their when they
are done based on schedule, at where are taking and when, backup types , backups physical device and size of the database backups and time to perform backup and all other related backup statistics.
USE msdb
GO
SELECT bs.server_name AS Server,-- Server name
bs.database_name AS DatabseName,-- Database name
CASE bs.compatibility_level
WHEN 80 THEN 'SQL Server 2000'
WHEN 90 THEN 'SQL Server 2005 '
WHEN 100 THEN 'SQL Server 2008'
WHEN 110 THEN 'SQL Server 2011'
END AS CompatibilityLevel,
-- Return backup compatibility level
recovery_model AS Recoverymodel,-- Database recovery model
CASE bs.type
WHEN 'D' THEN 'Full'
WHEN 'I' THEN 'Differential'
WHEN 'L' THEN 'Log'
WHEN 'F' THEN 'File or filegroup'
WHEN 'G' THEN 'Differential file'
WHEN 'P' THEN 'P'
WHEN 'Q' THEN 'Differential partial'
END AS BackupType,-- Type of database baclup
bs.backup_start_date AS BackupstartDate,-- Backup start date
bs.backup_finish_date AS BackupFinishDate,-- Backup finish date
bmf.physical_device_name AS PhysicalDevice,-- baclup Physical localtion
CASE device_type
WHEN 2 THEN 'Disk - Temporary'
WHEN 102 THEN 'Disk - Permanent'
WHEN 5 THEN 'Tape - Temporary'
WHEN 105 THEN 'Tape - Temporary'
ELSE 'Other Device'
END AS DeviceType,-- Device type
bs.backup_size AS [BackupSize(In bytes)],
-- Normal backup size (In bytes)
compressed_backup_size AS [ConmpressedBackupSize(In bytes)]
-- Compressed backup size (In bytes)
FROM msdb.dbo.backupset bs
INNER JOIN msdb.dbo.backupmediafamily bmf
ON ( bs.media_set_id = bmf.media_set_id )
ORDER BY bs.backup_start_date DESC
GO
There is another example scripts about find the backup history for all the databases on a single instance, you can review the following blog.
http://www.toadworld.com/platforms/sql-server/b/weblog/archive/2013/10/03/get-the-backup-history-for-databases.aspx
Regards,
Sofiya Li
Sofiya Li
TechNet Community Support

Similar Messages

  • Anyone know how to fix error message: word cannot complete too many files open

    anyone know how to fix error message: word cannot complete too many files open
    thanks
    Ronny

    First, take a look at this thread, toward the end of the second page:
    https://discussions.apple.com/thread/1449787?start=0&tstart=0
    Your ansswer is there, somewhere.
    Unfortunately, you've not provided enough system information to solve this.(The only info is that you use a MacBook Pro.) This issue may have been addressed in a prior version. Update your Support Communitees Profile to include your current hardware, system, and devices.

  • How to view Output Messages in the LabWindows UI?

    In my LabWindows/CVI I would like to view the output messages that are sent from sequences:
    "RunState.Engine.NewOutputMessage(Parameters.Messa​ge).Post()"
    I thought there might be a TS UI Control like the one in the sequence editor called Output - but I can't find one.
    So far I have managed to catch the message type (TS_UIMsg_OutputMessages) but I can't actually get the string from the event.
    Does anyone have an example of doing this?
    Thanks,
    Ronnie
    TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009

    Ok, let me see if I can explain how to do it more clearly then.
    1) Create a new OutputMessages collection using TS_EngineNewOutputMessages(). This collection will store your own private copy of the output messages. You can hold onto and add to this collection if you want to store them. If not you can just close the handle to free it once you are done with it.
    2) When you get the UIMessage you need to get the ActiveXData property of it. I think the CVI function should be called something like TS_UIMessageGetActiveXData(). The CAObjHandle you get back from this function is a different OutputMessages object that you should NOT hold onto (because of multithreading reasons), you should instead close the handle before returning back from your UIMessage handler. Before doing that though, you should use the TS_OutputMessagesCopyMessagesToCollection method to copy the messages from this OutputMessages object to the new one you created in step 1) above (i.e. you are making your own private copy of the messages and leaving the ones in the UIMessage unchanged (again, it is for multithreading reasons that it must be done this way to avoid race conditions).
    3) You now have a copy of the output messages from the event in your own private OutputMessages collection that you created in step 1) above. You can now access it to get the info for the output messages.  You can get the number of items it contains (and it might contain more than one), by using the TS_OutputMessagesGetItem() function and using CA_VariantInt(index) to package the integer that you pass for the index parameter.
    4) Getting the item gives you an OutputMessage object (notice no plural). You can get information about the output message using the methods and properties of the OutputMessage class (see the online help for more info). There is more to an output message than just the message text. There is also a timestamp, category, location, icon, id, severity, color, etc.
    If you need more information please let us know specifically what you are having trouble with or need more information about.
    Hope this helps,
    -Doug

  • How a new output message will be created automatically after changing a PO?

    Dear friends,
    How to generate a new output message automatically after changing a PO and saving it?
    Thx & Regds
    Amitava

    Hi,
    System only takes automatically the Output message in PO in creation mode in ME21N ( Only if you have maintained the condition record MN04)
    If you have not maintained Condition record in creation of PO also you need to maintain manually.
    But once you changed the PO system will not automatically pick up the new Output message, you have to manuallly input the Output messages in change mode of PO - ME22N.
    You can also use ME9F for this.
    rgds
    gsc

  • EDI over WCF request-response port - how to catch failed messages and send response over a 2 way port

    I'm using BizTalk 2009.  I've written an orchestration for accepting 270's and returning 271's, and another for 276's and 277's.  The incoming and outgoing EDI stream is wrapped in XML.  I've published the schema using the WCF publishing wizard,
    and I am using the WCF-WSHttp adapter.  I have custom pipeline components to unwrap and wrap the XML, and to handle the NACK generated by the adapter.  Everything works fine if valid EDI is received. 
    However, I'm challenged with handling failures from the EDI disassambler.  The specification I've been given is to return a 271 or 277 in all cases (or as many as possible).  What I would like to do is catch the failed message, generate a (271
    or 277) response, and return that response over the 2-way port.  I know how to enable failed message routing and how to subscribe to the message if it were to come in over a one-way port.  It seems that this cannot be done when the message comes
    in over a 2-way port. 
    Any suggestions on how this can be done?

    I should have mentioned that turning off as much EDI validation as I can in the pipeline is already part of my approach.  However, to my knowledge, there are some validations (such as incorrect segment count in the SE) that cannot be disabled. 
    Regarding the TA1/997/999 - because this is a real time transaction, I'm not generating any.  Still, to take your suggest, I decided to generate a 997, thinking I could at least subscribe to it and if the 997 indicated a failure, to
    generate the response (in the form of a 271 or 277) that my trading partner is expecting.  What I found was that the 997 was being returned through the send pipeline of the 2 way port, EVEN WHEN I set RouteAckOn2WayPort to False on the receive pipeline! 
    This produces even more work for me, because now I have to "eat" the acknowledgement so that the 271 or 277 can get through.

  • How to catch error message inside a variable?

    Hi,
    I'm trying to catch the error message inside a variable using this this command below:-
    <%=odiRef.getPrevStepLog("MESSAGE")%>
    Could you please tell me what is the right approach to capture the error message inside a variable.
    Thanks
    Anindya

    Hi Bhabani,
    I have done this and select an oracle schema.But the variables only captures the (null).Please look into this.You must have one step prior to this refresh variable. Then only it can get the status as given below.
    Returns the one-letter code indicating the status with which the previous step terminated. The state R (Running) is never returned.
    D: Done (success)
    E: Error
    Q: Queued
    W: Waiting
    M: Warning
    If you want the complete error details then you will face issues in case of multi line message. For this best option would be jython variable.Could please provide me some idea how to use this jython variable.I will update you on this soon
    Thanks
    Anindya

  • How to catch error message and show it in VC?

    I want to catch the error message and show it in VC.For example, if there is no data row in table view queryed from data service, then popup a window to show the message "No Data Found".I don't konw how to implement it!

    Hello Kane
    use expression{disble this after defining erroe messege} box in that popup there u can define your own message as error or warning accordingnly it display message
    I hope it work or Let me know it
    Regards
    ````Satish````

  • How to catch the message in RWB and send back to sender system

    hi
    I've proxy->xi-->jdbc scenario, when ever there is  some error and the data can't be intered in the data base, we can find error message thrown by the data base in the RWB , i want  this error message of the RWB to send back  to the sending system
    pl let me know if its possible  and how ???
    points shall be rewarded
    Thanks & Rgds ,
    mojib

    check this link, and use as per you requirement
    XI: How-to on JDBC receiver response
    JDBC Receiver Adapter -- Synchronous Select – Step by Step
    Regards
    Chilla

  • HT3275 My time machine is not able to complete a backup, giving me this error message:  the backup disk image "/Volumes/Data/Linda's iMac.sparsebundle" is already in use. How do I fix this?

    My time machine is not able to complete a backup, giving me this error message:  the backup disk image “/Volumes/Data/Linda’s iMac.sparsebundle” is already in use. How do I fix this?

    Stock standard issue.. asked 5-10 times per day here.. look at "more like this" on the right.
    Simply reboot the TC ie pull out the power. .count to 10.. plug the power back in.
    Maybe need to restart the network.. in order modem.. router .. TC.. clients. 2min gap.
    See C12 http://pondini.org/TM/Troubleshooting.html

  • How do i restore sms messages from backup

    I had an appointment at the genius bar today and they restored my iphone 4 to factory settings. i was told all my texts (SMS and iMessage) were backed up. I was told to open an iTunes and setup the iPhone as a "new phone" rather than restore from my backup file. Does anyone know how I can restore just the SMS/iMessage part of the backup? thanks!

    Actually, there's a way to restore deleted SMS directly from iPhone 5/4S/4/3GS.
    If you've ever synced your iPhone with iTunes before, there is also another way: to recover from iTunes backup for all iPhones including iPhone 5 and iphone4S. You just need the help from an iPhone text message recovery tool.
    Part 1: Directly recover deleted photos from iPhone 5/4S/4/3GS
    1:Connect your iPhone to the computer
    At first, please connect your iPhone to the computer and run the program after installing it.
    2:Enter your iPhone's system and scan it (iPhone 5/4S users can skip this step)
    After downloading the plug-in, you need to get into the device's scanning mode before scanning. You can follow the steps below:
    1)Hold your iPhone and click the "Start" button.
    2)Pressing the "Power" and "Home" buttons simultaneously for 10 seconds.
    3)After 10 seconds, release the "Power" button, but keep holding "Home" for another 15 seconds.
    3: Preview and recover iPhone messages
    When the scan is completed, choose "Messages" to preview the detailed content. Mark those you want and click "Recover" to save them on your compute with one click.
    Part 2: Scan and extract iTunes backup to recover iPhone SMS
    1: Scan your iTunes backup for iPhone 5/4S/4/3GS
    After installing and running the program, move to "Recover from iTunes Backup File" and you'll get the interface as follows. All your iTunes backup files have been found and displayed. Choose the one for your iPhone and click the"Start Scan" button.
    2: Preview and recover iPhone SMS
    Only need to check the "Messages" option and hit the "Recover" to save all the messages on your computer.
    3:Do backup well
    In order to save your important SMS messages, immediate backup is very useful and important. Please remember to backup them on your computer .

  • How to catch up Exception message?

    i have a question while using try{ ... }catch{ ... } clauses. for when update, delete, databse, there might be error occurred. all to often i do not deal with the message, only if to check log when serious problem i have to find it out; but i hope to learn how if i am able to display message of my own while erro occurrs. for instance, when falling into SQLException, originaly i might just utilize
    }catch(SQLException e){
    e.printStackTrace();
    is it possible for me to catch up message inside the printStackTrace that may happen while errors appearing? (or only down to catch{} clause be the last deadline that i am able to use? because i hope i am able to capture error code like ora-1234 and tranlate it into messages that user, who doesn't know too much about pc, can understand easily while reporting bug; and not just saying "we have problem here!")
    that is, if 'A' situation popping out, i hope to direct it to error page with special message shown. so does the same error page with different message specified while 'B' situation found out!
    any suggestions would be appreciated~
    thanks in advice,

    printStackTrace isn't obligatory. It's basically what you do with an exception when you don't have anything more specific to do with it.
    You can certainly catch a specific exception at any level, including inside another try {} block.
    Even having caught an exception you can decide that you don't want to handle it at this point in the code, and throw it again.
    You might do:
    try {
         try {
           ... statment which migh cause a particular database exception
            } catch(SQLException e) {
            if(e.getMessage().startsWith("ORA-1232")) {
              .. do somthing usefull
             } else
            throw e;   // the particular SQL exception was unexpected so go on and crash
       catch(Exception e) {
         e.printStackTrace();   // unexpected program failure

  • How to fix this error message The backup disk image "/Volumes/AirPort Disk/FARES DEL VALLE's iMac.sparsebundle" could not be accessed (error -1).

    how to fix this error message The backup disk image “/Volumes/AirPort Disk/FARES DEL VALLE’s iMac.sparsebundle” could not be accessed (error -1).

    The troubleshooting C17 is the specific article.
    http://pondini.org/TM/Troubleshooting.html
    This is generally a Lion error.. and you will need 5.6 utility to get access to the disk area.
    So download the real utility. Run it instead of v6 toy version.
    http://support.apple.com/kb/DL1482
    Go to the manual setup, disk page and click on disconnect all users.. that will unmount all users connected to the disk and allow it to start working. But there are a number of other issues that are possible cause. Pondini lists some of them.

  • How to display the Output messages on LabVIEW

    Hi,
    I'm building a simple user interface on LabVIEW and I have the following question:
     - TestStand has an Output Tab where I display some messages using Engine.OutputMessage; How can I do the same thing on my UI?
    I've attached a printscreen of my TestStand sequence as an example of what I want do do on LabVIEW.
    I apreciate all the help.
    Thanks in advance.
    Regards,
    Daniel Coelho
    Daniel Coelho
    VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
    Controlar - Electronica Industrial e Sistemas, Lda
    Attachments:
    TS PrintScreen.JPG ‏137 KB

    Sorry, from your post in the LabVIEW board I did not understand that it was the Output message that you were looking for.
    I thought you wanted the results from your test steps displayed on the user interface. 
    It is the “Output Panel” in the sequence editor that displays your output message, but I do not know if there is default Output panel activeX indicator for user interface that the TestStand engine would update automatically like it does the execution view.
    Maybe someone else knows 
    As also pointed out, the UI messages is your other option.
    The Output Message event number is 40 
    http://zone.ni.com/devzone/cda/epd/p/id/3879
    UIMsg_OutputMessages–(Value: 40) TestStand sends this message at periodic intervals when it holds references to output messages that calls to the OutputMessage.Post method queue. TestStand transfers the queued messages to an OutputMessages collection attached to the UIMessage.ActiveXData property for this event. An application that processes output messages should copy the output message references from the collection in UIMessage.ActiveXData to its own private OutputMessages collection by passing its private collection to the OutputMessages.CopyMessagesToCollection method. An application calls the Engine.NewOutputMessages method to create a private OutputMessage collection. TestStand generates this event only if the Engine.OutputMessagesEnabled property is True. Because there can be more than one handler for this event, the application should not modify the OutputMessages collection the UIMessage.ActiveXData property holds.
    Omar
    Message Edited by OmarGator on 10-09-2008 10:12 AM

  • HT3275 For the past several days, I have been getting this message during backups: Time Machine could not complete the back up.  The backup disk image "Volumes/Data/iMac.sparsebundle" could not be accessed (error-1).

    For the past several days, I have been getting this message during backups:
    Time Machine could not complete the back up.  The backup disk image "Volumes/Data/bhoppy2's iMac.sparsebundle" could not be accessed (error-1).  When I click on the 'help' icon on the message, it reverts to a blank page, and I cannot find anything online regarding the term 'sparsebundle.'  In addition, I cannot access previous backups any longer. 
    Help?

    See C17 in Time Machine Troubleshooting by Time Machine guru Pondini:
    http://pondini.org/TM/Troubleshooting.html

  • I am trying to use Time Machine to back-up to an external hard drive and I get the following message.Unable to complete backup. An error occurred while creating the backup folder. Does anyone know what I should do?

    I am trying to use Time Machine to back-up to an external hard drive and I get the following message.Unable to complete backup. An error occurred while creating the backup folder. Does anyone know what I should do?

    Hello Drake, I suspect one or more of the Drives needs repairing, but...
    Have you looked through Pondini's extensive TM help site?
    http://Pondini.org/TM/FAQ.html
    http://pondini.org/TM/Troubleshooting.html
    Can't imaging something not being covered there.

Maybe you are looking for