Posts

Showing posts from February, 2018

SQL DBA Interview Questions 2018

SQL DBA 2018 Latest interview questions?. If Database size is 500GB then what is TempDB Size in that Server? Why Restore job is taking long time compare to before log restore in logShipping? What are the Tempdb enchancements in 2016 sql server? If TUF is corrupt in logShipping what Happend? What are the 2016 new features? what is StrechDB? Model database is Correpted on that time Instance running fine. After restrting the istance is not responding why?How you will resolve? What is CXPAKET? What is AlwaysOn? What is the basic requiremets to configure AlwaysOn? Can you configure One listner to multiple AG Groups? if yes How? If no why? Can you explain How AlwaysOn Ag work flow? What are the DMV's using in Daily? Can you list out few regular XP's your using? what are the DBCC commands your using?

Long Running queries

How do I find a long running query with process ID, process name , login time, user , start time and duration? Long running queries have been found in the plan cache. These may be ETL, reports, or other queries that should run long. Or it could be that someone is searching for all users whose names are LIKE '%%'. Either way, these queries bear investigating. In some cases, this is the total clock time that the query took to execute and in others this is the total CPU time that the query took to execute. Queries with a high max_elapsed_time just take a lot of time to run – they could be slow single threaded queries. Queries with a high max_worker_time (CPU time) may be highly parallel queries. CODE: SELECT  creation_time         ,last_execution_time         ,total_physical_reads         ,total_logical_reads         ,total_logi...

SQL Introduction

What is SQL Stands for Structured Query Language it lets you Access and manipulate databases What Can SQL do Create new databases  Syntax: CREATE DATABASE database_name create new tables in a database  Syntax: CREATE TABLE table_name (column1 datatype, column2 datatype, column3 datatype,); Insert records in a database  Syntax: INSERT INTO table_name VALUES (value1, value2, value3, ...); Retrieve data from a database  Syntax: SELECT * FROM table_name; NOTE: insted of * you can use fileds which fileds we want retrive. Delete records from a database  Syntax: DELETE FROM table_name WHERE condition; Update records in a database  Syntax: UPDATE table_name SET column1 = value1, column2 = value2, WHERE condition; Execute queries against a database Create stored procedures in a database Create views in a database Set permissions on tables, procedures, and views However, to be compliant with the ANSI standard, they all support...

Database Developer vs Database Administrator

Image
Hi Geeks, Hope you're all doing good!! Have you ever asked someone or yourself to know who is a database developer and database administrator ? Or Have you ever been confused as to the difference between a DBA and a SQL Developer? Well, then you are not alone. There are number of blurred lines about exactly what is a DBA role, what is a SQL developer role. And thousands of people are still looking for the exact definitions. In this post, I will try my level best to clear all of your doubts about these two simple yet complicated things.  On a lighter note, The database administrator performs the day-to-day task(s) of maintaining the database environment to ensure its availability. Make sure it runs smoothly using database  tools to monitor, fix and maintain the database software, also the hardware on which it runs. On the other hand, the database developer designs and creates new ways of using a software  application. The database developer does this b...

Overview of SQL Server Security

Overview of SQL Server Security A defence-in-depth strategy, with overlapping layers of security, is the best way to under security threats. SQL Server provides a security architecture that is designed to allow database administrators and developers to create secure database applications and counter threats. Each version of SQL Server has improved on previous versions of SQL Server with the introduction of new features and functionality. However, security does not ship in the box. Each application is unique in its security requirements. Developers need to understand which combination of features and functionality are most appropriate to counter known threats, and to anticipate threats that may arise in the future. A SQL Server instance contains a hierarchical collection of entities, starting with the server. Each server contains multiple databases, and each database contains a collection of securable objects. Every SQL Server securable has associated permissions that can be g...

Architucture

Image
SQL Server Architecture Components of the SQL Server Engine Figure 1-1 shows the general architecture of SQL Server, which has four major components (three of whose subcomponents are listed): protocols, the relational engine (also called the Query Processor), the storage engine, and the SQLOS. Every batch submitted to SQL Server for execution, from any client application, must interact with these four components. (For simplicity, I’ve made some minor omissions and simplifications and ignored certain “helper” modules among the subcomponents.) The protocol layer receives the request and translates it into a form that the relational engine can work with, and it also takes the final results of any queries, status messages, or error messages and translates them into a form the client can understand before sending them back to the client. The relational engine layer accepts SQL batches and determines what to do with them. For Transact-SQL queries and pr...

Basic Introduction

Image
Introduction to SQL Server What is SQL Server RDBMS? As you most likely know, SQL Server is primarily thought of as a Relational Database Management System ( RDBMS ). It is certainly that, but it is also much more. SQL Server can be more accurately described as an Enterprise Data Platform . It offers many new features in every new version i.e. even more enhanced or improved features from previous versions of the product. In addition to traditional RDBMS duty, SQL Server also provides rich reporting capabilities, powerful data analysis, and data mining, as well as features that support asynchronous data applications, data-driven event notification, and more. The components of SQL Server are Database Engine The Database Engine is the primary component of SQL Server. It is the Online Transaction Processing (OLTP) engine for SQL Server. The Database Engine is a high-performance component responsible for the efficient storage, retrieval, and manipulati...

AlwaysOn Overview

Image
OVERVIEW An availability group supports a failover environment for a discrete set of user databases, known as availability databases, that fail over together. An availability group supports a set of primary databases and one to eight sets of corresponding secondary databases. Secondary databases are not backups. Continue to back up your databases and their transaction logs on a regular basis. Each set of availability database is hosted by an availability replica. Two types of availability replicas exist: a single primary replica. which hosts the primary databases, and one to eight secondary replicas, each of which hosts a set of secondary databases and serves as a potential failover targets for the availability group. The primary replica makes the primary databases available for read-write connections from clients. Also, in a process known as data synchronization, which occurs at the database level. The primary replica sends transaction log records of each primary databa...