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

Query to calculate long running SQL jobs (Report)

$
0
0

capture SQL job running metrics and store into below physical  table (day by day),  (this table contains last 60 days data).

Purpose : fetching a job which is taking longtime to run ( by comparing avg running time - like standard deviation ).

below FactLoadCubeProcess sqljob contains 9 steps,   

StepDurHHMMSS  column value = HH:MM:SS  ( 11455 means  1:14:55  )

Need a query to find which SQL job taking long time compare to previous avg time...

Jobname,stepname,date,durationrunning, avgrunning



Always Encrypted - Master Key Certificate - for Production from CA

$
0
0

I am using the SQL Server 2016 -  "Always Encrypted" feature locally. Currently I am using Self Signed Certificate and creating the certificate using powershell command. 

$cert1 = New-SelfSignedCertificate -Subject "ABC210902" -CertStoreLocation Cert:LocalMachine\My -KeyExportPolicy Exportable -Type DocumentEncryptionCert -KeyUsage DataEncipherment -KeySpec KeyExchange

Now I want to plan for production, and I assume we need get the certificate from a CA authority. Can you please guide me as what type of certificate should we purchase and what additional features the certificate must have to make it a Master Key Certificate?

Not able to generate Self Signed Cert in Windows Server 2012 R2 using Powershell for SQL Always Encrypted

$
0
0

Not able to generate Self Signed Cert in Windows Server 2012 R2 using Powershell for SQL Always Encrypted. I have SQL Server 2016 installed.

The options for New-SelfSignedCertificate command in Powershell, is very less in Windows Server 2012 R2

We don't get the ---- -KeyExportPolicy Exportable -Type DocumentEncryptionCert -KeyUsage DataEncipherment 

MSOLEDBSQL Provider Link Server

$
0
0

I'm trying to create a link server with the new MSOLEDBSQL provider, to make use of the MULTISUBNETFAILOVER options, but all attempts to create one regardless of SQL Version results in "Microsoft Distributed Transaction Coordinator (MS DTC) has stopped this transaction." errors.  Are there any fixes for this yet? 

SSMS would not authenticate after installing SQL on domain controller

$
0
0
I am getting 18456 error when trying to log on to sql management studio. i have installed sql on domain controller and i cannot log on neither by windows authentication nor sql authentication

SSMS would not authenticate after installing SQL on domain controller

$
0
0
I am getting 18456 error when trying to log on to sql management studio. i have installed sql on domain controller and i cannot log on neither by windows authentication nor sql authentication

Self signed cert used for one connection only, rest of connections not encrypted

$
0
0

One SQL 2016 prod database VM is being used by users for querying data, analytics, reporting, etc. users are in same domain and not using SSL. However, one database in another data center will query regularly one of the database on this first server. In order to use SSL, I can configure self-signed cert to protect communications between db servers in these 2 data centers.

AFAIK, if I force encryption on the instance, just encrypted connections are allowed, which is not what I need. or I need to separate this database into a separate instance just for this. I do not have a spare dev where to test this.

Can I enable SSL encryption that will be used by the remote server only, while regular users will not use SSL on same instance?

Thank you,



Easy way to import into SQL Server, by using a DMP from Oracle

$
0
0

What is the best way to import from Oracle DMP into SQL Server 2012?

Thanks


Problem with SQL server mail

$
0
0

Dear All,

Whenever I try to send any  mail from SQL server  via any jobs or maintaience plan, mail is going to queue without sending . Any help regarding this will be highly appreciated. I am using SQL server 2016 Standard Editions with SP2 and CU3 installed .


Best Regards,
Sandy

visual studio 2010 with sql server 2008

$
0
0
I have windows 10 on my laptop. so day before yesterday I installed visual studio 2010 and for connecting database i need sql server 2008. So can anyone answer will it support to windows 10.

SQL Server: Changing Recovery Model Concerns

$
0
0

All,

I'll start with the fact that I am not the "SQL Guy" or a SQL DBA. I'm working on a new client's backups and found that they have a Windows Server 2008 R2 server running SQL Server 2008 R2 Standard that hosts a SharePoint DB. This server stopped backing up a few days ago and it appears the server is out of available overhead for VSS to complete snapshots.

Additionally, the SQL DBs hosted on this server appear to not have been backed up since mid 2015. This is due to the SharePoint DB's LDF being ~214 GB. The MDF itself is only 650MB and it appears their original SQL maintenance plan had not been configured correctly to complete the log truncation.

After discussions with the client, they do not require point in time recovery but do have some concerns with a switch to Simple Recovery. As I'm not versed in SQL, I'm looking for some input. Below is what we're trying to gauge.

1.) How long would SQL take to flip the DB from Full to Simple Recovery Model with such a large LDF? (The client is a 24/7 shop and requires a high level of uptime and strict outage windows).

2.) Once the Full to Simple Recovery operation has been initialized, can it be stopped without any detrimental effects to the production DB? (They pose this question in the event the process time is determined to be excessive) My gut says it would be similar to terminating a CHKDSK operation on a NTFS volume, you never stop it once it's started, unless you want to risk data loss or corruption.

Below are the full specifics for the server and SQL:

===========================

Server: Windows Server 2008 R2

SQL: SQL Server 2008 R2 Standard RTM (10.50.1600.1)

Database: 650MB MDF / 214GB LDF

============================

Any and all help is greatly appreciated and thank you for your time.

SQL Agent Schedule

$
0
0

I have many SQL Server Agents Jobs. Many were scheduled at the same time. Say 1:00 am. In the schedule lists they are duplicates. I want to delete most of them and just keep one and then I want those Agent jobs to share the schedule if these jobs are going be scheduled at that time.

How can I delete these schedules? Thanks.

SQL Server max worker thread

sql errorlog of 845

$
0
0

server updated with SQL 2016 sp2,

error:

Time-out occurred while waiting for buffer latch type 4 for page (1:1735396), database ID 6. [SQLSTATE 42000] (Error 845).

Server resource (memory & core)

$
0
0

whenever cube process happen in my server A  (contains OLTP & OLAP),

Resource Monitor (0x110c) Worker 0x0000012EBA70A160 appears to be non-yielding on Node 0. Memory freed: 0 KB. Last wait: MISCELLANEOUS. Last clerk: type USERSTORE_TOKENPERM, name ACRUserStore-1369120-1-1. Approx CPU Used: kernel 0 ms, user 0 ms, Interval: 66658.



--current schedule task
SELECT scheduler_id, current_tasks_count, runnable_tasks_count, work_queue_count, pending_disk_io_count,cpu_id
FROM sys.dm_os_schedulers
WHERE scheduler_id < 255 order by runnable_tasks_count desc


efficiently recreating filtered indexes, why is it not done?

$
0
0

Hello,

I have a 500M rows table on which I want to create a filtered index containing rows of the last year. Every month I want to recreate the index (with drop_existing = on) dropping one month from it.

I expected this would be very fast, as it only needs to remove rows from the front of an existing index. No sorting and no need to read all the data.

My experiments show however that the clustered index is scanned, all rows are read, and an expensive sort is done.

Even when I create a new filtered index that is more restrictive than the existing, still all rows from the clustered index are read and sorting is done. Why is the existing filtered index not used, even though it contains all the data in the right order?

Curious to hear. Thanks 

not sure if applies to this forum or tsql

$
0
0
 

 

 I have been trying to find the top 10 worst performing procedures with this code.

Sql2012

SELECT TOP 10 *
FROM 
(
    SELECT 
         DatabaseName       = DB_NAME(qt.dbid)
        ,ObjectName         = OBJECT_SCHEMA_NAME(qt.objectid,dbid) + '.' + OBJECT_NAME(qt.objectid, qt.dbid)
        ,DiskReads          = SUM(qs.total_physical_reads)   -- The worst reads, disk reads
        ,MemoryReads        = SUM(qs.total_logical_reads)    --Logical Reads are memory reads
        ,Executions         = SUM(qs.execution_count)
        ,IO_Per_Execution   = SUM((qs.total_physical_reads + qs.total_logical_reads) / qs.execution_count)
        ,CPUTime            = SUM(qs.total_worker_time)
        ,DiskWaitAndCPUTime = SUM(qs.total_elapsed_time)
        ,MemoryWrites       = SUM(qs.max_logical_writes)
        ,DateLastExecuted   = MAX(qs.last_execution_time)
    FROM sys.dm_exec_query_stats AS qs
    CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt
    GROUP BY DB_NAME(qt.dbid), OBJECT_SCHEMA_NAME(qt.objectid,dbid) + '.' + OBJECT_NAME(qt.objectid, qt.dbid)

) T
ORDER BY IO_Per_Execution DESC
 The top one on the list has databaseName null and objectname null yet memoryreads,executions and IO_per_execution
are big numbers. How can I find which process it is?
 Thanks.

Java language programmability extension details?

$
0
0
Where can I find more information about Java language programmability extension, which is a new part of Machine Learning Services, in SQL Server 2019 CTP 2.0?

The first thing I'm wanting to learn is how database-called Java code can turn around and do its own queries on the database.

IIS thrown htttp 500 error

$
0
0

lot of 500 (internal server error) thrown for particular  page  with post method,

is 500 error due to db error?


in iis log :

2018-12-05 23:45:30 10.240.0.10 POST /shared/tickets/eval_condition - 443 - 96.71.57.33 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/70.0.3538.110+Safari/537.36 
https://admin.maxiwel.com/pops/orders/create_ticket?id=3507609 500 0 0 46

Exclude DB backup from Volume snapshot backups (VSS)

$
0
0

Volume snapshot backups (VSS) backup happen one of my warehouse server,

does VSS backup degrade DB performance (I/O)?  i already have DB backup via SQL script,

how to exclude DB files from VSS?

Viewing all 15911 articles
Browse latest View live


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