Creating an Oracle Database. Considerations before creating a DB Planning for Database Creation –Select the standard database block size. –Use an undo.

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

INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Introduction to Oracle Automatic Storage Management (ASM) Copyright System Managers LLC 2008.
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.
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.
Basic Storage Concepts and Settings
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.
Oracle Architectural Components
Managing an Oracle Instance
Advanced Databases Basic Database Administration Guide to Oracle 10g 1.
Database Backup and Recovery
INTRODUCTION TO ORACLE
RMAN Restore and Recovery
Backup and Recovery Part 1.
ITEC474 Redo Log Files.
CHAPTER 5 Managing Control Files, Online Redo Logs, and Archiving.
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.
Using RMAN to Perform Recovery
14 Copyright © 2004, Oracle. All rights reserved. Automatic Storage Management.
Oracle Database Administration
20 Copyright © 2004, Oracle. All rights reserved. Database Recovery.
IT Database Administration Section 03. Tablespaces and the DBA  Important for DBAs – logical units of database storage Made up of physical operating-system.
CHAPTER 23 Pluggable Databases. Oracle Multitenant (Pluggable Databases) New with Oracle Database 12c is Oracle Multitenant. This feature allows you to.
Oracle Database Workshop 1 Presented to IBRI CAS 27-Nov-2011 By Abdullah Alkalbani.
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 7 Making Backups with RMAN. Objectives Explain backup sets and image copies RMAN Backup modes’ Types of files backed up Backup destinations Specifying.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
■ 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.
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.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
Oracle FULL EXP/IMP 11i Database SURENDER SARA NCOAUG
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 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.
Oracle 10g Database Administrator: Implementation and Administration Chapter 3 Creating an Oracle Instance.
Week 3 Lecture 2 Basic Storage Concepts and Settings.
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.
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.
10 Copyright © Oracle Corporation, All rights reserved. User-Managed Backups.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
QUIZ DATABASE ADMINISTRATOR. LESS 3 LESS 5 LESS 6 LESS 7.
2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager.
8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database.
Intro To Oracle :part 1 1.Save your Memory Usage & Performance. 2.Oracle Login ways. 3.Adding Database to DB Trees. 4.How to Create your own user(schema).
Week 2 Lecture 2 Data Dictionary Views and Control Files.
13 Copyright © 2004, Oracle. All rights reserved. Optimizing Database Performance.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
8 Copyright © Oracle Corporation, All rights reserved. Managing Tablespaces and Data files.
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 Architecture, Creation and Interfaces Copyright ©2006, Custom Training Institute.
3 Copyright © Oracle Corporation, All rights reserved. 管理数据库事例.
Initialization Parameters
Maintaining Online Redo Log Files
Creating an Oracle Database
Duplicating a Database
Performing Database Recovery
ISYS366, Oracle Disk Internals
Database administration
Oracle 12c Multitenant Database
Presentation transcript:

Creating an Oracle Database

Considerations before creating a DB Planning for Database Creation –Select the standard database block size. –Use an undo tablespace to manage your undo records –Develop a backup and recovery strategy to protect the database from failure –Familiarize yourself with the principles and options of starting up and shutting down an instance and mounting and opening a database.

Considerations before creating a DB Deciding How to Create an Oracle Database Creating information structures, including the data dictionary, that Oracle requires to access and use the database Creating and initializing the control files and redo log files for the database Creating new datafiles or erasing data that existed in previous datafiles Use the Database Configuration Assistant (DBCA). Create the database manually from a script.

Planning Database File Locations Keep at least two active copies of a database control file on at least two different devices. Multiplex the redo log files and put group members on different disks. Separate data files whose data: –Will participate in disk resource contention across different physical disk resources –Have different life spans –Have different administrative characteristics

Creating a Database Using DBCA Selecting the Template Including Datafiles Specifying Global Database Name and Database Features Specifying Database Features Specifying Mode, Initialization Parameters, and Datafiles

Manually creating an Oracle DB Step 1: Decide on Your Instance Identifier (SID) Step 2: Establish the Database Administrator Authentication Method Step 3: Create the Initialization Parameter File Step 4: Connect to the Instance Step 5: Start the Instance. Step 6: Issue the CREATE DATABASE Statement Step 7: Create Additional Tablespaces Step 8: Run Scripts to Build Data Dictionary Views Step 9: Run Scripts to Install Additional Options (Optional) Step 10: Create a Server Parameter File (Recommended) Step 11: Back Up the Database.

Create Database CREATE DATABASE [ database ] { USER SYS IDENTIFIED BY password | USER SYSTEM IDENTIFIED BY password | CONTROLFILE REUSE | MAXDATAFILES integer | MAXINSTANCES integer | CHARACTER SET charset | NATIONAL CHARACTER SET charset | SET DEFAULT { BIGFILE | SMALLFILE } TABLESPACE | database_logging_clauses | tablespace_clauses | set_time_zone_clause }... ;

Database Logging Clauses

{ LOGFILE [ GROUP integer ] file_specification [, [ GROUP integer ] file_specification ]... | MAXLOGFILES integer | MAXLOGMEMBERS integer | MAXLOGHISTORY integer | { ARCHIVELOG | NOARCHIVELOG } | FORCE LOGGING }

Tablespace Clauses

{ EXTENT MANAGEMENT LOCAL | DATAFILE file_specification [, file_specification ]... | SYSAUX DATAFILE file_specification [, file_specification ]... | default_tablespace | default_temp_tablespace | undo_tablespace } Tablespace Clauses

Default Tablespace

DEFAULT TABLESPACE tablespace [ DATAFILE datafile_tempfile_spec ] extent_management_clause

Extent Managment Clause

EXTENT MANAGEMENT { DICTIONARY | LOCAL [ AUTOALLOCATE | UNIFORM [ SIZE size_clause ] ] }

Database creations are of three types: Copy an existing database and delete the old database. Copy an existing database and keep the old database. Create a new database when no database exists on your system.

Considerations before creating a DB Planning for Database Creation –Plan the database tables and indexes and estimate the amount of space they will require. –Plan the layout of the underlying operating system files that are to comprise your database. –Select the global database name, DB_NAME, DB_DOMAIN –Familiarize yourself with the initialization parameters –Select the database character set. –Consider what time zones your database must support.

Creating Directories

Exporting an Existing Database C:\> exp SYSTEM/password FILE=myexp.dmp FULL=y LOG=myexp.log C:\> set ORACLE_SID=orcl C:\> exp SYSTEM/password FILE=myexp.dmp FULL=y LOG=myexp.log

Deleting Database Files 1.Shut down starter database orcl at the command prompt: C:\> oradim -SHUTDOWN -SID orcl -USRPWD password -SHUTTYPE inst -SHUTMODE i

Deleting Database Files 2. Delete the following database files located in directory C:\oracle\oradata\orcl:

Modifying the Initialization Parameter File Copy: C:\ORACLE_BASE\admin\orcl\pfile\init.ora to C:\ORACLE_BASE\admin\prod\pfile\init.ora initsmpl.ora ORACLE_BASE\ORACLE_HOME\admin\sample\pfile

Creating and Starting an Oracle Service You are required to create and start an Oracle service only if you do one of the following: –Copy an existing database to a new database and keep the old database –Create a new database when you have no other database to copy Using ORADIM Utility to Administer an Oracle Instance

Nos conectamos a la instancia creada: - sqlplus “/ as sysdba” - startup nomount pfile=d:\oracle\admin\prod\pfile\init.ora

Putting the CREATE DATABASE Statement in a Script

Running the CREATE DATABASE Script 1.Verify that the service is started in the Control Panel. Check Status with: C:\> net START List services: C:\> net START OracleServicePROD 2. Make PROD the current SID: C:\> set ORACLE_SID=PROD

Running the CREATE DATABASE Script 3. Start SQL*Plus from the command prompt, and connect to the database as SYSDBA C:\> sqlplus / NOLOG SQL> CONNECT / AS SYSDBA 4. Turn on spooling to save messages: SQL> SPOOL script_name.log 5. Run script script_name.sql that you created

1.Crear los directorios: –d:\oracle\admin\cg4 –d:\oracle\admin\cg4\bdump –d:\oracle\admin\cg4\pfile –d:\oracle\admin\cg4\udump –d:\oracle\oradata\cg4 2.Copiar init.ora y editarlo con las nuevas rutas 3.Crear instancia: –ORADIM -NEW -SID cg4 -INTPWD cg4 -STARTMODE manual -PFILE "d:\oracle\admin\cg4\pfile\init.ora" 4.Establecer la bd a trabajar: –Set ORACLE_SID = cg4 5.Conectarse al SQLPLUS –Sqlplus "/ as sysdba" 6.Levantar la BD no montada con el pfile init.ora –Startup nomount pfile=d:\oracle\admin\cg4\pfile\init.ora

7. Crear Script de CREATE_DATABASE CREATE DATABASE cg4 USER SYS IDENTIFIED BY dba USER SYSTEM IDENTIFIED BY manager Maxinstances 1 Maxloghistory 1 Maxlogfiles 10 Maxdatafiles 100 LOGFILE group 1 ('d:\oracle\oradata\cg4\redolog1a.dbf', 'd:\oracle\oradata\cg4\redolog1b.dbf') SIZE 10M, group 2 ('d:\oracle\oradata\cg4\redolog2a.dbf', 'd:\oracle\oradata\cg4\redolog2b.dbf' ) SIZE 10M, group 3 ('d:\oracle\oradata\cg4\redolog3a.dbf', 'd:\oracle\oradata\cg4\redolog3b.dbf' ) SIZE 10M DATAFILE 'd:\oracle\oradata\cg4\system01.dbf' SIZE 200M CHARACTER SET WE8ISO8859P1 national character set utf8 EXTENT MANAGEMENT LOCAL sysaux datafile 'd:\oracle\oradata\cg4\sysaux01.dbf' size 50M autoextend on next 16M maxsize unlimited undo tablespace UNDOTBS1 datafile 'd:\oracle\oradata\cg4\UNDOTBS1.dbf' size 50M DEFAULT TEMPORARY TABLESPACE tempts1 TEMPFILE 'd:\oracle\oradata\cg4\temp01.dbf' SIZE 20M REUSE /

8. Ejecutar scripts de catalogos y diccionario de datos ORACLE_HOME\rdbms\admin START d:\oracle\ora92\rdbms\admin\CATALOG.sql START d:\oracle\ora92\rdbms\admin\CATPROC.sql START d:\oracle\ora92\rdbms\admin\catexp.sql