SQL Server Query Plan Generation take longer

Dear all,
We are dealing with a wired issue where queries on there first execution take approx 1 min to 2 mins to execute and later execution completes in less than a second,Can you please help us understand why sql server is taking longer time to generated the query
plan
Below is the result of files stats
Mohd Sufian www.sqlship.wordpress.com Please mark the post as Answered if it helped.

SYS.DM_OS_MEMORY_CLERKS
MEMORYCLERK_SQLOPTIMIZER 136 912
CACHESTORE_PHDR 1864 0
CACHESTORE_XMLDBTYPE 8 0
CACHESTORE_EVENTS 16 0
USERSTORE_OBJPERM 824 0
USERSTORE_TOKENPERM 840 968
MEMORYCLERK_SQLSTORENG 2736 4312
CACHESTORE_FULLTEXTSTOPLIST 32 0
MEMORYCLERK_XE 64 168
CACHESTORE_XPROC 72 0
OBJECTSTORE_SNI_PACKET 3336 112
CACHESTORE_BROKERRSB 8 0
OBJECTSTORE_SERVICE_BROKER 424 0
MEMORYCLERK_SQLSERVICEBROKERTRANSPORT 48 0
MEMORYCLERK_XE_BUFFER 0 0
MEMORYCLERK_SQLGENERAL 1608 4144
CACHESTORE_XMLDBATTRIBUTE 8 0
MEMORYCLERK_SQLHTTP 8 0
CACHESTORE_STACKFRAMES 0 16
MEMORYCLERK_SQLCONNECTIONPOOL 2440 0
MEMORYCLERK_SQLSERVICEBROKER 152 544
CACHESTORE_NOTIF 16 0
CACHESTORE_XMLDBELEMENT 8 0
OBJECTSTORE_LOCK_MANAGER 24 0
MEMORYCLERK_SQLBUFFERPOOL 0 1688
MEMORYCLERK_SQLSOAP 0 0
MEMORYCLERK_TRACE_EVTNOTIF 0 0
CACHESTORE_OBJCP 6576 512
CACHESTORE_CONVPRI 64 0
MEMORYCLERK_QSRANGEPREFETCH 0 0
CACHESTORE_BROKERREADONLY 80 0
MEMORYCLERK_SQLCLRASSEMBLY 0 0
MEMORYCLERK_SOSNODE 8 16320
MEMORYCLERK_SQLQUERYPLAN 0 0
OBJECTSTORE_SECAUDIT_EVENT_BUFFER 16 0
MEMORYCLERK_BHF 0 0
CACHESTORE_SQLCP 22680 3544
OBJECTSTORE_LBSS 96 192
CACHESTORE_SYSTEMROWSET 1832 0
MEMORYCLERK_FULLTEXT 24 0
USERSTORE_SCHEMAMGR 2632 328
MEMORYCLERK_SQLQUERYCOMPILE 0 0
CACHESTORE_TEMPTABLES 16 0
CACHESTORE_BROKERTBLACS 200 0
CACHESTORE_BROKERTO 8 0
CACHESTORE_BROKERKEK 8 0
MEMORYCLERK_SQLXML 0 0
USERSTORE_SXC 64 0
MEMORYCLERK_SNI 240 32
MEMORYCLERK_FULLTEXT_SHMEM 0 0
CACHESTORE_BROKERUSERCERTLOOKUP 8 0
CACHESTORE_BROKERDSH 8 0
MEMORYCLERK_SQLSOAPSESSIONSTORE 0 0
MEMORYCLERK_SQLQERESERVATIONS 0 0
MEMORYCLERK_HOST 16 0
MEMORYCLERK_SQLCLR 8 0
MEMORYCLERK_SQLXP 16 0
USERSTORE_DBMETADATA 1912 0
MEMORYCLERK_SQLUTILITIES 112 0
CACHESTORE_VIEWDEFINITIONS 16 0
MEMORYCLERK_SQLQUERYEXEC 80 0
sys.dm_os_performance_counters
object_name counter_name cntr_value
SQLServer:Buffer Manager Buffer cache hit ratio 556
SQLServer:Buffer Manager Buffer cache hit ratio base 612
SQLServer:Buffer Manager Page lookups/sec 4054066
SQLServer:Buffer Manager Free list stalls/sec 0
SQLServer:Buffer Manager Free pages 483
SQLServer:Buffer Manager Total pages 503088
SQLServer:Buffer Manager Target pages 1710080
SQLServer:Buffer Manager Database pages 494479
SQLServer:Buffer Manager Reserved pages 0
SQLServer:Buffer Manager Stolen pages 8126
SQLServer:Buffer Manager Lazy writes/sec 0
SQLServer:Buffer Manager Readahead pages/sec 378700
SQLServer:Buffer Manager Page reads/sec 493985
SQLServer:Buffer Manager Page writes/sec 2421
SQLServer:Buffer Manager Checkpoint pages/sec 0
SQLServer:Buffer Manager AWE lookup maps/sec 0
SQLServer:Buffer Manager AWE stolen maps/sec 0
SQLServer:Buffer Manager AWE write maps/sec 0
SQLServer:Buffer Manager AWE unmap calls/sec 0
SQLServer:Buffer Manager AWE unmap pages/sec 0
SQLServer:Buffer Manager Page life expectancy 262
SQLServer:Cursor Manager by Type Cache Hit Ratio 0
SQLServer:Cursor Manager by Type Cache Hit Ratio Base 0
SQLServer:Cursor Manager by Type Cached Cursor Counts 0
SQLServer:Cursor Manager by Type Cursor Cache Use Counts/sec 0
SQLServer:Cursor Manager by Type Cursor Requests/sec 0
SQLServer:Cursor Manager by Type Active cursors 0
SQLServer:Cursor Manager by Type Cursor memory usage 0
SQLServer:Cursor Manager by Type Cursor worktable usage 0
SQLServer:Cursor Manager by Type Number of active cursor plans 0
SQLServer:Cursor Manager by Type Cache Hit Ratio 0
SQLServer:Cursor Manager by Type Cache Hit Ratio Base 0
SQLServer:Cursor Manager by Type Cached Cursor Counts 0
SQLServer:Cursor Manager by Type Cursor Cache Use Counts/sec 0
SQLServer:Cursor Manager by Type Cursor Requests/sec 0
SQLServer:Cursor Manager by Type Active cursors 0
SQLServer:Cursor Manager by Type Cursor memory usage 0
SQLServer:Cursor Manager by Type Cursor worktable usage 0
SQLServer:Cursor Manager by Type Number of active cursor plans 0
SQLServer:Cursor Manager by Type Cache Hit Ratio 0
SQLServer:Cursor Manager by Type Cache Hit Ratio Base 0
SQLServer:Cursor Manager by Type Cached Cursor Counts 0
SQLServer:Cursor Manager by Type Cursor Cache Use Counts/sec 0
SQLServer:Cursor Manager by Type Cursor Requests/sec 0
SQLServer:Cursor Manager by Type Active cursors 0
SQLServer:Cursor Manager by Type Cursor memory usage 0
SQLServer:Cursor Manager by Type Cursor worktable usage 0
SQLServer:Cursor Manager by Type Number of active cursor plans 0
SQLServer:Cursor Manager by Type Cache Hit Ratio 0
SQLServer:Cursor Manager by Type Cache Hit Ratio Base 0
SQLServer:Cursor Manager by Type Cached Cursor Counts 0
SQLServer:Cursor Manager by Type Cursor Cache Use Counts/sec 0
SQLServer:Cursor Manager by Type Cursor Requests/sec 0
SQLServer:Cursor Manager by Type Active cursors 0
SQLServer:Cursor Manager by Type Cursor memory usage 0
SQLServer:Cursor Manager by Type Cursor worktable usage 0
SQLServer:Cursor Manager by Type Number of active cursor plans 0
SQLServer:Cursor Manager Total Cursor conversion rate 0
SQLServer:Cursor Manager Total Async population count 0
SQLServer:Cursor Manager Total Cursor flushes 0
SQLServer:Memory Manager Connection Memory (KB) 2864
SQLServer:Memory Manager Granted Workspace Memory (KB) 0
SQLServer:Memory Manager Lock Memory (KB) 7944
SQLServer:Memory Manager Lock Blocks Allocated 40550
SQLServer:Memory Manager Lock Owner Blocks Allocated 43550
SQLServer:Memory Manager Lock Blocks 10003
SQLServer:Memory Manager Lock Owner Blocks 10133
SQLServer:Memory Manager Maximum Workspace Memory (KB) 10280520
SQLServer:Memory Manager Memory Grants Outstanding 0
SQLServer:Memory Manager Memory Grants Pending 0
SQLServer:Memory Manager Optimizer Memory (KB) 1048
SQLServer:Memory Manager SQL Cache Memory (KB) 2080
SQLServer:Memory Manager Target Server Memory (KB) 13680640
SQLServer:Memory Manager Total Server Memory (KB) 4024704
Mohd Sufian www.sqlship.wordpress.com Please mark the post as Answered if it helped.

Similar Messages

  • From SharePoint Content Database, Using SQL-Server Query how to fetch the 'Document GUID' based on 'Content Type'

    I want to get all the documents based on content type using SQL Server Query. I know that, querying the content database without using API is not advisable, but still i want to perform this action through SQL Server Query. Can someone assist ?

    You're right, it's not advisable, may result in corruption of your databases and might impact performance and stability. But assuming you're happy to do that then it is possible.
    Before you go down that route, have you considered using something more safe like PowerShell? I've seen a script exactly like the one you describe and it would take far less time to do it through PS than it would through SQL.

  • Sql server query

    sql server query to rearrange the rows after inserting the rows in a table

    You want to re-arrange the data physically?!!! Why? I believe its something impossible other than having a clustered key(there could be some strange ways of doing it) and a thing that should not worry about. Always there is a ORDER BY CLAUSE to order your
    data while retrieving 
    Satheesh
    My Blog |
    How to ask questions in technical forum

  • Official documents on escaping characters in SQL Server query statements

    Hi,
    Are there any official documents on how to escaping special characters in SQL Server query statements? I find a lot of online resources discussing about this, but there are no definitive conclusions on:
    Which characters should be escaped? (Some only said single-quote needs to be escaped, double-quote does not need. While others said both need to be escaped)
    How to escape characters? (Some said using two single-quote to escape a single-quote. Others said using a backslash, etc.)
    So I just wonder if there is an official document from Microsoft regarding this?
    Thanks
    Alan

    Depends on where you're using them
    If its string values then single quotes(') should be escaped by putting one more single quote before it.
    If its LIKE operator you can use ESCAPE keyword or use [] to escapre special characters 
    see
    http://visakhm.blogspot.in/2013/01/wildcard-character-based-pattern-search.html
    If inside SSIS expression you can escape characters like \ " etc by adding an extra \ before the characters
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Converting SQL Server Query to Oracle

    Hello TechFriends,
    Can any one of u please tell me equivalent of following SQL Server Query?
    The same query runs in Oracle but givesa same reocrds in different order!! I want such an equivalent oracle query that gives records in same order as Sql Server does.
    select
    ProfValue_ProfScaleFK ProfScale,
    ProfValue_Value ProfValue,
    isnull(ProfValueDesc.name, ProfValue_name) ProfName
    from
    ProfValueDesc inner join TBL_LMS_Lang
    on lang_fk = lang_pk and langid = 'en'
    right outer join ProfValue
    on ProfValue_ProfScaleFK = ProfScale_fk and ProfValue_Value = ProfValue_FK ;
    Regards & TIA.
    Anand.

    If you want a specific ordering why don't you add an ORDER BY clause?
    Donal

  • Converting MS SQL Server Query to Oracle Query

    Hi There,
    I've a strange problem. My project uses both MS SQL Server and Oracle server at run time. I've lot of queries which are written in MS SQL Style. Now, iam planning to write a helper class whic converts MS SQL Query to Oracle Query. Please Help me if any one has that kind of Helper with you.
    Thanks And Regards,
    Sasi Kanth

    That is why persistence applications like Hibernate or
    CMP get used for apps that will use more than one DB,
    but it takes upfront planning.
    If you have a set of automated unit tests that work
    with SQL Server, they will be a big help in getting
    your Oracle code up and running.Indeed - JUnit and Ant would be a big help here.
    It sounds like you have SQL in your JSPs, that will
    work against you as well if so. If you are using a
    DAO pattern, this will be much easier, as you can
    re-implement each DAO for Oracle.If you'd layered this app properly, you might just implement an OracleDAOFactory and be done with it. Interfaces and a DAO layer would go a long way.
    This is why layering is such a good idea. It isolates changes in a smaller subset of classes.
    But your problem sounds pretty big. It'd be daunting even if it were well designed.

  • Help Required With SQL Subquery Across DB Link - Takes Long Time

    Hi,
    Apologies if this is not the correct forum but I am implementing this through HTMLDB.
    I am trying to run a SQL query over a DB link with a sub query on tables in my HTMLDB workspace.
    The SQL query over the database link takes 1.23 seconds to run on it's own:
    SELECT D.EMAIL_ADDRESS,
    D.COL2,
    D.COL3,
    D.COL4,
    D.COL5,
    D.COL6,
    T.COL1
    FROM SCHEMA.TABLE1@DATABASELINK D,
    SCHEMA.TABLE2@DATABASELINK T
    WHERE D.TABLE_JOIN = T.TABLE_JOIN
    AND T.COL1 = '1111111'
    AND UPPER(D.COL2) IN ('XXXXXX','YYYYYY')
    The SQL query based on HTMLDB workspace tables takes 0.01 seconds to run on it's own:
    SELECT UPPER(A.EMAIL_ADDRESS)
    FROM HTMLDBTABLE1 M, HTMLDBTABLE2 A
    WHERE M.TABLE_JOIN = A.TABLE_JOIN
    AND M.ID = 222
    However when I try and run these together the results take 280 seconds to complete:
    SELECT D.EMAIL_ADDRESS,
    D.COL2,
    D.COL3,
    D.COL4,
    D.COL5,
    D.COL6,
    T.COL1
    FROM SCHEMA.TABLE1@DATABASELINK D,
    SCHEMA.TABLE2@DATABASELINK T
    WHERE D.TABLE_JOIN = T.TABLE_JOIN
    AND T.COL1 = '1111111'
    AND UPPER(D.COL2) IN ('XXXXXX','YYYYYY')
    AND NOT EXISTS
    (SELECT UPPER(A.EMAIL_ADDRESS)
    FROM HTMLDBTABLE1 M, HTMLDBTABLE2 A
    WHERE M.TABLE_JOIN = A.TABLE_JOIN
    AND UPPER(A.EMAIL_ADDRESS) = UPPER(D.EMAIL_ADDRESS)
    AND M.ID = 222)
    Does anyone have any idea why this query is taking so long?
    Please let me know if you require additional information.
    Many thanks,
    Richard.

    I've updated my profile to show my email address, so go ahead and email me the strace output (compressed please). Maximum attachment size for emails to Oracle is 10MB (encoded), so split the strace output in 5MB chunks if necessary.
    poll() is not normally used by the Oracle network layer for client-server connections. So this may be related to an OS network service, such as DNS or NIS. The strace should make this clear (to me anyway).
    Edited by: herb on Aug 14, 2009 10:25 AM

  • Query on Cube jumps to Query on ODS ; Query on ODS takes Long time

    Hi All,
    Perormance Issue:  Query on Cube jumps to Query on ODS.
    Query on ODS taking long time.(JumpQuery)  
    Specific to ODS Query: When i have checked the Query on ODS(individually) also taking longer time
    Actually ODS contains quite huge data. Indexes already maintained.
    I have checked the RSRT- Execute SQL and Debug Option also. Indexes maintained Perfectly .
    Order of objects in ODS indexes are matching the order of Objects in SQL stat of RSRT Trans. Inspite of that taking long time.
    I have checked both the ways jumpquery aswellas individually .
    My question is when the query is jumping from cube to query on ODS how to check the performance, how the query is executing in background when switching over to the second query, Moreover calculated keyfigure has been used for jumping to the target query.
    How can query(ods query)  time is optimized or improve performance when jumping  from query on Cube ?
    can any body help?
    Rgds,
    C.V.
    Message was edited by:
            C.V. P

    What i understand is that you need to optimise the Query jumping time . But this will be very less compared to the time taken by the query on the ODS.
    Ideally you shouldnt be making a BEx Query on the ODS , as this takes a long time. What you can do is try executing the Bex Query on the ODS to find out as to where the issue lies. If this query is taking a long time , there is not muich that you can do here.

  • Variable database name in SQL Server query using Oracle database link

    Hi All,
    I have an ApEx 4.1 app running on 11g x64 (11.2.0.1) on Windows Server 2008 x64, and I have some data integration points with a SQL Server (2005 and 2008) that I need to establish. I have configured the database link with dg4odbc and it works beautifully... I can execute queries against the SQL Server database without any problems using the database link.
    However, there is a scenario where the SQL Server database name is dynamic, and I need to generate it on the fly in a PL/SQL block, and then use that in a dynamic SQL query (all of this in ApEx). This is where I run into problems... when I am querying the default database based on the ODBC connection and I don't have to specify the database name, there is no issue. But when I need to access one of several other non-default databases, I keep receiving the "invalid table" error.
    This runs fine:* (note that "fv" is the name of my database link)
    v_query1 := 'select "ReleaseDate" from dbo.Schedules@fv where dbo.Schedules."SchedID" = :schedule';
    EXECUTE IMMEDIATE v_query1 into rel_date using schedule;
    I then take that rel_date variable, convert to a varchar2 (rel_date_char), and then use it as the database name in the next query...
    This returns an error_ (Error ORA-00903: invalid table name)
    v_query2 := 'select "PARTNO" from :rel_date_char.dbo.ProdDetails@fv where "SchedID" = :schedule and "UnitID" = :unit
    and "MasterKey" = :master and "ParentKey" = :parent';
    EXECUTE IMMEDIATE v_query2 into part_number using schedule, unit, master, parent;
    I have also tried using all of the following to no avail:
    'select "PARTNO" from ' || :rel_date_char || '.dbo.ProdDetails@fv where "SchedID"...
    'select "PARTNO" from ' || rel_date_char || '.dbo.ProdDetails@fv where "SchedID"...
    'select "PARTNO" from ' || @rel_date_char || '.dbo.ProdDetails@fv where "SchedID"...
    'select "PARTNO" from @rel_date_char.dbo.ProdDetails@fv where "SchedID"...
    Is there a way to do this in PL/SQL?
    Thanks for any help!
    -Ian C.
    Edited by: 946532 on Jul 15, 2012 7:45 PM

    Just did a test using passthrough:
    SQL> set serveroutput on
    SQL> declare
    2 val varchar2(100);
    3 c integer;
    4 nr integer;
    5 begin
    6 c:= dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
    7 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 'select count(*) from EMP');
    8 LOOP
    9 nr:= DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
    10 exit when nr=0;
    11 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c,1,val);
    12 dbms_output.put_line(val);
    13 end loop;
    14 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
    15 end;
    16 /
    24576
    PL/SQL procedure successfully completed.
    SQL> declare
    2 val varchar2(100);
    3 c integer;
    4 nr integer;
    5 begin
    6 c:= dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
    7 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 'select count(*) from dbo.EMP');
    8 LOOP
    9 nr:= DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
    10 exit when nr=0;
    11 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c,1,val);
    12 dbms_output.put_line(val);
    13 end loop;
    14 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
    15 end;
    16 /
    24576
    PL/SQL procedure successfully completed.
    So all 3 ways work for me.
    Edited by: kgronau on Jul 23, 2012 10:08 AM
    Now using variables to perform the select:
    SQL> declare
    2 val varchar2(100);
    3 c integer;
    4 nr integer;
    5 tabname varchar2(20) :='EMP';
    6 ownr varchar2(20) :='dbo';
    7 dbname varchar2(20) :='gateway';
    8 begin
    9 c:= dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
    10 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 'SELECT count(*) FROM '||dbname||'.'|| ownr || '.'||tabname||'');
    11 LOOP
    12 nr:= DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
    13 exit when nr=0;
    14 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c,1,val);
    15 dbms_output.put_line(val);
    16 end loop;
    17 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
    18 end;
    19 /
    24576
    PL/SQL procedure successfully completed.
    => instead of executing the statement using "execute Immediate" we have to use PASTHROUGH package to pass the statement to the SQL Server.
    Edited by: kgronau on Jul 23, 2012 10:10 AM

  • BEx query selection screen takes long time to popup

    Hi,
    I have a query which is taking long time to popup the selection screen. I have tried in RSRT the generate report option, the generating report takes 45 to 60 mins. After the report is generated the query selection screen comes up in couple of seconds. The first time I run the query everything its fine but then for the second time the problem comes back again.
    The selection screen takes +/- 40 mins to comes up in RSRT and in the portal it times out.
    I have run the statistics of the query and according to the statistics report the query takes a  lot of time for the following component :
    OLAP: Query Gen.     2681,312682
    I have removed the query from the cache monitor and after that regenerate the report. But these steps didnu2019t solve my problem.
    I made two test queries, in one query I have made the CKFu2019s and RKFu2019s directly at the infoprovider, and dragged and dropped in the KF structure. In the other query I made the CKFu2019s and RKFu2019s in the query KF structure itself. The query where I have the CKFu2019s and RKFu2019s at the infoprovider that query times out, the other query where I put the CKFu2019s and RKFu2019s in the query KF structure doesn't has this performance problem.
    What I donu2019t know is why the query is failing when I use RKFu2019s and CKFu2019s from the infoprovider, the other query donu2019t have this problem.
    Please advise how to proceed.
    Thanks in advance,
    Arash

    Hi,
    Please check the following notes which should be useful.
    1387593 - Performance optimization for query change/generation
    1416737 - Performance optimization for query change/generation(2)
    1396485 - Performance optimization for query check/save
    Then please execute the SE38 report ANALYZE_RSZ_TABLES (see notes
    1472915, 1506560) and repair/correct the different tables to optmize
    the query definition tables.
    Regards,
    Amit

  • Sql server 7.0 generation support

    Looking through the documentation, it only looks like schema up
    to sql server version 6.5 can be generated. Is this true? If
    so, are there any plans for generating or capturing schema from
    sql server version 7.0?
    null

    Rhys,
    I assume you are talking about Designer generation. Which
    version of Designer are you using?
    In Des 1.3.2, you can generate and capture from ver 7.3.4.
    In Des 2.1.2, you can generate and capture from ver 7.3.4, 8.0.4,
    and 8.0.5.
    In Des 6.0, you can generate and capture from ver 7.3.4, 8.0.4,
    8.0.5, and 8i.
    Note: This is a Headstart Only Forum. You should use Metalink
    or contact support for more general Designer questions.
    Regards,
    Lauri
    rhys smallwood (guest) wrote:
    : Looking through the documentation, it only looks like schema up
    : to sql server version 6.5 can be generated. Is this true? If
    : so, are there any plans for generating or capturing schema from
    : sql server version 7.0?
    null

  • SQL Server Maintenance Plan Issue

    SQL Server Version:
    Microsoft SQL Server 2005 - 9.00.5000.00 (Intel X86) 
    Dec 10 2010 10:56:29 
    Copyright (c) 1988-2005 Microsoft Corporation 
    Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
    Issue : Maintenance Plan - DB backup plan & TRN Log backup plan skipped / some times not deleting the old backup files.
    Error : Failed to retrieve date for this request (Microsoft.SqlServer.SmoEnum)
    Additional Informaiton
    An exception occurred while executing a Transact-SQL statement or batch.
    (Microsoft.SqlServer.ConnectionInfo)
    A Server error occurred on the current command.
    The results, if any should be discarded (Microsoft Sql Server)
    Any experts can help me to resolve this issue.
    Thanks
    drmrpush
    MRVSFLY

    Hello,
    Same issue reported here:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/601fd83c-c49f-4bf8-b69d-95431197652d/maintenance-plan-is-not-opening-on-sql-server-2005-sp2?forum=sqlkjmanageability
    Please check solution on :
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3e53ba8b-ea23-4629-98db-43c80ba9888e/cannot-save-maintenance-plans?forum=sqltools
    This problem occurs if some of the stored procedures while installing SP2 has not been applied successfully. So manually run the script below and it may resolve
    your issue. It resolved ours and we went throught exact same process of re-installing several times.
                    1)     
     First go to the folder Install . The default location is this = “C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Install “ .
    Please post back still your issue not resolves.
    2)     
    Then in this folder find this “sysdbupg.sql” .
    3)     
    Please open this script with a nodepad.
    4)     
    Then copy the
    whole script and then paste it in the Query window of the Management studio.
    5)     
    Then execute this script.
    6)     
    Once this script has been successfully executed, The issue should be resolved.
    Regards, Pradyothana DP. Please Mark This As Answer if it solved your issue. Please Mark This As Helpful if it helps to solve your issue. ========================================================== http://www.dbainhouse.blogspot.in/

  • Switch from MySQL to MS SQL Server, Query not working

    I'm sure there is a simple setting somewhere for this, but cannot seem to find it and really would appreciate some assistance. Have an application which uses JDBC to connect to a MySQL DB to run the following query without an issue:
    SELECT * FROM users
    This returns the desired results. Changed to connect to MS SQL Server 2000 using the JDBC-ODBC bridge and the same query returns no results. The problem, SQL Server wants this query instead:
    SELECT * FROM [users]
    I don't want to have to change queries depending on the DB, as that is supposed to be one of the advantages of JDBC. Is there a setting in MySQL (or the JDBC driver) to have it work correctly if I pass table names in []? Or is there a setting in MS SQL Server (or in the JDBC, or ODBC) to have it accept queries without the []?
    Or is there a different approach that I'm missing which would avoid this whole problem?
    Thanks,
    Matt

    I suspect your database definitions are different. It has nothing to do with your java code.
    The bracket syntax is used to indicate the more standard quoted identifiers in standard SQL.
    Thus you could do this in oracle and in MS SQL Server...
    SELECT * FROM "users"
    I suspect that the above will work for your MS SQL Server database and will not work for your Oracle database. However if you created the table in oracle and specifically used "users" (with the double quotes around the name) when creating the table then it would work.
    Of course if the database definitions are different it means you must use different SQL for each. Just as if the name of the table was 'other' rather than 'users'.

  • SQL server Query to sort the Stored procedure as text

    Hi
    I have a requirement as below :
    Stored procedure in SQL server has some 1000 lines of code where the SP uses select, insert , update ,delete and Joins on direct tables and as well as temp tables , the requirement is to get all text code from sp which is used for either select/insert
    except update and delete.
    for example :
    Create PROCEDURE testproc
    AS
    Begin
    /*Statement 1*/
    select id from emptable
    /*Statement 2*/
    select address into #empAddress from empAddresstbl
    /*Statement 3*/
    update a
    set id = 0 from usertbl a 
    /*Statement 4*/
    Update u
    set access=0 from usertbl u
    inner join permissionstbl p
    on u.userid = p.userid
    /*Statement 5*/
    select name into #empname
    from empnametbl
    inner join Nametbl on
    empname.id = name.id
    END
    for the given sample sp the output of query shld be
    from emptable
    from empaddresstbl
    from empnametbl
    join nametbl
    it shld not consider the table name from update/delete and the tables used for joins in updates/delete.
    This has to be achieved using  SQL
     Thanks,

    Hi All,
    Problem is solved after adding files to microsoft access 2000 runtime. runtime missing some DLLs related to sql server 2000 to update those files follow the links below
    http://support.microsoft.com/?kbid=287484
    http://www.microsoft.com/office/orkarchive/2000ddl.htm#accsql
    Thanks,
    Brahma

  • SQL Server 2012 - Dropping Snapshots takes hours

    We recently did a SQL Server upgrade from 2005 to 2012. We have a nightly job that drops a snapshot of an active database. The snapshots gets created again later in the day. Before upgrading, in SQL 2005 the Job that drops the snapshots used to finish in few
    seconds. But once the server has been upgraded to 2012, the same job takes close to an hour to complete.
    The log files for the job contains a message "Nonqualified transactions are being rolled back. Estimated rollback completion: 0%. [SQLSTATE 01000] (Message 5060) Nonqualified transactions are being rolled back. Estimated rollback completion: 100%."
    This message is repeated several times. While monitoring the underlying database, we have found some blocking on the database during that time. But if I am correct, a blocking on the underlying database should not delay a statement to drop its snapshot. May
    I know if I am correct? If so, what could be the reasons for this delay after upgrading to 2012? Any missing settings at the server or database level? Thanks.

    Hi, Please check fot eh entire errors from the error log file. the error: "Nonqualified transactions are being rolled back. Estimated rollback completion: 100%." usually come with another statement like "Database 'MyDB' is already
    open and can only have one user at a time.", Another option might be right after the message that you post that you get "Cannot open backup device '<some path to a file> Not Found'". In short, we are missing part
    of the error massage :-)
    In the example above when you see "Database 'MyDB' is already open and can only have one user at a time." then the problem is pretty clear.
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

Maybe you are looking for

  • PI 7.4 Single Stack support for Principle Propagation SAML

    Hi Folks, Que: Does the single stack now support Principle Propagation using SAML? The posts I have read so far conclude that SAML is only supported on the dual stack, not the single stack. SAP Help gives steps for dual stack: Configuring Principal P

  • How to request a new (second) contract

    According to the iTunesConnect Developers Guide, I should be able to request a new contract on the Manage Your Contracts screen. I am the Admin. and I only see the one Contract (which is in process). There is no checkbox, as shown on p. 23, p. 23, "R

  • Can I see my sms backups on iCloud?

    I'd hoped to see my text messages on my MacBook after syncing my phone.  ICloud is set up.  Can I find my sms texts somwhere on the computer?

  • Poll on my jsp

    I want to incorporate a poll on my jsp. Could anyone give me an idea how I could develop a poll for my page (and the best way to implement it)? By the way, I am just a newbie in jsp. I would appreciate anyone's help! Thanks.

  • Different php.ini for each website

    Hello! I have several websites on my Mac Mini server. The uploadmaxfilesize is set to 5MB (global) in PHP. How can I deny uploading for some (ONLY 1 or 2) websites or expand this value to (for example) 10MB? Thank You!