Weird SQL server cursor issue

Hi All.
I have a stored procedure which can be seen below. The way it should work is that it should loop through a lot of all the databases on the SQL instance and pass the details onto another stored procedure. The stored procedure is called from SQL agent,
and what i am finding is that when executed from SQL agent it only calls 2 databases. The first 2 on the list. There are 6 other databases, it ignores them. If I call the stored procedure from outside of SQL agent, then it covers all the databases that
it should cover. Its really strange and I cannot think of why we have this behaviour.
When I run thesame duplicate setup on UAT, it works fine. Everything in terms of the stored procedure is exactly thesame. I am only seeing this issue on production. Any ideas please.
CREATE procedure [dbbackup].[spbackup_databases] (@BackupSysyemDB bit = 1,@BackupUserDB bit = 1, @BackupType char(1) = 'D', @BackupDB varchar(128) = NULL )
as
Begin
DECLARE @ActiveBackupID [uniqueidentifier]
DECLARE @ActiveEnabled char(1)
DECLARE @ActiveBackupDb varchar(128)
DECLARE @ActiveBackupOrder tinyint
DECLARE @ActiveBackupDirectory nvarchar(max)
DECLARE @ActiveBackupType nvarchar(15)
DECLARE @ActiveFullRetainHours int
DECLARE @ActiveDiffRetainHours int
DECLARE @ActiveLogRetainHours int
DECLARE @ActiveVerifyBackup char(1)
DECLARE @ActiveCompress char(1)
DECLARE @ActiveCopyOnly char(1)
DECLARE @BackupBlocksize int
DECLARE @ActiveChangeBackupType char(1)
DECLARE @ActiveBackupSoftwareID tinyint
DECLARE @ActiveEnableChecksum char(1)
DECLARE @ActiveBackupBlocksize int
DECLARE @ActiveBackupMaxTransferSize int
DECLARE @ActiveBackupStripes tinyint
DECLARE @ActiveCompressionLevel tinyint
DECLARE @ActiveBackupDescription nvarchar(max)
DECLARE @ActiveThreads tinyint
DECLARE @ActiveThrottle tinyint
DECLARE @ActiveEncrypt char(1)
DECLARE @ActiveEncryptionAlgorithm varchar(30)
DECLARE @ActiveServerCertificate nvarchar(max)
DECLARE @ActiveEncryptionKey nvarchar(max)
DECLARE @ActiveBackupReadWriteFileGroups char(1)
DECLARE @ActiveOverrideBackupPreference char(1)
DECLARE @ActiveLogAction char(1)
DECLARE @ActiveExecuteAction char(1)
DECLARE @ActiveBackupBufferCount int
DECLARE @ActiveBackupSystemDb varchar(128)
DECLARE @ActiveSystemBackupDirectory nvarchar(max)
DECLARE @SystemBackupType char(1)
DECLARE @ActiveSystemVerifyBackup char(1)
DECLARE @ActiveSystemFullRetainHours int
DECLARE @ActiveRetentionHours int
DECLARE @DefaultEnabled char(1)
DECLARE @DefaultBackupOrder tinyint
DECLARE @DefaultBackupDirectory nvarchar(MAX)
DECLARE @DefaultBackupType char(1)
DECLARE @DefaultFullRetainHours int
DECLARE @DefaultDiffRetainHours int
DECLARE @DefaultLogRetainHours int
DECLARE @DefaultVerifyBackup char(1)
DECLARE @DefaultCompress char(1)
DECLARE @DefaultCopyOnly char(1)
DECLARE @DefaultChangeBackupType char(1)
DECLARE @DefaultBackupSoftwareID tinyint
DECLARE @DefaultEnableChecksum char(1)
DECLARE @DefaultBackupBlocksize int
DECLARE @DefaultBackupBufferCount int
DECLARE @DefaultBackupMaxTransferSize int
DECLARE @DefaultBackupStripes tinyint
DECLARE @DefaultCompressionLevel tinyint
DECLARE @DefaultBackupDescription nvarchar(MAX)
DECLARE @DefaultThreads tinyint
DECLARE @DefaultThrottle tinyint
DECLARE @DefaultEncrypt char(1)
DECLARE @DefaultEncryptionAlgorithm varchar(30)
DECLARE @DefaultServerCertificate nvarchar(MAX)
DECLARE @DefaultEncryptionKey nvarchar(MAX)
DECLARE @DefaultBackupReadWriteFileGroups char(1)
DECLARE @DefaultOverrideBackupPreference char(1)
DECLARE @DefaultLogAction char(1)
DECLARE @DefaultExecuteAction char(1)
DECLARE @BackupDirectory nvarchar(255)
DECLARE @Error int
DECLARE @ErrorMessage nvarchar(MAX)
DECLARE @ErrorMessageOriginal nvarchar(MAX)
DECLARE @DefaultBackupKeysFolder nvarchar(maX)
DECLARE @DefaultBackupCertificatesFolder nvarchar(maX)
DECLARE @DefaultBackupSystemDbsFolder nvarchar(maX)
DECLARE @DefaultSnapshotLocation nvarchar(maX)
-- Initiate Backup Configuration Default Values
EXEC dbbackup.spinitiatebackup
-- Load defaults and insert into table if not present.
-- The default is full database backups as standard
SELECT
@DefaultEnabled = [Enabled]
,@DefaultBackupOrder = [BackupOrder]
,@DefaultBackupDirectory = [BackupDirectory]
,@DefaultBackupType = [BackupType]
,@DefaultFullRetainHours = [FullRetainHours]
,@DefaultDiffRetainHours = [DiffRetainHours]
,@DefaultLogRetainHours = [LogRetainHours]
,@DefaultVerifyBackup = [VerifyBackup]
,@DefaultSnapshotLocation = [DBCCFolder]
,@DefaultCompress = [Compress]
,@DefaultCopyOnly = [CopyOnly]
,@DefaultChangeBackupType = [ChangeBackupType]
,@DefaultBackupSoftwareID = [BackupSoftwareID]
,@DefaultEnableChecksum = [EnableChecksum]
,@DefaultBackupBlocksize = [BackupBlocksize]
,@DefaultBackupBufferCount = [BackupBufferCount]
,@DefaultBackupMaxTransferSize = [BackupMaxTransferSize]
,@DefaultBackupStripes = [BackupStripes]
,@DefaultCompressionLevel = [CompressionLevel]
,@DefaultBackupDescription = [BackupDescription]
,@DefaultThreads = [Threads]
,@DefaultThrottle = [Throttle]
,@DefaultEncrypt = [Encrypt]
,@DefaultEncryptionAlgorithm = [EncryptionAlgorithm]
,@DefaultServerCertificate = [ServerCertificate]
,@DefaultEncryptionKey = [EncryptionKey]
,@DefaultBackupReadWriteFileGroups = [BackupReadWriteFileGroups]
,@DefaultOverrideBackupPreference = [OverrideBackupPreference]
,@DefaultLogAction = [LogAction]
,@DefaultExecuteAction = [ExecuteAction]
FROM [dbbackup].[backupconfig]
INSERT INTO [dbbackup].[db_backupconfig]
[BackupID]
,[BackupDb]
,[Enabled]
,[BackupOrder]
,[BackupDirectory]
,[BackupType]
,[FullRetainHours]
,[DiffRetainHours]
,[LogRetainHours]
,[VerifyBackup]
,[DBCCSnapFolder]
,[Compress]
,[CopyOnly]
,[ChangeBackupType]
,[BackupSoftwareID]
,[EnableChecksum]
,[BackupBlocksize]
,[BackupBufferCount]
,[BackupMaxTransferSize]
,[BackupStripes]
,[CompressionLevel]
,[BackupDescription]
,[Threads]
,[Throttle]
,[Encrypt]
,[EncryptionAlgorithm]
,[ServerCertificate]
,[EncryptionKey]
,[BackupReadWriteFileGroups]
,[OverrideBackupPreference]
,[LogAction]
,[ExecuteAction]
SELECT
newid()
,s.name
,@DefaultEnabled
,@DefaultBackupOrder
,@DefaultBackupDirectory
,@BackupType
,@DefaultFullRetainHours
,@DefaultDiffRetainHours
,@DefaultLogRetainHours
,@DefaultVerifyBackup
,@DefaultSnapshotLocation
,@DefaultCompress
,@DefaultCopyOnly
,@DefaultChangeBackupType
,@DefaultBackupSoftwareID
,@DefaultEnableChecksum
,@DefaultBackupBlocksize
,@DefaultBackupBufferCount
,@DefaultBackupMaxTransferSize
,@DefaultBackupStripes
,@DefaultCompressionLevel
,@DefaultBackupDescription
,@DefaultThreads
,@DefaultThrottle
,@DefaultEncrypt
,@DefaultEncryptionAlgorithm
,@DefaultServerCertificate
,@DefaultEncryptionKey
,@DefaultBackupReadWriteFileGroups
,@DefaultOverrideBackupPreference
,@DefaultLogAction
,@DefaultExecuteAction
FROM master.dbo.sysdatabases s
WHERE s.name not in (select BackupDb from dbbackup.[db_backupconfig] where BackupType = @BackupType)
AND DATABASEPROPERTY([s].name, 'IsSuspect') = 0
AND DATABASEPROPERTY([s].name, 'IsShutdown') = 0
AND DATABASEPROPERTY([s].name, 'IsOffline') = 0
AND DATABASEPROPERTY([s].name, 'IsInLoad') = 0
AND DATABASEPROPERTY([s].name, 'IsInRecovery') = 0
AND isnull(DATABASEPROPERTY([s].name, 'IsNotRecovered'),0) = 0 -- 2012 bug
AND DATABASEPROPERTY([s].name, 'IsReadOnly') = 0
AND [s].name NOT IN ('master', 'msdb', 'model', 'distribution', 'tempdb')
-- LOAD CURSOR
DECLARE db_cursor CURSOR FOR
SELECT
s.[name]
,[Enabled]
,[BackupOrder]
,[BackupDirectory]
,bt.[BackupName]
,[FullRetainHours]
,[DiffRetainHours]
,[LogRetainHours]
,[VerifyBackup]
,[Compress]
,[CopyOnly]
,[ChangeBackupType]
,[BackupSoftwareID]
,[EnableChecksum]
,[BackupBlocksize]
,[BackupBufferCount]
,[BackupMaxTransferSize]
,[BackupStripes]
,[CompressionLevel]
,[BackupDescription]
,[Threads]
,[Throttle]
,[Encrypt]
,[EncryptionAlgorithm]
,[ServerCertificate]
,[EncryptionKey]
,[BackupReadWriteFileGroups]
,[OverrideBackupPreference]
,[LogAction]
,[ExecuteAction]
FROM [dbbackup].[db_backupconfig] bc
INNER JOIN [dbbackup].backuptype bt ON bt.BackupType = bc.BackupType
LEFT JOIN sys.databases [s]
ON [s].[name] collate database_default = [bc].[BackupDb]
WHERE [Enabled] = 'Y'
AND bc.[BackupType] = @BackupType
AND (@BackupDB is NULL OR bc.[BackupDb] = @BackupDB)
AND @BackupUserDB = 1
ORDER BY [BackupOrder] ASC
OPEN db_cursor
FETCH NEXT FROM db_cursor
INTO
@ActiveBackupDb,
@ActiveEnabled,
@ActiveBackupOrder,
@ActiveBackupDirectory,
@ActiveBackupType,
@ActiveFullRetainHours,
@ActiveDiffRetainHours,
@ActiveLogRetainHours,
@ActiveVerifyBackup,
@ActiveCompress,
@ActiveCopyOnly,
@ActiveChangeBackupType,
@ActiveBackupSoftwareID,
@ActiveEnableChecksum,
@ActiveBackupBlocksize,
@ActiveBackupBufferCount,
@ActiveBackupMaxTransferSize,
@ActiveBackupStripes,
@ActiveCompressionLevel,
@ActiveBackupDescription,
@ActiveThreads,
@ActiveThrottle,
@ActiveEncrypt,
@ActiveEncryptionAlgorithm,
@ActiveServerCertificate,
@ActiveEncryptionKey,
@ActiveBackupReadWriteFileGroups,
@ActiveOverrideBackupPreference,
@ActiveLogAction,
@ActiveExecuteAction
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @ActiveRetentionHours = CASE
WHEN @ActiveBackupType = 'DIFF' THEN @ActiveDiffRetainHours
WHEN @ActiveBackupType = 'LOG' THEN @ActiveLogRetainHours
WHEN @ActiveBackupType = 'FULL' THEN @ActiveFullRetainHours
ELSE
144
END
IF (@ActiveBackupSoftwareID = 1) SET @ActiveBackupSoftwareID = NULL
SET @ActiveBackupDescription = 'Backup for ' + @ActiveBackupDb + ' Type = ' + @BackupType + ' ON ' + CONVERT(VARCHAR(30),GETDATE(),113)
select @ActiveBackupDb,
@ActiveEnabled,
@ActiveBackupOrder,
@ActiveBackupDirectory,
@ActiveBackupType,
@ActiveFullRetainHours,
@ActiveDiffRetainHours,
@ActiveLogRetainHours,
@ActiveVerifyBackup,
@ActiveCompress,
@ActiveCopyOnly,
@ActiveChangeBackupType,
@ActiveBackupSoftwareID,
@ActiveEnableChecksum,
@ActiveBackupBlocksize,
@ActiveBackupBufferCount,
@ActiveBackupMaxTransferSize,
@ActiveBackupStripes,
@ActiveCompressionLevel,
@ActiveBackupDescription,
@ActiveThreads,
@ActiveThrottle,
@ActiveEncrypt,
@ActiveEncryptionAlgorithm,
@ActiveServerCertificate,
@ActiveEncryptionKey,
@ActiveBackupReadWriteFileGroups,
@ActiveOverrideBackupPreference,
@ActiveLogAction,
@ActiveExecuteAction
EXEC [dbbackup].[spbackup_db]
@Databases = @ActiveBackupDb,
@Directory = @ActiveBackupDirectory,
@BackupType = @ActiveBackupType,
@Verify = @ActiveVerifyBackup,
@CleanupTime = @ActiveRetentionHours,
@Compress = @ActiveCompress,
@CopyOnly = @ActiveCopyOnly,
@ChangeBackupType = @ActiveChangeBackupType,
@BackupSoftware = @ActiveBackupSoftwareID,
@CheckSum = @ActiveEnableChecksum,
@BlockSize = @ActiveBackupBlocksize,
@BufferCount = @ActiveBackupBufferCount,
@MaxTransferSize =@ActiveBackupMaxTransferSize,
@NumberOfFiles = @ActiveBackupStripes,
@CompressionLevel = @ActiveCompressionLevel,
@Description = @ActiveBackupDescription,
@Threads = @ActiveThreads,
@Throttle = @ActiveThrottle,
@Encrypt = @ActiveEncrypt,
@EncryptionAlgorithm = @ActiveEncryptionAlgorithm,
@ServerCertificate = @ActiveServerCertificate,
@ServerAsymmetricKey = @ActiveEncryptionKey,
@EncryptionKey = @ActiveEncryptionKey,
@ReadWriteFileGroups = @ActiveBackupReadWriteFileGroups,
@OverrideBackupPreference = @ActiveOverrideBackupPreference,
@LogToTable = @ActiveLogAction,
@Execute = @ActiveExecuteAction
FETCH NEXT FROM db_cursor
INTO
@ActiveBackupDb,
@ActiveEnabled,
@ActiveBackupOrder,
@ActiveBackupDirectory,
@ActiveBackupType,
@ActiveFullRetainHours,
@ActiveDiffRetainHours,
@ActiveLogRetainHours,
@ActiveVerifyBackup,
@ActiveCompress,
@ActiveCopyOnly,
@ActiveChangeBackupType,
@ActiveBackupSoftwareID,
@ActiveEnableChecksum,
@ActiveBackupBlocksize,
@ActiveBackupBufferCount,
@ActiveBackupMaxTransferSize,
@ActiveBackupStripes,
@ActiveCompressionLevel,
@ActiveBackupDescription,
@ActiveThreads,
@ActiveThrottle,
@ActiveEncrypt,
@ActiveEncryptionAlgorithm,
@ActiveServerCertificate,
@ActiveEncryptionKey,
@ActiveBackupReadWriteFileGroups,
@ActiveOverrideBackupPreference,
@ActiveLogAction,
@ActiveExecuteAction
END
CLOSE db_cursor
DEALLOCATE db_cursor
-- Deal with system databases
-- Read parameters
IF (@BackupSysyemDB = 1)
BEGIN
SELECT @ActiveBackupSystemDb = sysbk.[BackupDb],
@ActiveSystemBackupDirectory = sysbk.[BackupDirectory],
@ActiveSystemVerifyBackup = sysbk.VerifyBackup,
@ActiveSystemFullRetainHours = sysbk.[FullRetainHours]
FROM [dbbackup].[system_backupconfig] sysbk
WHERE [BackupDb] = 'SYSTEM_DATABASES'
EXEC [dbbackup].[spbackup_db]
@Databases = 'SYSTEM_DATABASES',
@Directory = @ActiveSystemBackupDirectory,
@Verify = @ActiveSystemVerifyBackup,
@CleanupTime = @ActiveSystemFullRetainHours,
@BackupType = 'FULL'
END
End
GO

Does your SQLAgent account has enough permissions to do this? Is SQLAgent given sysadmin permissions?
Which account does you use in SSMS to run this stored procedure?
Regards, Ashwin Menon My Blog - http:\\sqllearnings.com
It has the permissions as its sysadmin, if it didnt then the 2 data sets would not be returned. for some reason its only looping twice. could this be something to do with the cursor type ?

Similar Messages

  • Required info on SQL Server Performance Issue Analysis and Troubleshoot way

    Dear All,
    I am going to prepare the simple documentation steps on SQL Server Performance Issue Analysis and troubleshoot method. I am struggling to make this documentation since we have different checklist (like network latency,disk latency, memory/processor pressure,SQL
    query tuning etc) to validate once application performance issue reported from the customer.So, I am looking for the experts document or link sharing .
    Your input will help for document preparation in better way.
    Thanks in advance.

    Hi,
    Recommendations and Guidelines on configuring disk partitions for SQL Server
    http://support.microsoft.com/kb/2023571
    Disk and File Layout for SQL Server
    https://blogs.technet.com/b/dataplatforminsider/archive/2012/12/19/disk-and-file-layout-for-sql-server.aspx
    Microsoft SQL Server 2012 Performance Tuning: Implementing Physical Database Structure
    http://www.packtpub.com/article/sql-server-2012-implementing-physical-database-strusture
    Database Mirroring Best Practices and Performance Considerations
    http://technet.microsoft.com/en-us/library/cc917681.aspx
    Hope the information helps.
    Tracy Cai
    TechNet Community Support

  • SQL Server Connection Issue

    I've tried going through the steps to resolve the issue, but I am still coming up blank. The part that I am not understanding is the, "A non-recoverable error occurred during a database lookup." part.
    Is this a security problem? I can establish an ODBC connection to the server as well as connect and query through visual studio, however when trying to run it through one of our custom programs, it throws this error message. 
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider:
    TCP Provider, error: 0 - A non-recoverable error occurred during a database lookup.)

    There are many reasons of SQL server connectivity issue. Refer checklist to find out the real cause of connectivity issue.
    1. Check SQL services are running
    2. Check SQL Browser service is running
    3. Check remote connections are enabled
    4. Network connectivity between database & application servers by TRACERT command
    5. Check TCP/IP protocol enabled at SQL server
    6. Check talent connectivity – telnet <IP address> <port no on SQL server running>
    7. Check UDP port 1434 is open or not on SQL Server
    8. Check firewall is running or not Check
    9. If firewall running, SQL Server & UDP port must be added in exception in firewall
    10. Run SQL Discovery report on machine SQL server installed, to check you are using correct instance name to connect( default \named) -http://mssqlfun.com/2013/02/26/sql-server-discovery-report/
    http://mssqlfun.com/2012/09/28/check-list-for-sql-server-connectivity-issue/
    Regards,
    Rohit Garg
    (My Blog)
    This posting is provided with no warranties and confers no rights.
    Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

  • SQL Server Performance Issue in Memory

    Dear All
    Can you please help me out of this below issue.
    My Server having : Windows 2012 SD 64 bit
    SQL : SQL 2008 R2 64 bit SP1 
    Memory : 64 GB
    SQL Min Memory : 45 GB and Max memory : 55 GB so remaining 9 GB available
    but my sql server any time shows 94% memory utilization. i have checked below points
    Physical Memory_MB                      Physical Memory_GB                      Virtual Memory GB
    65536                                   64                                      8192
    Buffer Pool Usage at the Moment
    BPool_Committed_MB                      BPool_Commit_Tgt_MB                     BPool_Visible_MB
    56320.000000                            56320.000000                            56320.000000
    Total Memory used by SQL Server Buffer Pool as reported by Perfmon counters
    Mem_KB               Mem_MB                                  Mem_GB
    57671680             56320.000000                            55.000000000
    Memory needed as per current Workload for SQL Server instance
    Mem_KB               Mem_MB                                  Mem_GB
    57671680             56320.000000                            55.000000000
    Total amount of dynamic memory the server is using for maintaining connections
    Mem_KB               Mem_MB                                  Mem_GB
    912                  0.890625                                0.000869750
    Total amount of dynamic memory the server is using for locks
    Mem_KB               Mem_MB                                  Mem_GB
    40296                39.351562                               0.038429260
    Total amount of dynamic memory the server is using for the dynamic SQL cache
    Mem_KB               Mem_MB                                  Mem_GB
    2056                 2.007812                                0.001960754
    Total amount of dynamic memory the server is using for query optimization
    Mem_KB               Mem_MB                                  Mem_GB
    2880                 2.812500                                0.002746582
    Total amount of dynamic memory used for hash, sort and create index operations.
    Mem_KB               Mem_MB                                  Mem_GB
    0                    0.000000                                0.000000000
    Total Amount of memory consumed by cursors
    Mem_KB               Mem_MB                                  Mem_GB
    28464                27.796875                               0.027145385
    Number of pages in the buffer pool (includes database, free, and stolen).
    8KB_Pages            Pages_in_KB                             Pages_in_MB
    7208960              57671680.000000                         56320.000000000
    Number of Data pages in the buffer pool
    8KB_Pages            Pages_in_KB                             Pages_in_MB
    6710944              53687552.000000                         52429.250000000
    Number of Free pages in the buffer pool
    8KB_Pages            Pages_in_KB                             Pages_in_MB
    234598               1876784.000000                          1832.796875000
    Number of Reserved pages in the buffer pool
    8KB_Pages            Pages_in_KB                             Pages_in_MB
    0                    0.000000                                0.000000000
    Number of Stolen pages in the buffer pool
    8KB_Pages            Pages_in_KB                             Pages_in_MB
    263418               2107344.000000                          2057.953125000
    Number of Plan Cache pages in the buffer pool
    8KB_Pages            Pages_in_KB                             Pages_in_MB
    135772               1086176.000000                          1060.718750000
    Page Life Expectancy - Number of seconds a page will stay in the buffer pool without references
    Page Life in seconds PLE Status
    111450               PLE is Healthy
    Number of requests per second that had to wait for a free page
    Free list stalls/sec
    373
    Number of pages flushed to disk/sec by a checkpoint or other operation that require all dirty pages to be flushed
    Checkpoint pages/sec
    8052165
    Number of buffers written per second by the buffer manager"s lazy writer
    Lazy writes/sec
    1247
    Total number of processes waiting for a workspace memory grant
    Memory Grants Pending
    0
    Total number of processes that have successfully acquired a workspace memory grant
    Memory Grants Outstanding
    0
    My User asking how much sql transaction takes out off 55 GB , and each transaction how much takes, how to find sql healthy and sql needs how much memory. 
    Thanks
    Mohamed Udhuman

    Issue i mentioned here, Memory bottleneck is available or not , how to avoid sql buffer pool takes more memory means.
    Thanks
    Mohamed Udhuman
    Hello,
    Your output you posted does not makes sense or may be I am not able to understand it..If you want through analysis I need following from you
    1.
    select
    (physical_memory_in_use_kb/1024)Memory_usedby_Sqlserver_MB,
    (locked_page_allocations_kb/1024 )Locked_pages_used_Sqlserver_MB,
    (total_virtual_address_space_kb/1024 )Total_VAS_in_MB,
    process_physical_memory_low,
    process_virtual_memory_low
    from sys. dm_os_process_memory
    2 What is reason for keeping Max server memory and Min server mmory almost equal. 55 G is MAX and 45 G is min.
    3. Does SQL server account has locked pages in memory privilege ?
    4. Did you see any out of memory error ?
    5 Please post output of DBCC MEMORYSTATUS and SP_readerrorlog on skydrive and post location here.
    PS: SQL server utilizing memory is normal behavior ,what you posted does not exactly points to memory pressure and what seems to me cause here is poorly written queries running.
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    My TechNet Wiki Articles

  • Sql Server Connection Issues

    After reinstalling Windows Server 2008 R2 EE my SQL 2008 R2 Sp2 Instances have some connection issues.
    The server were installed under the same hostname, but he got a new sid in my active directory.
    On the server there one DB Engine MSSQLSERVER, two named Reporting Services for MS crm 4.0 and SCOM and one Analysis Services Instance.
    The DB Engine will collect Data from another DB, before writing to Analysis Services.
    Here are the problems on the server:
    When I connect via SSMS remotly, I sometimes get this error: Failed to connect to server <hostname> ... Named Pipes Provider, error 40 - Could not open a connection to SQL Server - Error 5
    Both RS Instances have many event log errors like "Report Server (Instance) cannot connect to the report server database.". RS Reports are working fine, but sometimes the rendering is taking a long
    time.
    The DB Engine Agent Job to collect Data sometimes throw the following error: An OLE DB error has occurred. Error code: 0x80004005.  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult:
    0x80004005  Description: "Unable to complete login process due to delay in opening server connection".  End Error  Error: 2013-12-10 06:03:40.41     Code: 0xC00291EC
    User use Excel to connect to the Cube on my server. Often they got timeout errors. When they connect again it will work.
    Are there any solutons on this?
    Thanks a lot!

    Hello,
    The server were installed under the same hostname, but he got a new sid in my active directory.
    Did you connect to SQL Server instance with Windows authentication? Since the SID of domain account is changed, the SQL Server instace may cannot verify the login account which stored in the master with old SID. In that case, please try to connect
    SQL Server with SQL authentication and then readd the domian as login the instance.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • OraOledb for 64-bit, Linked Servers and SQL Server 2005 issues

    Our environment is : SQL Server 2005, Windows Server 2003, 64-bit and 32-bit operating systems.
    Problem on 64-bit operating system box: (32-bit works fine).
    I am trying to access Oracle 10g database using linked server from our SQL Server 2005. In case of number fileds i got the following error:
    Invalid data for type "numeric".
    After going through one of the posting in this forumn i was able to resolve the problem by converting those column values to char while querying and then converting them back to numeric type on SQL server side.
    But today i ran into another problem. There is a VARCHAR2 column. I was able to retrieve the data yesterday for that column but today i am getting a blank recordset. If i exclude the colum from the query then i am getting all the rows.
    I am querying against a view and it has got a number of columns whose data type is VARCHAR2.
    Again the problem is on 64-bit operating system only. We have a 32-bit operating system on which i am able to retrieve the data including this column. I looked at the data and everything looks OK. No funny characters etc.
    I tried workarounds like using cast, to_char, checking for nulls etc., Nothing works.
    Any help is greately appreciated. Thanks.

    Did you find a resolution for this? We have similar problem. Set up a linked server in SQL 2006 to Oracle (running on Windows 64-bit) Linked server works and views I had set up were working but they added some new data in the Oracle test database I am using and now I get errors on one of the views.
    Error I am getting on the view is "Cannot initialize the data source object of OLE DB Provider "OraOLDEDB.ORacle" for the linked server"
    If I fine tune my queries to find the specific table or view that is at issue, then I get the error "inconsistent metadata for a column"

  • SharePoint 2010 and SQL Server 2012 issue

    Hi,
    I have SharePoint 2010 integrated with SQL Server 2008 R2 in my machine. I wanted to use Power View feature, so I went for SQL Server 2012 installation. Now when I try to create the SQL Server Reporting service service application, it says, this feature
    is not supported by current version of database.
    Please let me know how to fix the issue. Do I need to reinstall SharePoint 2010 once again using SQL Server 2012 ?
    thanks
    Tarique

    http://social.technet.microsoft.com/Forums/sharepoint/en-US/9eacbd00-f264-4f55-bd27-55cf0761cbd7/power-view-is-not-supported-in-this-edition-of-reporting-services?forum=sharepointadmin
    The only requirements for SSRS Integrated mode/PowerView are that you're using SharePoint Enterprise and SQL Enterprise/BI and that SharePoint be installed and joined to the farm on the server where you're also installing SSRS.
    You need to reconfigure your sharepoint farm farm to use SQL server 2012 
    http://technet.microsoft.com/en-us/library/ee210640.aspx
    Business intelligence features are not all available in all editions of SQL Server 2012

  • Database Adapter and SQL Server procedure issue

    Hello,
    I am using Jdev 11.1.1.7.0 and SQL Server 2005.
    In the Database Adapter configuration wizard, Specify Stored Procedure step, I choose the “GEACupax” schema and got the following error after a click on “Procedure Browse” button:
    com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'GEACUPAX.INFORMATION_SCHEMA.SCHEMATA'.
    The command Database Adapter tried to execute was:
    (from jdev log:) select schema_name from GEACUPAX.INFORMATION_SCHEMA.SCHEMATA order by schema_name;
    Note, the schema name has changed to uppercase. I think that is the problem. If I try this query in SQLDeveloper, it returns the same error. I can fix it changing the schema name to “GEACupax”. The case matters.
    Any ideas?
    Leandro.

    Vijay,
    Thanks for you reply.
    I figure out a related bug:
    Bug 12859472: Cannot browse store procedure in case-sensitive MS SQL Database
    There are two possible workarounds:
    1. Use a database name with capital letters
    2. Do not use stored procedures, but access the tables directly.
    The notes on the Bug ticket describes that the issue would be scheduled to be fixed in PS7 which is 11.1.1.8.
    Cheers!
    Leandro.

  • SQL Server Mail Issue in 2012

      Hi
    I configured in SQL Server Database Mail Option in SQL Server 2012 using Gmail SMTP with all correct parameters but when i sending the mail i got the below error message
    broker is also enabled in msdb database.
    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2014-06-24T16:51:23). Exception Message: Could not connect to mail server. (A connection attempt failed because the connected party did not properly
    respond after a period of time, or established connection failed because connected host has failed to respond 74.125.25.108:587).)
    pls do the need ful
    Here i attached mail conf wizard
    --Ragu Thangavel
    Ragu Thangavel

    Hey ragu,
    See the first film of a long TRAINSIGNAL quite comprehensively explains the use and settings of the mail server, but it illustrates not GMAIL service.
    https://www.youtube.com/watch?v=DAlD8Bzbtcs
    The second film explains how to configure GMAIL account (a port set, what server address, and the like) is only relevant for GMAIL account.
    https://www.youtube.com/watch?v=j69e3mTJF0k
    If you go to the movies can also rule out any important issues such as whether the service works, misconfiguration, etc. .. and you can learn more about the subject.
    Please Mark This As Answer if it helps to solve the issue
    Tzuri Ben Ezra | My Certifications:
    CompTIA A+ ,Microsoft MCP, MCTS, MCSA, MCITP
    |
    FaceBook: Tzuri FaceBook | vCard:
    Tzuri vCard | 
    Microsoft ID:
    Microsoft Transcript 
     |

  • OraOledb, Linked Servers and SQL Server 2005 issues

    Some issues I've come across when using SQL Server 2005 (and SQL Server Express 2005), the OraOLEDB provider (10.2.0.1) and a linked Oracle database (8.1.7.4.0 64-bit)
    1) You must set the OraOledb.Oracle\AllowInProcess value to 1 to allow the OraOledb provider to run in SQL Server's process. Without doing this I receive an 'unspecified error' from the OLE DB provider when attempting to run a query
    2) When running a ' select * ' query across a linked server using the provider, I receive the following error: Msg 9803, Level 16, State 1, Line 1
    Invalid data for type "numeric". I can, however, select all of the columns by name and the query completes (no error). Sometimes the 'select *' query returns a few rows before the error, sometimes it doesn't. The Microsoft Provider for Oracle does not have this problem

    Okay... I've got a Win2K3 Std Ed server (x64) running 64-bit SQL Server 2005 Enterprise Edition. I've installed the Oracle 10g 10.2.1 full client and admin tools, added two named services via the NetConfig assistant, and successfully set up (and tested) a connection via the ODBC Administrator to an Oracle database.
    Now... when I try to create a new connection manager in SQL Server 2005 Integration Services, the OLEDB provider for Oracle can't be found, and when I try to manually add an underlying OLEDB connection to the database, SQL Server reports:
    Test connection failed because of an error in initializing provider. The 'OraOLEDB.Oracle.1' provider is not registered on the local machine.
    Does anyone know what I need to do to see my ODBC Server data connections in SQL Server 2005 (64 bit)? I don't have this issue on my 32-bit SQL Server 2005 servers.

  • SQL Server 2014 issues

    Hello:
    I have bumped upon a design issue with SQL Server 2014.
    I want to report this to Microsoft, where it can be addressed and corrected in the upcoming Service packs.
    This is something critical.. (that's what at least....I feel).
    Please let me know the link/Forum where I can post this.
    Thanks

    Two possibilities. On Microsoft connect
    https://connect.microsoft.com/SQLServer/Feedback
    or in SQL Server forums.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?category=sqlserver
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • SQL server Timeout issue in data insertion

    We are loading data from DB2 database to SQL server using Data flow task. During data insertion in SQL server, we are receiving the below error.
    "An exception has occurred during data insertion, the message returned from the provider is: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."
    Kindly help to resolve this issue.
    Thanks!!!

    Check the connection timeout property of the source connection.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/a5571966-b14e-45c6-9ce8-4f5651d3ee00/ado-net-destination-timeout-issue?forum=sqlintegrationservices
    Regards, RSingh

  • SQL Server 2008r2 issue for w8.1

    Hi,
    I am getting sql server 2008r2 compatibility issue for w8.1 whenever I try to installed it.Please check the attached screen shoot given bellow

    You must read
    Hardware and software requirements for SQl Server 2008 r2 before proceeding. You did not told edition of SQL server you are trying to install on windows 8.
    Enterprise edition is not supported on windows 8
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Articles

  • SQL Server Connectivity Issue

    I am able to connect the server but not to the SSMS. getting the below error:
    The client was unable to establish a connection because of an error during connection initialization process before login. Possible causes
    include the following: the client tried to connect to an unsupported version of SQL Server; the server was too busy to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server. (provider:
    TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.) (Microsoft SQL Server, Error: 10054)"
    To fix it :
    I have done some changes in system registry..
    from the path... \System\CurrentControlSet\Control\Lsa\Kerberos\Parameters
    -- Added the following registry value:
    Name: MaxTokenSize
    Data type: REG_DWORD
    Radix: Decimal
    Value: 48000
    --Rebooted server
    and it resolves the issue for me..
    BUT it is happening weekly basis..
    and every time server restart resolves the issue.
    CAN ANYBODY HELP TO FIX THE ISSUE PERMANENTLY..
    Details :
    SQL Server 2005 -- SP4 -- Standard Edition (64-bit)
    MS Windows Server 2003 R2 -- SP2-- Standard x64 Edition
    RAM: 16 GB
    Thanks in advance...

    It says clearly ofcourse need to check so-
    the client tried to connect to an unsupported version of SQL Server;
    >>check what version of client tools you are using for ex- you can connect sql2005 from 2008 but reverse is not possible (ofcouse it will gives complete info) or you are using one which is not the right version tool,
    the server was too busy to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server.
    >>Check during that time what was the lad on the server like cpu,mem or other issues.
    check in the sql errorlog.
    (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.) (Microsoft SQL Server, Error: 10054)"
    check ->Troubleshooting: Connection Forcibly Closed
    http://msdn.microsoft.com/en-us/library/ms187005(v=sql.105).aspx
    Thanks, Rama Udaya.K (http://rama38udaya.wordpress.com) ---------------------------------------- Please remember to mark the replies as answers if they help and UN-mark them if they provide no help,Vote if they gives you information.

  • SQL Server Connectivity Issues

    Hi,
    I am getting the below error intermittently. On the Database server, CPU, Disk I/O, and Network all look fine.
    Any suggestions on where to track what may be causing this issue? Thanks!
    The underlying provider failed on Open. ---> System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation
    timed out.) ---> System.ComponentModel.Win32Exception: The wait operation timed out
    Thanks.

    Hi,
    Restarted the server 5days ago but getting these connection issues each day since and for a couple of weeks before restart.
    Apps connecting are .Net and using Entity Framework, but occasionally I get the connection error when attempting to connect through SSMS.
    Full error below...
    Error Checking Previous SignOffs
    System.Data.EntityException: The underlying provider failed on Open. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception: Access is denied
    --- End of inner exception stack trace ---
    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
    at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)
    at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
    at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
    at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
    at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)
    at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
    at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
    at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
    at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
    at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
    at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
    at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
    at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
    at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
    at System.Data.SqlClient.SqlConnection.Open()
    at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
    --- End of inner exception stack trace ---
    at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
    at System.Data.EntityClient.EntityConnection.Open()
    at System.Data.Objects.ObjectContext.EnsureConnection()
    at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
    at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
    at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
    at Checks.CheckFundsNotSignedOff(String ID, DateTime accPeriod, Levels level)
    at GeneralView.CheckPreviousSignOffs(String selectedID, Levels selectedLevel)
    Thanks.

Maybe you are looking for

  • I tunes problems

    when i try to open itunes i get a message "itunes can not be opened" -1712 what can i do?

  • Materialized View Refresh; Process Flow

    I was wondering if anyone has used process flow to refresh materialized view; I am trying to use a process flow for this i.e. run something similiar to below EXECUTE dbms_refresh.refresh('"ODW_SRC"."MV_SERVICE_DAILY_AUDIT"'); I am trying to avoid usi

  • MobileMe Gallery on iPod Touch

    Hello! Anyone know if there's a way to get the MobileMe Gallery on Photos on an iPod Touch?

  • Consignment sttelement price to be as goods entry price

    Hi, Can you please provide us the valuable inputs how we can achieve the below thing. In Info record we had two prices as per the date 1) 24.02.2010 to 24.03.2010 2) 25.03.2010 to 31.05.2010. We had created the consignment PO with Price Date Category

  • Ajax autocomplete component in page fragment

    Hi I've used ajax autocomplete field in page fragment (for searching) but it's only visible on one page. How to make it visible everywhere? Michal