INTRODUCTION TO ORACLE

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.
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.
3 Managing an Oracle Instance. Objectives Setting up operating system and password file authentication Creating the parameter file Starting up an instance.
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 DATABASE ADMINISTRATION Lynnwood Brown System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2007 all rights.
Primer on Structure& Storage Analysis Primer on Structure & Storage Analysis This presentation is supposed to give a simple and brief overview for storage.
Basic Storage Concepts and Settings
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.
System Administration Accounts privileges, users and roles
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
Harvard University Oracle Database Administration Session 5 Data Storage.
Managing an Oracle Instance
Oracle Database Architecture An Oracle server: –Is a database management system that provides an open, comprehensive, integrated approach to information.
Advanced Databases Basic Database Administration Guide to Oracle 10g 1.
A Guide to Oracle9i1 Introduction to Oracle9i Database Administration Chapter 11.
Backup and Recovery Part 1.
Using RMAN to Perform Recovery
Getting Started with Oracle11g Abeer bin humaid. Create database user You should create at least one database user that you will use to create database.
Oracle Database Administration
IT Database Administration Section 03. Tablespaces and the DBA  Important for DBAs – logical units of database storage Made up of physical operating-system.
Managing the Oracle RDBMS Today you will look at the basics, including: –Setting up Enterprise Manager –Using Enterprise Manager –Using Server Manager.
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.
9 Copyright © 2005, Oracle. All rights reserved. Administering User Security.
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.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC End User Management – Lecture 3 Copyright System Managers LLC 2007 all rights reserved.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
Controlling User Access. Objectives After completing this lesson, you should be able to do the following: Create users Create roles to ease setup and.
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.
Oracle 10g Database Administrator: Implementation and Administration Chapter 3 Creating an Oracle Instance.
Week 3 Lecture 2 Basic Storage Concepts and Settings.
Database Security. Multi-user database systems like Oracle include security to control how the database is accessed and used for example security Mechanisms:
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.
INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003.
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 Managing Rollback Segments Objectives Planning the number and size of rollback segments Creating rollback segments using appropriate storage.
12 Copyright © Oracle Corporation, All rights reserved. User-Managed Complete Recovery.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
Week 2 Lecture 2 Data Dictionary Views and Control Files.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
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.
1 Chapters 19 and 20  Ch. 19: By What Authority? Users Roles Grant and revoke Synonyms  Ch. 20: Changing the Oracle Surroundings Indexes Clusters Sequences.
 Database Administration Oracle Database Instance Management Starting Up and Shutting Down أ. ندى الغامدي, أ. ندى الطوالة.
3 Copyright © Oracle Corporation, All rights reserved. 管理数据库事例.
Controlling User Access
Controlling User Access
Controlling User Access
Controlling User Access
Database structure and space Management
Using Data Dictionary and Dynamic Performance Views
Is 221: Database Administration
Managing Tablespaces and Data Files
Performing Database Recovery
ISYS366, Oracle Disk Internals
Database administration
Oracle 12c Multitenant Database
Presentation transcript:

INTRODUCTION TO ORACLE Lynnwood Brown President System Managers LLC Database Creation & End User Management – Lecture 3 Copyright System Managers LLC 2003 all rights reserved.

MANUAL DATABASE CREATION Define the administrative user Place the administrative user in the DBA group (UNIX) or the ORA_DBA group (NT/2000) Windows NT/2000 service OracleService<SID> must be created using the ORADIM utility which will create the Oracle service and modify the server's registry Copyright System Managers LLC 2003 all rights reserved.

MANUAL DATABASE CREATION Creating the Instance C:\> ORADIM -NEW  -SID  <YOUR_SID>  -INTPWD  <password>  -STARTMODE <mode> -PFILE  <pfile> <YOUR_SID> - Database SID <password> - Password for database administrative user <mode> - Startup mode for the services, either AUTO or MANUAL <pfile> - Path and name of the INIT<sid>.ORA file

MANUAL DATABASE CREATION Deleting the Instance C:\> ORADIM  -DELETE  -SRVC  <service_name> NOTE: SERVICE_NAME = SID             For Oracle 8.1 and 9.x ORADIM ERRORS ARE IN THE DIRECTORY: <ORACLE_HOME> \DATABASE\ORADIM.LOG Copyright System Managers LLC 2003 all rights reserved.

MANUAL DATABASE CREATION Starting The Instance Ensure that the environmental variables have been set and the services have been started (NT/2000). Log into SQL*PLUS as the system user with administrative privileges C:\> sqlplus “system/manager as sysdba” SQL> startup nomount – Start the Oracle instance but do not mount or open the database. On UNIX this starts the Oracle processes and allocates the SGA          Other startup options include MOUNT and EXCLUSIVE

MANUAL DATABASE CREATION Creating The Database Must have at least one tablespace (SYSTEM) One or more data files is specified for the SYSTEM tablespace Must have at least one log group or two log files Copyright System Managers LLC 2003 all rights reserved.

MANUAL DATABASE CREATION Creating The Database 8i SQL > create database test logfile group 1 (‘c:\oradata\test\redo01.log', ‘c:\oradata\test\redo02.log') size 5M, group 2 (‘c:\oradata\test\redo03.log', ‘c:\oradata\test\redo04.log') size 5M maxlogfiles 9 datafile ‘c:\oradata\test\system01.dbf' size 150M maxdatafiles 255 maxinstances 1 noarchivelog character set WE8ISO8859P1 / Copyright System Managers LLC 2003 all rights reserved.

MANUAL DATABASE CREATION Creating The Database catalog.sql - Script that creates the basic Oracle Data Dictionary objects catproc.sql - Script that creates the Oracle Data Dictionary objects for procedural option (PL/SQL) Create Additional Tablespaces (TEMP, INDEX, DATA) create tablespace DATA datafile ‘c:\oradata\test\data01.dbf' size 50M reuse default storage (initial 1M next 1M minextents 1 maxextents unlimited pctincrease 0)

MANUAL DATABASE CREATION Creating The Database (Rollback Segments) 8i create tablespace RBS datafile 'd:\oradata\test\rbs01.dbf' size 50M reuse default storage (initial 1M next 1M minextents 2 maxextents unlimited pctincrease 0) / create rollback segment RBS01 storage (initial 1M next 1M minextents 2 maxextents unlimited) tablespace RBS alter rollback segment RBS01 online Copyright System Managers LLC 2003 all rights reserved.

MANUAL DATABASE CREATION Creating The Database 9i CREATE DATABASE test MAXLOGFILES 9 MAXINSTANCES 1 MAXDATAFILES 256 MAXLOGHISTORY 256 DATAFILE 'c:\test\system_01.dbf' SIZE 150M UNDO TABLESPACE "UNDOTBS" DATAFILE 'c:\test\undotbs_01.dbf' SIZE 150M AUTOEXTEND ON NEXT 5M MAXSIZE UNLIMITED CHARACTER SET WE8ISO8859P1 LOGFILE GROUP 1 ('c:\test\redo1_01.dbf‘) SIZE 50M, GROUP 2 ('c:\test\redo1_02.dbf') SIZE 50M;

MANUAL DATABASE CREATION UNDO Tablespace New in Oracle 9i Replaces rollback segments RDBMS manages undo segments automatically: New init<SID>.ora parameters: UNDO_MANAGEMENT AUTO or Manual (use roll back segments) UNDO_TABLESPACE = <Undo tablespace name>

MANUAL DATABASE CREATION UNDO Tablespace (cont) Creating an UNDO tablespace after the database has been created: SQL> create undo tablespace UNDO_TS1 datafile ‘c:\oradata\undorbs1.dbf' size 100m; SQL> alter system set undo_tablespace=undo_ts1; Copyright System Managers LLC 2003 all rights reserved.

MANUAL DATABASE CREATION Creating And Enlarging Tablespaces Automatically increase tablespace sizes using “AUTOEXTEND” CREATE TABLESPACE DATA DATAFILE '/u01/oracle/rbdb1/users01.dbf' SIZE 300M REUSE AUTOEXTEND ON NEXT 5M MAXSIZE 1500M; Add another data file if not using AUTOEXTEND SQL > alter tablespace DATA add datafile '/u01/oracle/rbdb1/users02.dbf' size 20M;

MANUAL DATABASE CREATION Shutting Down the Database Must be the administrative user: SQL> shutdown normal             Other SHUTDOWN options include: IMMEDIATE – Allow transactions to complete and then log off all users ABORT – Log off all users (no grace period)

END USER MANAGEMENT Create database users by using the CREATE/ALTER USER commands. Create database objects (tables, views, synonyms and indexes). Control database access/security by granting access privileges: grant update on emp to scott; Grant database access so that users can/cannot pass the privilege on to other users: grant update on emp to scott with admin option; Copyright System Managers LLC 2003 all rights reserved.

END USER MANAGEMENT To create a user named SCOTT with password TIGER: SQL > Create user scott identified by tiger SQL > Default tablespace users SQL > Temporary tablespace temp SQL > Quota 15m on users; Give SCOTT the privilege to connect to the database and create objects. SQL > Grant connect, resource to scott; Copyright System Managers LLC 2003 all rights reserved.

END USER MANAGEMENT End User Profiles – Resource Control SQL > CREATE PROFILE new_user LIMIT sessions_per_user 10 connect_time 30 idle_time 10; Altering User Access To Resources SQL > ALTER USER <userID> IDENTIFIED BY <pw> profile new_user;

END USER MANAGEMENT Create roles to automate the security/access process: SQL > create role manager; SQL > grant update on emp to manager; SQL > grant manager to scott; Oracle has several pre-defined roles. One of the pre-defined roles is called DBA. Copyright System Managers LLC 2003 all rights reserved.

END USER MANAGEMENT How to determine the privileges a user or role has: SQL > select grantee, privilege from sys.dba_sys_privs; How to determine which users are in which roles: SQL > select grantee, granted_role from sys.dba_role_privs;

OBJECT CREATION Database objects include: Tables – Used to store records (rows of data) Views – Like a table but takes up no disk space. Is based on an underlying table. Indexes – Use to speed retrieval of data from a table. Synonyms – Used to reference objects owned by another user without having to reference the object owners name/schema. Sequence – Used to generate a unique number Database links – Used to access data in one database from another database. Copyright System Managers LLC 2003 all rights reserved.

OBJECT CREATION Create Table: Create View: Create table dept (deptno number, Creation date, Dname varchar2(10) Dloc varchar2(20); Create View: Create view DVIEW as select deptno, dname, dloc from dept; Copyright System Managers LLC 2003 all rights reserved.

OBJECT CREATION Create Index: Create Synonym: Create Sequence: Create index i_dept on dept(deptno); Create Synonym: Create public synonym dept on dept; Create Sequence: Create sequence dept_num start with 1 increment by 1; Copyright System Managers LLC 2003 all rights reserved.

OBJECT MANAGEMENT System and Object Management ALTER TABLE EMP ADD (COLx NUMBER(7,2)…..); ALTER TABLE EMP MODIFY (COLx NUMBER(8,2)); ALTER SESSION <userID> IDENTIFIED BY <pw>; ALTER SYSTEM SET LICENSE_MAX_SESSIONS/USERS LICENSE_SYSTEMS_WARNINGS; Copyright System Managers LLC 2003 all rights reserved.

SOME ORACLE DATA DICTIONARY TABLES/VIEWS FOR MANAGING END USERS: THE DATA DICTIONARY SOME ORACLE DATA DICTIONARY TABLES/VIEWS FOR MANAGING END USERS: Table/View Name Description DBA_USERS Names of all users of the database DBA_TABLES Names of all tables in the database DBA_INDEXES Names of all indexes in the database DBA_SYNONYMS Names of all indexes in the synonyms DBA_SEQUENCES Names of all sequences in the database DBA_VIEWS Names of all views in the database There are many other tables/views in the Oracle data dictionary. Refer to the Oracle Administrators Guide for a complete list/description Copyright System Managers LLC 2003 all rights reserved.

THE DATA DICTIONARY DATA DICTIONARY VIEWS ACCESSIBLE TO END USERS: DBA_<name> - End users must be granted the privilege to access the DBA views ALL_<name> - Objects that the end user has access to but did not create USER_<name> - Objects created by the end user Copyright System Managers LLC 2003 all rights reserved.