Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


titleKullanışlı DMV fonksiyonları

select * from sys.dm_db_index_physical_stats(null,null,null,null,null)

select DB_NAME(database_İd),object_name(object_id),avg_fragmentation_in_percent,* from sys.dm_db_index_physical_stats(DB_ID('EBIFlowDB'),null,null,null,null)
avg_fragmentation_in_percent > 20

select object_name(object_id),* from sys.dm_db_index_usage_stats 

select * from sys.dm_os_windows_info

select * from sys.dm_os_sys_info

four-node failover cluster için quorum configuration seçimiNode and Disk Majority doğrucevapçünkü çift sayılıkonfigurasyoneğerteksayıyanifive-nodegibibudurumdasadeceNode Majorityyeterliolacaktı.
Create a script that writes audit events into application log whenever data in the ProductPrices table is updated. Schema Name:Sales, Table name:ProductPrices

USE Master





USE Contoso



ADD (UPDATE ON Sales.ProductPrices BYdbo)


MSSQLservisiçalıştırılırkenyenidenduruyor ve hatayıneredenyakalarız.MSSQL11.MESSQLSERVER\MESSQL\Log\ErrorLog
ServerA → ServerB Mirroring

1-Backup full backup

2-Restore full backup

3-Log restore

Design a database on SAN and high availability on plus database must remain online if SQL Server FailureYou should include two servers configured as a failover cluster

SQL1 - Principal server

SQL2 - Mirror server

SQL3 - Witness server

Upgrade 1 and 2

Remove SQL3

Upgrade SQL2

Manually failover from SQL1 to SQL2

Upgrade SQL1

Manually failover from SQL2 to SQL1

Add SQL3 back

You suspect that SQL Server is assigning stronger locks to queriesStart a SQL Profiler Trace: Lock: Timeout
Migrate Database to Microsoft Azure ServerUse SQL Server Management Studio to deploy the database to Windows Azure SQL Database
query_processing error - failover occurs set server configurationHealthCheckTimeout
Migrate SQL2008 to SQL2012side-by-side migration for login:backup master and restore it to SQL2012
Power Vıew Components

1-Install Reporting Services

2-Install Database Engine and PowerPivot For SharePoint

3-Configure Microsoft SQL Server Reporting Services Add-in Sharepoint mode

SSL Sertifika hatası alınıyor ancak yükleme normal yapılmış, ayarları düzenlemek gerekiyor.

"A self-generated certificate was successfully loaded for encryption"

  • From the SQL Configuration manager on the SQL Server, open the PROTOCOLS properties for the SQL Instance
  • Choose the server certificate provided by network administrators from the drop-down list on the CERTIFICATES tab
  • Restart the SQL Server
Transaction Log file maksimum parametresi düzenlemeManagement Studio → Database → Properties → Files → Transaction Log Autogrow window - set
OLTP - Uses (SAN) - Any server fails, the database remains - minimize the amount of storage used by the database:
  • Two servers configured in a Windows Failover Cluster in the same data center.
  • SQL Server configured as a clustered instance.


A database contains a large product catalog that is updated periodically and you need to be able to send the entire product catalog to all branch offices on monthly basisSQL server that includes an application database configured to perform snapshot replication

Two servers in the same data center that hosts your production database.

  1. catastrophic server failure or disk failure occurs.
  2. transactional consistency

Two server configured on the same subnet

SQL Server Availability Group configured in Synchronous- Commit Availability Mode

SQL 2005 upgrade to SQL 2012
  1. Perform a full database backup on SQL2005
  2. Restore the full database backup on SQL 2012
  3. Change the compatibility level for the database to 110 on SQL2012
  • Multiple databases on the same low-latency subnet must allow applications to write changes locally, and these changes must be replicated to all related databases.
  • An order summary table is repopulated once a week. This table must be replicated to all databases.
  • Field offices using unreliable connections keep a local copy of the product catalog and process orders locally. These orders must be periodically replicated to all other
  • Information order-tracking database must be replicated across a low-latency connection as changes occur to multiple reporting databases


  • Peer-to-Peer Replication
  • Snapshot Replication
  • Merge- Replication
  • Transactional Replication
SSIS packages
  1. Create domain user account and grant permission to domain user account to access the network share.
  2. Create a credential that references the domain user
  3. Add a proxy that references the credential
  4. Assign the proxy to the SSIS package execution subsystem
You create a stored procedure that return database level information from DMV
  1. Modify the sp to include the EXECUTE AS OWNER statement Grant VIEW SERVER STATE permission to the owner of the stored procedure
  2. Create a SQL Server login that has VIEW SERVER STATE permissions. Modify the sp to include the EXECUTE as {newlogin} statement.
sp_ ile başlayan prosedür yazdırmama kuralı

Create a condition named StoredProceedureNamingConvention by using the Stored Procedure facet that has a single expression

Set the Field to @Name, Operator to LIKE, and VALUE to 'sp[_]%'

Create a Policy named StoredProceedureNamingPolicy

SET the check condition to StoredProceedureNamingConvention and Evaluation Mode On Change, Prevent

Enable StoredProceedureNamingPolicy

Development Team wants to refresh test db wednesdat at 10am

Transaction backup

Backup size çok düşük

Import data from text file to the database

  1. Data import using sp
  2. data is loaded and minimally logged


Data Import Command: BULK INSERT

Recovery Model: Bulk-Logged

The firewall only allows inbound connections on port 1433. The server only hosts single instance. How to allow remote connection?
  • Enable Inbound connections 1434 in the Windows Firewall on the server
  • sp_configure 'remote admin connections ' reconfigure

You plan a bulk insert

  • transaction log minimally affected
  • database online and all user transactions are recoverable
  • All transactions are fully recoverable prior to import
  1. Perform a LOG backup
  2. Configure the database to use the BULK-LOGGED recovery model
  3. Execute the BCP tool