SlideShare une entreprise Scribd logo
1  sur  9
Basics of SQL Server
Vishal Jharwade
sqlcircuit.blogspot.com
Agenda
• SQL Server Architecture
• Database Architecture
• System Databases
• Recovery Models
• Backup and Restore
• Security
• T-SQL
• SQL Jobs
SQL Server BI Model
3
Reporting Services
Analysis Services
OLAP & Data Mining
Integration
Services
ETL
SQL Server
Relational Engine
DevelopmentTools
ManagementTools
System Databases with SQL Server
• Master
The Master database holds information for all databases located on the SQL Server instance. This
database includes information such as system logins, configuration settings, linked servers, and
general information regarding the other system and user databases for the instance. The master
database also holds extended stored procedures, which access external processes.
• Model
Model is essentially a template database used in the creation of any new user database created in
the instance.
• Tempdb
As its name implies, Tempdb holds temporary objects such as global and local temporary tables and
stored procedures. This database is recreated every time SQL Server starts, and the objects
contained in it will be based upon the objects defined in the model database.
• Msdb : The msdb database stores information regarding database backups, SQL Agent
information, DTS packages, SQL Server jobs, and some replication information such as for log
shipping.
Recovery Models
• Full Recovery :
The Full Recovery model uses database backups and transaction log backups to provide complete
protection against media failure. It provides the ability to recover the database to the point of failure
or to a specific point in time.
• Bulk logged Recovery :
The bulk-logged recovery model protects against failure and offers the best performance. In
order to get better performance. The operations which minimally logged and not fully
recoverable are SELECT INTO, BULK INSERT, CREATE INDEX and TEXT/IMAGE OPERATION.
• Simple Recovery :
The simple recovery model allows you to recover data only to the most recent full backup or
differential backup. Transaction log backups are not available because the contents of the
transaction log are truncated each time a checkpoint is issued for the database.
Backups and Restore
• Full Backup :
A full database backup backs up the whole database. This includes part of the transaction log so
that the full database backup can be recovered.
• Differential Backup :
A differential database backup records only the data that has changed since the last full database
backup.
• Transaction log Backup :
A transaction log backup makes a copy of only the log file. A log file backup by itself cannot be used
to restore a database. A log file is used after a database restore to recover the database to the point
of the original failure.
File group Backup : It backups only file groups available in the database.
T-SQL : System stored procedures commonly use for Database Administration.
• sp_databases: It lists databases that resides in the instance of SQL Server 2005. you can also get the
same information from sys.databases table.
• sp_spaceused: It shows disk space information occupied by database.
• sp_help: Reports information about a database object.
• sp_helpdb: Reports information about a specified database or all databases.
• sp_renamedb: syntax :sp_renamedb [ @dbname = ] 'oldname' , [ @newname = ] 'newname‘
• sp_who: Provides information about current users, sessions, and processes in an instance of the
Microsoft SQL Server Database Engine.
• sp_dboption: Displays or changes database options.
Global Variables:
• @@SERVERNAME: Returns the name of the local server that is running SQL Server.
• @@SERVICENAME: Returns name of the service on which SQL server is running.
• @@VERSION: Returns version, processor architecture, build date, and operating system for the
current installation of SQL Server.
• @@ERROR: Returns the error number for the last Transact-SQL statement executed.
• @@ROWCOUNT: Returns the number of rows affected by the last statement.
SQL Server commands
• KILL : KILL is commonly used to terminate a process. You can not kill your own process.
• BACKUP: It is used to take backup of a particular database.
• COUNT: Returns total no. of objects.
• DELETE : Remove rows from the table or view.
• DISTICT : Used to retrieve unique data.
• DROP : To remove the database object.
• GETDATE : Returns the current database system timestamp.
• TOP: Specifies that only the first set of rows will be returned from the query result.
• UPDATE: It is used to update the records into the table.
SQL Agent Job
• SQL Jobs are the collection of steps performed sequentially to perform specific task.
• It is run by SQL Server agent service.
• SQL Agent Jobs can be scheduled to run at specified times or at specified intervals.
• Jobs Can be enabled or disabled.
• For errors, You can see the job history or SQL Server agent log.

Contenu connexe

Tendances

Sql server 2019 new features
Sql server 2019 new featuresSql server 2019 new features
Sql server 2019 new featuresGeorge Walters
 
Oracle statistics by example
Oracle statistics by exampleOracle statistics by example
Oracle statistics by exampleMauro Pagano
 
The oracle database architecture
The oracle database architectureThe oracle database architecture
The oracle database architectureAkash Pramanik
 
MySQL Architecture and Engine
MySQL Architecture and EngineMySQL Architecture and Engine
MySQL Architecture and EngineAbdul Manaf
 
Overview SQL Server 2019
Overview SQL Server 2019Overview SQL Server 2019
Overview SQL Server 2019Juan Fabian
 
Why oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cWhy oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cSatishbabu Gunukula
 
Oracle Database Introduction
Oracle Database IntroductionOracle Database Introduction
Oracle Database IntroductionChhom Karath
 
Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)Bilal Arshad
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuningYogiji Creations
 
SQL Queries
SQL QueriesSQL Queries
SQL QueriesNilt1234
 
PostgreSQL Tutorial For Beginners | Edureka
PostgreSQL Tutorial For Beginners | EdurekaPostgreSQL Tutorial For Beginners | Edureka
PostgreSQL Tutorial For Beginners | EdurekaEdureka!
 
Relational database- Fundamentals
Relational database- FundamentalsRelational database- Fundamentals
Relational database- FundamentalsMohammed El Hedhly
 
Microsoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxMicrosoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxsamtakke1
 
An Introduction To Oracle Database
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle DatabaseMeysam Javadi
 

Tendances (20)

Sql server 2019 new features
Sql server 2019 new featuresSql server 2019 new features
Sql server 2019 new features
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
 
Oracle statistics by example
Oracle statistics by exampleOracle statistics by example
Oracle statistics by example
 
The oracle database architecture
The oracle database architectureThe oracle database architecture
The oracle database architecture
 
MySQL Architecture and Engine
MySQL Architecture and EngineMySQL Architecture and Engine
MySQL Architecture and Engine
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
 
Overview SQL Server 2019
Overview SQL Server 2019Overview SQL Server 2019
Overview SQL Server 2019
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Why oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cWhy oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19c
 
Tableau Prep.pptx
Tableau Prep.pptxTableau Prep.pptx
Tableau Prep.pptx
 
Lecture2 oracle ppt
Lecture2 oracle pptLecture2 oracle ppt
Lecture2 oracle ppt
 
Oracle Database Introduction
Oracle Database IntroductionOracle Database Introduction
Oracle Database Introduction
 
Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuning
 
SQL Queries
SQL QueriesSQL Queries
SQL Queries
 
PostgreSQL Tutorial For Beginners | Edureka
PostgreSQL Tutorial For Beginners | EdurekaPostgreSQL Tutorial For Beginners | Edureka
PostgreSQL Tutorial For Beginners | Edureka
 
Oracle DBA
Oracle DBAOracle DBA
Oracle DBA
 
Relational database- Fundamentals
Relational database- FundamentalsRelational database- Fundamentals
Relational database- Fundamentals
 
Microsoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxMicrosoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptx
 
An Introduction To Oracle Database
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle Database
 

Similaire à Basics of SQL Server Architecture, Databases, Recovery Models, Security and T-SQL

Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAiougVizagChapter
 
database-stucture-and-space-managment.ppt
database-stucture-and-space-managment.pptdatabase-stucture-and-space-managment.ppt
database-stucture-and-space-managment.pptIftikhar70
 
database-stucture-and-space-managment.ppt
database-stucture-and-space-managment.pptdatabase-stucture-and-space-managment.ppt
database-stucture-and-space-managment.pptsubbu998029
 
Online Oracle Training For Beginners
Online Oracle Training For BeginnersOnline Oracle Training For Beginners
Online Oracle Training For Beginnersvibrantuser
 
SQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and ProfilingSQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and ProfilingAbouzar Noori
 
SQL PPT.pptx
SQL PPT.pptxSQL PPT.pptx
SQL PPT.pptxKulbir4
 
SQL SERVER Training in Pune Slides
SQL SERVER Training in Pune SlidesSQL SERVER Training in Pune Slides
SQL SERVER Training in Pune Slidesenosislearningcom
 
My sql technical reference manual
My sql technical reference manualMy sql technical reference manual
My sql technical reference manualMir Majid
 
Rolta’s application testing services for handling ever changing environment.
Rolta’s application testing services for handling ever changing environment.   Rolta’s application testing services for handling ever changing environment.
Rolta’s application testing services for handling ever changing environment. Rolta
 
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytxjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytWrushabhShirsat3
 
Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)Lucas Jellema
 
R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07zeesniper
 
Sql server-dba
Sql server-dbaSql server-dba
Sql server-dbaNaviSoft
 

Similaire à Basics of SQL Server Architecture, Databases, Recovery Models, Security and T-SQL (20)

Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
 
ORACLE ARCHITECTURE
ORACLE ARCHITECTUREORACLE ARCHITECTURE
ORACLE ARCHITECTURE
 
ora_sothea
ora_sotheaora_sothea
ora_sothea
 
database-stucture-and-space-managment.ppt
database-stucture-and-space-managment.pptdatabase-stucture-and-space-managment.ppt
database-stucture-and-space-managment.ppt
 
database-stucture-and-space-managment.ppt
database-stucture-and-space-managment.pptdatabase-stucture-and-space-managment.ppt
database-stucture-and-space-managment.ppt
 
Online Oracle Training For Beginners
Online Oracle Training For BeginnersOnline Oracle Training For Beginners
Online Oracle Training For Beginners
 
SQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and ProfilingSQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and Profiling
 
SQL PPT.pptx
SQL PPT.pptxSQL PPT.pptx
SQL PPT.pptx
 
Oracle 10g Introduction 1
Oracle 10g Introduction 1Oracle 10g Introduction 1
Oracle 10g Introduction 1
 
SQL SERVER Training in Pune Slides
SQL SERVER Training in Pune SlidesSQL SERVER Training in Pune Slides
SQL SERVER Training in Pune Slides
 
1650607.ppt
1650607.ppt1650607.ppt
1650607.ppt
 
MySQL database
MySQL databaseMySQL database
MySQL database
 
My sql technical reference manual
My sql technical reference manualMy sql technical reference manual
My sql technical reference manual
 
Rolta’s application testing services for handling ever changing environment.
Rolta’s application testing services for handling ever changing environment.   Rolta’s application testing services for handling ever changing environment.
Rolta’s application testing services for handling ever changing environment.
 
unit-ii.pptx
unit-ii.pptxunit-ii.pptx
unit-ii.pptx
 
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytxjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
 
Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)
 
R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07R12 d49656 gc10-apps dba 07
R12 d49656 gc10-apps dba 07
 
Sql server-dba
Sql server-dbaSql server-dba
Sql server-dba
 
Unit 2 oracle9i
Unit 2  oracle9i Unit 2  oracle9i
Unit 2 oracle9i
 

Dernier

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Dernier (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Basics of SQL Server Architecture, Databases, Recovery Models, Security and T-SQL

  • 1. Basics of SQL Server Vishal Jharwade sqlcircuit.blogspot.com
  • 2. Agenda • SQL Server Architecture • Database Architecture • System Databases • Recovery Models • Backup and Restore • Security • T-SQL • SQL Jobs
  • 3. SQL Server BI Model 3 Reporting Services Analysis Services OLAP & Data Mining Integration Services ETL SQL Server Relational Engine DevelopmentTools ManagementTools
  • 4. System Databases with SQL Server • Master The Master database holds information for all databases located on the SQL Server instance. This database includes information such as system logins, configuration settings, linked servers, and general information regarding the other system and user databases for the instance. The master database also holds extended stored procedures, which access external processes. • Model Model is essentially a template database used in the creation of any new user database created in the instance. • Tempdb As its name implies, Tempdb holds temporary objects such as global and local temporary tables and stored procedures. This database is recreated every time SQL Server starts, and the objects contained in it will be based upon the objects defined in the model database. • Msdb : The msdb database stores information regarding database backups, SQL Agent information, DTS packages, SQL Server jobs, and some replication information such as for log shipping.
  • 5. Recovery Models • Full Recovery : The Full Recovery model uses database backups and transaction log backups to provide complete protection against media failure. It provides the ability to recover the database to the point of failure or to a specific point in time. • Bulk logged Recovery : The bulk-logged recovery model protects against failure and offers the best performance. In order to get better performance. The operations which minimally logged and not fully recoverable are SELECT INTO, BULK INSERT, CREATE INDEX and TEXT/IMAGE OPERATION. • Simple Recovery : The simple recovery model allows you to recover data only to the most recent full backup or differential backup. Transaction log backups are not available because the contents of the transaction log are truncated each time a checkpoint is issued for the database.
  • 6. Backups and Restore • Full Backup : A full database backup backs up the whole database. This includes part of the transaction log so that the full database backup can be recovered. • Differential Backup : A differential database backup records only the data that has changed since the last full database backup. • Transaction log Backup : A transaction log backup makes a copy of only the log file. A log file backup by itself cannot be used to restore a database. A log file is used after a database restore to recover the database to the point of the original failure. File group Backup : It backups only file groups available in the database.
  • 7. T-SQL : System stored procedures commonly use for Database Administration. • sp_databases: It lists databases that resides in the instance of SQL Server 2005. you can also get the same information from sys.databases table. • sp_spaceused: It shows disk space information occupied by database. • sp_help: Reports information about a database object. • sp_helpdb: Reports information about a specified database or all databases. • sp_renamedb: syntax :sp_renamedb [ @dbname = ] 'oldname' , [ @newname = ] 'newname‘ • sp_who: Provides information about current users, sessions, and processes in an instance of the Microsoft SQL Server Database Engine. • sp_dboption: Displays or changes database options. Global Variables: • @@SERVERNAME: Returns the name of the local server that is running SQL Server. • @@SERVICENAME: Returns name of the service on which SQL server is running. • @@VERSION: Returns version, processor architecture, build date, and operating system for the current installation of SQL Server. • @@ERROR: Returns the error number for the last Transact-SQL statement executed. • @@ROWCOUNT: Returns the number of rows affected by the last statement.
  • 8. SQL Server commands • KILL : KILL is commonly used to terminate a process. You can not kill your own process. • BACKUP: It is used to take backup of a particular database. • COUNT: Returns total no. of objects. • DELETE : Remove rows from the table or view. • DISTICT : Used to retrieve unique data. • DROP : To remove the database object. • GETDATE : Returns the current database system timestamp. • TOP: Specifies that only the first set of rows will be returned from the query result. • UPDATE: It is used to update the records into the table.
  • 9. SQL Agent Job • SQL Jobs are the collection of steps performed sequentially to perform specific task. • It is run by SQL Server agent service. • SQL Agent Jobs can be scheduled to run at specified times or at specified intervals. • Jobs Can be enabled or disabled. • For errors, You can see the job history or SQL Server agent log.