- Her zaman SQL ile uygulama sunucusunu birbirinden ayır
- Registered Server özelliğini kullan
- Template leri kullan
- SQL'in 3 farklı lisanslama metodu var
- Developer
- Enterprise seviyesinde özellikleri olup sadece geliştirme makinalarında kullanılabilir ve lisans ücreti düşüktür.
- Express
- Çok düşük kaynak kullanımına olanacak sağlar, ücretsizdir
- Standart
- En önemlisi, herşeyi yapar candır
- Enterprise
- Linsans ücreti çok yüksek, bu sebeple iyi düşünülmeli
- Always ON
- 7/24 Aynı performans
- Data işlemleri
- Developer
- Scale Out
- MDF-NDF ile LDF dosyaalrını ayır ve farklı disklere taşı.
- İndex ve Tabloları birbirinden ayır
- AutoClose should be off
- Uygulamaların sisteme tekrar tekrar session açmasına yol açabilir
- AutoShring should be off
- Çünkü indexlerde ciddi fragmantasyoa yol açıyor
- Statistics
- SQL server tarafından hanögi index in kullanılması gerektiğini belirler
- sp_configure blocked process treshold. Start using Sql profiler to catch the Blocked Process Report
Asenkron olması - query background için daha uygun
select is_auto_update_stats_on, is_auto_update_stats_async_on, * from sys.databases
Nasıl Asenkron Stats eklemes yapılır
ALTER DATABASE DB
SET auto_update_statistics_async on
Kullanış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)
where
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
Soru | Cevap |
---|---|
four-node failover cluster için quorum configuration seçimi | Node 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 CREATE SERVER AUDIT C_Audit TO APPLICATION LOG ALTER SERVER AUDIT C_Audit WITH(STATE=ON) USE Contoso CREATE DATABASE AUDIT SPECIFICATION C_AuditSpec FOR SERVER AUDIT C_Audit ADD (UPDATE ON Sales.ProductPrices BYdbo) ALTER DATABASE AUDIT SPECIFICATION C_AuditSpec WITH (STATE=ON) |
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 Failure | You 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 queries | Start a SQL Profiler Trace: Lock: Timeout |
Migrate Database to Microsoft Azure Server | Use SQL Server Management Studio to deploy the database to Windows Azure SQL Database |
query_processing error - failover occurs set server configuration | HealthCheckTimeout |
Migrate SQL2008 to SQL2012 | side-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" |
|
Transaction Log file maksimum parametresi düzenleme | Management 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: |
|
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 basis | SQL server that includes an application database configured to perform snapshot replication |
Two servers in the same data center that hosts your production database.
| Two server configured on the same subnet SQL Server Availability Group configured in Synchronous- Commit Availability Mode |
SQL 2005 upgrade to SQL 2012 |
|
|
|
SSIS packages |
|
You create a stored procedure that return database level information from DMV |
|
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
| 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? |
|
You plan a bulk insert
|
|