What are the types of indexes available with SQL Server?
There are basically two types of indexes that we use with the SQL Server. Clustered and the Non-Clustered.
When do we use the UPDATE_STATISTICS command?
This command is basically used when we do a large processing of data. If we do a large amount of deletions any modification or Bulk Copy into the tables, we need to basically update the indexes to take these changes into account. UPDATE_STATISTICS updates the indexes on these tables accordingly.
Which TCP/IP port does SQL Server run on?
SQL Server runs on port 1433 but we can also change it for better security.
From where can you change the default port?
From the Network Utility TCP/IP properties –> Port number.both on client and the server.
What is the use of DBCC commands?
DBCC stands for database consistency checker. We use these commands to check the consistency of the databases, i.e., maintenance, validation task and status checks.
Can you give me some DBCC command options?
(Database consistency check) - DBCC CHECKDB - Ensures that tables in the db and the indexes are correctly linked.and DBCC CHECKALLOC - To check that all pages in a db are correctly allocated. DBCC SQLPERF - It gives report on current usage of transaction log in percentage. DBCC CHECKFILEGROUP - Checks all tables file group for any damage.
What command do we use to rename a db?
sp_renamedb ‘oldname’ , ‘newname’
Well sometimes sp_reanmedb may not work you know because if someone is using the db it will not accept this command so what do you think you can do in such cases?
In such cases we can first bring to db to single user using sp_dboptions and then we can rename that db and then we can rerun the sp_dboptions command to remove the single user mode.
What is a Join in SQL Server?
Join actually puts data from two or more tables into a single result set.
Can you explain the types of Joins that we can have with Sql Server?
There are three types of joins: Inner Join, Outer Join, Cross Join
When do you use SQL Profiler?
SQL Profiler utility allows us to basically track connections to the SQL Server and also determine activities such as which SQL Scripts are running, failed jobs etc.
What is a Linked Server?
Linked Servers is a concept in SQL Server by which we can add other SQL Server to a Group and query both the SQL Server dbs using T-SQL Statements.
Can you link only other SQL Servers or any database servers such as Oracle?
We can link any server provided we have the OLE-DB provider from Microsoft to allow a link. For Oracle we have a OLE-DB provider for oracle that microsoft provides to add it as a linked server to the sql server group.
Which stored procedure will you be running to add a linked server?
sp_addlinkedserver, sp_addlinkedsrvlogin
What are the OS services that the SQL Server installation adds?
MS SQL SERVER SERVICE, SQL AGENT SERVICE, DTC (Distribution transac co-ordinator)
Can you explain the role of each service?
SQL SERVER - is for running the databases
SQL AGENT - is for automation such as Jobs, DB Maintanance, Backups
DTC - Is for linking and connecting to other SQL Servers
How do you troubleshoot SQL Server if its running very slow?
First check the processor and memory usage to see that processor is not above 80% utilization and memory not above 40-45% utilization then check the disk utilization using Performance Monitor, Secondly, use SQL Profiler to check for the users and current SQL activities and jobs running which might be a problem. Third would be to run UPDATE_STATISTICS command to update the indexes
Lets say due to N/W or Security issues client is not able to connect to server or vice versa. How do you troubleshoot?
First I will look to ensure that port settings are proper on server and client Network utility for connections. ODBC is properly configured at client end for connection ——Makepipe & readpipe are utilities to check for connection. Makepipe is run on Server and readpipe on client to check for any connection issues.
What are the authentication modes in SQL Server?
Windows mode and mixed mode (SQL & Windows).
Where do you think the user’s names and passwords will be stored in sql server?
They get stored in master db in the sysxlogins table.
What is log shipping? Can we do logshipping with SQL Server 7.0
Logshipping is a new feature of SQL Server 2000. We should have two SQL Server - Enterprise Editions. From Enterprise Manager we can configure the logshipping. In logshipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and we can use this as the DR (disaster recovery) plan.
Let us say the SQL Server crashed and you are rebuilding the databases including the master database what procedure to you follow?
For restoring the master db we have to stop the SQL Server first and then from command line we can type SQLSERVER –m which will basically bring it into the maintenance mode after which we can restore the master db.
What is BCP? When do we use it?
BulkCopy is a tool used to copy huge amount of data from tables and views. But it won’t copy the structures of the same.
What should we do to copy the tables, schema and views from one SQL Server to another?
We have to write some DTS packages for it.
What is RAID and what are different types of RAID configurations?
RAID stands for Redundant Array of Independent Disks. RAID defines data storage schemes to divide and replicate data among various disks so that data reliability and I/O performance can be increased.
The basic configurations of RAID are:
LEVEL 0: Striped set without parity/Non-Redundant Array
LEVEL 1: Mirrored set without parity
LEVEL 2: Redundancy through Hamming code
LEVEL 3: Striped set with dedicated parity/Bit interleaved parity
LEVEL 4: Block level parity
LEVEL 5: Striped set with distributed parity
LEVEL 6: Striped set with dual distributed Parity
What is database architecture?
Database architecture describes the design of the database. It explains how the data is stored. The data of the server is stored in databases. This database is further split into one or more discs. The database can be considered to have two layers. Physical layer, which is a transparent layer for the database administrators to work on. Other users typically work on the user view layer. Tables, views, procedures form this view
What are pages and Extents?
A page is a unit of data storage in SQL. The size of a page is 8Kb. A page has a header and a body. Different types of pages are: Date, text, index, page free space etc. The data rows are put on the page serially after the header.
Extents are units in which space is allocated to tables and indexes. An extent is 8 continuous pages. SQL Server has two types of extents: uniform and mixed extent. For efficient allocation, the SQL server does not allocate whole extents to tables with small amounts of data
What do you know about system database?
The system database contains information/metadata for all database present on an SQL Server instance. The system database stores information regarding logins, configuration settings, connected servers etc. It also holds various extended stored procedures to access external processes and applications.
Major system databases:
Master: Core system database to mange Sql Server instance.
Resource: Responsible for physically storing all system objects.
TempDB: This is a temporary database used to store temporary, tables, cursors, indexes, variables etc.
Model: This acts as a template database for all user created databases.
MSDB: Database to manage SQL Server agent configurations.
Distribution: Database primarily used for SQL Server replication.
ReportServer: Main database for reporting services to store metadata and other object definitions.
ReportServerTempDB: Acts as a temporary storage for reporting services.
What are Page Splits?
When there is not enough room on a page for a new row, a Server splits the page, allocates a new page, and moves some rows to the new page
Explain what are the database objects?
Database objects such as tables, primary key, and foreign key describe the structure of the content of a database. These objects also represent the properties of a server. Server side objects are objects that reside on the server but not in the database. Typical examples of server side objects include, logins, user defined error messages etc. The database objects are contained in the database project while the server objects are contained in the server project. These objects are defined in a .sql file. Most of these objects are defined in a separate file depending on the scenario. E.g it is necessary to specify columns in the same file where the table is defined
Illustrate physical database architecture in brief
The physical database architecture describes how the database and files are organized in a SQL server.
Pages and extents: these describe how the data is stored
Physical Database Files and File groups: describes the operating system files used to store data and logs.
Space Allocation and Reuse: Describes the algorithms used for space allocation.
Table and Index Architecture: Describes the way pages for tables can be indexed
What is Model Database?
It is a template database used in the creation of new database.
Explain logical database components
The logical components are usually used to connect to the database. Any object that a user can use to access or connect to the database is a logical component. Triggers, tables, procedures, views, keys etc are typical examples
Please illustrate physical database architecture?
The physical database architecture describes how the database and files are organized in a SQL server.
Pages and extents: these describe how the data is stored
Physical Database Files and File groups: describes the operating system files used to store data and logs.
Space Allocation and Reuse: Describes the algorithms used for space allocation.
Table and Index Architecture: Describes the way pages for tables can be indexed
What is TEMPDB Database?
It stores temporary objects like temporary tables and temporary stored procedure.
What is the difference between CUBE operator and ROLLUP operator?
CUBE generates a result set that represents aggregates for all combinations of values in the selected columns.
ROLLUP generates a result set that represents aggregates for a hierarchy of values in the selected columns.
What is MSDB Database?
It stores information related to database backups, DTS packages, Replication, SQL Agent information, SQL Server jobs.
Do you know what are the restrictions applicable while creating views?
Views can be created referencing tables and views only in the current database.
A view name must not be the same as any table owned by that user.
You can build views on other views and on procedures that reference views.
Rules or DEFAULT definitions can't be associated with views.
Only INSTEAD OF triggers can be associated with views.
The query that defines the view cannot include the ORDER BY, COMPUTE, or COMPUTE BY clauses or the INTO keyword.
You cannot define full-text index definitions for views.
You cannot create temporary views
You cannot create views on temporary tables.
What is Master Database?

Master database is system database. It contains information about server’s configuration. It is a very important database and important to backup Master database. Without Master database, server can't be started.
Request to Download PDF

Post A Comment: