Quantcast
Channel: Forum SQL Server Database Engine
Viewing all 15694 articles
Browse latest View live

Timeout error while creating an index on heap

$
0
0
Hi Experts,

While trying to create a clustered idx on a HEAP Table, we are seeing below error. How to avoid this error. This Table is originally a HEAP and now we wanted to remove fragmentation (~25Gb), so tried creating clustered on this table using SSMS. It is throwing Timeout error. How to fix this? Kindly help.



Thanks,

Sam


error while adding db back to Always on

$
0
0
Hi,

we configured alwayson with 15 dbs in sql 2014. we configured full,diff and log backups. due to some reason the yesterday all log backups failed. due to this the logs grown hugely. i fixed the log backup drive.after taking continuous log backups and shrinking the log files three of the dbs logs were huge still. after trying many times as log space is not reducing i removed the dbs from always and made the recovery model simple and tried shrinking the log files. After this log space reduced and L drive came back to normal. Till here everything fine. again i made the dbs recovery mode to full. 

To add those two dbs back in alwayson setup took full backup and log backup freshly in primary replica.And restored them with no recovery mode in Secondary and DR Replica. When i tried to add the dbs in always everything was success in the validation but at the end i got a below error.

------------------------
Failed to join the database 'xyz' to the availability group 'ABCSQL2014' on the availability replica 'Replica2'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=12.0.5000.0+((SQL14_PCU_main).160617-1804)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

The mirror database, "xyz", has insufficient transaction log data to preserve the log backup chain of the principal database.  This may happen if a log backup from the principal database has not been taken or has not been restored on the mirror database. (Microsoft SQL Server, Error: 1478)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=12.00.5223&EvtSrc=MSSQLServer&EvtID=1478&LinkId=20476

------------------------------

I tried in both ways for adding dbs in always back. 
1. I restored freshly fulL backup and t-Log backup with no recovery mode in 2ndary and DR Node. while adding dbs in alwayson selected the "Join" option in Data synchronization. -got error.
2. without restoring dbs in secondary and dr node i selected "Full" option in Data synchronization by giving the network backup folder-Still got the error.:(

I tried creating the test db with one table. with above two trails i am able to add db in two replicas without errors. But why i am not able to add those dbs which i removed yesterday and add them back now?? i already restored log backup with no recovery mode. then why it is showing still needs to restore t-log backup in secondary?

Am i doing anything wrong? These are production dbs. Please help me to add them back in Always on setup.. 

Thanks
Jo

pols

Waiting queries

$
0
0
Do waiting queries increase CPU load ? How to reduce wait time of waiting queries ? 

Migrate SQL 2017

$
0
0

currently we are in   sql 2016,  (windows Server)

shall we migrate to SQL 2017?  is this SQL 2017 provides more  stability and speed ?  compare to SQL 2016.

Or wait to update SQL 2019?

sp_send_dbmail sends *.csv.txt instead of *.csv

$
0
0

The following code sends files with the extension *.csv.txt. Is there a way to send it as *.csv?

The query is executed on Microsoft SQL Server 2012 - 11.0.7462.6 (X64).

declare @sep char(1) = char(9);

exec msdb.dbo.sp_send_dbmail  @profile_name =  'DBMail', 
                     @recipients =  'mail@mail.com' ,
                    @subject =  'A subject',
                    @body =  'A body',
                    @query ='select * from [view]',
                    @execute_query_database = 'dbname' ,
                    @attach_query_result_as_file = 1,
                    @query_attachment_filename =  'vendors.csv',
                    @query_result_separator =  @sep,
                    @query_result_width = 2048

is WITH(READPAST) affected by readlocks

$
0
0

If a transaction calls a SELECT using the table hint WITH(READPAST)... will it skip rows that are locked by other SELECT statements that are in READ COMMITTED mode and are issuing shared locks?

ie. Does READPAST skip rows that are locked by SELECT statements, not just UPDATE and INSERT statements?

Restoring the Database mdb.bak file

$
0
0

Hi,

I am restoring the mdb.bak file from MS SQL 2012 server named 'ITASM' to  MS SQL 2016 server named 'ibntest002063'. But While restoring the file I am getting the error whose image is below. I have created database named 'mdb' similar to database named 'mdb'  in ITASM server.  Do let me know what other consideration I have to follow. Also restoring database backup of MS SQL 2012 to MS SQL 2016 is ok ?

Connecting a local AD Client App to a hosted Azure SQL database using Azure AD.

$
0
0

Background. I have a client that wants to move the database that they connect to from their local network to their Azure cloud server. They have purchased a few companies and they will not be able to link all of the local domains but want to have a few people access the app from the new companies they purchased. The app is used within a windows network. Its a clickonce app that uses SQL as the database and AD security group for single sign on.  Their local AD is not connected to the Cloud Azure AD or linked as this is a one off type app only used by a few users.

QUESTIONS:

How can I get each user to authenticate to the hosted Azure SQL database using the local windows credentials linked to the SQL logins?

Any help or guidance or direction on how to get this to work would be great.

Thanks


Determining the size of Buffer Pool

$
0
0

Hello!

I'm trying to figure out the size of SQL Server memory buffer pool on my server - this can be done by 1) using thesys.dm_os_buffer_descriptors view or 2)  the sys.dm_os_performance_counters view.

According to MS the buffer pool size "determines the maximum number of pages that can be cached in the buffer pool at any time in the running instance" so I think the buffer size can be found by counting all (distinct) pages returned by the sys.dm_os_buffer_descriptors view:

select distinct page_id INTO #PAGES FROM sys.dm_os_buffer_descriptors
select COUNT(*) AS cached_pages_count, COUNT(*)*8/1024 as BufferSIZEinMB from #PAGES
DROP TABLE  #PAGES;

But the sys.dm_os_performance_counters view displayes the values that differ from the one above:

Q1: Is it the Total pages counter that satisfies MS definition?

Q2: Why the number of distinct pages from the sys.dm_os_buffer_descriptors view is three times smaller than that from the sys.dm_os_performance_counters\Total pages ?

Thank you for advance,
Michael


Alwayson error

$
0
0

Hi,

We configured the Ag for 15 dbs in SQL 2014. Primary,seconadry and DR node.
Morning i found that the databases are not sync in DR Node. When i tried to join the db to AG (Resume data movement) i got the below error.

Failed to resume data movement in database 'abc', which resides on the availability replica 'DRnodeServer' in the availability group 'SQL2014'. (Microsoft.SqlServer.Smo)

Could not process the operation. AlwaysOn Availability Groups replica manager is waiting for the host computer to start a Windows Server Failover Clustering (WSFC) cluster and join it. Either the local computer is not a cluster node, or the local cluster node is not online. If the computer is a cluster node, wait for it to join the cluster. If the computer is not a cluster node, add the computer to a WSFC cluster. Then, retry the operation. (Microsoft SQL Server, Error: 35220)


Thanks,


pols


Copying and moving latest backup

$
0
0

Hi guys, 

I take a backup of my databases every night and the name of the backup is the follow:

Pippo_backup_2019_10_07_20126_5563527.bak

Pippo_backup_2019_10_08_20114_3255228.bak

.....

It means, nameDB_Backup_Year_Month_Date_??????_??????.bak

Now, I've been asked to copy and move overnight the latest backup for each database. I ma wondering how can I determine the latest backup taken?

Many Thanks

logs were not shriking

$
0
0
Hello,

I am trying to shrink  my production log file as its occupying lot of space in L drive. Its in Alwayson setup. two days back i already removed the db from alwayon and made it simple recovery mode and shrinked the log file.After this i added the db back to Ag.  Now again the logs were growing. I checked any open transactions. No open transactions. I checked the log_reuse_wait_desc. Its showing AVAILABILITY_REPLICA.

i tried below commands also. 

USE[abc]
GO
CHECKPOINT
GO
CHECKPOINT

DBCC SHRINKFILE('abc_log', 1024, TRUNCATEONLY)
go

Took  t-log backups also.tried shrinking log files. Nothing helping me to reduce the size. Infact after running the above commands the log space increased surprisingly. .
I can not remove this db from alwayson and make simple ,shrink. Please help me to reduce the log space..:(  


Thanks,

pols



How to start a SQL job on another server?

$
0
0

Here actually are 2 questions.

1. After a SQL Job finish on server 1 I want to trigger a SQL Job on Server 2.

Is there any typical solutions from Microsoft?

2. what are some popular ways to start a SQL job on different server.

 

How do I check/change which port a named instance of SQL Server is listening on

$
0
0

Hi All, 

I am trying to connect Jira service desk on one windows server (svrap01) to a database on a named instance of MS SQL Server on another windows server (svrdb01) and am getting the error

Error connecting to database

The TCP/IP connection to the host SVRDB01, port 1433 has failed. Error: "connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

I think the issue is that the named instance of the SQL Server on SVRDB01 is not listening on the right port.  How do I check/change which port the named instance is listening on?

Thanks for any help, Roscoe 

Fix CXPACKET Waittype

$
0
0

Dear Experts,

How to fix CXPACKET waittype


Kiran


Microsoft.ACE.OLEDB.16.0 provider is not registered on the local machine. (System.data)

$
0
0

Trying to import data from Excel is giving this message.

Office365 64-bit

Here's what I tried:

1) I installed the 64-bit Access database engine 2016

2) I tried the 2010 & 2007 versions as well

3) I reinstalled Office365

I'm out of ideas. What else could be going on here?

SQL Server frozen, this is happening every 8 or 6 six days,

$
0
0

This is the error:

Server log:

Date10/8/2019 1:21:21 AM
LogSQL Server (Archive #1 - 10/8/2019 7:09:00 AM)

SourceServer

Message
New queries assigned to process on Node 1 have not been picked up by a worker thread in the last 300 seconds. Blocking or long-running queries can contribute to this condition, and may degrade client response time. Use the "max worker threads" configuration option to increase number of allowable threads, or optimize current running queries. SQL Process Utilization: 24%. System Idle: 67%.

This is the text file

                                                                                                                                                                                                                                                                                                                                                                                   

Current time is 01:21:02 10/08/19.                                                                              
=====================================================================                                            
       BugCheck Dump                                                                                            
=====================================================================                                            

This file is generated by Microsoft SQL Server                                                                  
version 11.0.7462.6                                                                                             
upon detection of fatal unexpected error. Please return this file,                                               
the query or program that produced the bugcheck, the database and                                                
the error log, and any other pertinent information with a Service Request.                                       


Computer type is Intel(R) Xeon(R) CPU E5-2643 0 @ 3.30GHz.                                                       
Bios Version is HP     - 2                                                                                      
8 X64 level 8664, 3 Mhz processor (s).                                                                          
Windows NT 6.2 Build 9200 CSD .                                                                                 

Memory                               
MemoryLoad = 53%                     
Total Physical = 131037 MB           
Available Physical = 60906 MB        
Total Page File = 150402 MB          
Available Page File = 78606 MB       
Total Virtual = 134217727 MB         
Available Virtual = 134098520 MB     
**Dump thread - spid = 0, EC = 0x0000000000000000                                                               
***Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL11.SQL\MSSQL\LOG\SQLDump0005.txt          
* *******************************************************************************                                
*                                                                                                               
* BEGIN STACK DUMP:                                                                                             
*   10/08/19 01:21:02 spid 11568                                                                                
*                                                                                                               
* Deadlocked Schedulers                                                                                         
*                                                                                                               
* *******************************************************************************                                
* -------------------------------------------------------------------------------                                
* Short Stack Dump                   

access network share via openrowset

$
0
0

I am trying to access a blob on a network share but keep getting 

Msg 4861, Level 16, State 1, Line 3
Cannot bulk load because the file "\\server\share\1.jpg" could not be opened. Operating system error code 5(failed to retrieve text for this error. Reason: 15105).

the command is: 

select * from openrowset ( 
           bulk '\\server\share\1.jpg' 
           ,SINGLE_BLOB) x 

I can access the file from windows. I have given permissions to the share for the domain user running sqlserver 

obviously a delegation error. can a username/password be specified in the sp or openrowset? I just want access through sqlserver. I dont care how. would an assembly bypass this ? 

thanx


???

SQL 2016 Enterprises to SQL 2017 standard

$
0
0

Hi,

we are going to migrate SQL 2016 Enterprises to SQL 2017 Standard edition.

 what are the things to take care for this?

  •   Compatibility?
  •   can we upgrade SQL 2016 Ent to SQL 2017 Stand directly ( In-place upgrade)
  •   we are using Rebuild with online /Table partition features in Enterprises. (what are the features differentiate with         standard)
  •   Is there any difference in  Performance compare with SQL 2016 Ent vs SQL 2017Std.
  • we configured Transnational Replication.

  

  


Need suggestion on why MS SQL 2016 (sqlservr.exe) memory is not released and keeps on increasing

$
0
0

Hi,

We are using SQL Server Enterprise Evaluation 2016 (13.0.1601.5) with min memory 0 MB and Max Memory as default i.e. 2,147,483,647 MB. The RAM size is 32 GB. After restart (Failover Active to Passive and vice versa) of SQL Cluster Service, sqlservr.exe memory increases slowly i.e.  on first day 5 GB then next it reaches to 10 GB then next day 15 GB. Since memory keeps on increasing after 3-4 days  few SQL quries also takes very long time to execute. But if SQL service are restarted then those sql quries are executed within few seconds. After executing DBCC DROPCLEANBUFFERS and Freeproccache the memory is not released by SQL server. 

Also suppose If I set max memory to 15 GB then whether my daily running transactions (insert, update, select) will get fail or not after 3-4 days from restart of SQL services .

Requesting you to please suggest on this. 

Thanks in advance

Regards,

Nikhil P Desai


Viewing all 15694 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>