19th September 2015 SQL Saturday Denmark Questions.

What editions is replication in?

As per https://msdn.microsoft.com/en-us/library/cc645993.aspx#Replication replication is supported in Standard Edition, this does not include Oracle publishing or Peer to Peer transactional replication.

How can I read the transaction log?

To read the current logs:

SELECT * FROM fn_dblog (NULL, NULL)

The parameters to fn_dblog are StartLSN and EndLSN in 3 part decimal format

To read from a log backup:

SELECT * FROM
fn_dump_dblog (
NULL, NULL, N’DISK’, 1, N’D:\LogBackups\Justdave_Log1.bak’,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT);

The parameters are:

  • Start LSN starting with 0x
  • End LSN starting with 0x
  • Device Type ‘DISK’ or ‘TAPE’ deffault DISK
  • Seqnum – used to indentify a backup within a backup device, usually 1
  • Filename of log backup on disk
  • the name of a backup file in the default backup directory for the SQL Server instance
  • The remaining parameters can be used to specify multiple media families in a media set used for a log backup i.e. the filenames of the remaining stripes if more than 1 stripe was used for the log backup

Warning: As per http://www.sqlskills.com/blogs/paul/using-fn_dblog-fn_dump_dblog-and-restoring-with-stopbeforemark-to-an-lsn/

There is a bug where using these functions to read log information will result in a new hidden SQLOS scheduler being created and up to three threads, which will not go away (and will not be reused) until a server restart. This is fixed in 2012 SP2 and 2014.

Advertisements

27th January 2015 Cardiff SQL Server Usergroup Questions.

Can you setup replication in SSDT?

How does non-overwrite work?

What editions is replication in?

https://msdn.microsoft.com/en-us/library/cc645993.aspx#Replication

Can you reduce service account DDL privileges for security, also capt?


27th January 2015 Cardiff SQL Server User Group

Replication Intro – followup questions:

1. How to setup cross domain replication

I found this KB article

HOW TO: Replicate Between Computers Running SQL Server in Non-Trusted Domains or Across the Internet

http://support.microsoft.com/kb/321822


Cardiff User Group Talk June 24 2014 Speaking Questions

Answer to Questions for Cardiff User Group Talk Jun 24 2014.

1. Backup Encryption in 2014 – Is this an Enterprise only feature?

SQL Server Express and SQL Server Web do not support encryption during backup. However restoring from an encrypted backup to an instance of SQL Server Express or SQL Server Web is supported.

https://msdn.microsoft.com/en-us/library/cc645993.aspx#High_availability

2. SSD Buffer Pool Extension – 32x vs 4x how much addition memory is used inside SQL Server?

There a 2 structures per page in the bufferpool, 1 ‘BUF’ header (~100 bytes,corresponds to sys.dm_os_buffer_descriptors which is a list of BUF structures for all hashed buffers). and the actual page itself.

For pages in the bufferpool extension file they only need a ‘BUF’ structure in memory which contains file_id,page_id and is_in_bpool_extension =1. This points to the actual page in the BPE file!

Therefore only additonal small ‘BUF’ header structures are needed for a large bufferpool file.

NOTE: Bufferpool memory can also be seen via sys.dm_os_memory_clerks type=’MEMORYCLERK_SQLBUFFERPOOL’.

select type,sum(pages_kb) pages_kb

from sys.dm_os_memory_clerks

group by type

having type in (‘MEMORYCLERK_BHF’,‘MEMORYCLERK_SQLBUFFERPOOL’)

order by type

3. SSD or fast disk?

SSD may well be quicker even than fast disk as it can be larger then the cache on a disk array.

Fast Disks will help with writes which SSDs do not.


SQL Supper 22nd April 2014 Questions.

1. To install SQL Server 2014 documentation locally?

SSMS -> Help -> Manage Help Settings -> Help Library Manager then choose  Install Content from online

Under SQL Server 2014 Add  Books Online, Developer Reference and Installation.

You can also check for updates online as well.

2. What is new in SQL Server 2014 Integration Services?

As per books online nothing! However Professional Microsoft SQL Server 2014 Integration Services

http://www.amazon.co.uk/Professional-Microsoft-Server-Integration-Services-ebook/dp/B00JSQ3RLG/ref=sr_1_1?s=books&ie=UTF8&qid=1399224239&sr=1-1&keywords=Professional+Microsoft+SQL+Server+2014+Integration+Services

does mention 2014 enhancements although it says they are from codeplex and not integrated into the base product yet.

3. What is new in Report Services?

Books Online only mentioned addition of support for Chrome as a browser!

4. What T-SQL enhancements are there in 2014?

This is covered at http://www.smooth1.co.uk/sqlserver2014/t_sql_enhancements.html

5. Resource Governor for physical IO, the IO settings do not appear in SSMS.

If you run ‘script resource pool as’ the settings are visible:

USE [master]
GO

/****** Object:  ResourcePool [PoolAdmin]    Script Date: 05/05/2014 10:17:42 ******/
CREATE RESOURCE POOL [PoolAdmin] WITH(min_cpu_percent=0,
max_cpu_percent=100,
min_memory_percent=0,
max_memory_percent=100,
cap_cpu_percent=100,
AFFINITY SCHEDULER = AUTO
,
min_iops_per_volume=20,
max_iops_per_volume=100)

GO

I have mail Mark Souza (General Manager -Data Platform Group) for an update when these will appear in the properties page.


SQL Saturday Exeter 2014 (22 March 2014) Speaker Answers

Questions from my presentation at SQL Saturday Exeter 2014:

1. Backup to Azure – Backup to URL https or http?

As per http://msdn.microsoft.com/en-us/library/dn435916%28v=sql.120%29.aspx

“Here is a sample URL value: http[s]://ACCOUNTNAME.Blob.core.windows.net/<CONTAINER>/<FILENAME.bak>. HTTPS is not required, but is recommended.

2. What happens if you turn on 2014 trace flags 2312 (force new cardinality estimator) and 9481 (force old cardinality estimator) at the same time do you get an error?

No, niether is used and the database compatability level determines the cardinality estimator that is used. http://blogs.msdn.com/b/psssql/archive/2014/04/01/sql-server-2014-s-new-cardinality-estimator-part-1.aspx

Is the showplan really changes for columnstore indexes in 2014? ” The EstimatedExecutionMode and ActualExecutionMode properties have two possible values: Batch or Row. The Storage property has two possible values: RowStore and ColumnStore.” Surely that was in 2012?

Books online still says that both EstimatedExecutionMode/ActualExecution Mode and Storage properties are new in 2014 http://msdn.microsoft.com/en-us/library/bb510411(v=sql.120).aspx#CCI. Actually only the Storage Propery is new http://www.smooth1.co.uk/sqlserver2014/csi.html