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

2019 Ent TDE backup compression

$
0
0

hi all:

  I understand If your database has virtual log files (VLFs) larger than 4GB then do not use backup compression with TDE for your log backups. 

Here is the situation. I have a  database and they VLF size is over 20G. But active VLF size is around 60MB

Total of VLF count is 244 but inactive VLF is 243. 

questions:

1. Can I use backup compression with TDE for this DB (VLF size over 20G but active VLF size is 60MB? 

2. What is the consequence of using backup compresison with TDE for DB with active VLF size over 4GB? 

thanks


 Hui



--Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --


[Help]: Delete OR Detech Database on SQL Server Management Studio !

$
0
0

Hi Everyone!

I have a PROJECT database

The drive that contains the PROJECT database is deleted from the virtual machine.

So, when i trying delete or detech the PROJECT database on SQL Server Management Studio error: 

The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0x00000000836000 in file 'D:\Data\PROJECT.MDF'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. (.Net SqlClient Data Provider)

Please guide me delete or detech this database on SQL Server Management Studio

Thank!

Sum of all Memory Clerks and Total Server Memory (KB)

$
0
0

I am trying to understand the memory management of SQL Server. I have a Windows Server 2019 on virtual environment with 64 GB of RAM. I also have SQL Server 2019 installed with Max Server Memory 59776 MB. By using the following query I found the list of all memory clerks:

SELECT  [type] AS [ClerkType], SUM(pages_kb) / 1024 AS [SizeMb]
FROM sys.dm_os_memory_clerks WITH (NOLOCK)
GROUP BY [type]
ORDER BY SUM(pages_kb) DESC

Total sum of all memory clerks was equal to 23523 MB.

Value for MEMORYCLERK_SQLBUFFERPOOL memory clerk is 18387 MB.

I also checked some performance counters:

Total Server Memory (KB) = 32262 MB.
Database Cache Memory (KB) = 18387 MB.

Please correct me if any of the below statements are wrong,

Max Server Memory for SQL Server 2019 = Buffer Pool Memory + Non-Buffer Pool Memory.

Total Server Memory (KB) - The committed memory from the Buffer Pool.

Data Cache Memory (KB) performance counter is equivalent to MEMORYCLERK_SQLBUFFERPOOL memory clerk and both represents data cache used size.

Above query shows all memory clerks for both Buffer Pool Memory and Non-Buffer Pool Memory.

My question related to this subject:

If Total Server Memeory (KB) is related to Buffer Pool memory, then why its size (32262 MB) is bigger than Total sum memory clerks altogether (23523 MB) which represents both Buffer Poll Memory and Non-Buffer Pool Memory?

EDIT: Result of select * from sys.dm_os_process_memory

physical_memory_in_use_kb = 38065556

large_page_allocations_kb = 333824

locked_page_allocations_kb = 37424380

total_virtual_address_space_kb = 137438953344

virtual_address_space_reserved_kb = 114125108

virtual_address_space_committed_kb = 38942228

virtual_address_space_available_kb = 137324828236

page_fault_count = 473391

memory_utilization_percentage = 100

available_commit_limit_kb = 33175136

process_physical_memory_low = 0

process_virtual_memory_low = 0

OPENQUERY giving wrong result on linked server

$
0
0

I have setup linked servers on my SQL Server and choose Oracle as a linked server.

SOMETIMES, When I run the query below under the SA username, I get different result. However when I run under my own username I get correct result. I Can't understand this anomaly. The below query returns only one row. The difference occurs in ORGANIZATION_FULL_NAME column only.

SELECT*FROMOPENQUERY(HR_ORACLE,'
            SELECT e.CHILD_ORG_IND_MGR_POS_PER_ID,e.CURRENT_EMPLOYEE_FLAG,e.EMAIL_ADDRESS,
            e.ENTERPRISE_MANAGER_PERSON_ID,e.ENTERPRISE_MANAGER_POSITION_ID,e.FIRST_NAME,e.LAST_NAME,e.FULL_NAME,e.GENDER,e.JOB_CATEGORY_CODE,e.JOB_CATEGORY_NAME,
            e.JOB_ID,e.JOB_NAME,e.JOB_SUBCATEGORY_CODE,
            e.JOB_SUBCATEGORY_NAME,e.MOBILE_PHONE_NUMBER,ltrim(rtrim(e.NATIONAL_IDENTIFIER)) NATIONAL_IDENTIFIER,e.ORG_CURATOR_PERSON_ID,e.ORG_STR_DEDUCTED_MGR_PERSON_ID,e.ORGANIZATION_FULL_NAME,e.ORGANIZATION_ID,
            e.ORGANIZATION_SHORT_NAME,e.PARENT_ORG_IND_MGR_POS_PER_ID,e.PARENT_ORG_IND_MGR_POSITION_ID,e.PATRONYMIC,e.PERSON_ID,e.PERSON_IS_CURATOR_FLAG,e.PERSON_IS_ENTERPRISE_MGR_FLAG,
            e.POS_ORG_MGR_POSITION_FLAG,e.POSITION_ID,e.L3_PARENT_ORGANIZATION_ID
            FROM XXRCR.XXRCR_CUR_EMPS_EVER_V e
            WHERE e.EMAIL_ADDRESS like (''%EMAIL@EMAIL.COM'')  ')

These are my linked server settings:

Collation Compatible = False

Data Access = True

RPC = False

RPC Out = True

Use Remote Collation = True

Collation Name = Null

Connection Timeout = 0

Query Timeout = 0

Distributor = False

Publisher = False

Subscriber = False

Lazy Schema Validation = False

Enable Promotion of Distributed Transactions = True

Stalled Dispatcher

$
0
0

I recently got the error below in the logs. Right now no user with sysadmin rights can perform any action. Getting an error that 'user does not have permission to perform this action'.  Any help will be appreciated<o:p></o:p>

<o:p> </o:p>

<o:p> </o:p>

***Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\LOG\SQLDump0003.txt<o:p></o:p>

     * *******************************************************************************<o:p></o:p>

<o:p> </o:p>

      * BEGIN STACK DUMP:<o:p></o:p>

      *   05/28/20 05:05:05 spid 2036<o:p></o:p>

      *<o:p></o:p>

      * Stalled Dispatcher<o:p></o:p>

      *<o:p></o:p>

      * *******************************************************************************<o:p></o:p>

      * -------------------------------------------------------------------------------<o:p></o:p>

      * Short Stack Dump<o:p></o:p>

      Stack Signature for the dump is 0x0000000000000257<o:p></o:p>

<o:p> </o:p>

      [INFO]          Identity             Begin               End |        State                 Result     Error  Speculate   Prepared LazyCommit   ReadOnly |      Transaction         Database         ThreadId |   ReadSet  WriteSet   ScanSet Savepoint LogSizeRq | CommitDep TotalComm       Dependent 0       Dependent 1       Dependent 2       Dependent 3       Dependent 4       Dependent 5       Dependent 6       Dependent 7 |            Area  Location |<o:p></o:p>

     External dump process return code 0x20000001.<o:p></o:p>

External dump process returned no errors.<o:p></o:p>

<o:p> </o:p>

      Dispatcher (0x1d0c) from dispatcher pool 'XE_Engine Dedicated dispatcher (00000000E73B8E88)' Worker 0x00000002A26AE160 appears to be non-yielding on Node 0. Approx CPU Used: kernel 0 ms, user 0 ms, Interval: 240370.<o:p></o:p>

      Dispatcher (0x1d0c) from dispatcher pool 'XE_Engine Dedicated dispatcher (00000000E73B8E88)' Worker 0x00000002A26AE160 appears to be non-yielding on Node 0. Approx CPU Used: kernel 0 ms, user 0 ms, Interval: 302765.<o:p></o:p>

Bulk Insert error for exponential values during import in sqlserver

$
0
0

We got the following error during bulk insert in SQL server 

Microsoft SQL Server 2014 (SP1-GDR) (KB4019091) - 12.0.4237.0 (X64) 
Web Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)

BULK INSERT ABC

FROM ‘D:\Dump001.csv’

WITH (FIELDTERMINATOR = '|',ROWTERMINATOR = '\n', FIRSTROW=2)

Msg 4864, Level 16, State 1, Line 3

Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 552612, column 148 (column_amt).

Msg 4864, Level 16, State 1, Line 3

Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 635686, column 148 (column_amt).

Msg 4864, Level 16, State 1, Line 3

Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 657871, column 148 (column_amt).

Msg 4864, Level 16, State 1, Line 3

Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 675625, column 148 (column_amt).

Msg 4864, Level 16, State 1, Line 3

Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 675628, column 148 (column_amt).

Msg 4864, Level 16, State 1, Line 3

Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 699484, column 148 (column_amt).

Msg 4864, Level 16, State 1, Line 3

Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 898948, column 148 (column_amt).

Msg 4864, Level 16, State 1, Line 3

Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 997300, column 148 (column_amt).

Msg 4864, Level 16, State 1, Line 3

Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1214311, column 148 (column_amt).

Msg 4864, Level 16, State 1, Line 3

Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1494400, column 148 (column_amt).

We found the exponential values in those columns like 1.0001666E7.

Please help us to resolve this issue or any way for this. 


rajesh

Database performance

$
0
0

Hi Experts,

Is there a way to assign resources , memory/cpu to individual database so if an instance is assigned 32 gb , out of 10 databases on that instance , assign 4 gb and 1 vcore to one of the databases.

Thanks

Error: 9019, Severity: 21, State: 1 Error

$
0
0

Has anyone experienced an error 9019 on SQL Server 2019? This error occurred on the forwarder in a distributed availability group configuration. Nothing was connected or executing anything against this instance, but index maintenance was executing against the primary node of the primary availability group. 

There are no indications that the replication of data got behind and the health of all of the AGs is good. 

I can see that the 9019 error was an issue corrected in SQL2012, but this one seems to be different.

SQL Server 2019 CU3 (15.0.4023.6) Enterprise Edition

Error: 9019, Severity: 21, State: 1

The virtual log file sequence 0x000539c6 at offset 0x0000000037f92000 bytes in file 'L:\MSSQL\XXXXXXX' is active and cannot be overwritten with sequence 0x000539f6 for database 'XXXXXXX'.


Ed Mlynar


Mission Impossible - Run Service in Gov AWS without Log On As A Service

$
0
0

Government sites on AWS, because they are more Linux shops than Microsoft shops, block the Log On As A Service.

Are there alternative methods for service accounts where "Log On As A Service" is not a requirement?


R, J

Data Convert for Always Encryption

$
0
0
I research the Always Encryption recently. I have a question about converting data. I also see some similar questions in the forum, but I still don’t get the definite answer.

We are trying to implement Always Encrypted. The client is SSMS. I have set "Column Encryption Setting = Enabled" in the connection options, so I see the data decrypted.
The column type that I want to encrypt is varbinary. Now, I want to convert the decrypted data from the varbinary to XML type with this query:
Select convert(xml, testaecolumn) FROM [TestDB].[dbo].[DataCalc]
For this conversion we are getting an error: 
Explicit conversion from data type varbinary(max) encrypted with (encryption_type = 'DETERMINISTIC', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = '*******', column_encryption_key_database_name = 'TestDB') to xml is not allowed.

Is the data convert not supported for AE? Are there any documents?

SQL Server 2016 SP2 CU4 update failed for sql tool extension

$
0
0

I have already a SQL Server 2016 SP2 (with CU KB4458621) and would like to install CU4 however seems that the patch sequencer didn't detect SP2 was installed for  sql_tools_extensions

sql_tools_extensions_Cpu64_1.log

SOFTWARE RESTRICTION POLICY: C:\965cbc8e038e3\x64\setup\sql_tools_extensions.msp is permitted to run at the 'unrestricted' authorization level.
SequencePatches starts. Product code: {AB765DC7-7642-4D1C-BEDC-035516CCD224}, Product version: 13.0.1601.5, Upgrade code: {BB3795F0-6ECF-450B-8D03-2A264C5F95DF}, Product language 1033
PATCH SEQUENCER: verifying the applicability of QFE patch C:\965cbc8e038e3a2d191fea70aca95a\x64\setup\sql_tools_extensions.msp against product code: {AB765DC7-7642-4D1C-BEDC-035516CCD224}, product version: 13.0.1601.5, product language 1033 and upgrade code: {BB3795F0-6ECF-450B-8D03-2A264C5F95DF}
PATCH SEQUENCER: QFE patch C:\965cbc8e038e3\x64\setup\sql_tools_extensions.msp is not applicable.
 SequencePatches returns success.
Final Patch Application Order:
 Other Patches:
Unknown\Absent: {D16C247A-EE4D-4709-ACB7-10799D13BA42} - C:\965cbc8e038e3\x64\setup\sql_tools_extensions.msp
Product: SQL Server 2016 Client Tools Extensions - Update '{D16C247A-EE4D-4709-ACB7-10799D13BA42}' could not be installed.

Windows Installer installed an update. Product Name: SQL Server 2016 Client Tools Extensions. Product Version: 13.0.1601.5. Product Language: 1033. Manufacturer: Microsoft Corporation. Update Name: {D16C247A-EE4D-4709-ACB7-10799D13BA42}. Installation success or error status: 1642.

 Note: 1: 1708
Product: SQL Server 2016 Client Tools Extensions -- Installation failed.

Windows Installer installed the product. Product Name: SQL Server 2016 Client Tools Extensions. Product Version: 13.0.1601.5. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation success or error status: 1642.

any hints ?

Attach SQL 2008 database to SQL Server 2016

$
0
0
Is it possible to attach SQL 2008 database to SQL Server 2016 ?

Planning database growth for 2 years

$
0
0

Hello,

I'm not sure how to go about planning database growth over a 2 year span.

My sys admin is asking me to for resource needs ( memory, disk , cpu) and I'm not sure how to go about this.

Please advise.

Default trace was stopped because of an error. Cause: 0x80070057(The parameter is incorrect.).

$
0
0

Hello, 

We have MS SQL server 2016 Enterprise (SP2-CU5). After starting the server, the default trace file grows to 20 MB, and then stops with this error in ErrorLog:

Trace ID '1' was stopped because of an error. Cause: 0x80070057(The parameter is incorrect.). Restart the trace after correcting the problem.

Error: 19099, Severity: 16, State: 1.

sys.traces is empty and sp_configure "default trace enabled" config_value and run_value is 1.

Any thoughts how to solve this?

[Help]: Delete OR Detach Database on SQL Server Management Studio

$
0
0

Hi Everyone!

I have a PROJECT database

The drive that contains the PROJECT database is deleted from the virtual machine.

So, when i trying delete or detech the PROJECT database on SQL Server Management Studio error: 

The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0x00000000836000 in file 'D:\Data\PROJECT.MDF'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. (.Net SqlClient Data Provider)

Please guide me delete or detech this database on SQL Server Management Studio

Thank!



i would like to abstract a database qualifier

$
0
0

hi we run 2014 std.  we have 2 dbs (staging and warehouse) that are always on the same server and we often reference both in certain procs.  the procs are always on staging.

in order to have multiple environments set up for development purposes,  i'll often combine the tables from each (staging and warehouse) in one local db, call it x.  and simulate real life by not qualifying queries targeted for staging but prefixing queries going to warehouse with x.dbo....

for my testing to be more valid i'd like a way for the x to be "mappable" by a parameter or something as i move thru the dev, qa and prod environments so that the x is "soft replaced" by the word warehouse.

is there a way to do this?


database on restoring mode and unable to open

$
0
0

Hi 

Version :2014

We have database and gone in to RESTORING stage,. Our backups are Veam and backup run as  their technology snapshot. what ever the status of the database datafiles MDF,LDF will backup. Backup software not aware status of the DB.  now when I restore the backup files(through Veam backup software), I am unable to open the database even with data lost. Any one can advice how to open the DB.

RESTORE DATABASE database  WITH RECOVERY;



Data Conversion for Always Encryption

$
0
0
I research the Always Encryption recently. I have a question about converting data. I also see some similar questions in the forum, but I still don’t get the definite answer.

We are trying to implement Always Encrypted. The client is SSMS. I have set "Column Encryption Setting = Enabled" in the connection options, so I see the data decrypted.
The column type that I want to encrypt is varbinary. Now, I want to convert the decrypted data from the varbinary to XML type with this query:
Select convert(xml, testaecolumn) FROM [TestDB].[dbo].[DataCalc]
For this conversion we are getting an error: 
Explicit conversion from data type varbinary(max) encrypted with (encryption_type = 'DETERMINISTIC', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = '*******', column_encryption_key_database_name = 'TestDB') to xml is not allowed.

Is the data convert not supported for AE? Are there any documents?


query record with restricted result.

$
0
0

hi ,

table : dispalytable      ( heavy transaction table)

 a  query gave result set .    select top(1) * from dispalytable where id >10

user1  ran that  query 

user2  ran that  query


but i want to restrict the first record not displayed to  second user , the second user2 only can view nxt top first record of the result set.

( no user can view the same result set)

how to accomplish this ?     ROWLOCK ?


SQL Server detected a logical consistency-based I/O error

$
0
0

We started receiving these error messages suddenly

Error: 824, Severity: 24, State: 2.

Message
SQL Server detected a logical consistency-based I/O error: invalid protection option. It occurred during a read of page (7:8192) in database ID 2 at offset 0x00000004000000 in file 'X:\tempdb\tempdb_mssql_6.ndf'.  Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0x31333637; actual: 0x9c88f38a). It occurred during a read of page (7:8216) in database ID 2 at offset 0x00000004030000 in file 'X:tempdb\tempdb_mssql_6.ndf'.  Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

An error occurred while processing the log for database 'tempdb'.  If possible, restore from backup. If a backup is not available, it might be necessary to rebuild the log.
During undoing of a logged operation in database 'tempdb', an error occurred at log record ID (239:1702646:104). Typically, the specific failure is logged previously as an error in the Windows Event Log service. Restore the database or file from a backup, or repair the database.

SQL Server must shut down in order to recover a database (database ID 2). The database is either a user database that could not be shut down or a system database. Restart SQL Server. If the database fails to recover after another startup, repair or restore the database.

------

After these messages, i had to start SQL services manually, however the errors continued

Error while allocating extent for a worktable.  Extent (6:16248) in TEMPDB may have been lost.

-------

I ran DBCC CHECKDB(tempdb)  --- no results.....

Checked with storage team for health checks, they say no issue.

However, i see many suspect_pages recorded for this DB and it even got recorded before the server crash too.

database_idfile_idpage_idevent_typeerror_count
27404401106
244044014759
2451123211
27821621
27819211
261617611935
278088118

then i had to manually delete the tempdb files and restart SQL services. Errors stopped and DB health is OK.

Trying to investigate the root cause, any pointers/advise is really appreciable. Thanks in advance.

Viewing all 15694 articles
Browse latest View live


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