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

Can We Delete MS_AgentSigningCertificate.cer?

$
0
0

After installing SQL Server (2016, 2017) there is an "MS_AgentSigningCertificate.cer" file in the system database files folder (i.e., where the files for the [master] database are). I have read in several other thread that this file is used for internal processes during installation.

Can the file be safely deleted after installation is complete?


Dan Jameson
Associate Director of IT/DBA
Children's Oncology Group
www.ChildrensOncologyGroup.org


Changing Recovery Model from Full to Simple

$
0
0

I need to change my recovery model from Full to Simple on SQL Server 2014 Enterpriese. What is the correct procedure? This is my environment and plan to change the configuration as below. In my understanidng, if I succeed to change it to simple recovery mode, it will be automatically start to cutting off trunsaction log, and the log won't be enlarged like when it does not take trunsuction log backup in full recovery mode.  If there is any my misunderstanding and plan, pleaase correct me. Any advices will be greatfuly appreciated. Thank you...

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

My Environment

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

-SQL Server 2014 Enterprise

-Recovery Model = Full

-Full backup is scheduled in SQL Server Agent as weekly

-Differential backup is schedule in SQL Server Agent as daily

-Trunsuction log backup is schedule in SQL Server Agent as every 12 hours.

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

Configuration change plan from Full to Simple Recovery Model

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

(1) Announce users about downtime for maintenace.

(2) Execute full backup just in case.

(3) Disable those 3 SQL Server Agent jobs.

(4) Change Recovery model from Full to Simple.

(5) Reboot the SQL Server

 

Can't connect to SQL Server after install

$
0
0
I installed SQL Server 2014 Standard on Windows 2016 Standard.  Default instance.  Mixed mode authentication.  During the install, I added my own account and one other domain account as administrators, and gave 'sa' a password.  I am a local admin on the machine, but not a domain admin.  After the install, I updated with SP3 to ensure support for TLS 1.2.  Enabled TCP/IP, Named Pipes, and Shared Memory.  The database engine server is started with my domain account.  I can't login.  I try using SSMS 2014 and SSMS 7.9.  I get error "Login failed for user..."  Error 18456. Any idea what I'm missing?  Thanks.

Compress backup

$
0
0

When I set up full backup on SQL Server 2014 Enterpriese, there is section "Set Backup Compression". If I choose "Use the default server setting", how can I make sure it will be compressed or not?

I would like to make the size of backup file as smaller as possible because the disk for backup file storage is limited in my environment, and I would like to change the configuration to compress backup. Is there any matter of concern to use compress backup? In my understanding, it will be high CPU usage, so it had better to schedule it less user access term, and it can not append to the same backup set with compress backup and non-compress backup, so I think I need to create new backup set for that. Is there any matter of concern to use compress backup file?

My most concern is how it will impact to recovery procedure with compressed backup file. Is there any difference to recover database with compressed backup file or not compressed backup file?

Any advice will be greatefully appreciated. Thank you..

Backup file management

$
0
0

I would like to ask about backup configuration on SQL Server.

It is configured Weekly Full backup, and Daily Differentical & Trunsaction Log Backup in Full Recovery Mode on my database which is SQL Server 2014 Enterprise. There is only limited storage for backup file in my environment, so I am reviewing my backup configuration to prevent from oppression of capacity because of enlarged backup files as much as possible. Please correct me if any of my understanding below is wrong..

-If I choose "Append to the exisiting backup set" in weekly full backup configuration, all past backup will be remained in the file? For example, if the database to take a backup is 10 GB, and it is schedule to execute as weekly, it will be gaining 10 GB every week? If you need to recover your dabase, you can use all past backup weeks not only the latest but also before week(s) of the latest backup.

-If I choose "Overwrite all existing bacukp sets" in weekly full backup configuration, and if the database to take a backup is 10 GB, is the backup file remain in 10 GB? In this case only one which is the latest backup you can use to recover database.

Is there any way to delete old backup from full backup file with "the Append" configuration to make the file smaller? There is expiration set up section in backup configuration, and I am wondering if this is it. If I set it up as after 30 days, 30 days older backup will it be deleted automatically from the backup file even it is in the "Append" configured backup file?

Any advice will be greatefully appreciated it. Thank you...   


Transaction log just after changing recovery mode from simple to full

$
0
0

Please correct me if any of my following understanding is wrong..

If I change recovery mode from simple to full on SQL Server 2014 Enterpriese, Transaction log truncation will keep automatically executing as same as simple recovery mode UNTIL the first full backup is executed since changing recovery mode from simple to Full.

After the 1st full backup, the size of transaction log will be enlarged until you execute transaction log backup which will Transaction log truncation at the same time..

Any advice will be greatefully appreciated. Thank you..

   



Violation of Primary Key error in Identity column (SQL Server 2016 Enterprise edition SP1)

$
0
0

Violation of Primary Key error in Identity column (SQL Server 2016 Enterprise edition SP1)

We have a table called “[URCIPRO].[ACTLOGSLNO_Seq]”,this table is having only two columns (1) SeqID <IDENTITY DECIMAL(18,0)> and (2) SeqVal <BIT>. This table used to generate the log table serial number, so it will have frequent and multiple hit at same time.  

Issue: we are getting primary key violation error frequently for this above table even though its IDENTITY KEY.  

Please help us to resolve this issue.

Parameter Sniffing Options

$
0
0

Currently I am evaluating the database scope option parameter sniffing . What I under standing is it's to get rid of the parameter sniffing problem.  I am using sample database adventurework2012 for testing

CREATE PROCEDURE Get_OrderID_OrderQty
@ProductID INT
AS
 
SELECT SalesOrderDetailID, OrderQty
FROM Sales.SalesOrderDetail
WHERE ProductID = @ProductID;

When Parameter sniffing is ON

EXEC Get_OrderID_OrderQty @ProductID=897    <<<  This will give index seek

EXEC Get_OrderID_OrderQty @ProductID=870    <<<< this will give index seek

When Parameter sniffing is OFF

EXEC Get_OrderID_OrderQty @ProductID=897    <<<  This will give index scan

EXEC Get_OrderID_OrderQty @ProductID=870    <<<< this will give index scan

this is not I expect, I expect after parameter sniffing is off , 897 will be seek, and 870 will be index scan. ..


SharePoint database user audit failed

$
0
0

The error message is as follows

System.Data.SqlClient.SqlException: 无法打开登录所请求的数据库 "SharedServices1_DB"。登录失败。  用户 'BEYONDSOFT\t-spsadmin' 登录失败。 

The user's password is correct, but the audit fails all the time. May I ask why?

Availability Group read only and non-readable replica

$
0
0

I want to create a AG with read only and non-readable replicas. How to license these replicas.

If fail over, what will happen.


How to sync users for Availability Groups

$
0
0

I am new to Availability Group.

Please guide me how to transmit users from the primary to the secondary.

Thank you in advance.

LInk Server without Kerberos

$
0
0

I have a SQLA , which Has a link server to SQLB. Now connecting to SQLA and exec sql against SQLB successfully

I am checking from sys.dm_exec_connections from SQLB, and didn't find any Kerberos connection,  all NTLM. Is it possible?suppose is using Kerberos ?

Prevent from full Transaction Log

$
0
0

Not to occur the error of full transaction log on SQL Server 2014, I think DBA need to monitor transaction log regularly besides executing transaction log backup.

I set up auto growth and max size of transaction log as By 10% and unlimited on my SQL server. What I regularly do for the monitoring duty is checking the usage of drive where transaction log is located in.

Is there any better way to monitor or get noticed if transaction log is almost full on SQL management studio or query?

SQL 2016 question

$
0
0
Hello, we are seeing some disk latency issues like sometimes reads\writes are slow. Trying to trouble shoot the issue. Would like to capture in a table when reads\writes are getting slower. Also would like to capture the traffic hitting the db along with data growth. We are using SQL 2016 Enterprise. Any ideas? Thanks.

sqldev

ShrinkFile( Filename, emptyfile) returns error

$
0
0

We have a 20 TB database on SQL Server with a little over 100 files (originally).

We recently decided to use Compress to shrink the size of FullText data inline.
For that we applied a new filegroup with 32 Files (as we have 32 physical processors on board) in which we copied all original data.

All FullText occupied over 10TB of data out of the 20TB and has been deleted (dropped original tables after cloning compressed data).Now we want to reclaim that space and this is kind of the only time ShrinkFile should be used.

However, the DBCC ShrinkFile( Filename, Emptyfile) where filename is an NDF file, returns the error:
Cannot move all contents of file "Filename" to other places to complete the emptyfile operation.

I tested:

- Single User Mode
- Simple recovery mode
- Restarting server before and after shrink
- Any thinkable combination of ShrinkFile with options like, NoTruncate, TruncateOnly, TargetSize in any possible order.

All to no avail.

I'm not asking why is takes a day+ many hours to shrink simply a 100 GB file for obviously SQL Server's ShrinkFile was not meant to work fast.
But I am asking why it does not work?

There are no FileStream objects in the database.
The 100GB file has finally been "emptied" but still holds a mere 40 MB of something. When asking which tables are still in the file, I get a list of about all tables in the entire database. This maybe something to be expected, but only whennot trying to empty the file.

Please help.

Ferenc
B-ICT, MCDBA since 2001, MCSE+I since 1999/9/11, MCSD since 2002, DB/2 DBA since 2000

p.s. Not Sure if the DBCC (shrinkfile) is part of the DB Engine but I had to choose something.


EMC DDboost cleanup of expired backups

$
0
0

Hi ,

Can you please let me know the process/configuration if cleanup process of expired backups of ddboost . 

Currently most of the databases write backups to Data Domain (ddboost), we are writing backups with different retention times.
1)      Daily full backup 14 Days
2)      Weekly full backup 60 Days
3)      Monhtly full backup 760 Days

4)Tlog backups with 2 days retention 

So would like to setup automatic process to delete expired backups on ddboost, we need to find a way to do that.

Please help me soon

How to set up Service Master Key and Database Master Key

$
0
0

I have to configure Database Master Key and Service Master Key on SQL server 2014 Enterprise, but I am not 100 % sure if I am ready for it. Could you someone help me to correct if any of my following understanding and procedure are wrong, please?  

<My understanding>

-Database Master Key(DMK) is key to encrypt database. If you have multiple databases that you would like to set DMK, you have to create DMKs on each database separately.

-Service Master Key(SMK) is key to encrypt Database Master Key. It is one SMK for one Instance.

-SMK will be automatically created after you create DMK.

-If you create DMK you also need to create certificates of DMK, and also take a backup of DMK and the cert. 

-If you need to upgrade SQL Server, or detach your database to attach to other server, you need to drop those DMK and SMK before that, otherwise you will fail upgrade SQL server or attach database with error.

<My procedure>

(1) Create DMK

use <database>;

Create Master Key Encryption by Password = 'Password_of_DMK'


(2) Create certificate of the DMK

use <database>;

Create certificate 'Name_of_Cert' With Subject = 'Subject_Of_Cert'

(3) Backup DMK

use <database>;
Open Master Key 
Decryption By Password = 'Password_of_DMK';

Backup Master Key to File = 'Path_Of_Location'
Encryption by Password = 'Password_of_Backup_DMK';

(4) Backup SMK

use master;
Backup Service Master Key to File = 'Path_Of_Location'
Encryption By Password = 'Password_Of_SMK';

I will gratefully appreciate any advice or suggestion. Thank you..  



How to decrypt Service Master Key and Database Master Key

$
0
0

I would like to make sure if this is the right procedure to decrypt Service Master Key and Database Master Key on SQL Server 2014 Enterprise. Here is my understanding.

(1) Restore Service Master Key

Restore Service Master Key
From File = 'Path_Of_Backup_Of_SMK'
Decryption By Password = 'Password_Of_Backup_Of_SMK'; 

(2) Restore Database Master Key

use <database>;
Restore Master Key
From File = 'Path_Of_Backup_Of_DMK'
Decryption By Password = 'Password_Of_Backup_Of_DMK'

(3) Drop DMK certification

use <database>;
Drop Certificate 'Name_Of_Certificate';

(4) Drop DMK

use <database>;

Open Master key Decryption by Password = 'Password_Of_DMK';

Drop Database Master Key;

If I decrypt SMK and DMK once, can't I restore database from Full/Differential/transaction backup files that were taken during DMK and SMK were configured on the database?

Is there any other concern to database management that can have impact from decrypting SMK and DMK?   

exec sp_readerrorlog gives Msg 22004, Level 16, State 1, Line 0 - The log file is not using Unicode format.

$
0
0

We are using SQL 2016.

Re the error we are geting - lots of people are advising that we look at the sql agent properties - and if the "Write OEM file" is ticked then untick it - but its not ticked. OR you can run

USE [msdb]
GO
EXECmsdb.dbo.sp_set_sqlagent_properties @oem_errorlog=0
GO


... to untick - but its not ticked and running the sp above does not make the error log readable.

In SQL agent properties from SSMS it says Error Log File Name location is 

E:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Log\SQLAGENT.OUT

The folder exists - but no file.

To be clear _ i am trying to rad the SQL Server logs - not the sql agent log.

If I go into SSMS (2017), Management, Sql Server logs, Current - get the same error message - "The log file is not using Unicode format." as before.

in SQL config manager - the Dump directory for Sql server is 

E:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Log

but this only contains a few old .txt files (output from a named SQL agent job).

We have restarted sql server - but this did not make any difference.

Transaction log backup

$
0
0

I am setting up backup SQL server 2014 Enterprise as follow. What I would like to do is I got only limited storage for backup file, and to prevent from lack of storage, I would like to keep only backup files that are created in a month, so I set up Maintenance Plans to delete backup file (bak file) that are older than 30 days.

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

(Recovery Model) Full

(Full Backup) Weekly

(Difference Backup) Daily

(Transaction Log Backup) Hourly

-Set up Maintenance Plans to delete bak file that is older than 30 days.

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

I am lil confused transaction logs backup file management as monitoring my backup file storage. The maintenance plan can delete old full backup and difference backup files automatically, but will transaction logs backup file (=trm file) be remained there even though it is created more than 30 days ago? I understand if transaction log backup is executed, it will truncate transaction log, but doesn't it delete old trm file? If it is not, should I create another Maintenance Plans to delete trm file that is more than 30 days? Should I keep old trm files even though I don't need old full backup that is older than 30 days? 

It will be gratefully appreciated any advice. Thank you..




Viewing all 12644 articles
Browse latest View live


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