CHAPTER 2 Implementing a Database. Introduction to Creating Databases After you’ve installed the Oracle software, the next logical step is to create a.

Slides:



Advertisements
Similar presentations
CHAPTER 4 Tablespaces and Datafiles. Introduction After installing the binaries, creating a database, and configuring your environment, the next logical.
Advertisements

ITEC474 INTRODUCTION.
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.
4 Copyright © 2005, Oracle. All rights reserved. Managing the Oracle Instance.
Overview of Database Administrator (DBA) Tools
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 2 Overview of Database Administrator (DBA) Tools.
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.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.
Backup The flip side of recovery. Types of Failures Transaction failure –Transaction must be aborted System failure –Hardware or software problem resulting.
Harvard University Oracle Database Administration Session 2 System Level.
Oracle Architectural Components
Managing an Oracle Instance
Advanced Databases Basic Database Administration Guide to Oracle 10g 1.
2 Copyright © 2009, Oracle. All rights reserved. Installing your Oracle Software.
A Guide to Oracle9i1 Introduction to Oracle9i Database Administration Chapter 11.
INTRODUCTION TO ORACLE
RMAN Restore and Recovery
Backup and Recovery Part 1.
Chapter 12 Performing Incomplete Recovery. Background Viewed as one of the more difficult chapters to write Thought it was important to put in material.
CHAPTER 16 User-Managed Backup and Recovery. Introduction to User Managed Backup and Recovery Backup and recover is one of the most critical skills a.
CHAPTER 5 Managing Control Files, Online Redo Logs, and Archiving.
Using RMAN to Perform Recovery
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 3 Administration of Users.
Oracle Database Administration
Oracle Database Administration
CHAPTER 23 Pluggable Databases. Oracle Multitenant (Pluggable Databases) New with Oracle Database 12c is Oracle Multitenant. This feature allows you to.
Managing the Oracle RDBMS Today you will look at the basics, including: –Setting up Enterprise Manager –Using Enterprise Manager –Using Server Manager.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 3 Administration of Users.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
CHAPTER 6 Users and Basic Security. Progression of Steps for Creating a Database Environment 1. Install Oracle database binaries (Chapter 1) 2. Create.
1Introduction Objectives 1-2 Course Objectives 1-3 Oracle Products 1-4 Relational Database Systems 1-5 How the Data Is Organized 1-6 Integrity Constraints.
4 Copyright © 2006, Oracle. All rights reserved. Recovering from Noncritical Losses.
5 Copyright © 2004, Oracle. All rights reserved. Controlling the Database.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
CHAPTER 5 Managing Control Files and Online Redo Logs.
Oracle 10g Database Administrator: Implementation and Administration Chapter 2 Tools and Architecture.
A Guide to Oracle9i1 Database Instance startup and shutdown.
7 Copyright © 2004, Oracle. All rights reserved. Recovering from Noncritical Losses.
IT Database Administration SECTION 01. Starting Up and Shutting Down the Database Database Administration Facilities – A number of tools are available.
Database Administration 3.Using Administration Tools.
3 Copyright © 2009, Oracle. All rights reserved. Creating an Oracle Database Using DBCA.
Oracle 10g Database Administrator: Implementation and Administration Chapter 3 Creating an Oracle Instance.
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.
IT Database Administration SECTION 02. CREATING DATABASES Creating a Database: Overview 1. Plan the physical design and storage structures 2. Back.
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.
10 Copyright © Oracle Corporation, All rights reserved. User-Managed Backups.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
CHAPTER 1 Installing the Oracle Binaries. Introduction to Managing and Safeguarding Your Organization’s Data Efficiently installing Oracle software Create.
8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database.
Week 2 Lecture 2 Data Dictionary Views and Control Files.
13 Copyright © 2004, Oracle. All rights reserved. Optimizing Database Performance.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
Control File Information The database name The timestamp of database creation The names and locations of associated datafiles and redo log files Tablespace.
Oracle 10g Administration Database Control and Storage Structures Copyright ©2006 Custom Training Institute.
CERN IT Department CH-1211 Genève 23 Switzerland t Using Data Guard for hardware migration UKOUG RAC & HA SIG, Feb 2008 Miguel Anjo, CERN.
 Database Administration Oracle Database Instance Management Starting Up and Shutting Down أ. ندى الغامدي, أ. ندى الطوالة.
3 Copyright © Oracle Corporation, All rights reserved. 管理数据库事例.
Managing an Oracle Instance
Initialization Parameters
Is 221: Database Administration
Recovering from Noncritical Losses
Duplicating a Database
Performing Database Recovery
ISYS366, Oracle Disk Internals
Oracle 12c Multitenant Database
Presentation transcript:

CHAPTER 2 Implementing a Database

Introduction to Creating Databases After you’ve installed the Oracle software, the next logical step is to create a database. DBAs must know how to configure required operating system variables, directories, and the initialization file before creating the database. As part of creating the database the data dictionary must be instantiated. After the database is created it needs to be made available for remote Oracle Net connections by configuring and starting a listener.

Creating a Database Database Configuration Assistant utility CREATE DATABASE statement

Operating System Variables Manually setting Using Oracle provide scripts DBA home grown script

Creating a Database 1. Set the operating system variables 2. Configure the initialization file 3. Create required directories 4. Create the database 5. Create the data dictionary 6. Run pupbld.sql as SYSTEM

OS Variables that Oracle Uses ORACLE_HOME PATH ORACLE_SID LD_LIBRARY_PATH

Initialization File versus Spfile Spfile is required by some Oracle products Spfile is modifiable via ALTER SYSTEM Spfile on server will be used by remote clients for operations such as starting up the database Initialization text file can be edited directly with an OS editor (like vi) Comments can be placed in a text file

Configure Initialization File ORACLE_HOME/dbs/init.ora db_name db_block_size memory_target control_files undo_management undo_tablespace

Security Related Initialization Parameters sql92_security=TRUE os_authent_prefix='‘ global_names=TRUE audit_sys_operations=TRUE audit_trail='DB'

Create Required Directories Follow standards (OFA or standards for your environment) Directories to contain: datafiles, control files, online redo log files 10g and lower requires creation of directories that background processes can write to

Crafting a CREATE DATABASE statement CREATE DATABASE O11R2 maxlogfiles 16 maxlogmembers 4 maxdatafiles 1024 maxinstances 1 maxloghistory 680 character set "UTF8" DATAFILE '/ora01/dbfile/O11R2/system01.dbf' SIZE 500m EXTENT MANAGEMENT LOCAL UNDO TABLESPACE undotbs1 DATAFILE '/ora02/dbfile/O11R2/undotbs01.dbf' SIZE 800m SYSAUX DATAFILE '/ora03/dbfile/O11R2/sysaux01.dbf' SIZE 200m DEFAULT TEMPORARY TABLESPACE temp TEMPFILE '/ora03/dbfile/O11R2/temp01.dbf' SIZE 800m DEFAULT TABLESPACE users DATAFILE '/ora02/dbfile/O11R2/users01.dbf' SIZE 20m LOGFILE GROUP 1 ('/ora02/oraredo/O11R2/redo01a.rdo', '/ora03/oraredo/O11R2/redo01b.rdo') SIZE 100m, GROUP 2 ('/ora02/oraredo/O11R2/redo02a.rdo', '/ora03/oraredo/O11R2/redo02b.rdo' ) SIZE 100m, GROUP 3 ('/ora02/oraredo/O11R2/redo03a.rdo', '/ora03/oraredo/O11R2/redo03b.rdo' ) SIZE 100m USER sys IDENTIFIED BY secretfoo USER system IDENTIFIED BY secretfoobar;

Tablespaces Initially Created SYSTEM SYSAUX UNDO TEMP USERS

SYS versus SYSTEM SYS is like superuser SYS owns all data dictionary objects SYS has all privileges (start/stop database) SYSTEM is a database account that has the DBA role granted to it Some shops lock the SYSTEM account and don’t use it (because it’s usually the first account a hacker will try to access)

Create the Database 1. Create CREATE DATABASE statement 2. Connect as SYS and startup nomount 3. Run CREATE DATABASE statement 4. Create the data dictionary (must be done as SYS) 5. Run the pupbld.sql script as SYSTEM

Creating the Data Dictionary SQL> connect / as sysdba What does the “?” translate to in the prior statements? What do these scripts actually create? Why do you need to be connected as SYS when creating the data dictionary

Creating a Listener Listener required for connections from remote clients ORACLE_HOME/network/admin default location for Oracle Net files Consider setting a variable like TNS_ADMIN that points to default location for Oracle Net files lnsrctl utility

Listener Security Considerations PASSWORDS_INVPRD=f00bar # ADMIN_RESTRICTIONS_INVPRD=ON # LOG_FILE_INVPRD=invlistener.log LOG_DIRECTORY_INVPRD=/orahome/app/oracle/product/ /db _1/network/log # TRACE_FILE_INVPRD=invlistener.trc TRACE_DIRECTORY_INVPRD=/orahome/app/oracle/product/ / db_1/network/trace # LOG_STATUS=ON # INBOUND_CONNECT_TIMEOUT_INVPRD2=60

Named Listener INVPRD = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = 1528)))) SID_LIST_INVPRD = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = INVPRD) (ORACLE_HOME = /orahome/app/oracle/product/ /db_1) (SID_NAME = INVPRD)))

Creating a Password File Optional Allows remote connections to the database as SYS orapw utility

Operating System Authentication OS group of dba and oper assigned when installing the Oracle software Any OS user belonging to dba group can connect to the database without a password $ sqlplus / as sysdba SQL> show user; USER is “SYS”

SYSDBA vs. SYSOPER SYSDBA contains all privileges SYSOPER can start/stop, alter, toggle archivelog mode and recover the database

Starting a Database Nomount: background processes and memory allocated, only file accessed at this point is the initialization file Mount: Control files opened. Datafiles and online redo logs not opened. Open: Datafiles and online redo logs opened sqlplus / as sysdba SQL> startup;

Stopping a Database sqlplus / as sysdba SQL> shutdown immediate; NORMAL TRANSACTIONAL TRANSACTIONAL LOCAL IMMEDIATE ABORT

Database vs. Instance Database consists of datafiles, controlfiles, and online redo log files Instance consists of background processes and memory structures.

Using Database Configuration Assistant Good way to consistently create databases (when used with a response file) dbca utility

Dropping a Database Be very careful Permanently drops datafiles, control files and online redo logs You are not prompted There is no undrop database command

How many Oracle Homes on one Database Server One set of Oracle binaries for each database? One set of Oracle binaries for all databases? Different versions of Oracle binaries Security considerations? Hardware resource considerations?

One Database or Many Databases on One Server One database per each application Shared database with different users and tablespaces for each application Security considerations? Hardware resource considerations?

Summary Creating a database is a critical DBA task. The database should be created in a consistent, secure, and maintainable manner. As part of creating a database, a listener must be configured to allow for remote connections to the database via Oracle Net.