IT 21003 Database Administration SECTION 02. CREATING DATABASES Creating a Database: Overview 1. Plan the physical design and storage structures 2. Back.

Slides:



Advertisements
Similar presentations
The Architecture of Oracle
Advertisements

2 Copyright © 2005, Oracle. All rights reserved. Installing the Oracle Database Software.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
Acknowledgments Byron Bush, Scott S. Hilpert and Lee, JeongKyu
Oracle Architecture. Instances and Databases (1/2)
ITEC474 Control File Maintenance
Page Footer Keed Education Oracle Database Administration Basic Copyright 2009 Keed Education BV Version Concept.
1 - Oracle Server Architecture Overview
Harvard University Oracle Database Administration Session 2 System Level.
Oracle Architectural Components
Harvard University Oracle Database Administration Session 5 Data Storage.
Advanced Databases Basic Database Administration Guide to Oracle 10g 1.
INTRODUCTION TO ORACLE
Backup and Recovery Part 1.
7 Maintaining Redo Log Files. 7-2 Objectives Explaining the use of online redo log files Obtaining log and archive information Controlling log switches.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
Oracle backup and recovery strategy
Introduction to Oracle Backup and Recovery
Using RMAN to Perform Recovery
Backup & Recovery Concepts for Oracle Database
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
Oracle Database Administration
20 Copyright © 2004, Oracle. All rights reserved. Database Recovery.
1 Copyright © 2009, Oracle. All rights reserved. Exploring the Oracle Database Architecture.
IT Database Administration Section 03. Tablespaces and the DBA  Important for DBAs – logical units of database storage Made up of physical operating-system.
Database Administration TableSpace & Data File Management
CHAPTER 2 Implementing a Database. Introduction to Creating Databases After you’ve installed the Oracle software, the next logical step is to create a.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
■ Decide on the local database name, and which domain will contain this database. These names are set in the initialization parameters DB_NAME and DB_DOMAIN.
Backup & Recovery Backup and Recovery Strategies on Windows Server 2003.
16 Copyright © 2007, Oracle. All rights reserved. Performing Database Recovery.
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
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.
An Oracle server:  Is a database management system that provides an open, comprehensive, integrated approach to information management.  Consists.
A Guide to Oracle9i1 Database Instance startup and shutdown.
10/23/2015ISYS366 - Installation1 ISYS366 Installation.
IT Database Administration SECTION 01. Starting Up and Shutting Down the Database Database Administration Facilities – A number of tools are available.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Database Administration 3.Using Administration Tools.
Introduction to Oracle. Oracle History 1979 Oracle Release client/server relational database 1989 Oracle Oracle 8 (object relational) 1999.
IT Database Administration Section 09. Backup and Recovery Backup: The available options Full Consistent (cold) Backup Database shutdown, all files.
Database Storage Structures
44 Creating a Database. 4-2 Objectives Preparing the operating system Preparing the parameter file Creating the database Preparing the operating system.
Week 2 Lecture 1 Creating an Oracle Instance. Learning Objectives  Learn the steps for creating a database  Understand the prerequisites for creating.
Creating an Oracle Database. Considerations before creating a DB Planning for Database Creation –Select the standard database block size. –Use an undo.
Chapter 1Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 1 Backup and Recovery Overview MSCD642 Backup and Recovery.
Overview of Oracle Backup and Recovery Darl Kuhn, Regis University.
12 Copyright © Oracle Corporation, All rights reserved. User-Managed Complete Recovery.
QUIZ DATABASE ADMINISTRATOR. LESS 3 LESS 5 LESS 6 LESS 7.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database.
Week 2 Lecture 2 Data Dictionary Views and Control Files.
IT Database Administration Section 05. Rollback Segments: An Introduction  What are they?  Space within a database used to store “before” images.
3 Copyright © 2004, Oracle. All rights reserved. Database Architecture Comparison.
9 Copyright © 2004, Oracle. All rights reserved. Getting Started with Oracle Migration Workbench.
Control File Information The database name The timestamp of database creation The names and locations of associated datafiles and redo log files Tablespace.
Oracle Database Architectural Components
Initialization Parameters
Maintaining Online Redo Log Files
Creating an Oracle Database
Duplicating a Database
Oracle Memory Internals
Oracle Architectural Components
Performing Database Recovery
ISYS366, Oracle Disk Internals
Database administration
Presentation transcript:

IT Database Administration SECTION 02

CREATING DATABASES Creating a Database: Overview 1. Plan the physical design and storage structures 2. Back Up any existing databases 3. Set the instance indentifier 4. Connect to Enterprise Manager or other utility and startup an instance

CREATING DATABASES Creating a Database: Overview 5.Create the database using an appropriate facility 6. Run any required post-installation scripts 7. Back Up the new database

CREATING DATABASES Pre-Creation Activities: Planning – Plan the Tables and Indexes Estimate Sizes Estimate Sizes – Plan the Backup and Recovery strategy

CREATING DATABASES Pre-Creation Activities: Planning –Creating a Database can overwrite existing database files In practice a new init.ora file is often created by copying and editing an existing one In practice a new init.ora file is often created by copying and editing an existing one If the Control_Files parameter is not changed, existing files may be overwritten If the Control_Files parameter is not changed, existing files may be overwritten

CREATING DATABASES Pre-Creation Activities: Planning The Instance_Name and Database_Name also need changedThe Instance_Name and Database_Name also need changed Decide on New Database or Migration of old Database Decide on New Database or Migration of old Database

CREATING DATABASES Pre-Creation Activities: Parameter Files –Create and edit the required parameter file(s) The parameter file configures the instance that will be used to create the databaseThe parameter file configures the instance that will be used to create the database –Rename and edit a supplied init.ora file or utilize an existing file Make sure the name is changed, do not use the same parameter file for different databasesMake sure the name is changed, do not use the same parameter file for different databases initprod.ora for production instanceinitprod.ora for production instance initest.ora for test instanceinitest.ora for test instance

CREATING DATABASES Pre-Creation Activities: Parameter Files Cont’d –Examine the following parameters in your file (DB_NAME)(DB_NAME) (DB_BLOCK_SIZE)(DB_BLOCK_SIZE) (PROCESSES)(PROCESSES) (LICENSE_SESSION_WARNING)(LICENSE_SESSION_WARNING)

CREATING DATABASES Pre-Creation Activities: Parameter Files Cont’d –Examine the following parameters in your file (CONTROL_FILES)(CONTROL_FILES) (DB_BLOCK_BUFFERS)(DB_BLOCK_BUFFERS) (LICENSE_MAX_SESSIONS)(LICENSE_MAX_SESSIONS) (LICENSE_MAX_USERS)(LICENSE_MAX_USERS) –These MUST BE CHANGED

CREATING DATABASES DB_NAME –String of eight or fewer characters used to identify the local name component of the database name To avoid confusion, this should match the Oracle instance identifierTo avoid confusion, this should match the Oracle instance identifier –DB_NAME is stored in the datafile headers, redo log files, and control files –This parameter is not easy to change once the database has been created

CREATING DATABASES CONTROL_FILES –Control_Files can be specified within the parameter file as follows: CONTROL_FILES=/usr/oracle/home/con trol_file,CONTROL_FILES=/usr/oracle/home/con trol_file, /usr/oracle/home/control_file2 /usr/oracle/home/control_file2

CREATING DATABASES CONTROL_FILES –At least TWO FILES should be specified so that the loss of a control file is not critical –The control files should be placed on DIFFERENT DISKS

CREATING DATABASES CONTROL_FILES –If a name for the control file is not specified, an operating-system-dependent default file is created –Be careful on Create Database the control files are replaced, could cause old databases to not function

CREATING DATABASES DB_BLOCK_SIZE –DB_BLOCK_SIZE specifies the size of a database block and therefore the size of the database buffers in SGA

CREATING DATABASES DB_BLOCK_SIZE –Default size is operating-system dependent Usually set at either 2Kb or 4Kb or 2048 kb or 4096 kbUsually set at either 2Kb or 4Kb or 2048 kb or 4096 kb More realistic size is 16Kb or 32KbMore realistic size is 16Kb or 32Kb It should be an exact multiple of the OS block sizeIt should be an exact multiple of the OS block size

CREATING DATABASES DB_BLOCK_SIZE –The parameter should probably be increased, if: The Oracle host machine is very large, has lots of memory, and lots of fast storageThe Oracle host machine is very large, has lots of memory, and lots of fast storage If there are a relatively high number of large rowsIf there are a relatively high number of large rows Not many requests for small amounts of dataNot many requests for small amounts of data

CREATING DATABASES DB_BLOCK_SIZE –Oracle to 8i – block size cannot be changed once set without restructuring the database –Oracle 9i up – block size can be changed

CREATING DATABASES DB_BLOCK_BUFFERS –DB_BLOCK_BUFFERS is the total number of buffers(database blocks) in the buffer cache at one time

CREATING DATABASES DB_BLOCK_BUFFERS –Governs the size of the large portion of the SGA and can have profound effect on performance –Size of each buffer is determined by DB_BLOCK_SIZE

CREATING DATABASES DB_BLOCK_BUFFERS –Estimate the number of buffers by determining the number of blocks each application accesses at one time (include data, index, and rollback segment blocks) –High values enable larger cache, which may reduce I/O If set too high, the SGA may be larger than physical memory and lead to swapping, and reduction in system performanceIf set too high, the SGA may be larger than physical memory and lead to swapping, and reduction in system performance

CREATING DATABASES The PROCESSES Parameter –Determines the maximum number of users who can connect to the instance at any one time

CREATING DATABASES The PROCESSES Parameter –To estimate the number required: One for each Server ProcessOne for each Server Process Overhead of One Process required for each Background ProcessOverhead of One Process required for each Background Process

CREATING DATABASES The PROCESSES Parameter –Example: If the required maximum number of users connected to an instance at one time is 100, the setting of PROCESSES may need to be 107If the required maximum number of users connected to an instance at one time is 100, the setting of PROCESSES may need to be 107 PROCESSES = Background + UsersPROCESSES = Background + Users

CREATING DATABASES Listing Additional Parameters –To obtain a list of parameters and their current values for an instance Connect as a DBAConnect as a DBA SELECT *SELECT * FROM v$parameter;FROM v$parameter;

CREATING DATABASES Setting the Instance Identifier (SID) –The instance identifier is used by the operating system to determine the default instanced for database connections –The value is often the DB_NAME of the database –Setting the instance identifier is operating- system specific –Utilize SQL Plus Worksheet or Oracle Enterprise Manager

CREATING DATABASES Creating the Database –Syntax: –CREATE DATABASE [database_name] –[CONTROLFILE REUSE] –[LOGFILE {GROUP integer} filespec] –[MAXLOGFILES integer]

CREATING DATABASES Creating the Database –Syntax Cont’d: –[DATAFILE filespec, filespec] –[MAXDATAFILES integer] –[MAXINSTANCES integer] –[ARCHIVELOG | NOARCHIVELOG] –[CHARACTER SET charset]; –[NATIONAL CHARACTER SET charset];

CREATING DATABASES Creating the Database Example: CREATE DATABASE db1 DATAFILE ‘E:\production\system_dbf’ SIZE 50M LOGFILE GROUP 1 (‘E:\production\log01\dev_log1a.rdo’, ‘E:\production\log01\dev_log1b.rdo’, ‘E:\production\log01\dev_log1c.rdo’) SIZE 1M GROUP 2 (‘E:\production\log02\dev_log2a.rdo’, ‘E:\production\log01\dev_log2b.rdo’, ‘E:\production\log01\dev_log2c.rdo’) SIZE 1M;

CREATING DATABASES Creating the Database Example Results: Creates a database named db1Creates a database named db1 Creates two online redo log groups with three log files of 1mb eachCreates two online redo log groups with three log files of 1mb each Creates a SYSTEM tablespace with size of 50MBCreates a SYSTEM tablespace with size of 50MB Remember that other parameters will be loading default valuesRemember that other parameters will be loading default values Example: MAXDATAFILES will be set to 32Example: MAXDATAFILES will be set to 32

CREATING DATABASES Database Creation Parameters –database_name Name of the database being createdName of the database being created Character string of up to eight charactersCharacter string of up to eight characters Defaults to DB_NAME in the parameter file used at startup timeDefaults to DB_NAME in the parameter file used at startup time –Specify this parameter to ensure that the correct parameter file is used

CREATING DATABASES Database Creation Parameters –CONTROLFILE REUSE – (NEVER USE THIS) Specifies that the control files listed in the parameter file are to be overwritten (if they already exist)Specifies that the control files listed in the parameter file are to be overwritten (if they already exist)

CREATING DATABASES Database Creation Parameters –LOGFILE Specifies one or more redo log filesSpecifies one or more redo log files Each filespec specifies one or more redo log groups, each of which contain more than one fileEach filespec specifies one or more redo log groups, each of which contain more than one file If the GROUP clause is omitted, a default group is createdIf the GROUP clause is omitted, a default group is created If omitted, two redo log file groups are created by defaultIf omitted, two redo log file groups are created by default

CREATING DATABASES Database Creation Parameters Cont’d –DATAFILE One or more files to be used for the SYSTEM tablespaceOne or more files to be used for the SYSTEM tablespace If omitted, Oracle creates an operating-system-dependent file in the default directoryIf omitted, Oracle creates an operating-system-dependent file in the default directory Files can be specified to extend automaticallyFiles can be specified to extend automatically

CREATING DATABASES Database Creation Parameters Cont’d –ARCHIVELOG | NOARCHIVELOG Specifies whether the database will be in ARCHIVELOG more or NOARCHIVELOG modeSpecifies whether the database will be in ARCHIVELOG more or NOARCHIVELOG mode

CREATING DATABASES Database Creation Parameters Cont’d –CHARACTER SET Specifies the character set that will be use for the databaseSpecifies the character set that will be use for the database –NATIONAL CHARACTER SET Specifies the national character set to be used for the databaseSpecifies the national character set to be used for the database –Defaults to CHARACTER SET

CREATING DATABASES Database Creation Parameters Cont’d - Limits –The MAX...parameters limit the size of the control file The control file has to reserve space for the file detailsThe control file has to reserve space for the file details –MAXLOGFILES Integer value specifying the maximum number of redo log file groups that the database will haveInteger value specifying the maximum number of redo log file groups that the database will have

CREATING DATABASES Database Creation Parameters Cont’d - Limits –MAXLOGMEMBERS Maximum number of log members (files) in a groupMaximum number of log members (files) in a group

CREATING DATABASES Database Creation Parameters Cont’d - Limits –MAXDATAFILES Integer value specifying the maximum number of datafiles that can make up the databaseInteger value specifying the maximum number of datafiles that can make up the database –Default value is 32, difficult to change after database creation depending on the Oracle version used DB_FILES in the parameter can be used to temporarily reduce the parameterDB_FILES in the parameter can be used to temporarily reduce the parameter

CREATING DATABASES CREATE DATABASE Operations –CREATE DATABASE automatically does the following: Creates (or overwrites) the Control FilesCreates (or overwrites) the Control Files Creates the Database FilesCreates the Database Files Creates the Redo Log FilesCreates the Redo Log Files Creates the SYSTEM rollback segment in the SYSTEM tablespaceCreates the SYSTEM rollback segment in the SYSTEM tablespace

CREATING DATABASES CREATE DATABASE Operations Creates and loads the Data Dictionary TablesCreates and loads the Data Dictionary Tables –A script called sql.bsq is run to create the tables –Change this file parameters before running CREATE DATABASE Mounts the DatabaseMounts the Database Opens the DatabaseOpens the Database Creates the SYS and SYSTEM UsersCreates the SYS and SYSTEM Users

CREATING DATABASES Post Creation Activities –The CREATE DATABASE statement builds the dictionary base tables These tables are extremely difficult to readThese tables are extremely difficult to read Their structure may change across releases of OracleTheir structure may change across releases of Oracle

CREATING DATABASES Post Creation Activities –Scripts need to be run to create views on the base tables Held in the ORACLE_HOME\rdbms\admin folderHeld in the ORACLE_HOME\rdbms\admin folder –catalog.sql Builds some basic views on the dictionary tablesBuilds some basic views on the dictionary tables –catproc.sql Builds the views for procedural objects (packages, procedures, etc)Builds the views for procedural objects (packages, procedures, etc)

CREATING DATABASES Post Creation Activities Cont’d –Change passwords for SYS and SYSTEM users Initially, password for SYS is set to change_on_install and SYSTEM password is managerInitially, password for SYS is set to change_on_install and SYSTEM password is manager –Create additional tablespaces, rollback segments, control files, and redo log files and backup the entire database –Create the user accounts –Create and populate the tables and other storage structures