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

Maintenance Plan

$
0
0

Hi All,

On one of our backup maintenance plan, the DB Backup task is configured to backup & also check the backup integrity.

Our management wants to know if it was added to perform backup integrity when the plan was created or later it was added.

Is there a way to check? If yes, can you please let me know.



No SQLPackage.exe in SQl Server 2019 ?

$
0
0

Hi,

Our installer are failing as they are unable to find SQLPackage.exe on SQL Server 2019. Copied DAC folder of 2012 and put it in 150 folder, it didn't work.

Pls help...

igraph png not working on SQL Server 2019

$
0
0

Hi,

I made some tests with Graph Databases and was trying to use R services do create an image file of the graph. I'm not an R specialist but I was able to write an R script to create the image, it works very well on SQL Server 2017.

The R script:

exec sp_execute_external_script @language = N'R', 
@script = N'
require(igraph)
g <- graph.data.frame(graphdf)
V(g)$label.cex <- 2
png(filename = "c:/R/plot1.png", height = 1200, width = 1200, res = 100); 
plot(g, vertex.label.family = "sans", vertex.size = 40)
dev.off() ', 
@input_data_1 = N'select LikeMember.MemberName as LikeMember,    LikedMember.MemberName as LikedMember         from dbo.ForumMembers as LikeMember,  dbo.ForumMembers as LikedMember,  Likes
        where Match(LikeMember-(Likes)->LikedMember)', 
@input_data_1_name = N'graphdf'
GO

It works perfectly in SQL Server 2017 but I couldn't make it work in SQL Server 2019. The error message is:

Error in png(filename = "c:/R/plot1.png", height = 1200, width = 1200,  : 
  unable to start png() device
Calls: source -> withVisible -> eval -> eval -> png
In addition: Warning messages:
1: In png(filename = "c:/R/plot1.png", height = 1200, width = 1200,  :
  unable to open file 'c:/R/plot1.png' for writing
2: In png(filename = "c:/R/plot1.png", height = 1200, width = 1200,  :
  opening device failed

Error in execution.  Check the output for more information.
Error in eval(ei, envir) : 
  Error in execution.  Check the output for more information.
Calls: runScriptFile -> source -> withVisible -> eval -> eval -> .Call
Execution halted

Although the error message seems obvious, I already checked the permissions on the folder, the user of the services (SQL Server and Launchpad) and even used the audit over the folder but could not identify how to solve this problem.

Any idea?

Thank you!

Dennes


why do dm_db_index_usage_stats have two entries for each index

Error Access to the path is denied. (mscorlib) When trying to open new query window

$
0
0

SQL server 2012 SSMS 2017

Hi If I click the new query button or right click db and choose new query I get this message .

TITLE: Microsoft SQL Server Management Studio
------------------------------
Access to the path is denied. (mscorlib)

I have not had this problem previous to today?


Unable to delete replication after restored a database with replication

$
0
0

Hi There,

Backup and restored a database from another SQL server which had Replication set up. After successfully restored database, the replication had carried forward, now wouldn’t be able to remove the replication setting such as delete subscription or publication, even wouldn’t be able to delete the database. The replication can be considered as orphan replication setup, how can I delete these settings?

Cheers,

Tony


Cheers, Tony

Where to find SQL Server 2014 Developer edition download?

$
0
0

Hi!

Does anyone know if there is a link to download SQL Server 2014 developer edition?

I need to repair an instance but we no longer have a copy of the media..

Thanks,

Zoe

Windows live mail

$
0
0

After a Windows update last night all my files in livemail have been orphaned from the message I got.

How do I recover please? I need clear instructions please. Thank you


Non clustered column store index major bug in SQL server 2016 SP1 Enterprise Edition

$
0
0

Our stage table holds 130 + columns with 1 billion 430 million rows with partition with service date. we created non clustered column store index, it took 36 hours for its completion. after creating the index the select count_big(col_name) from table shows 40 billion as row count, we tested this by sp_space used, sys.indexex table, right click and properties the table all shows the 1 billion 430 million rows. Before index creation also we count the table after 45 minutes execution it says the 1 billion 430 million. estimated number of rows in non clustered column store also shows 1 billion 430 million rows, but count shows very strange result. 

Below are the execution plan details

Column store index scan (Non clustered)
scan columnstore index, entirely or only a range.

Physical operation : columnstore index scan
logical operation : index scan
Estimated execution mode : Batch
Storage : ColumnStore
Estimated I/O Cost:0.05625
Estimated Operator Cost : 8.74159(41%)
Estimated SubtreeCost : 8.74159
Estimated CPU Cost:8.68534
Estimated Number Of Executions:1
Estimated Number Of Rows: 1262930000
Estimated Row Size: 27B
Partitioned : True
Ordered: False
Node ID : 5

In the GUI it is displayed like this

select cost 0% <———Parallelism(Gather Streams) Cost 0% <——-Compute Scalar Cost : 0% <—— Hash Match Aggregate Cost(59%) <——- Columnstore index scan cost 55%.


SQL error 5171

$
0
0
I'm getting an error while operating the SQL server. It displays as SQL server error 5171. I'm not able to resolve this error. Please, somebody, help me get out of this.

Database Status: Suspect vs Recovery Pending.

$
0
0

what's the different between database status Suspect vs Recovery Pending. ???

what's are the different causes for both Suspect vs Recovery Pending. ???

questions about cutom indexes on replication target tables

How to Configure Database Mail Using Database Engine Service Credentials

$
0
0

I have jobs set up in SQL Server Agent that use sp_send_dbmail to email employees some reports on a schedule. Today I discovered the reports were not going out due to a password change on my credentials. I updated my account for Database Mail under Basic authentication and the reports are emailing once again.

[Manage Existing Account screen shot]

I began to enter a help ticket to our IT department to see if I could get an account with a non-expiring password, but then I saw the option above Basic authentication to use the Database Engine service credentials and thought this would be the way to go. When I choose this option, I get the same error I was getting when my password was incorrect:

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2019-11-06T12:47:35). Exception Message: Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM).  )

My understanding is that the service credentials being used are the virtual account for SQL Server under SQL Server Services, which appears to be set up correctly.

[2 SSCM screen shots]

 So why does Database Mail not authenticate properly and send the email as it does when I use Basic authentication?


SQL Server 2019 Behavior change with scope of SET IDENTITY_INSERT ON/OFF

$
0
0

We are migrating to SQL Server 2019 RTM version and noticed that one of our stored procs that uses SET IDENTITY_INSERT ON/OFF statements is failing which works properly in SQL 2017 and earlier.  Even changing compatibility level to SQL 2017 does not work the same way in SQL 2019.  This looks like a bug/behavior change that is not documented anywhere.

We have lots of customers running earlier versions of our product with this stored procs that we cannot afford to change but still want to migrate to SQL 2019 and now this has become a show stopper for our SQL 2019 migrations.

Can this bug be fixed as a patch quickly?

How to reproduce the behavior.

CREATE PROC proc_inner
AS
    BEGIN
        SET IDENTITY_INSERT [#TMP_MESSAGE] ON;
        INSERT INTO [#TMP_MESSAGE]
        (DCORP, 
         ENTITYKEY, 
         SEQNO, 
         MESSAGE
        )
               SELECT 'test', 
                      1, 
                      1, 
                      'bdkfsjk';
        SET IDENTITY_INSERT #TMP_MESSAGE OFF;
    END;
GO

CREATE PROC proc_outer
AS
    BEGIN
        IF OBJECT_ID('TEMPDB..[#TMP_MESSAGE]') IS NULL
            BEGIN
                CREATE TABLE [#TMP_MESSAGE]
                (DCORP     CHAR(10), 
                 ENTITYKEY INT, 
                 SEQNO     INT IDENTITY(1, 1), 
                 MESSAGE   VARCHAR(8000)
                );
        END;
        EXEC proc_inner;
        SELECT *
        FROM #TMP_MESSAGE;
    END;
GO

EXEC proc_outer; -- this statement fails on SQL 2019 

In SQL 2019 - you receive error

Msg 544, Level 16, State 1, Procedure proc_inner, Line 5 [Batch Start Line 36]
Cannot insert explicit value for identity column in table '#TMP_MESSAGE' when IDENTITY_INSERT is set to OFF.

(0 rows affected)

In SQL 2017 and earlier, the same statement works properly.


SQL Server Transaction logs

$
0
0

  When are transaction logs committed to database?

  In simple logging logs are committed frequently to purge the logs automatically.

  But what happens in case of full logging?

  Also what is the impact of this process? which one is better in performance simple or full logging? (let's forget point in time recovery for a while)


Shahid Roofi


How to truncate transactional log

$
0
0

How do I truncate the log and not corrupt the database.

Sql server few DB not backed up

$
0
0

We have backup job scheduled every night to take backup user and system databases and it's runs fine every night bit sometimes it shows backup job successfully runs but log shows that it has taken only one database backup out of 7 database (user and system DBs). Event viewer or sql server logs not showing any error and sql batch scheduler also not showing any failed backup or other errors but only shows job succeed.

We are using cursor (FORWARD_ONLY) to read each database excluding Temp Db from system table and taking Backup and storing database to shared folder.

Any thoughts?

Sql Agent service stop notification

$
0
0

I am trying setup automatic job using the windows task scheduler to notify when Sql Agent service stopped but somehow i am not getting alert when i am manually stopping but when i run the job manually then i am getting the email notification.

I think it should be right windows event trigger setting bu i am not sure which one i should setup the triggering action.

I need notification when sql agent service stopped.

If someone can help me out?

 
I am calling PowerShell script using batch script.

Batch Script:

powershell.exe -command C:\Users\ServiceCheck.ps1

Powershell Script (ServiceCheck.ps1):

$servers=get-content "C:\Users\servers.txt"

foreach($server in $servers)

{

# go to each server and return the name and state of services

# that are like "SQLAgent" and where their state is stopped

# return the output as a string

$body=get-wmiobject win32_service -computername $server |

select name,state |

where {($_.name -like "SQLAGENT*" -or $_.name -like "SQL*AGENT") `

-and $_.state -match "Stopped"} |

Out-String

if ($body.Length -gt 0)

{

#Create a .net mail client

$smtp = new-object Net.Mail.SmtpClient("mail.myinc.com")

$subject="SQL Agent is down on " + $server

$smtp.Send("pds0809@myinc.com", "pds0809@myinc.com", $subject, $body)"message sent"

}

}


Connect to Oracle, error 7302

$
0
0

Dear friends,

I have the following error when I want to test my linked server:
Cannot create an instance of OLE DB provider "OraOLEDB.Oracle" for linked server (Error Number: 7302).

I followed the instructions posted on this URL:
https://www.mssqltips.com/sqlservertip/4396/creating-a-sql-server-2014-linked-server-for-an-oracle-11g-database/

My situation
2 W2012R2 servers, 1 with SQL2016dev and 1 with Ora11g as mentioned on the URL.
On the SQL server I installed as well the ODAC122010 x64. So the provider OraOLEDB.Oracle came available.
Both servers are not part of any domain, they both live in the WORKGROUP.

After creating the linked server I get the mentioned error.
I just want to connect via SSMS.
I searched for a solution, but did not find one.
So I was wondering if somebody can help me?

Thanks in advance
Marco


Poor SQL performance on hyper-v VM

$
0
0

Hello.

We have a problem with SQL database performance on a Hyper-V VM.

SQL Server 2012 r2 express, DB size is less than 1 GB, VM have an absurd amount of system resources: 10 2.5 GHz cores, 16 GB memory, dedicated SSD.

The same DB is located on PC of one of our developers (core i5, 4 gb memory,  hdd).

He is doing the same request on SQL server on VM and his local PC and it takes 15-20 sec on his PC, but 50-60 sec on VM.

We have no idea what could go wrong, maybe someone could show me a direction where to dig for an answer?

Thanks in advance!



Viewing all 12963 articles
Browse latest View live


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