Quantcast
Channel: SQL Server Database Engine forum
Viewing all 12644 articles
Browse latest View live

CPU Performance

$
0
0

We've inherited some SQL server 2014 databases, they are running on Azure IaaS.  We're getting complaints about performance and trying to get a grip on it.  We're starting to look at CPU performance, and run the following test:

DECLARE @Loops INT SET @Loops = 1 DECLARE @CPU INT SET @CPU = @@CPU_BUSY DECLARE @StartDate DATETIME SET @StartDate = GETDATE() WHILE @Loops <= 100000 BEGIN IF COALESCE('123', '456') = '456' PRINT 1 SET @Loops = @Loops + 1 END

PRINT 'Total CPU time: ' + CONVERT(varchar, @@CPU_BUSY - @CPU)  
PRINT 'Total milliseconds: ' + CONVERT(varchar, DATEDIFF(ms, @StartDate, GETDATE()))
PRINT ''   
GO

On Production machine, 16 Virtual Processors (20 to 30% busy), we get the following result:

Total CPU time: 1150
Total milliseconds: 13473

On test machine, 4 Virtual Processors (also around 20 to 30% busy) we get the following:
Total CPU time: 2
Total milliseconds: 1183

I've tried running a few benchmarks on the production machine, but they don't show any problems, and always show the production machine CPU at least twice as powerful as test machine.

Is there some SQL Server setting that might be configured wrongly?  Any idea how to troubleshoot this issue?

Note the 'problem' database is running always on Availability Group, we are wondering if that may be a factor here.


dbcc shrinkfile on tran logs

$
0
0
I read that shrinking database files causes index fragmentation.  I inherited  a server with a shrink log job running every two hours against tran log files on three databases.  I think this job was put in place to shrink logs out of concern for storage capacity. The DBs are configured with full recovery mode.  One DB is about 200 GB and another is about 300 GB.   The dbcc shrinkfile syntax is like "dbcc shrinkfile(myDB, 100)".  How does shrinking just the logs impact indexes and performance overall?  Thanks.

DB Admin

$
0
0
Looking for resources on what tasks a DB Admin should do daily, weekly, and monthly. I'm new to this role and have not had any formal training. I'm familiar with the components SQL offers to monitor certain jobs, user access, and tasks but need additional help to go more in depth in other areas. e.g. improve CPU usage, indexing.

Automatic soft NUMA on SQL Server 2012 Enterprise SP4

$
0
0

Hi all,

I knew so far that automatic soft-NUMA was introduced in SQL Server 2016. I'm running SQL Server 2012 Enterprise Edition SP4 and I was playing with manual soft-NUMA, I noticed a strange message into the errorlog:

Automatic soft-NUMA was not enabled, because 'NodeConfiguration' key was detected in the registry at path 'Software\Microsoft\Microsoft SQL Server\110'. Disable registry based soft-NUMA configuration in order to activate the automatic soft-NUMA configuration

as if my instance was able to use automatic soft-NUMA...

was auto soft-NUMA back ported to SQL 2012?

SQL Server Standard 2014

$
0
0
How can I tell how many users can the licence accommodate on an installed instance on a server? Our IT Support person left and we are not sure how many users the server can take since we want to increase the number of users.

SQL Server 2012 SP4 Enterprise Edition NUMA Node imbalance

$
0
0

Hi all,

problem: NUMA node imbalance on my SQL Server 2012 Enterprise Edition which is running in a virtual environment (16 vCPU on 2 vNUMA nodes, the physical server has 2 socket with 20 cores per socket). Under heavy load I can observe that one of my NUMA node is 80-100% loaded while the other one is 40% loaded. The more the load is the more the imbalance is.

To reproduce the issue it is enough to run the TPC-C test with HammerDB, create a test DB with 400 warehouses and start the workload.

With 200 users the imbalance is small

with 400 users the imbalance is big

If, under heavy load, I query sys.dm_os_schedulers, I can observe that  runnable_tasks_count, current_workers_count and active_workers_count are not fairly distributed between NUMA nodes, as if the internal algorithm dictating the workers-to-scheduler assignment failed...

Any help?

Temp DB structure. Is it right or not?

$
0
0

Hi guys, 

I have an instance which is giving me some problem after I moved some databases on it. I think that this is related with the processes that the new databases brought in the instance and in particular in the Temp Db. Now I checked and the Temp db is split in two file, this is good but I don't feel that the mapping is good as it is at the moment:

Logical    Type      Filegroup  initial Size Autogrowth  

tempdev   ROWS... PRIMARY  253          By 256 MB, Unlimited

tempdev2 ROWS... PRIMARY  253          By 256 MB, Unlimited

templog    LOG       Not Appl. 147          By 256 MB, Unlimited

What do you think? Is it ok?

Thanks

Cannot start sqlserver service for datatabase

$
0
0

Hi all,

I am using Sql server 2005.  The server was shutdown unexpectdly.   After starting it up, I was unable to start sql server service for database instance.   The error that comes up with it is as follows:

The log scan number  passed to log scan in database ‘master’ is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf)

I have searched in google for the issue and tried to find any solution, knowing that I don't have backup for this particular database.     The workaround that I found is "other than restoring from backup sets" :

  1. Create dummy database master1 with master.mdf and master_log.mdf to different path
  2. Take master1 database offline
  3. Overwrite the files master.mdf and master_log.ldf
  4. Bring  master1 database online
  5. Take the backup of master1
  6. Overwrite the master database from backup

This solution caught my eyes because this is what I thought of when the issue persists to come after attempting to restart the service.  I am not SQL server (we don't have sql server dba).  But I thought that I could try to solve it.  So, I thought of trying to create a dummy database as mentioned above and then  replacing it with the current master db.  Because I thought the issue might be from master db.  But don't know whether it will work or do I have to do some post steps after replacing it.  I am not aware of the steps.  For example, in step 3 it says to overwrite the file master.mdf and master_log.ldf but then in step 6 it asks to overwrite the master database from backup.   I know that this step was provided by someone "not microsoft documention", it could be true.  Can someone explain how to approach this issue?  Or if there is another fix/workaround without restoring from backupsets since i don't have backup, would be appreciated

Thank you!


Who will be announced as the next SharePoint Guru? Read more about March 2019 competition!!

$
0
0


What is TechNet Guru Competition?

Each month the TechNet Wiki council organizes a contest of the best articles posted that month. This is your chance to be announced as MICROSOFT TECHNOLOGY GURU OF THE MONTH!

One winner in each category will be selected each month for glory and adoration by the MSDN/TechNet Ninjas and community as a whole. Winners will be announced in dedicated blog post that will be published in Microsoft Wiki Ninjas blog, a tweet from the Wiki Ninjas Twitter account, links will be published at Microsoft TNWiki group on Facebook, and other acknowledgement from the community will follow.

Some of our biggest community voices and many MVPs have passed through these halls on their way to fame and fortune.

If you have already made a contribution in the forums or gallery or you published a nice blog, then you can simply convert it into a shared wiki article, reference the original post, and register the article for the TechNet Guru Competition. The articles must be written in March 2019 and must be in English. However, the original blog or forum content can be from beforeMarch 2019.

Come and see who is making waves in all your favorite technologies. Maybe it will be you!


Who can join the Competition?

Anyone who has basic knowledge and the desire to share the knowledge is welcome. Articles can appeal to beginners or discusse advanced topics. All you have to do is to add your article to TechNet Wiki from your own specialty category.


How can you win?

  1. Please copy/Write over your Microsoft technical solutions and revelations to TechNetWiki.
  2. Add a link to your new article on THIS WIKI COMPETITION PAGE (so we know you've contributed)
  3. (Optional but recommended) Add a link to your article at the TechNetWiki group on Facebook. The group is very active and people love to help, you can get feedback and even direct improvements in the article before the contest starts.

Do you have any question or want more information?

Feel free to ask any questions below, or Join us at the official MicrosoftTechNet Wiki groups on facebook. Read More about TechNet Guru Awards.

If you win, people will sing your praises online and your name will be raised as Guru of the Month.


PS: Above top banner came from Rajeesh Menoth.

Artificial intelligence can never beat natural stupidity.

Tool to get historic wait events in SQL server

$
0
0

Hi Experts,

In Oracle, we have several monitoring reports like AWR which creates historic snapshot for several performance metrics and wait events in past for a particular customized time slot or duration. Does SQL server have any such utility/reports which can show me historic wait events (yesterday major waits encountered between 10 AM - 3 PM)

Best Regards,
Sandy


SQL server 2008 r2 rtm on Windows server 2012 r2

$
0
0
Hi, 

Today I updated my KBs on Windows Server 2012 R2, and on that server, there is an instance of SQL Server 2008 R2.
After I restarted the server I saw that the SQL Server Service wouldn't turn on so I tried doing it manually, its failed with errors (1053, about timeout).
I've searched on the event viewer to see if there is something related to this issue, but I found nothing that indicates why it is happening, until I've searched in the administrative section and I saw a warning that goes something like this: "this application (Microsoft SQL Server (2008 and 2008 r2)) has the following problem: Microsoft SQL Server (2008 and 2008 R2) is not supported on this version of windows"
this error showed up right after the reboot of that server, so I assumed that Microsoft has implemented some restrictions on the new KBs (allegedly related to the "end of service" on 9 in July), but when I tried to install SP1 on that instance, it went up right away...

so I want to ask if something is known to you guys about the posibility of ending the service of SQL Server 2008 R2 RTM on Windows Server 2012 R2 with the latest KBs? and why is happened to my SQL Server?

Facing performance issue with a SELECT from a very simple view in SQL Server 14.0.3048 Express Edition with DB size 16 MB.

$
0
0

Hello Everyone,

I am facing a rather unwanted performance issue.

The setup is as follows:

There is 1 Table called "BhavCopyAll" having 4 columns (SYMBOL,HIGH,LOW,TIMESTAMP)."BhavCopyAll" has 1 clustered index"ClusteredIndex-BhavCopyAll" covering all 4 columns.

3 Views:

1) DemandPivot --calls table "BhavCopyAll" only
2) SupplyPivot --calls table "BhavCopyAll" only
3) SupDem --calls views DemandPivot and SupplyPivot only

Select * From DemandPivot returns 529 rows in 9 seconds consistently.
Select * From SupplyPivot returns 460 rows in 9 seconds consistently.

But: "Select * From SupDem" does not return.

So I decided to test with SP approach.

I created 4 SPs (you can find them in DB Backup):
1) usp_SupDem_Perm (implements the exact logic as in view SupDem using perm tables)
2) usp_SupDem_# (implements the exact logic as in view SupDem using #tables)
3) usp_SupDem_@ (implements the exact logic as in view SupDem using @tables)
4) usp_SupDem_## (implements the exact logic as in view SupDem using ##tables)

When I executed these SPs, I got these results:
1) usp_SupDem_Perm returns 314 rows in 18 seconds consistently.
2) usp_SupDem_# returns 314 rows in 18 seconds consistently.
3) usp_SupDem_@ returns 314 rows in 18 seconds consistently.
4) usp_SupDem_## returns 314 rows in 18 seconds consistently.

Question is: Why does "Select * From SupDem" not return?

"BhavcopyAll" has 25100 records so I have uploaded the backup. Zipped backup is only 668 KB.

DB Backup link: https://1drv.ms/u/s!AuV9gXqFVffxhHQ37voERfUyMIOe

I am open to all possible solutions, like indexing, query hints or schema changes.

Sharat

 

Who will be announced as the next SQL DB Guru? Read more about March 2019 competition!!

$
0
0


What is TechNet Guru Competition?

Each month the TechNet Wiki council organizes a contest of the best articles posted that month. This is your chance to be announced as MICROSOFT TECHNOLOGY GURU OF THE MONTH!

One winner in each category will be selected each month for glory and adoration by the MSDN/TechNet Ninjas and community as a whole. Winners will be announced in dedicated blog post that will be published in Microsoft Wiki Ninjas blog, a tweet from the Wiki Ninjas Twitter account, links will be published at Microsoft TNWiki group on Facebook, and other acknowledgement from the community will follow.

Some of our biggest community voices and many MVPs have passed through these halls on their way to fame and fortune.

If you have already made a contribution in the forums or gallery or you published a nice blog, then you can simply convert it into a shared wiki article, reference the original post, and register the article for the TechNet Guru Competition. The articles must be written in March 2019 and must be in English. However, the original blog or forum content can be from beforeMarch 2019.

Come and see who is making waves in all your favorite technologies. Maybe it will be you!


Who can join the Competition?

Anyone who has basic knowledge and the desire to share the knowledge is welcome. Articles can appeal to beginners or discusse advanced topics. All you have to do is to add your article to TechNet Wiki from your own specialty category.


How can you win?

  1. Please copy/Write over your Microsoft technical solutions and revelations to TechNetWiki.
  2. Add a link to your new article on THIS WIKI COMPETITION PAGE (so we know you've contributed)
  3. (Optional but recommended) Add a link to your article at the TechNetWiki group on Facebook. The group is very active and people love to help, you can get feedback and even direct improvements in the article before the contest starts.

Do you have any question or want more information?

Feel free to ask any questions below, or Join us at the official MicrosoftTechNet Wiki groups on facebook. Read More about TechNet Guru Awards.

If you win, people will sing your praises online and your name will be raised as Guru of the Month.


PS: Above top banner came from Rajeesh Menoth.

Artificial intelligence can never beat natural stupidity.


Sql Server - Storing comments for table names and columns

$
0
0

Hi,

Is there any way i can associate some comments with the tables and columns? for eg. if i have a table GLAccounts, I want a comment like 'This table stores all the GL main accounts' and similarly for the columns in the table.  

Is this possible at all in SQL Server i.e. can we store comments associated with objects within SQL SERVER

thanks

MS

Step by Step Database Migration from SQL server 2016 Standard Edition to SQL server 2017 Standard Edition

$
0
0

Dear All,

We are planning to migrate existing SQL server 2016 Standard Edition to SQL server 2017 Standard Edition . I am preferring to do SQL server in-place migration . Being a junior DBA, will appreciate if anyone can provide detailed step by step migration document .

Appreciate all your assistance and cooperation .

Best Regards,
Sandy


SQL Server keeps crashing, And Dump file shows Data, How can i debug this further to find the problem?

$
0
0

We are running:

Microsoft SQL Server 2014 (SP3) (KB4022619) - 12.0.6024.0 (X64) 
Sep  7 2018 01:37:51 
Copyright (c) Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)

Crashes of the SQL instance is begging to become very frequent, and i am struggling to find the problem.

There is a section in the dump file that specifies the below error:

03/01/2019 13:00:30,spid66,Unknown,*  Detail
03/01/2019 13:00:30,spid66,Unknown,*             EXEC  REPORTDATABASE.dbo.SOFTCAT_Populate_SCSalesHistoryByDay
03/01/2019 13:00:30,spid66,Unknown,* Input Buffer 160 bytes -
03/01/2019 13:00:30,spid66,Unknown,*   Access Violation occurred writing address 0000000000000013
03/01/2019 13:00:30,spid66,Unknown,*   Exception Code    = c0000005 EXCEPTION_ACCESS_VIOLATION
03/01/2019 13:00:30,spid66,Unknown,*   Exception Address = 00007FFC023E1743 Module(OLEAUT32+0000000000001743)

I am struggling to Debug this and i Do not now how to further investigate into this issue causing crashes.

Does the above mean it is "EXEC  REPORTDATABASE.dbo.SOFTCAT_Populate_SCSalesHistoryByDay" this jobs fault?

It is quite a complex process is there steps that i can follow to help me find the issue?

How to check the processes associated to a user

$
0
0

Hi guys, 

Do you know if there is any script which can give me the processes associated with a specific user? I am going to drop some user but I'd like to know if the user has some process linked with him/her. 

Many Thanks

Measuring Availability Group synchronization lag - Clarifications

$
0
0

Can I get some help on below

As I have started and learning about the Measuring of Availability Group synchronization lag between replicas inclusive of BCP , I want to understand and learn that does this query or dashboard show the values including FileStream synchronization lag ?

My Databases are with FileStream enabled .  I am using SQL Server 2014 SP2 AOAG.

Please help me understand the above point and kindly advise me with good link or query to measure the Sync lad between replicas.


Best Regards,SQLBoy

Upgrade Application Database Schema

$
0
0

I have 70+ scripts from an Application Vendor to upgrade a database and I am trying to automate executing these scripts using SQLCMD. I have tried to shield the database from other sessions by taking the database into Single-user mode. However, database backup process or other miscellaneous process keeps blocking me as the scripts move one to another. Is there a better way to handle this? I have disabled as many known process as possible.

Thank you!



Changing the connection for the Report

$
0
0

Hi , 

I am doing the project which require me to make the existed report to cut the connection to one server and re link them to SQL server.

The report is now located in the SQL Server Reporting Services. I am now download the report in rdl format.I am not familiar to do it in the visual studio , so what are next steps to cut the original connection for reports and re link to another server?

Thank you 

Viewing all 12644 articles
Browse latest View live


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