Quantcast
Channel: Forum SQL Server Database Engine

Transaction Log recovery phases

0
0

https://docs.microsoft.com/en-us/azure/azure-sql/accelerated-database-recovery

I am not quite sure the design for Phase 2 Redo , why it's not start scanning from the last commit lsn ?


MSDN subscription

0
0
how to associate a sql server database to an MSDN subscription

How to interpret Native Compilation Advisor report

0
0

so which code is blocking this procedure to natively compile 

Index Reorganize during Database Full Backup

0
0

Index Maintenance usually starts 3 Hours before the database full backup and ends before the Full Backup Start.

The Database is in Simple Recovery Model.

Last weekend the Index Maintenance took more than 5 Hours and the Full backup was running at the same time.

We have noticed that since the Full backup started the Transaction Log File started to grow every 30 Seconds until it filled the Disk and Both Full Backup and Maintenance was failed due to insufficient Disk space for log file.

Why when the Backup started while Index Reorganize is running made this happen to the Transaction Log File?

Regards

Cost in Execution Plan summing up more than 100% , its some where 140%+

0
0

Hi All

I am using Azure SQL, while performance tuning I found one of the queries generated execution plan value more than 140%

Query plan attached, Can you help me to understand if its a bug and can be fixed or something new in SQL engine.

Query Plan greater than 100%


Thanks

Saurabh Sinha

Blog TwitterLinkedInGallery Facebook 



The network name cannot be found at System.Data.SqlTypes.SqlFileStream.OpenSqlFileStream

0
0

Hi,

I have 3 Node SQL AOAG Cluster.

Recently , while trying to check the Application status , I started seeing below error in previous primary (AG Replica1) where as the status is working in now primary (previous secondary AG Replica2). Please share some thoughts on the issue below.

Internal error occurred in sync. Please see details for contextual information.

Organisation.RE.APP.Sync.Common.Exceptions.SyncCriticalSqlException: Critical issue requires administrative attention. ---> System.REta.SqlClient.SqlException: The network name cannot be found ---> System.ComponentModel.Win32Exception: The network name cannot be found
at System.REta.SqlTypes.SqlFileStream.OpenSqlFileStream(String path, Byte[] transactionContext, FileAccess access, FileOptions options, Int64 allocationSize) at System.REta.SqlTypes.SqlFileStream..ctor(String path, Byte[] transactionContext, FileAccess access, FileOptions options, Int64 allocationSize)    at System.REta.SqlTypes.SqlFileStream..ctor(String path, Byte[] transactionContext, FileAccess access)   at Organisation.RE.APP.Framework.Implementation.REta.SqlFileStreamHelper.GetSqlFileStream(String PstrFileStreamPath, Byte[] PabyTransactionContext, FileAccess PeFileAccess)

CreateChangeBatch: Critical issue requires administrative attention.

The network name cannot be found

The network name cannot be found



Best Regards,SQLBoy

TDE with Keyvault

0
0

I am reading this DOC. 

https://docs.microsoft.com/en-us/sql/relational-databases/security/encryption/setup-steps-for-extensible-key-management-using-the-azure-key-vault?view=sql-server-ver15&tabs=portal

Just not quite understand the following steps?

Why it's required to have another login to map for the credential to open the keyvault ?

And TDE_Login is a sql login,,,, can use Domain login ?

So this is the private key or public key ? and which steps in the docs really create a key in the key vault ?


Safely stop full text catalog population?

0
0

SQL Server 2008 R2

We noticed that one of our full text catalogs was incorrectly set to "Do not track changes" with a "Last population date" set months ago. As soon as we set the Track changes setting to "Automatic", the Population status went to "Incrementally populating catalog"

The issue for us is that this is early morning of a work-day and it has rendered all file I/O access to result in Timeouts.

Is there a way to safely stop the population and resume it at a later time?

This catalog has a single table with 2 fields selected that are of data type: nvarchar(1000) and Image, which are BLOB's that represent the files our user's are now unable to access.


max worker thread

0
0

If I have a server have 16 cores , 64 bits, can I tune max worker thread (instance setting) to 1000 ?

And if calculating max worker thread will be using physical core or logical core or the CPU ?

SQL Server soft-numa

0
0
If the server has 2 socket and each has 8 phyiscal core per each. and enable hardware numa. So SQL Server 2016 will still do the auto-software numa configuration during startup ?

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?

Recompile or DISABLE_PARAMETER_SNIFFING

0
0

If I would like to make the query to compile the plan for individual parameter, 

should I should recompile or DISABLE_PARAMETER_SNIFFING?

What's the different ?

Multipage allocation vs Large Pageallocation

0
0

May I know Multipage allocation vs Large Pageallocation are the same concept ?

Any example of what type of Multipage allocation are?

I check in my sys.dm_os_memory_clerks that column page_sizes_in_bytes are all 8192 .

SQL Server resource pool MAX_MEMORY_PERCENT

0
0
  • MIN_MEMORY_PERCENT and MAX_MEMORY_PERCENT

    These settings are the minimum and maximum amount of memory reserved for the resource pool that can not be shared with other resource pools. The memory referenced here is query execution grant memory, not buffer pool memory (for example, data and index pages). Setting a minimum memory value for a pool means that you are ensuring that the percentage of memory specified will be available for any requests that might run in this resource pool. This is an important differentiator compared to MIN_CPU_PERCENT, because in this case memory may remain in the given resource pool even when the pool does not have any requests in the workload groups belonging to this pool. Therefore it is crucial that you be very careful when using this setting, because this memory will be unavailable for use by any other pool, even when there are no active requests. Setting a maximum memory value for a pool means that when requests are running in this pool, they will never get more than this percentage of overall memory.

the above is the definition from the web 

https://docs.microsoft.com/en-us/sql/relational-databases/resource-governor/resource-governor-resource-pool?view=sql-server-ver15

but it didn't tell the MAX_MEMORY_PERCENT control what kind of memory ? buffer pool ? memory grant to query execution ?

dm_os_ring_buffers :RING_BUFFER_OOM'

0
0

;WITH rb
AS (
SELECT CAST (record as xml) record_xml FROM sys.dm_os_ring_buffers
WHERE ring_buffer_type = 'RING_BUFFER_OOM'
)
SELECT
rx.value('(@id)[1]', 'bigint') AS RecordID
,DATEADD (ms, -1 * osi.ms_ticks - rx.value('(@time)[1]', 'bigint'), GETDATE()) AS DateOccurred
,rx.value('(OOM/Action)[1]', 'varchar(30)') AS MemoryAction
,rx.value('(OOM/Pool)[1]', 'int') AS MemoryPool
,rx.value('(MemoryRecord/MemoryUtilization)[1]', 'bigint') AS MemoryUtilization
FROM rb
CROSS APPLY rb.record_xml.nodes('Record') record(rx)
CROSS JOIN sys.dm_os_sys_info osi
ORDER BY rx.value('(@id)[1]', 'bigint') 

what's the definition of MemoryPool(Pool) and MemoryUtilization(MemoryUtilization)


sys.dm_os_memory_pools pool_id

0
0

https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-os-memory-pools-transact-sql?view=sql-server-ver15

By default pool_id 0 is internal pool and pool_id 1 is default pool ?

what's actually CMEMTHREAD

0
0

https://www.sqlskills.com/help/waits/cmemthread/

what's actually "TREAD-safe-memory-object" ?

DBCC memory status Current commited

0
0

May i know if the current committed will also include stack memory allocation ? (which is not control by max server memory ) ?

Filter index question

0
0

I am comming to this example

https://www.mssqltips.com/sqlservertip/2353/performance-advantages-of-sql-server-filtered-statistics/

CREATE TABLE MyRegionTable(idINT, Location NVARCHAR(100), USState CHAR(2))
GO
CREATE TABLE MySalesTable(idINT, detail INT, quantity INT)
GO
CREATE CLUSTERED INDEX IDX_d1 ON MyRegionTable(id)
GO
CREATE INDEX IDX_MyRegionTable_name ON MyRegionTable(Location)
GO
CREATE STATISTICS IDX_MyRegionTable_id_name ON MyRegionTable(id,Location)
GO
CREATE CLUSTERED INDEX IDX_MySalesTable_id_detailON MySalesTable(id,detail)
GO
INSERT MyRegionTable VALUES(0,'Atlanta', 'GA')
INSERT MyRegionTable VALUES(1, 'San Francisco', 'CA')
GO
SET NOCOUNT ON
-- MySalesTable will contain 1 row for Atlanta and 1000 rows for San Francisco
INSERT MySalesTable VALUES(0, 0, 50)
DECLARE @i INT
SET
@i = 1
WHILE @i <=1000 BEGIN
INSERT
MySalesTable VALUES (1,@i, @i*3)
SET @i = @i +1
END
GO
UPDATE STATISTICS MyRegionTable WITH fullscan
UPDATE STATISTICS MySalesTable WITH fullscan
GO

--- So when come into the following statement 

SELECT detail FROM MyRegionTable JOIN MySalesTable ON MyRegionTable.id = MySalesTable.id
WHERE
Location='Atlanta'OPTION (recompile)

so we know the estimation is wrong. But I am question why the join query doesn't consider the stats of 

IDX_MySalesTable_id_detail?????? 

SQL Server 2016 slower than SQL Server 2008

0
0

I have two databases with the same data, one on an SQL Server 2008 R2 instance, and one on an SQL Server 2016 instance. Both SQL Server instances are on the same machine, and the database files are on the same disk. The SQL Server 2016 has Legacy Cardinality Estimation = ON. Both instances and databases have Max DOP=1. With the SQLQueryStress tool, I run a stored procedure 100 times on the SQL Server 2008 R2 instance and then on the SQL Server 2016 instance. The total time on the SQL Server 2008 R2 is 1,83 sec whereas the total time on the SQL Server 2016 is 2,16 sec. The execution plans are exactly the same, why is SQL Server 2016 slower?

The Results in the SQLQueryStress:

The execution plan of the stored procedure on the SQL Server 2008 R2 database:


The execution plan of the stored procedure on the SQL Server 2016 database:








Latest Images