More Related Content
Similar to Lesson 1 configuring (20)
Lesson 1 configuring
- 2. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
SQL Server Instances
•SQL Server instances are separate deploymentsof Database Engine, Analysis Services, and Reporting Services hosted on the same computer.
•Each instance may have one Database Engine, one Analysis Services, and one Reporting Services service installed.
•Each instance has its own program files, directory, and security configuration.
•A user who can create and drop databases in one instance might not have rights to change databases on another instance.
•Multiple instances on the same host enable you to deploy SQL Server multiple timeswithout requiring extra operating system deployments. SQL Server 2012 enables you to deployup to 50 Database Engine instances on a single host server
- 3. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Instance-Level Settings
•When talking about SQL Server settings, you are talking about settings for an instance, not settings that apply to every instance of SQL Server on a host computer.
•When you configure settings in the Server Properties dialog box, those settings apply only to the instance you are configuring, not to other instances of the Database Engine installed on the same host computer
•You can configure instance-level settings byright-clicking a specific instance within SQL Server Management Studio and then choosing Properties
- 4. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Memory Allocation
- 5. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Memory Allocation
•By default, a SQL Server 2012 instance uses memory dynamically.
•An instance does not use this amount of memory at startup, but when client load reaches this amount.
•The min server memory value
•Ensuresthat the instance has a minimum memory allocation.
•An instance does not use this amount of memory at startup, but when client load reaches this amount.
•SQL Server 2012 will not release memory back to the operating systemif it means going below this value.
•When SQL Server 2012 is run on a 32-bit operating system, the lowest minimum memory value you can allocate is 64 MB.
•If SQL Server 2012 is run on a 64-bit operating system, thelowest minimum memory value you can allocate is 128 MB.
- 6. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Memory Allocation
•The default setting for minimum server memory is 0
•The default maximum server memory is 2,147,483,647 MB. (approximately 2050 TB)
•A setting of 0 meansthat the minimum server memory value is not set.
- 7. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Using sys.sp_configure
----------------------------------------------------
--sys.sp_configure
----------------------------------------------------
--Default 'show advanced options' is 0, if it's not 0 from any reason, you can change it
--to 0 using the following command.
EXECsys.sp_configure'show advanced options',0;
GO
RECONFIGURE;
EXECsys.sp_configure
--Change the value to 1 for more information
EXECsys.sp_configure'show advanced options',1;
GO
RECONFIGURE;
- 8. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Using sys.sp_configure
EXECsys.sp_configure
EXECsys.sp_configure'min server memory'
GO
EXECsys.sp_configure'max server memory'
GO
EXECsys.sp_configure'min server memory',600;
GO
EXECsys.sp_configure'max server memory',4096;
GO
RECONFIGURE;
GO
EXECsys.sp_configure'min server memory'
GO
EXECsys.sp_configure'max server memory'
GO
- 9. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Memory management for more than one instance guidelines
•For maximum server memory
•Use maximum server memory to limitthe amount of memory each instance uses.
•Allocate memory based on expected instance usage. Ensure that the total allocated memory does not exceed the total physical memory of the host system.
•For minimum server memory
•Ensure that the total minimum memory sumis 1 or 2 GB less than the total physical memory of the host system.
•This strategy has the advantageof allowing instances to use more than a fixed allocation when possible.
- 10. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Processor and I/O Affinity
- 11. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Processor and I/O Affinity
•Affinitysupport for servers with 33 to 64 processors is only available on 64-bit operating systems
•Note : This feature will be removed in a future version of Microsoft SQL Server. Do not use this feature in new development work, and modify applications that currently use this feature as soon as possible.
•Processor affinity assignsspecific server processors to specific threads.
•The default setting for each instanceis to configure processor affinity mask and I/O affinity mask automatically for all processors on the host server.
- 12. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Processor and I/O Affinity
•--Set affinity mask to be configured automatically
•
•EXECSYS.SP_CONFIGURE'affinity mask',0
•GO
•RECONFIGURE
•GO
•EXECSYS.SP_CONFIGURE'affinity mask'
•
•
•--Set affinity mask to assigned the first cpufor the DB threads
•
•EXECSYS.SP_CONFIGURE'affinity mask',1
•GO
•RECONFIGURE
•GO
•EXECSYS.SP_CONFIGURE'affinity mask'
•
•--Set affinity mask to assigned the first cpufor the DB threads
•
•EXECSYS.SP_CONFIGURE'affinity mask',1
•GO
•RECONFIGURE
•GO
•EXECSYS.SP_CONFIGURE'affinity mask'
•
•--Set affinity mask to assigned the second cpufor the DB threads
•
•EXECSYS.SP_CONFIGURE'affinity mask',2
•GO
•RECONFIGURE
•GO
•EXECSYS.SP_CONFIGURE'affinity mask'
- 13. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Configure the priority boost Server Configuration Option
•Use the priority boost option to specify whether MicrosoftSQL Server should run at a higher Microsoft Windows2008 or Windows2008 R2 scheduling priority than other processes on the same computer.
•Note: This feature will be removed in a future version of Microsoft SQL Server. Do not use this feature in new development work, and modify applications that currently use this feature as soon as possible.
- 14. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
lightweight pooling Server Configuration
•Use the lightweight poolingoption to provide a means of reducing the system overhead associated with the excessive context switching.
•When excessive context switching is present, lightweight pooling can provide better throughput by performing the context switching inline, thus helping to reduce user/kernel ring transitions.
- 15. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Configuring Fill Factor
- 16. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Configuring Fill Factor
•Fill factoris the value that determines the percentage of space on each leaf-level page to be filled with data.
•In an SQL Server, the smallest unit is a page, which is made of Page with size 8K. Every page can store one or more rows based on the size of the row.
•The default value of the Fill Factor is 100, which is same as value 0. The
•default Fill Factor (100 or 0) will allow the SQL Server to fill the leaf-level pages of an index with the maximum numbers of the rows it can fit. There will be no or very little empty space left in the page, when the fill factor is 100.
•You must stop and restart the SQL Server servicefor the change to take effect. The new fill factor will be in effect when you see it in the run-value column.
- 17. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
The model database
•The model database serves as the template for all new databases that you create on an instance of SQL Server 2012.
•This includes the tempdbdatabase, which the instance creates each time it starts.
•Creating a new database involves making a complete copy of the contents
•of the model database, including all database options such as recovery model, Auto Close, and Auto Shrink.
•Any modifications you make to the model database will apply to databases you create in the future.
- 18. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Installing Additional Instances
•SQL Server 2012 supports up to 50 instances of the Database Engine on a single host computer
•Instances are functionally separate deployments of SQL Server 2012 features on the same host computer and have separate program files and data directories.
•A user or group assigned the SQL Server Administrator role for one instance might not have the role on any other instance even though the same server hosts those other instances.
- 19. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Installing Additional Instances
•You can deploy the following features individually or together as separate instances in SQL Server 2012:
•Database Engine Services
•SQL Server Replication
•Full-Text and Semantic Extractions for Search
•Data Quality Services
•Analysis Services
•Reporting Services –Native
- 20. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Instance Names
•Instance names have the following properties and limitations:
•They are not case sensitive.
•If you specify MSSQLServeras the instance name, the installation routine installs the default instance. If a default instance already exists on the host, the installer presents you with an error.
•You can’t use the name DEFAULT or any other reserved keywords such as ADD, ALL, EXECUTE, ALTER, PRIMARY, or RECONFIGURE
•Instance names can be a maximum of 16 characters.
•The first character in an instance name must be a letter.
•You cannot use the backslash (), comma (,), colon (:), semicolon (;), single quote ('),ampersand (&), embedded space, or at sign (@) in an instance name.
- 21. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Deploying Software Updates
•Software update deployment and patch management on a computer on which you have deployed a single instance of SQL Server 2012 is straightforward:
•You can configure Windows Update to retrieve updates for SQL Server 2012 either from Microsoft Update or from your organization’s local Windows Server Update Services (WSUS) server.
•Or you can download and deploy the updates manually.
- 22. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Deploying Software Updates
•You must update all features associated with a SQL Server 2012 instance at the sametime. For example, if you have deployed Analysis Services with the Database Engine in an instance, you must update both.
•Remember that each instance on a server has its own separate program files. This means that if you have multiple instances of SQL Server 2012 deployed on the same host server, you must use care when applying updates and service packs. You will need to choose whether to update all instances or only specific instances
- 23. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Resource Governor
•Resource Governor is a SQL Server 2012 feature that enables you to place limits on the consumption of CPU and memory resources within a SQL Server 2012 Database Engine instance.
•Resource Governor has the following limitations:
•You can use it with the SQL Server Database Engine only. You cannot use Resource Governor to manage system resources for Analysis Services, Integration Services, or Reporting Services.
•You cannot use Resource Governor to perform workload monitoring or workload management between SQL Server Database Engine instances.
•Resource Governor applies only to CPU bandwidth and memory managed by the SQL Server 2012 Database Engine.
•Online transaction processing (OLTP) queries are often short and do not use the CPU long enough for Resource Governor constraints to apply.
- 24. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Cycle SQL Server Error Logs
•The SQL Server error log stores information about processes that have completed successfully such as backup operations, batch commands, and scripts.
•It also stores system information messages indicating issues or failures.
•Each time the Database Engine instance is started, the current error log cycles and is renamed errorlog.1. The file named errorlog.1 becomes errorlog.
•2, errorlog.2 becomes errorlog.3, and so on until errorlog.6.
•SQL Server 2012 default settings retain the current error log and the five most recent error logs.
•To modify the number of error logs stored, use SQL Server Management Studio and right-click the right-click the Management SQL Server Logs node, select Limit The Number Of Error Logs Before They Are Cycled.