About Me

My photo
I am an MCSE in Data Management and Analytics, specializing in MS SQL Server, and an MCP in Azure. With over 19+ years of experience in the IT industry, I bring expertise in data management, Azure Cloud, Data Center Migration, Infrastructure Architecture planning, as well as Virtualization and automation. I have a deep passion for driving innovation through infrastructure automation, particularly using Terraform for efficient provisioning. If you're looking for guidance on automating your infrastructure or have questions about Azure, SQL Server, or cloud migration, feel free to reach out. I often write to capture my own experiences and insights for future reference, but I hope that sharing these experiences through my blog will help others on their journey as well. Thank you for reading!

3-day plan to learn SQL Server 2022 administration basics:

 3-day plan to learn SQL Server 2022 administration basics:

Day 1:

Introduction to SQL Server: Learn about what SQL Server is, its features, and its uses.

SQL Server is a relational database management system (RDBMS) developed by Microsoft. It is used to store, retrieve, and manage data in various applications and websites. Some of the key features of SQL Server include:

High availability: SQL Server provides features such as clustering, mirroring, and replication to ensure high availability and disaster recovery.

Scalability: SQL Server can handle large amounts of data and can scale to meet the needs of growing businesses.

Security: SQL Server has several built-in security features, including encryption, user authentication, and authorization.

Business intelligence: SQL Server provides tools for data analysis, reporting, and integration with other business intelligence applications.

Development tools: SQL Server includes development tools such as SQL Server Management Studio and Visual Studio to help developers manage databases and build applications.

SQL Server is used in a wide range of applications and industries, including finance, healthcare, e-commerce, and government. Its uses include storing and managing data for websites, online transaction processing, business intelligence and analytics, and more.

Installation: Install SQL Server 2022 on your computer and configure the basic settings.

 Create a Windows Azure VM:

a. Log in to the Azure portal at https://portal.azure.com/

b. Click on "Create a resource" and select "Virtual Machine".

c. Choose the appropriate OS version and size for your VM.

d. Configure the other settings such as Networking and Storage as required.

                                                  Virtual Network Settings


 

NSG Settings in Azure

 

e. Click on "Review + Create" and then "Create".

 

Connect to your VM:

a. Once your VM is deployed, click on "Connect".

b. Choose "RDP" as the type of connection and download the RDP file.

c. Use the RDP file to connect to your VM.

 

Download SQL Server 2022:

a. Open a web browser on your VM and navigate to https://www.microsoft.com/en-us/sql-server/sql-server-downloads

b. Choose the appropriate SQL Server 2022 version and edition you want to install, then click on "Download".


 

c. Save the executable file to your local machine.

 

Install SQL Server 2022:

a. Launch the SQL Server 2022 installation executable. Run as Administrator

b. Select "Installation" from the left-hand menu, and then "New SQL Server stand-alone installation or add features to an existing installation".

c. Follow the prompts and select the appropriate installation options as required.

d. Choose the appropriate authentication mode (Windows Authentication or Mixed Mode).

e. Provide the required product key or choose the Evaluation Edition.

f. Specify the installation location, instance name, and other configuration options as required.

g. Continue through the installation process until it completes.

          h. whitelist SQLSERVER.exe on windows firewall.


 using Powershell :-

Open PowerShell as an administrator.

Run the following command to enable script execution: 

  Set-ExecutionPolicy Unrestricted -Scope CurrentUser

Run the following command to add SQLserver.exe to the Windows Defender Firewall Allowed Apps list: 

    New-NetFirewallRule -DisplayName "SQL Server" -Direction Inbound -Program "C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Binn\sqlservr.exe" -Action Allow -Protocol TCP -LocalAddress Any -LocalPort 1433

Run the following command to add SQLserver.exe to the Windows Defender Firewall Allowed Apps list for the SQL Browser Service:    

New-NetFirewallRule -DisplayName "SQL Browser" -Direction Inbound -Program "C:\Program Files\Microsoft SQL Server\Binn\sqlbrowser.exe" -Action Allow -Protocol TCP -LocalAddress Any -LocalPort 2382

 

Configure SQL Server 2022:

        Download SSMS from below link:-        Download SQL Server Management Studio (SSMS) - SQL Server Management Studio (SSMS) | Microsoft Learn 

a. Open SQL Server Management Studio on your VM.

b. Connect to your instance of SQL Server using the appropriate credentials.

               Local : .\admina

               Remote : SQL Server authentication


SQL Server EXE location:- C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Binn

SQL Server Errorlog file location:- C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log

 

c. Configure your SQL Server instance and databases as required.

 

That's it! You have now installed and configured SQL Server 2022 on a Windows Azure VM.

 

Security: Understand SQL Server security and authentication modes.

SQL Server security and authentication modes are important aspects of database administration. They help protect the database from unauthorized access and ensure that only authorized users can access the database.

SQL Server security modes:

Windows Authentication Mode: In this mode, users are authenticated through Windows Active Directory. This mode is more secure because it uses Windows security features to authenticate users.

Mixed Mode: In this mode, users can authenticate either through Windows Active Directory or through SQL Server authentication. SQL Server authentication requires a username and password and is less secure than Windows authentication.


SQL Server authentication modes:


SQL Server Authentication: This mode requires users to provide a valid SQL Server login and password. This mode is less secure because passwords are stored in the database and can be compromised.

Windows Authentication: This mode allows users to log in using their Windows domain account. This mode is more secure because it uses Windows security features to authenticate users.

In addition to authentication modes, SQL Server provides several security features that can be used to protect the database from unauthorized access:

User Accounts and Logins: SQL Server user accounts are used to authenticate users and provide access to the database. Each user account has a login that is used to connect to the database.

Roles: SQL Server roles are used to group users and assign permissions to the group. Roles can be used to simplify the management of user accounts and permissions.

Permissions: SQL Server permissions are used to control access to the database objects, such as tables, views, and stored procedures. Permissions can be assigned to users or roles.

Encryption: SQL Server provides several encryption features, such as Transparent Data Encryption (TDE), Cell-level Encryption, and Backup Encryption, to protect data at rest and in transit.

Auditing: SQL Server auditing allows the database administrator to monitor and track database activity. Auditing can be used to detect security breaches and identify suspicious activity.

In summary, SQL Server security and authentication modes are critical aspects of database administration. Properly securing the database requires a combination of authentication modes, user accounts, roles, permissions, encryption, and auditing.

Database Creation: Create a new database, configure its settings, and perform basic management tasks.

SQL Server Management Studio: Get familiar with the SQL Server Management Studio tool and its features.


A.What are the prerequisites for installing SQL Server?

  1. Hardware requirements: SQL Server has minimum hardware requirements such as CPU, RAM, and disk space. You need to ensure that your hardware meets or exceeds these requirements.
  2. Operating system requirements: SQL Server can be installed on various Windows operating systems. You need to make sure that your operating system version is compatible with the version of SQL Server you want to install.
  3. .NET Framework: SQL Server requires .NET Framework to be installed on the server. You need to ensure that the correct version of .NET Framework is installed.
  4. Windows Installer: SQL Server also requires Windows Installer to be installed on the server. You need to ensure that the correct version of Windows Installer is installed.
  5. Windows PowerShell: SQL Server also requires Windows PowerShell to be installed on the server. You need to ensure that the correct version of Windows PowerShell is installed.
  6. Internet Information Services (IIS): If you want to install Reporting Services, then IIS is required.
  7. SQL Server Native Client: If you want to connect to a SQL Server database from a client computer, then you need to install SQL Server Native Client on the client computer.
  8. SQL Server Management Studio (SSMS): SSMS is a tool used to manage and administer SQL Server. It is not a prerequisite for installing SQL Server, but it is recommended that you install it.
  9. Firewall: You need to ensure that the firewall settings on the server are configured to allow SQL Server traffic.
Edition and supported feature of SQL Server 2019 :- 

B. What is the difference between a default and named instance of SQL Server?

A default instance is a single instance of SQL Server installed on a server, identified only by the name of the server itself. This is the simplest and most common way to install SQL Server.

A named instance, on the other hand, is a separate instance of SQL Server that can be installed on the same server as the default instance or on a different server.

A named instance is identified by a unique name, and it allows for multiple instances of SQL Server to run on the same machine, each with its own set of databases, logins, and other configuration settings.

One advantage of using named instances is that it allows for better isolation and management of SQL Server instances. It also allows different versions or editions of SQL Server to coexist on the same machine. 
However, managing multiple instances can be more complex and resource-intensive than managing a single default instance.

What authentication modes are available during SQL Server installation?

Windows Authentication mode: With this mode, users are authenticated through the Windows operating system. It allows users to connect to SQL Server with their Windows login credentials, which eliminates the need for a separate login and password for SQL Server.

Mixed mode authentication: This mode allows both Windows Authentication and SQL Server Authentication. With SQL Server Authentication, users are required to provide a separate SQL Server login and password for authentication. This mode is useful when you have SQL Server instances that need to be accessed by users who do not have Windows login credentials.


What is a SQL Server instance ID, and how is it used during installation?

A SQL Server instance ID is a unique identifier assigned to each installation of SQL Server on a computer. During installation, you can specify an instance ID to differentiate between multiple installations of SQL Server on the same computer. This is useful for scenarios where you need to run multiple instances of SQL Server with different configurations or for different applications.

The instance ID is used in various configurations and settings, such as service names, network protocols, and registry keys. For example, the default instance of SQL Server has a service name of "MSSQLSERVER" and a network protocol name of "np:.". A named instance of SQL Server, on the other hand, has a service name in the format "MSSQL$" followed by the instance ID (e.g., "MSSQL$INSTANCE1") and a network protocol name in the format "np:\<computer_name>\pipe\MSSQL$<instance_id>\sql\query".


What are some considerations when deciding on a location for SQL Server installation files and databases?

When deciding on a location for SQL Server installation files and databases, there are several considerations to keep in mind:

Disk Space: SQL Server installation files and databases can take up a significant amount of disk space, so it is important to choose a location with sufficient space available.

Security: The location should be secure to prevent unauthorized access to the installation files and databases.

Performance: The location should be on a disk with good performance characteristics to ensure that the SQL Server instance performs well.

Backup and Recovery: The location should be included in the backup and recovery plan for the SQL Server instance.

Accessibility: The location should be easily accessible to the SQL Server instance and any applications or users that need to access the databases.

Disaster Recovery: The location should be part of the disaster recovery plan for the SQL Server instance, and should be backed up regularly to ensure that data can be restored in the event of a disaster.


What is collation and How do you choose the appropriate collation for your SQL Server installation?

Collation refers to the set of rules that determine how character data is sorted and compared in SQL Server. It includes rules for character set, case sensitivity, accent sensitivity, and other language-specific sorting rules. When installing SQL Server, you need to choose an appropriate collation setting that matches the requirements of your applications and data.

The collation setting can be chosen during SQL Server installation or set for individual databases. There are several factors to consider when choosing a collation, including:

Language: You should choose a collation that matches the language of your data and applications. For example, if you are working with English-language data and applications, you might choose a collation that supports the English language.

Case sensitivity: Collations can be case sensitive or case insensitive. If your application requires case sensitivity, you should choose a case-sensitive collation.

Accent sensitivity: Some languages use accents and other diacritical marks in their characters. If your data and applications require accent sensitivity, you should choose a collation that supports it.

Performance: Some collations perform better than others in certain situations. For example, binary collations can be faster for certain types of queries but may not provide the desired sorting behavior.

In general, it is recommended to choose a collation that supports the language of your data and applications, is case-insensitive, and is accent-insensitive unless your specific requirements dictate otherwise.

What are the different SQL Server components that can be installed, and what are their purposes?

There are several SQL Server components that can be installed, each serving a specific purpose. Some of the commonly used components are:

Database Engine: This is the core component of SQL Server that stores, processes, and manages data.

Analysis Services: This component allows you to create and manage OLAP (Online Analytical Processing) cubes and data mining models.

Reporting Services: This component allows you to create, manage, and deploy reports.

Integration Services: This component is used for data integration and transformation, allowing you to extract data from various sources, transform it, and load it into a destination system.

Master Data Services: This component provides a centralized location for managing master data and ensures its consistency across different applications and systems.

Data Quality Services: This component provides data cleansing and matching capabilities, helping to ensure data accuracy and consistency.

SQL Server Management Studio: This is a graphical user interface tool used to manage and administer SQL Server instances, databases, and other components.

When installing SQL Server, you can choose to install any combination of these components based on your requirements.

What is the purpose of the SQL Server Browser service, and is it required for all installations?

The SQL Server Browser service is responsible for providing information about SQL Server instances installed on a network. When a client application tries to connect to a SQL Server instance, the SQL Server Browser service listens on UDP port 1434 and provides information about the instance to the client.

The SQL Server Browser service is not required for all installations, but it is necessary when installing a named instance of SQL Server or when configuring a server to use dynamic ports. Without the SQL Server Browser service, clients would need to know the port number of the instance they are trying to connect to, which can be difficult to manage in large environments with multiple instances.

However, the SQL Server Browser service does pose a security risk as it can potentially expose information about SQL Server instances to unauthorized clients. It is recommended to disable the SQL Server Browser service if it is not needed or to configure firewalls to restrict access to the service.

SQl Server browser service works on which port

  The SQL Server Browser service listens on UDP port 1434 by default.

How do you configure SQL Server network settings during installation, and what are some considerations for doing so?


During SQL Server installation, network settings can be configured on the "Server Configuration" page. The following are some considerations for configuring these settings:

Protocol: SQL Server supports several network protocols such as TCP/IP, Named Pipes, and Shared Memory. The selection of the protocol depends on the environment and requirements of the application.

IP Address: If SQL Server is being installed on a machine with multiple network cards, the IP address on which SQL Server listens should be specified. This can help in avoiding potential IP conflicts.

Port Number: By default, SQL Server uses port number 1433. However, if required, the port number can be changed during installation to avoid conflicts with other applications.

Authentication Mode: Authentication mode specifies the type of authentication used to connect to SQL Server. SQL Server supports two authentication modes: Windows Authentication and SQL Server Authentication.

Firewall Settings: The firewall settings should be configured to allow incoming connections to SQL Server from client machines. The ports used by SQL Server should be opened in the firewall.

Encryption: SSL encryption can be enabled during installation to ensure that all data transferred between SQL Server and client machines is encrypted.

Named Instances: For named instances, a unique port number is assigned automatically during installation. The port number is registered with SQL Server Browser service, which enables client applications to locate the named instance.

In summary, network settings during SQL Server installation should be configured based on the environment and application requirements. It is essential to consider security, firewall, and encryption settings to ensure that the SQL Server instance is accessible and secure.


Day 2:


Backup and Recovery: Learn how to back up and restore a SQL Server database, and how to configure backup options.

Maintenance Plans: Understand how to create and manage maintenance plans in SQL Server.

Query Optimization: Learn how to optimize SQL Server queries for performance and efficiency.

Indexes: Understand how to create and manage indexes in SQL Server.

SQL Server Agent: Get familiar with the SQL Server Agent tool and its features.

Day 3:

High Availability and Disaster Recovery: Learn about SQL Server high availability and disaster recovery solutions, such as Always On Availability Groups and Failover Clustering.

Monitoring and Troubleshooting: Learn how to monitor and troubleshoot SQL Server performance issues.

Reporting: Get familiar with SQL Server reporting services and how to create and manage reports.

SQL Server Integration Services (SSIS): Understand the basics of SQL Server Integration Services and how to create simple ETL processes.

Advanced Topics: If time allows, explore advanced topics such as SQL Server Analysis Services (SSAS) and SQL Server Reporting Services (SSRS).

Remember to practice what you learn by creating and managing your own SQL Server databases, and by experimenting with different features and settings.

No comments: