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

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?


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?

Attach SQL 2008 database to SQL Server 2016

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

[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!


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;



sql login creation

$
0
0
Hi All,

As an admin we create sql authentication logins for application users.
For those logins, we want to give the ability for the user to change the password and should never expire.
To accomplish this requirement, what specific permissions we should give for the sql login?

Thanks,
Sam

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?


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?



Deadlock analysis - what's AutoCreateQPStats?

$
0
0

I'm trying to analyze a deadlock that I can reproduce fairly consistently. I can tell what one session is doing (splitting an empty partition function range), but the other one is a bit of a mystery - it's somewhere in a lengthy stored procedure and the deadlock XML says

transactionname="AutoCreateQPStats"

I haven't found any explanation of what that means.

(I can't tell exactly where in the stored procedure this is occurring because the line number in the execution stack is inside an IF block that I have proved isn't getting executed in this test, so SQL Server and I are counting lines very differently. If anyone can explain that I'd also be interested, but this is probably the wrong forum for it.)

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.

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

Sample Database in SQL Server 2019 format

$
0
0

Hi,

I want to find a sample database in SQL Server 2019 format. The database can as simple as just contain one table with one record. Where can I find such a sample database file online?

Thanks

Microsoft.ACE.OLEDB.16.0 provider is not registered on the local machine. (System.data)

$
0
0

Trying to import data from Excel is giving this message.

Office365 64-bit

Here's what I tried:

1) I installed the 64-bit Access database engine 2016

2) I tried the 2010 & 2007 versions as well

3) I reinstalled Office365

I'm out of ideas. What else could be going on here?

SQL Server 2012 Database engine failed to install everytime

$
0
0

Hi,

I am trying to install SQL Server 2012 -64 bit in our dev server running Windows Server 2012. Everytime, Database engine fails to install. I've checked the event logs it shows.

Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'e:\sql11_main_t.obj.x86release\sql\mkmastr\databases\objfre\i386\modellog.ldf'. Diagnose and correct the operating system error, and retry the operation.

I followed the link- https://serverfault.com/questions/447808/sql-server-express-service-is-not-starting to resolve the issue. I opened command prompt and run the command - NET START MSSQL$SQLEXPRESS /f /T3608

But it throws the error - The service name is invalid.

Has anyone gone through this issue. Please suggest a solution for this issue.

Thanks,


Kunal


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

Resource governing between SQL instances on server

$
0
0

Whats the best way to control resources between SQL instance on the same servers ?

supposingly there are different SQL instances active on different nodes in a cluster and some nodes are down

then the SQL instances has to be running on the remaining nodes. 

SQL Server 2019 Installation Issues

$
0
0

I downloaded the https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads This one's a developer.

After opening the program, he downloaded something for me.

图片

After downloading he told me the download was successful and then automatically closed and opened another program and then prompted

图片

What's wrong with that? I run the installer in administrator mode, and when I run the installer in normal mode, it won't install and open with this interface. How do you solve it?

Database 'XXX' cannot be opened due to inaccessible files or insufficient memory or disk space

$
0
0
I am getting the following error with my database Database ' XXX' cannot be opened due to inaccessible files or insufficient memory or disk space. I have sufficient space on the drive >100gigs. Does anyone have any suggestion what caused this and how it can be fixed? I am running SQL 2008 and not commands are running on the db.

How to clear SQL DB logs

$
0
0

1. SQL logs are continuously growing, how can I perform truncate of logs?

2. I am using MS DPM 2019 server for backup solution. But logs are not getting shrink and after backup no claim of space. how can I clear the logs by backup ?


Arif

Viewing all 12963 articles
Browse latest View live


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