Svetlin Nakov Telerik Software Academy Manager Technical Training

Slides:



Advertisements
Similar presentations
Windows Basic and Dynamic Disk Borislav Varadinov Telerik Software Academy academy.telerik.com System Administrator Marian Marinov CEO of 1H Ltd.
Advertisements

HTML Forms, GET, POST Methods Tran Anh Tuan Edit from Telerik Academy
Amazon S 3, App Engine Blobstore, Google Cloud Storage, Azure Blobs Svetlin Nakov Telerik Software Academy academy.telerik.com.
Queues, Notifications, , CDN, Logging, Caching, Background Tasks, MapReduce, … Svetlin Nakov Telerik Software Academy academy.telerik.com.
RPN and Shunting-yard algorithm Ivaylo Kenov Telerik Software Academy academy.telerik.com Technical Assistant
Shortest paths in edge-weighted digraph Krasin Georgiev Technical University of Sofia g.krasin at gmail com Assistant Professor.
Telerik Software Academy Telerik School Academy.
Asynchronous Programming with C# and WinRT
Unleash the Power of JavaScript Tooling Telerik Software Academy End-to-end JavaScript Applications.
Character sequences, C-strings and the C++ String class, Working with Strings Learning & Development Team Telerik Software Academy.
Hybrid or Native?! Doncho Minkov Telerik Software Academy Senior Technical Trainer
Done already for your convenience! Telerik School Academy Unity 2D Game Development.
Processing Sequences of Elements Telerik School Academy C# Fundamentals – Part 1.
C# Fundamentals – Part I
Welcome to the JSON-stores world Telerik Software Academy Databases.
NoSQL Concepts, Redis, MongoDB, CouchDB
Telerik Software Academy Telerik School Academy Creating E/R Diagrams with SQL Server.
The Business Plan and the Business Model Margarita Antonova Volunteer Telerik Academy academy.telerik.com Business System Analyst Telerik Corporation.
What are ADTs, STL Intro, vector, list, queue, stack Learning & Development Team Telerik Software Academy.
Making JavaScript code by template! Learning & Development Team Telerik Software Academy.
Svetlin Nakov Telerik Software Academy academy.telerik.com Manager Technical Training Who, What, Why?
Access to known folders, using pickers, writing to and reading from files, caching files for future access George Georgiev Telerik Software Academy academy.telerik.com.
Accessing SQL Server and MySQL – Live Demo Svetlin Nakov Telerik Software Academy academy.telerik.com Manager Technical Training
Learning & Development Telerik Software Academy.
Telerik Software Academy ASP.NET Web Forms.
Classical OOP in JavaScript Classes and stuff Telerik Software Academy
Using Selenium for Mobile Web Testing Powered by KendoUI Telerik QA Academy Atanas Georgiev Senior QA Engineer KendoUI Team.
NoSQL Concepts, Redis, MongoDB, CouchDB Svetlin Nakov Telerik Software Academy academy.telerik.com Manager Technical Training
New features: classes, generators, iterators, etc. Telerik Academy Plus JavaScript.Next.
File Systems - Inside FAT and NTFS Borislav Varadinov Telerik Software Academy academy.telerik.com System Administrator Marian Marinov CEO of 1H Ltd.
Creating E/R Diagrams with SQL Server Management Studio and MySQL Workbench Svetlin Nakov Telerik Software Academy Manager Technical.
Throwing and Catching Exceptions Tran Anh Tuan Edit from Telerik Software Academy
Loops, Conditional Statements, Functions Tran Anh Tuan Edit from Telerik Academy
Telerik Software Academy ASP.NET Web Forms.
Private/Public fields, Module, Revealing Module Learning & Development Team Telerik Software Academy.
Building Data-Driven ASP.NET Web Forms Apps Telerik Software Academy ASP.NET Web Forms.
Course Introduction Svetlin Nakov Telerik Software Academy academy.telerik.com Manager Technical Training
Nikolay Kostov Telerik Software Academy Senior Software Developer and Trainer
Telerik Software Academy End-to-end JavaScript Applications.
Planning and Tracking Software Quality Yordan Dimitrov Telerik Corporation Team Leader, Team Pulse, Team Leader, Team Pulse, Telerik Corporation,
What you need to know Ivaylo Kenov Telerik Corporation Telerik Academy Student.
Data binding concepts, Bindings in WinJS George Georgiev Telerik Software Academy academy.telerik.com Technical Trainer itgeorge.net.
Pavel Kolev Telerik Software Academy Senior.Net Developer and Trainer
Objects, Properties, Primitive and Reference Types Learning & Development Team Telerik Software Academy.
ORM Concepts, Entity Framework (EF), DbContext
When and How to Refactor? Refactoring Patterns Alexander Vakrilov Telerik Corporation Senior Developer and Team Leader.
Free Training and Job for Software Engineers Svetlin Nakov, PhD Manager Technical Training Telerik Corp. Telerik Software Academy.
Free Training and Job for Software Engineers Svetlin Nakov, PhD Manager Technical Training Telerik Corp. Telerik Software Academy.
Access to known folders, using pickers, writing to and reading from files, caching files for future access George Georgiev Telerik Software Academy academy.telerik.com.
Doing the Canvas the "easy way"! Learning & Development Telerik Software Academy.
.NET Cloud Development Made Easy George Georgiev Telerik Software Academy academy.telerik.com Technical Trainer 1.
Creating and Running Your First C# Program Svetlin Nakov Telerik Software Academy academy.telerik.com Manager Technical Training
The past, the present, the future Learning & Development Team Telerik Software Academy.
Connecting, Queries, Best Practices Tran Anh Tuan Edit from Telerik Software Academy
Processing Sequences of Elements Telerik Software Academy C# Fundamentals – Part 2.
Telerik JavaScript Framework Telerik Software Academy Hybrid Mobile Applications.
Building Rock-Solid Software Nikolay Kostov Telerik Software Academy academy.telerik.com Senior Software Developer and Technical Trainer
Telerik Software Academy Databases.
Things start to get serious Telerik Software Academy JavaScript OOP.
Learning & Development Mobile apps for iPhone & iPad.
Processing Matrices and Multidimensional Tables Telerik Software Academy C# Fundamentals – Part 2.
Nikolay Kostov Telerik Software Academy academy.telerik.com Team Lead, Senior Developer and Trainer
Functions and Function Expressions Closures, Function Scope, Nested Functions Telerik Software Academy
Implementing Control Logic in C# Svetlin Nakov Telerik Software Academy academy.telerik.com Manager Technical trainer
Mocking tools for easier unit testing Telerik Software Academy High Quality Code.
Introduction to SQL Server  Working with MS SQL Server and SQL Server Management Studio.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
What why and how? Telerik School Academy Unity 2D Game Development.
Windows Security Model Borislav Varadinov Telerik Software Academy academy.telerik.com System Administrator
Presentation transcript:

Svetlin Nakov Telerik Software Academy Manager Technical Training

 SQL Server 2012 – Intro  SQL Server Services  Types of Databases  Authentication and Permissions  SQL Server Management Studio  Moving a SQL Server Database  Through Backups and Restore  By Detaching and Attaching 2

 MySQL – Intro  MySQL Community Server  MySQL Services, Start, Stop  Authentication and Login  MySQL Console Client  MySQL Workbench  phpMyAdmin Tool  Moving a MySQL Database 3

MS SQL Server 2012MS SQL Server 2012 Overview

What is Microsoft SQL Server?What is Microsoft SQL Server?  MS SQL Server is a Relational Database Management System (RDBMS) from Microsoft  The main language supported in SQL Server is Transact SQL (T-SQL), an extension of SQL  Powerful, trustworthy, easy-to-use DB server  The most recent version is SQL Server 2012  Works only on Windows systems  A free distribution exists (SQL Server Express)  5

Services of SQL Server 2012Services of SQL Server 2012  SQL Server – the database engine  Responsible for database management, data storage, queries, data manipulation, data integrity, transactions, locking, users, security  Executes SQL / T-SQL queries  SQL Server Agent – DB monitoring  Executes scheduled tasks  Monitors SQL Server  Sends notifications about problems 6

Services in SQL Server 2012 (2)Services in SQL Server 2012 (2)  Distributed Transaction Coordinator (MSDTC)  Manages database transactions  Supports transactions that span multiple databases  Coordinates committing the distributed transaction across all the servers that are enlisted in the transaction  Implements 2-phase commit 7

msdb Northwind tempdb msdb

SQL Server DatabasesSQL Server Databases  SQL Server has system and user databases  System databases  Maintain internal information about MS SQL Server as a system  Don't play with them!  User databases  Databases created by users (developers)  Store user's schemas and data  Use the system databases internally 9

Types of SQL Server DatabasesTypes of SQL Server Databases 10 System Databases User Databases model tempdb msdb distribution pubsNorthwind… master

System DatabasesSystem Databases  Master – meta-database keeping data about  User accounts  Configurable environment variables  System error messages  Model – a prototype for new databases  Tempdb – storage for temporary tables and database objects  MSdb – alerts and scheduled tasks 11

SQL Server DatabasesSQL Server Databases  Each SQL Server database consists of two files: .mdf file  Contains the core data in the database  Schema, tables data, and other database objects .ldf file  Transaction log – keeps track of transactions  You need both these files to use the database 12

SQL Server Authentication

Connecting to SQL ServerConnecting to SQL Server  Connecting to SQL Server requires  The name of the server (e.g. localhost )  The name of the DB instance (e.g. SQLEXPRESS )  The name of the database (e.g. Northwind )  Username / password (if using SQL Server authentication)  Types of authentication in SQL Server  Windows (by using a Windows user credentials)  Mixed (both Windows and SQL Server) 14

SQL Server Users PermissionsSQL Server Users Permissions  Each user has certain permissions and roles for a database (Database User Account)  A role defines a group of users with the same permissions  There are 3 types of roles in MS SQL Server  Fixed server roles  Fixed database roles  User-defined database roles 15

Fixed Database RolesFixed Database Roles  Public – maintains all default permissions for users in a database  Db_owner – performs any database role activity  Db_accessadmin – add or remove database users, groups, and roles  Db_ddladmin – add, modify, or drop database objects  Db_securityadmin – assign statement and object permissions  Others… 16

SQL Server Management Studio A Powerful Management Tool for Administrators and Developers

SQL Server Management Studio (SSMS)  SQL Server Management Studio (SSMS) is a powerful graphical DB management tool  Administrate databases (create, modify, backup / restore DB)  Create and modify E/R diagrams  View / modify table data and other DB objects  Execute SQL queries  Free and easy to use tool  Works with all SQL Server versions 18

SQL Server Management Studio – Screenshot 19

SSMS Setting Server AccountSSMS Setting Server Account  You can use SSMS to create database user / give permissions to Windows users  Follow these steps: 1.Right click on the [Security / Login] folder in Object Explorer and choose "New Login…" 20

SSMS Setting Server Account (2)SSMS Setting Server Account (2) 2.In the next dialog click the [Search] button2.In the next dialog click the [Search] button  Select one of the Windows accounts in a typical Windows fashion  Leave the authentication method set to Windows authentication  Click [OK]  Thus you create an SQL Server User account  Account permissions could be assigned later  Windows administrators already have access 21

SSMS Setting Database Account 1. Right click on the "Security" under some of the databases and choose "New"  "User" 2. Enter username and select one of the Server accounts to use 3. Assign the roles for this user 4. Click [OK] to confirm  By selecting the [Name-of-Database]  "Properties"  "Permissions" you can also set specific permissions for the accounts 22

23

Creating Accounts and Assigning Permissions in SQL Server Live Demo

Using SQL Server Management Studio  SSMS can be used to visually edit the structure or data in a database  It can execute T-SQL queries  Select the database you want to work with in the Object Explorer  Click the [New Query] button  Write the query in the window to the right of Object Explorer  Click the [Execute] button 25

26

Executing Simple SQL Queries in SQL Server Management Studio Live Demo

Moving an SQL Server Database

Moving a SQL Server DatabaseMoving a SQL Server Database  Necessary when we install a certain application at the customer environment  Ways of moving an SQL Server database:  By backup and restore  Create backup and restore it on the other server  By detaching and attaching the database files  The 2 servers must be the same versions!  By dumping the database as SQL script  Not supported in SSMS 29

Moving by Backup and RestoreMoving by Backup and Restore  Backup and restore database through SSMS 30

Moving DB by Detaching and Attaching  On the source server:  Choose the database in SQL Server Management Studio  From the context menu we choose the Detach command  We copy the database files from the source server to the destination server: .mdf .ldf 31

Moving a Database by Detaching and Attaching Live Demo

MySQL ServerMySQL Server Overview

 MySQL Database Server  MySQL is open-source DB server (RDBMS)  World's most-popular open-source database  Mostly used to power web sites and small apps  Supports concurrency, transactions (full ACID)  Stored procedures, views, triggers, partitioning  Support clustering and replication  Free and paid editions  Community Server, Enterprise, Cluster CGE 34

 MySQL Community Server  The free open-source MySQL edition  Windows:  Pre-packaged installer available from  Linux:  Available through the package managers  E.g. apt-get install mysql-server, yum install mysql-server 35

 MyISAM  Fast, non-transactional  unreliable, forget it!  InnoDB  Fully ACID transactional, highly reliable  Recommended for most applications  Memory  Ultra-fast, non-persistent  CSV  Stores the data in CSV (text) files 36

 MySQL Services  Just one service (in Windows): MySQL56  Starting: net start MySQL56  Stopping: net stop MySQL56 37

The Console Client, MySQL Workbench, phpMyAdmin

 MySQL uses traditional username / password authentication  The administrator's user is: root  The default password is specified during the installation process  Connecting through the console client  mysql –u root -p  use world;  select * from city limit 100; 39

Live Demo

 MySQL Workbench is free open-source GUI administration tool for MySQL  Execute SQL queries  Browse / edit table data  Create / modify relational schema  DB design (E/R diagrams)  Forward / reverse engineering  Visualize query plan 41

Live Demo

 phpMyAdmin Tool  Web-based open-source MySQL admin tool 43

Live Demo

 To move MySQL database to another location  Use SQL export / SQL import feature  Export a database to SQL script  MySQL Workbench  Server Administration  Data Export  Export to Self-Contained File  phpMyAdmin  Export  SQL  Import a database from SQL script  Just execute the script in Workbench  phpMyAdmin  Import  SQL 45

форум програмиране, форум уеб дизайн курсове и уроци по програмиране, уеб дизайн – безплатно програмиране за деца – безплатни курсове и уроци безплатен SEO курс - оптимизация за търсачки уроци по уеб дизайн, HTML, CSS, JavaScript, Photoshop уроци по програмиране и уеб дизайн за ученици ASP.NET MVC курс – HTML, SQL, C#,.NET, ASP.NET MVC безплатен курс "Разработка на софтуер в cloud среда" BG Coder - онлайн състезателна система - online judge курсове и уроци по програмиране, книги – безплатно от Наков безплатен курс "Качествен програмен код" алго академия – състезателно програмиране, състезания ASP.NET курс - уеб програмиране, бази данни, C#,.NET, ASP.NET курсове и уроци по програмиране – Телерик академия курс мобилни приложения с iPhone, Android, WP7, PhoneGap free C# book, безплатна книга C#, книга Java, книга C# Николай Костов - блог за програмиране 46

1. Download and install SQL Server Express. Install also SQL Server Management Studio Express (this could take some effort but be persistent). 2. Connect to the SQL Server with SQL Server Management Studio. Use Windows authentication. 3. Create a new database Pubs and create new login with permissions to connect to it. Execute the script install_pubs.sql to populate the DB contents (you may need slightly to edit the script before). 4. Attach the database Northwind (use the files Northwind.mdf and Northwind.ldf ) to SQL Server and connect to it. 47

5. Backup the database Northwind into a file named northwind-backup.bak and restore it as database named North. 6. Export the entire Northwind database as SQL script. Use [Tasks] -> [Generate Scripts]. Ensure you have exported table data rows (not only the schema). 7. Create a database NW and execute the script in it to create the database and populate table data. 8. Detatch the database NW and attach it on another computer in the training lab. In case of name collision, preliminary rename the database. 48

9. Download and install MySQL Community Server + MySQL Workbench + the sample databases. 10. Export the MySQL sample database " world " as SQL script. 11. Modify the script and execute it to restore the database world as " worldNew ". 12. Connect through the MySQL console client and list the first 20 tons from the database " worldNew ". 49

 C# Telerik Academy  csharpfundamentals.telerik.com csharpfundamentals.telerik.com  Telerik Software Academy  academy.telerik.com academy.telerik.com  Telerik Facebook  facebook.com/TelerikAcademy facebook.com/TelerikAcademy  Telerik Software Academy Forums  forums.academy.telerik.com forums.academy.telerik.com