How to find the existing sql server backup plan/schedule is there a script for that?

Friends,
Is there a easy way to find out in SQLServer (for All DB's) what is the current backup plan/schedule ? is there a script for that?
Thanks,
Karthikeyan Jothi

To check the database backup 
Select
SERVERPROPERTY('ServerName'),
db.name,
CONVERT(VARCHAR(10), b.backup_start_date, 103) + + convert(VARCHAR(8), b.backup_start_date, 14) backup_start_date,
CONVERT(VARCHAR(10), b.backup_finish_date, 103) + + convert(VARCHAR(8), b.backup_finish_date, 14) backup_finish_date,
case
when (DATEDIFF(hour, b.backup_start_date, getdate())<24)then 'Success'
when (DATEDIFF(hour, b.backup_start_date, getdate())>=24)then 'Failed'
end Status,
DATEDIFF(hh, b.backup_finish_date, GETDATE())BackupAgeInHours,
(b.backup_size/1024/1024/1024 )BackupSize,
case b.[type]
WHEN 'D' THEN 'Full'
WHEN 'I' THEN 'Differential'
WHEN 'L' THEN 'Transaction Log'
END Type,
ISNULL(STR(ABS(DATEDIFF(day, GetDate(),(Backup_finish_date)))), 'NEVER')DaysSinceLastBackup
FROM sys.sysdatabases db
Left OUTER JOIN (SELECT * , ROW_NUMBER() OVER(PARTITION BY database_name ORDER BY backup_finish_date DESC) AS RNUM
FROM msdb.dbo.backupset) b ON b.database_name = db.name AND RNUM = 1
where dbid<>2
OR
SELECT
DISTINCT
a.Name AS DatabaseName ,
CONVERT(SYSNAME, DATABASEPROPERTYEX(a.name, 'Recovery')) RecoveryModel ,
COALESCE(( SELECT CONVERT(VARCHAR(12), MAX(backup_finish_date), 101)
FROM msdb.dbo.backupset
WHERE database_name = a.name
AND type = 'd'
AND is_copy_only = '0'
), 'No Full') AS 'Full' ,
COALESCE(( SELECT CONVERT(VARCHAR(12), MAX(backup_finish_date), 101)
FROM msdb.dbo.backupset
WHERE database_name = a.name
AND type = 'i'
AND is_copy_only = '0'
), 'No Diff') AS 'Diff' ,
COALESCE(( SELECT CONVERT(VARCHAR(20), MAX(backup_finish_date), 120)
FROM msdb.dbo.backupset
WHERE database_name = a.name
AND type = 'l'
), 'No Log') AS 'LastLog' ,
COALESCE(( SELECT CONVERT(VARCHAR(20), backup_finish_date, 120)
FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY backup_finish_date DESC ) AS 'rownum' ,
backup_finish_date
FROM msdb.dbo.backupset
WHERE database_name = a.name
AND type = 'l'
) withrownum
WHERE rownum = 2
), 'No Log') AS 'LastLog2'
FROM sys.databases a
LEFT OUTER JOIN msdb.dbo.backupset b ON b.database_name = a.name
WHERE a.name <> 'tempdb'
AND a.state_desc = 'online'
GROUP BY a.Name ,
a.compatibility_level
ORDER BY a.name
To check the schedule you can try the below script
https://gallery.technet.microsoft.com/SQL-Jobs-Complete-eabe0050
--Prashanth

Similar Messages

  • How to find the existing START ROUTINEs in Transfer Rules in whole system ?

    Hi all,
       How to find the existing Start Routines in Transfer Rules in BW System, please ?
       I know that we could find from the Transfer Rules.
       Is there any way to find instead of looking at Transfer Rules for <b>each</b> InfoSource?
    Thanks,
    Venkat.

    Hi Venkat
    You can find it in these tables
    RSTRAN
    RSUPDROUT
    RSAROUT
    RSAABAP
    RSAABAPINV
    Thanks
    Tripple k

  • How to find  the existing workflows

    Hi Gurus,
    How to find  the existing workflows, and assign a  user  to a role.
    Suitably rewarded for helpful answers.
    B S B

    Hi,
    You can find existing workflow in Transaction PFTC.
    Select Task Type as Workflow Template(WS) and either do F4 on Task
    or put some description and press enter.
    For assigning a user to a role, check transaction PPOCW. (If in an Org. Unit) or through SU01.
    Regards,
    Ashish

  • How to find the existing request no for Smart form

    Hi Experts,
    plz tell me how to find the existing request no for Smart form in ABAP.
    thanks in advance.
    regards,
    radhika.

    Radhika,
    Choose Goto > Object Directory Entry> Lock Overview On the Initial screen of the "smartforms" transaction, after entering the actual smartform. This would give you the request number for the smartform.
    Regards
    Narasimhan

  • How to find the existing Idoc...

    Hi all
    How to find the existing Idoc...
    in tranction we02..?

    Please find the function module that is being used to generate the inbound/outbound IDoc.
    Then you go to inside the FM and search for 'CUSTOMER-FUNCTION' in the main program.
    This is the place that provided by SAP to modify the IDoc segments.
    CALL CUSTOMER-FUNCTION '012'
      EXPORTING
        DEKKO              = EKKO
        DPEKKO             = PEKKO
      TABLES
        DEKPO              = XEKPO
        DPEKPO             = XPEKPO
        DEKET              = XEKET
        DH_APPL            = APPL.
    Hope this will help.
    Regards,
    Ferry Lianto
    <b>Please reward points if helpful.</b>

  • Why do i constantly get cut off on calls.  I've had this problem with my 3GS, my 4S and now my iPhone 5.  When the core functionality is Phone, i.e. the ability to talk, why can't Apple make the iPhone function as a Phone?  is there an App for that !!

    why do i constantly get cut off on calls.  I've had this problem with my 3GS, my 4S and now my iPhone 5.  When the core functionality is Phone, i.e. the ability to talk, why can't Apple make the iPhone function as a Phone?  is there an App for that !!

    Well, since you've had the same problem, with three different phones, that all use different size sim cards, it seems pretty obvious the problem is with your carrier/coverage & nothing to do with your phone or sim card.

  • How to find the backend  SQL query of the JSP page in OIC

    Does anybody how the best way to find the backend SQL QUERY of OIV JSP page?

    How To Generate Trace Files in in HTML/JSP (using Profile Option)
    •     • Note: This requires proper responsibility to set SQL Initialization statement using Profile option.      
         Step 1.     Login to the desired Form application.     
         Step 2.     Select +Profile >> System ('Find System Profile Values' screen will pop up)     
         Step 3.     Check 'User' and Type in the Username (in which the account for that user will be trace)     
         Step 4.     Type 'Initialization%' in the Profile box and Hit 'Find' (Click here for preview.)     
         Step 5.     In the User box, type the following statement and Hit 'Save' (Click here for preview)
         BEGIN FND_CTL.FND_SESS_CTL('','','TRUE','TRUE','','ALTER SESSION SET TRACEFILE_IDENTIFIER = TESTING MAX_DUMP_FILE_SIZE = 5000000 EVENTS ='||''''||' 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12'||'''');END;     
         Note:     specify any name you like to identify your trace, in this case, testing is the end name on the trace. You can also specify the amount of data allowable to be in the trace, in this case, 5000000 is the amount set. Make sure you hit 'Save' afterwards.[Quotes in the statement are all 'Single' quotes.]
              specifying TRACEFILE_IDENTIFIER value is mandatory when setting up the trace using the above profile option value
         Step 6.     Login to HTML / JSP page with username/password and start your flow. (Everything you do once login to HTML / JSP will get trace.)     
         Step 7.     Logout of HTML / JSP application once you completed with your flow.      
         Step 8.     Go back to the Profile option in the Form application and delete the Initialization SQL statement, and Hit 'Save'.     
         Step 9.     Log in to the database server or login server and retrieve your trace file.
         Identify and retrieve the trace file using the tracefile_identifier specified in Step 5.
         In this case the tracefile_identifier is “TESTING”. (Click here for Trace file locations) *     
         Note:     If you need to regenerate your trace or tracing a new flow, then repeat Step 1 to Step 8. To avoid self-confusion, choose a different name for your trace identifier everytime you set to trace.     
         Step 10.     See TKPROF section on how to format trace file into readable text.
         Trace Options Definition
         No Trace          Tracing is not activated
         Activities will not get traced.
         Regular Trace
         (Level 1)          Contains SQL, execution statistics, and execution plan.
         Provides execution path, row counts as well as produces smallest flat file.
         Trace with Binds
         (Level 4)          Regular Trace plus value supplied to SQL statement via local variables.
         Trace with Waits
         (Level 8)          Regular Trace plus database operation timings that the SQL waited to have done in order to complete, i.e. disk access.
         Trace with Binds and Waits
         (Level 12)          Regular trace with both waits and binds information.
         Contains the most complete information and will produce the largest trace file.
    ****Send me an email to [email protected],I will share the document with you.

  • How to find the current SQL

    Dear All,
    My testing engineers are checking the application from front end, i have to find the current SQL (What SQL queries are used in the application) statements in the back end.
    Please let me know how to find the current executing SQL stements.
    Thanks in advance
    Mahi

    You need to join this query with one more table - v$sqlstats. There are many statistics in particular cpu_time, elapsed_time etc stored in that table for each sql statement.
    You can join v$sqlstats by sql_id until you have multiple child cursors for single statement.
    Or you can just join to v$sql and get statistics from there and in this latter case you include child_number column to distinguish child cursors from each other.
    Best Regards,
    Alex

  • How to find the version appl server?

    How to find the version of IAS, forms and reports?
    we are running HRMS on HP unix server.
    Thanks

    Hi,
    You can get your application server version in the context file with the value of the context variable s_techstack.
    You can also do it with the following steps,
    On Windows NT/2000 platform :
    Navigate to :
    C:\Program Files\Oracle\Inventory\Components
    \oracle.iappserver.iapptop directory.
    On UNIX platform:
    Navigate to :
    $ORACLE_HOME/oraInventory/Components/oracle.iappserver.iapptop directory
    In both cases the sub directory under the oracle.iasppserver.iapptop directory will show the version of Application Server installed. For example thesubdirectory may be called 1.0.2.2.1, which indicates version 1.0.2.2.1.
    Rgds,
    S.Jai
    Shanthi Gears (LTD)

  • How to find the main sql

    Hi all,
    I'm working on a 11.2 Oracle Enterprise database.
    I need a query to find the top 10 queries of my database. Please could you help me?
    Best regards
    dbajug

    moreajays wrote:
    Hi,
    AWR will give you all historic sql details
    @?/rdbms/admin/awrsqrpt.sql
    To know current top CPU queries you can use below sql
    col sql_text for a80
    set pages 200
    set line 900
    col PROGRAM for a20
    col MACHINE for a20
    col CPU 9999999999
    alter session set nls_date_format='dd-mon-yyyy hh24:mi:ss';
    col event for a40
    select *
    from (select /*+ rule */
    sa.sql_id,
    sa.CPU_TIME "CPU",
    s.sid "SID",
    s.serial# "SERIAL",
    s.program "PROGRAM",
    s.machine "MACHINE",
    sa.SQL_TEXT "SQL_TEXT",
    vp.spid,
    sw.event,
    s.logon_time,
    s.last_call_et / 60,
    s.username,
    s.status
    from v$sqlarea sa, v$session s, v$process vp, v$session_wait sw
    where sa.address = s.sql_address
    and sw.sid = s.sid
    and s.paddr = vp.addr
    order by CPU_TIME desc)
    where rownum < 10;Thanks,
    Ajay More
    http://www.moreajays.com
    Hey? This query is not going to help.
    Your join condition sa.address = s.sql_address will exclude all SQLs that are not the most recently executed by a session.
    And you are listing the same SQL several times if it is executed by multiple sessions, but taking no account of the number of times it was executed.
    You need to run something much simpler. Perhapsselect sql_text,executions,disk_reads,buffer_gets,cpu_time,elapsed time from v$sql order by....;run it several times, sorting it on each of the projected columns.

  • How to change the Existing alias with new alias name...MAXL SCRIPT

    HI Experts
    I need to change alias name of the existing member with new alias name.
    please send me maxl code to change the alias name .
    My thought is
    1) Old alias should be replaced with new alias name .
    2)There is one account that should be rolled out to another parent..these parents are already exsist
    3) I need a MAXL Script to change the new alias name .
    please suggest ASAP.
    Thanks
    USER

    John
    I heard that we can replace existing alias name with new alias thru MAXL
    i.e replace alias name XXXX member with YYYY ;
    please correct me if iam wrong ,might be Maxl command is wrong but this is the idea.
    Thanks
    USER

  • How to find the existing hierarchy variable?

    Dear SAP gurus,
    In this existing query, there is a Cost Element hierarchy variable created. When I run the query (second attempt by refreshing the query selection screen), the Cost Element Node variable field was not available to be changed again. Believe this has to do with the option 'Changeable with query navigation' option in the variable created. I was trying to confirm on this via the variable properties, but I had trouble identifying where it is located, because there are just too many cost element hierarchies available for reporting.
    Anyone can help me? Thank you in advance.
    Regards,
    Adelynn

    HI Nagesh,
    Thanks for your highlight, I found the variable, however, I didnt see any option "Changeable with query navigation" for this hierarchy variable. Any reason for this?
    The issue I am facing was, say, when I run the query for the first time with Cost Element Node 1, and i was trying to change my selection to CE node 2, so I refreshed my variable screen but the field to select CE hierarchy Node was no longer there. Normally this happens to variable that has the option "Changeable with query navigation" unchecked.
    But in this case, I did not see this option for the hierarchy variable used, how do we justify the scenario in this case?
    Please kindly assist, thanks again.
    Regards,
    Adelynn

  • How to find the existing function module is used in another function module

    Hi all,
    I created a function module and the same one is called from another function module.
    When I tried to find where the  first function module is used  using  Where-used List , I am getting the message "function module not found in selected areas" .
    Please  guide me what is other method to find whether the function module is used in another one.
    Thanks,
    Vengal Rao.

    hi,
    Go to UTILITIES-> Update Navigation index.
    or go to fucntion group and Generate the Funtion group once.
    it will detect all fucntion modules under that function group.
    regards,
    Rama

  • How to find sql server backup was taken under compression mode

    Hello,
    How to find SQL server backup was taken under compression mode ? I have disabled the Compress Mode backup setting but I want to make sure the backup is taken without compression.
    Is there a script for that?
    Thanks
    JK

    I have disabled the Compress Mode backup
    That is only a default setting, in backup command you can always overwrite it to a different value.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to find the license type ( per seat or per processor ) for exsting sql server instance ?

    Hi All,
    could you please help me on to find the license type of the existing sql server instance ...
    I already tried with below queries to find license type but no luck.
    SELECT  ServerProperty('LicenseType') as LicenseType, ServerProperty('NumLicenses') as ProcessorCount 
    Thank You,
    rup

    Hello,
    If you run the following statement, you should be able to get “"Enterprise Edition: Core-based Licensing ..." if the instance
    is using a core-based license.
    select serverproperty('Edition')
    The following post may help you too to determine if you are using Enterprise Core Edition:
    http://blogs.msdn.com/b/sql_shep/archive/2012/06/21/sql-server-2012-license-core-limitaion.aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

Maybe you are looking for

  • I can not boot my mac book air

    I can not book myMac book air withaut power cabel . Power shows 96 % power .

  • How to replace the printhead for the Officejet Pro L7580

    I need a video for first cleaning the printhead and the replacing(if necessary) the printhead(s) for the L7580.  I found a video for the 8500, but it did not help. I do not  see a release latch  for my printhead

  • Bing Map API in Dreamweaver MX

    How do I add a Bing Map API, or embed a Bing Map, in Dreamweaver MX?

  • Code Review Tool for Weblogic 8.1

    I am working with WLS 8.1. Can anyone suggest plugin or code review tool for reviewing from workshop? I have used PMD open source plugin with eclipse for reviewing java files. I couldnt use it for .ejb files generated from workshop. Pls suggest some

  • Update exchange rates automatically

    Hi, We are a mid sized company moving into SAP. We have operations only in USA or Canada. We want to automatically update the exchange rates in the system. There are services out there like Ruetuers etc that provide this. Given the size of our compan