Module 3: Creating and Managing Databases. Overview Creating Databases Creating Filegroups Managing Databases Introduction to Data Structures.

Slides:



Advertisements
Similar presentations
Transaction Log file:.ldf Extent: 8 contiguous 8KB pages Page: 8KB Primary Data file:.mdf Secondary data file:.ndf Primary Data file:.mdf Secondary.
Advertisements

Oracle Architecture. Instances and Databases (1/2)
Module 4 Working with Databases. Module Overview Overview of SQL Server Databases Working with Files and Filegroups Moving Database Files.
FlareCo Ltd ALTER DATABASE AdventureWorks SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS Slide 1.
SharePoint and SQL Server integration Demo: SQL Server Optimizing Configurations SQL Server 2014 for SharePoint 2013 Avoiding ginormous transaction.
Module 15: Managing Transactions and Locks. Overview Introduction to Transactions and Locks Managing Transactions SQL Server Locking Managing Locks.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
1 - Oracle Server Architecture Overview
Advanced Databases Basic Database Administration Guide to Oracle 10g 1.
Microsoft SQL Server Administration for SAP SQL Server Architecture.
Week 9 – Chapter 8 SQL 710 Methods to Backup Databases
Module 7: Restoring Databases. Overview SQL Server Recovery Process Preparing to Restore a Database Restoring Backups Restoring Databases from Different.
Module 6: Backing Up Databases. Overview Preventing Data Loss Setting and Changing a Database Recovery Model SQL Server Backup When to Back Up Databases.
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Database Configuration and Maintenance Database Configuration and Maintenance Exam / 30.
Modification is sent by application to SQL Server Modification is sent by application to SQL Server 1 Data pages are located in, or.
Transaction log grows unexpectedly
Optimizing SQL Server 2012 for SharePoint 2013 SharePoint Saturday/Friday, Honolulu March 27, 2015.
Session 7 Creating and Managing Databases. RDBMS and Data Management/ Session 7/2 of 27 Session Objectives Describe the system and user-defined databases.
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
Overview What is SQL Server? Creating databases Administration Security Backup.
Module 8: Server Management. Overview Server-level and instance-level resources such as memory and processes Database-level resources such as logical.
Managing Transaction and Lock Vu Tuyet Trinh Hanoi University of Technology 1.
Module 1: Introduction to Microsoft SQL Server 7.0.
Implementing Database Snapshot & Database Mirroring in SQL Server 2005 Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server MVP Microsoft.
1 Chapter Overview Creating a User Database Setting Database Options Managing User Database Size Placing Database Files on Multiple Disks.
Agenda Journalling More Embedded SQL. Journalling.
Chapter 4 SQL. SQL server Microsoft SQL Server is a client/server database management system. Microsoft SQL Server is a client/server database management.
Chapter 2: Designing Physical Storage MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study Guide (70-443)
Module 3: Managing Database Files. Overview Introduction to Data Structures Creating Databases Managing Databases Placing Database Files and Logs Optimizing.
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
Agenda for Today Chapter 5 –Skip Lesson 2 Review questions Midterm Chapter 6 Review questions.
Databases Lesson 5.
Architecture Rajesh. Components of Database Engine.
1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing.
Copyright © Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
Module 5: Upgrading to SQL Server 7.0. Overview Planning an Upgrade Preparing to Upgrade Verifying the Upgrade Setting a Compatibility Level.
Application Data and Database Activities Auditing Dr. Gabriel.
© All rights reserved. U.S International Tech Support
Indexes / Session 2/ 1 of 36 Session 2 Module 3: Types of Indexes Module 4: Maintaining Indexes.
SQL Server 2005 Implementation and Maintenance Chapter 12: Achieving High Availability Through Replication.
1 Chapter Overview Understanding Data Restoration Issues Understanding the Types of Database Backups Understanding the Restoration Process.
4. SQL Backup tasks Objectives –Secure the databases and the database server Contents –Understanding Backup Terms, –Backing Up Databases, Files, Filegroups,
Module 11: Managing Transactions and Locks
Backup and Recovery - II - Checkpoint - Transaction log – active portion - Database Recovery.
Module 14: Managing Transactions and Locks. Overview Introducing Transactions and Locks Managing Transactions Understanding SQL Server Locking Architecture.
SQL Server 2012 Session: 1 Session: 6 Creating and Managing Databases Data Management Using Microsoft SQL Server.
3 Copyright © 2004, Oracle. All rights reserved. Database Architecture Comparison.
SQL Basics Review Reviewing what we’ve learned so far…….
Microsoft SQL is known as RDMS (Relational Database Management System) which is developed by Microsoft and is highly used at corporate and enterprise.
Advanced SQL - DDL Advanced Database Dr. AlaaEddin Almabhouh.
In-Memory Capabilities
Inside transaction logging
Chapter Overview Understanding the Database Architecture
The Vocabulary of Performance Tuning
The Vocabulary of Performance Tuning
Microsoft SQL Server 2014 for Oracle DBAs Module 3
Inside transaction logging
SQL SERVER TRANSACTION LOG INSIDE
Statistics for beginners – In-Memory OLTP
The Vocabulary of Performance Tuning
A Beginners Guide to Transactions
A Beginners Guide to Transactions
Chapter 11 Managing Databases with SQL Server 2000
A Beginners Guide to Transactions
A Beginners Guide to Transactions
Understanding Core Database Concepts
The Vocabulary of Performance Tuning
A Beginners Guide to Transactions
Presentation transcript:

Module 3: Creating and Managing Databases

Overview Creating Databases Creating Filegroups Managing Databases Introduction to Data Structures

 Creating Databases Defining Databases How the Transaction Log Works Setting Database Options Retrieving Database Information

Defining Databases CREATE DATABASE Sample ON PRIMARY ( NAME=SampleData, FILENAME='c:\Program Files\..\..\Data\Sample.mdf', SIZE=10MB, MAXSIZE=15MB, FILEGROWTH=20%) LOG ON ( NAME=SampleLog, FILENAME= 'c:\Program Files\..\..\Data\Sample.ldf', SIZE=3MB, MAXSIZE=5MB, FILEGROWTH=1MB) COLLATE SQL_Latin1_General_Cp1_CI_AS CREATE DATABASE Sample ON PRIMARY ( NAME=SampleData, FILENAME='c:\Program Files\..\..\Data\Sample.mdf', SIZE=10MB, MAXSIZE=15MB, FILEGROWTH=20%) LOG ON ( NAME=SampleLog, FILENAME= 'c:\Program Files\..\..\Data\Sample.ldf', SIZE=3MB, MAXSIZE=5MB, FILEGROWTH=1MB) COLLATE SQL_Latin1_General_Cp1_CI_AS Creating a Database Defines: The name of the database The size of the database The files where the database will reside

How the Transaction Log Works Data modification is sent by application Data modification is sent by application11 Disk Modification is recorded in transaction log on disk 33 Data pages are located in, or read into, buffer cache and modified Data pages are located in, or read into, buffer cache and modified 22 Buffer Cache Disk Checkpoint writes committed transactions to database Checkpoint writes committed transactions to database 44

Retrieving Database Information Determine Database Properties by Using the DATABASEPROPERTYEX Function Use System Stored Procedures to Display Information About Databases and Database Parameters sp_helpdb sp_helpdb database_name sp_spaceused [ objname ]

Creating Filegroups Northwind Database Default FilegroupOrderHistoryGroupsys...sys... sys...sys... sysuserssysusers sysobjectssysobjects OrdersOrders CustomersCustomers ProductsProducts OrdHistYear2OrdHistYear2 OrdHistYear1OrdHistYear1 Northwind.mdf C:\D:\ OrdHist1.ndf OrdHist2.ndf Northwind.Idf E:\ ndf is data file; ldf is log file

 Managing Databases Managing Data and Log File Growth Monitoring and Expanding a Transaction Log Shrinking a Database or File Dropping a Database

Managing Data and Log File Growth ALTER DATABASE Sample MODIFY FILE ( NAME = 'SampleLog', SIZE = 15MB) GO ALTER DATABASE Sample ADD FILE (NAME = SampleData2, FILENAME='c:\Program Files\..\..\ Data\Sample2.ndf', SIZE=15MB, MAXSIZE=20MB) GO ALTER DATABASE Sample MODIFY FILE ( NAME = 'SampleLog', SIZE = 15MB) GO ALTER DATABASE Sample ADD FILE (NAME = SampleData2, FILENAME='c:\Program Files\..\..\ Data\Sample2.ndf', SIZE=15MB, MAXSIZE=20MB) GO Using Automatic File Growth Expanding Database Files Adding Secondary Database Files

Monitoring and Expanding a Transaction Log Monitoring the Log Monitoring Situations That Produce Extensive Log Activity Mass loading of data into indexed table Large transactions Performing logged text or image operations Expanding the Log When Necessary

Shrinking a Database or File Shrinking an Entire Database Shrinking a Data File in the Database Shrinking a Database Automatically Set autoshrink database option to true DBCC SHRINKDATABASE (Sample, 25) DBCC SHRINKFILE (Sample_Data, 10)

Dropping a Database DROP DATABASE Northwind, pubs Methods of Dropping a Database SQL Server Enterprise Manager DROP DATABASE statement Restrictions on Dropping a Database While it is being restored When a user is connected to it When publishing as part of replication If it is a system database

 Introduction to Data Structures How Data Is Stored Types of Pages and Extents Pages That Manage File Space Pages That Track Tables and Indexes

Database How Data Is Stored Extent (8 contiguous 8-KB pages) Page (8 KB) Tables, Indexes Data Max row size = 8060 bytes Data (file).mdf or.ndf Log (file).Idf

Review Creating Databases Creating Filegroups Managing Databases Introduction to Data Structures