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

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.


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.


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 ?

Options to minimize performance impact caused by Row Level Security

$
0
0

Hello,

We have plans to implement Row Level Security in a table of size 1TB to control access to records. We are using
a function, security policy and a lookup table with the list of user groups to achieve this logic.
The logic seems to be working fine. However, we are observing a performance hit as the function is being called every time
for every row returned by the query. 

Please let us know if anyone of you have any recommendation/option to minimize the performance impact caused by the implementation of RLS.

SQL Server Version : SQL 2016 - SP2

Regards

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?

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.

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

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 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?   

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..  



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..




MDW Data Collector Server Activity collection step 3 suddenly stopped working

$
0
0

For many weeks my data collections from my database instace have been uploading to my MDW server. Suddenly step 3 of the Server Activity Collector has stopped working giving the following error: Job Name                            DataCollector Server Stats Coll n Upload Step Name                         collection_set_3_noncached_collect_and_upload_upload Duration                              00:00:05 Sql Severity        0 Sql Message ID 0 Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted          0

Message Executed as user: domain_svcAccount. SSIS error. Component name: DFT - Find and save sql text, Code: -1071636471, Subcomponent: LKUP - Look up query text on target server [2], Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E14.   An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80040E14  Description: "The handle that was passed to dm_exec_sql_text was invalid.".   .  SSIS error. Component name: DFT - Find and save sql text, Code: -1071611309, Subcomponent: LKUP - Look up query text on target server [2], Description: OLE DB error occurred while fetching parameterized rowset. Check SQLCommand and SqlCommandParam properties.   .  SSIS error. Component name: DFT - Find and save sql text, Code: -1073450974, Subcomponent: SSIS.Pipeline, Description: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "LKUP - Look up query text on target server" (2) failed with error code 0xC0208253 while processing input "Lookup Input" (16). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.   .The master package exited with error, previous error messages should explain the cause.  Process Exit Code 5.  The step failed.

Has anyone encountered this error before ? Thanks

job owner is specific login any impact if we change to sa

$
0
0

Hi Team,

we have few application jobs running on production server and owner for those jobs are specific login and he left the company so now my query is any impact if I change job owner to SA or specific account that account only using for job owners. please advise me as this is basic question reason for asking it is production.

orphan users in database, does it have performance impact?

$
0
0

Hi, all

I have instances of sql server's, that have many databases, from 1000 to 2000 databases. 

Many of them, almost all, have orphan databases users (without a login) these users are not used, they came from the developing environment.

My question is, doesn't this have a performance impact on the all instance?

I have a college ( a orlder dba college, in another company) that said to me, that he saw a increase in performance of the all SQL Server, (lower CPU consumption) after he remove some(2-3) orphan users in an instance, where i have a big database  (10Tb) management by him.

does this have some fundamental reason for happeny? is this real?

looking for yours opinions

thks

MMoura


xp_logininfo and Best Practice

$
0
0

All,

Is it a good idea to grant EXEC rights on xp_logininfo to user logins and service ids? We DBAs have access to it and today we were asked to grant access to this Extended Procedure to a Login used by Tidal to run all our processes.

My questions is from the Security perspective because it can Query the AD database. If someone can point me to a best practice document that would be great.

Our SQLServer is SQLServer 2016.

Thanks,

rgn

ODBC Driver 17 for SQL Server - Linked Server Fails

$
0
0

ODBC Driver 17 for SQL Server  - Linked Server failure

I have a problem where my linked server works for about 12 minutes and then fails.  Sorry I do not have the failure message at this point, but I can get it tomorrow

I have a Windows 2012 Server and have SQL Server 2014 SP3 Installed.

I have a requirement to provide a linked server to another SQL Server instance and the way I had to set it up was to create a system DSN connection using the original “SQL Server” ODBC drivers on my server connecting to the remote server and then I created a linked server using the Microsoft OLE DB Provider for ODBC provider to that system DSN

This was working fine for many years until TLS 1.2 became required.  To deal with TLS 1.2 I installed the ODBC Driver 17 for SQL Server.  I then created a new DSN connection and restarted the instance and the linked server tested fine. 

The problem is that after about 12 minutes the Linked server fails – sorry I do not have the error message, but its something about cannot connect using the ODBC driver 17 for SQL server.  If I restart the instance the linked server will work again for about 10 minutes and fail. 

The way I fixed it was I created the DSN connection using the ODBC Driver 11 for SQL server – it supports TLS 1.2 just fine and the linked server did not fail after 10 minutes.  As a matter of fact, I could get the linked server to work without even having to restart the instance. 

My question is why does the linked server fail after 10 minutes using the ODBC Driver 17 for SQL server. 

Any help is appreciated.   

When Service Master Key is generated?

$
0
0

I would like to know when Service Master Key (SMK) management as follows. 

(1) Is SMK automatically generated when SQL server is installed?

(2) How can I confirm SMK is exist?

(3) Even though any Database Master Key (DMK) is not created yet, is SMK existed?

(4) If DMK is created, SMK is going to be re-created automatically or does it need to manually re-create? 

(5) Why is SMK required to take a backup? If backing up of SMK is missing, what kind of impact would occur on the database?

Any advice will be gratefully appreciated. Thank you. 

Enforce Password expiration setting

$
0
0

I would like to confirm the policy of the expiration password setting of SQL login account.

(1) If the setting of "Enforce Password expiration" has been on, and if password of SQL login account is expired, and if the setting is changed to checked off, is the account still expired and need to set new password? or the account can login with old password?

(2) If checking off the setting once after password is expired once, then checking it on again without changing the password, will the password is already expired? or will it be reset like starting to count day to expiration date from 1?

(3) How can I know when password is set last time, and when will be expired?

(4) Is there any alert to set up to let DBA knows before the password expired? 

Thank you..


Database back up

$
0
0

How do you exclude a database from being backed up using the sqlcmd?

sqlcmd -E -S $(ESCAPE_SQUOTE(SRVR)) -d master -Q "EXECUTE [dbo].[DatabaseBackup] @Databases = 'USER_DATABASES', @Directory = N'\\somewhere',  @BackupType = 'FULL', @Verify = 'Y', @CleanupTime = 360, @CheckSum = 'Y', @LogToTable = 'Y'" -b

Viewing all 15889 articles
Browse latest View live


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