0% found this document useful (0 votes)
14 views

Untitled document_1

Uploaded by

COOLNET browsing
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Untitled document_1

Uploaded by

COOLNET browsing
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

What are the default system databases while installing sql server
master, model, msdb, and tempdb
2.what is replication
Replication in SQL Server is a set of technologies that allows users
to copy and distribute data and database objects from one database to
another. The goal of replication is to maintain consistency and integrity
between the databases by synchronizing the data.
3.types of replication
Snapshot Replication, Transactional Replication, peer-to-peer
replication, and Merge Replication
4.can you have different collation on different databases
Yes, We can change the database collation using SQL Server Management
Studio (SSMS), or Transact-SQL (T-SQL). You can specify the collation for a new
database or update the collation for an existing database by using SQL Server
Management Studio (SSMS)
5.how many sql server instances can be installed on one machine
50 instances on a stand-alone server. 25 failover cluster
instances when using a shared cluster disks as storage. 50 failover
cluster instances with SMB file shares as the storage option.
6.difference between backup, restore and detach file
Backup:
The process of creating a copy of data to be stored in a safe place. Backups are
important for protecting data from hardware failure, power outages, viruses, and
other issues.
Restore:
The process of retrieving data from a backup. For example, in Windows, System
Restore can be used to return a system to working order after data corruption or an
installation failure
Detach:
The process of removing columns from a data grid or unattaching a media file from
a submission. For example, in Oracle, detaching columns from a data grid displays
them in their own window. In the Media Library, detaching a media file from a
submission frees up the original media to be modified or removed.

7.how to shrink the database log file in the sql server


Shrink a data or log file using SSMS. In Object Explorer,
connect to an instance of the SQL Server Database Engine and
then expand that instance. Expand Databases and then right-click
the database that you want to shrink. Point to Tasks, point to
Shrink, and then select Files
8.how to trace deadlock information in sql server
Enable Trace Flag 1222
Use the DBCC TRACEON command to enable this flag and capture deadlock
information in the error log.
Query the SQL Server Error Log
Use the sys.sp_readerrorlog stored procedure to query the error log for deadlock
messages.
Use SQL Server Management Studio
Use the Activity Monitor to view deadlock information or the Profiler to capture
deadlock information as it occurs.
Use SQL Server Profiler
Use the Deadlock Graph to identify and resolve deadlocks. The Deadlock Graph
provides a graphical representation of the processes involved in a deadlock and
the resources they're waiting for.
Use SolarWinds SQL Sentry
This tool displays deadlocks in SQL Server and shows the total time lost during
those deadlocks.
9.what is the difference between actual execution plan and estimated execution plan
an actual execution plan is generated after a query has been
executed, while an estimated execution plan is a prediction of how a
database engine will execute a query
10.how to find all the processor running by specific login in SQL server
Go to Activity Monitor on the top icons of the management
studio. You will see the information about the SQL Server resources
in the SQL activity monitor. Expand the Processes tab to see all the
running processes of the SQL server. The MySQL processes will
give you the data of the load running on your database server

11.how would you find out how many transactions per second sql server instance is
performing
To find out how many transactions per second an SQL Server
instance is performing, you can use the Transactions/sec counter from the
SQL Server Databases counter object:
 SQL Server 2000: Use sysperfinfo to access the counter
 SQL Server 2005 or later: Use sys.dm_os_performance_counters to access the
counter
12.how would you find orphan users and how would you fix them?
USE database_name EXEC sp_change_users_login report GO
USE DATABASENAME
sp_change_users_login AUTO_FIX, 'LoginName/UserName'
Go

13.how to create a maintenance plan that will backup all databases full backup in sql server
To create a database maintenance plan, open SQL Server
Management Studio (SSMS) and connect to the SQL Server
instance. Once connected to the instance, expand Management
Right-click on the Maintenance Plans Select New Maintenance Plan
14.how to debug permission issues for user in sql server
15.what is the difference between index rebuild and index reorganize
The main difference between index rebuild and index reorganize is
that rebuild creates a new index structure, while reorganize is a more
lightweight option that fixes the physical ordering of pages:

16.what is index fragmentation


Index fragmentation refers to the disorganization of data within an index
in a database system
17. How would drop replicated database
sp_removedbreplication
[ [ @dbname = ] N'dbname' ]
[ , [ @type = ] N'type' ]
[ ; ]

18. What is the difference between log shipping and replication


Compared to database replication, log shipping does not
provide as much in terms of reporting capabilities, but backs up
system tables along with data tables, and locks the standby server
from users' modifications. A replicated server can be modified (e.g.
views) and is therefore unsuitable for failover purposes.
19. What is sql server clustering
SQL Server clustering is a high-availability solution that connects
multiple SQL Server instances (nodes) to share storage and improve
performance:
20. What is auto failover of primary replica in availability group
automatic failover of a primary replica in an availability group is a
failover mode that occurs when the primary replica becomes
unavailable. This mode ensures that the database is quickly available
without data loss.
21. What is active cluster and passive cluster
 Active node: The primary node that handles the full workload
 Passive nodes: Standby nodes that take over if the active node fails

22. Can you setup replication with always on


Transactional Replication is a powerful tool in Microsoft SQL Server that allows to
replicate data from one database to another. When database is part of AlwaysOn
Availability group(AG), the setup process requires careful consideration to ensure a
seamless and reliable environment.

The following are the steps involved in setting the SQL Server replication when the
publisher in Always on Availability group.

1. Setup the remote distribution


2. Configure publisher to use the remote distribution
3. Setup the SQL Server replication
4. Creating linked servers to subscribers on the secondary servers
5. Redirect the original publisher to listener of the AG
23. What is always on in sql server
Always On is a feature in SQL Server that automatically copies
databases to multiple servers and switches to a replica if the primary
database is unavailable. It's a high-availability and disaster-recovery
solution that can help maximize the availability of a company's user
databases.
24. How many secondary replica's can be configured in always on availability group
An Always On availability group in SQL Server can support up to
eight secondary replicas in addition to one primary replica
25. Is ssis cluster aware?
Clustering Integration Services is not recommended because the Integration Services
service is not a clustered or cluster-aware service

26. How to configure SSIS to store packages in msdb


To configure SQL Server Integration Services (SSIS) to store packages in
MSDB, you can save a copy of the package to SQL Server:
In Solution Explorer, double-click the package you want to save
Select Save Copy of <package file> As from the File menu
In the Save Copy of Package dialog box, select SQL Server from the Package
location list
If you select SQL Server, you'll need to provide a server name, authentication type,
user name, and password
Specify the package path by typing it or clicking the Browse button
Review the package protection level
Click OK

27. Different types of index in sql server


The 6 important types of indexes in SQL are: Clustered Index, Non-Clustered Index,
Unique Index, Full-Text Index, Composite Index, and Filtered Index. In the realm of SQL
databases, indexes play a crucial role in enhancing query performance.

29. What are the joins in sql server


INNER JOIN, OUTER JOIN, CROSS JOIN, and SELF JOIN. However, remember
that OUTER JOINS have two subtypes: LEFT OUTER JOIN and RIGHT OUTER JOIN.
30. Difference between ddl and dml
DDL is a Data Definition Language that is used to define data
structures. For example: creating a table, and altering a table are
instructions in SQL. DML is a Data Manipulation Language that is
used to manipulate data itself. For example: insert, update, and
delete are instructions in SQL.
31. Difference between union and union all operator in sql server
The key difference is that UNION removes duplicate records,
whereas UNION ALL includes all duplicates. This distinction not
only changes the number of rows in the query result, but it also
impacts performance.
32. How to delete duplicate records in sql server.
Methods for Removing Duplicates in the Database.
Using ROW_NUMBER() and DELETE.
Using DELETE with subquery.
Using GROUP BY with HAVING clause.
Using temporary tables for batch processing.

33. How can you copy data from one table to another table

then it is possible by using the SELECT INTO statement in SQL. The SELECT INTO
statement in Structured Query Language copies the content from one existing table into the
new table.

You might also like