2. Contents :
1.Introduction of ORACLE 9i.
2. SQL
3. Database Administration
4. Data Dictionary
5. Recovery Manager Tool(RMAN).
3. Introduction
Oracle9i Enterprise Edition is an object relational database
that is scalable and easily manageable.
Oracle 9i offers a comprehensive high-performance
infrastructure for e-busines .It is called oracle 9i.
oracle 9i includs everything needed to develop,deploy,and
manage Internet applications.
4. Oracle9i Features
Dynamic Memory RMAN
Management
One
Multiple Insert Management
Statement Interface
Default
Oracle Merge Temporary
Statement Tablespace
6. Oracle9i Application Server
Portals
A Transactional Apps
P
A
C Business Intelligence
intelligence
H
E
Integration
7. Oracle9i Database
Object Relational Data
Documents
XML
Multimedia
Messages
8. Communicating with a RDBMS
Using SQL
SQL statement
is entered. Statement is sent to
SELECT department_name
SELECT department_name Oracle Server.
FROM
FROM departments;
departments;
Oracle
server
10. SQL Statements
SELECT Data retrieval
INSERT
UPDATE Data manipulation language (DML)
DELETE
MERGE
CREATE
ALTER
DROP Data definition language (DDL)
RENAME
TRUNCATE
COMMIT
ROLLBACK Transaction control
SAVEPOINT
GRANT
REVOKE
Data control language (DCL)
14. The MERGE Statement Syntax
We can conditionally insert or update rows in a
table by using the MERGE statement.
MERGE INTO table_name table_alias
MERGE INTO table_name table_alias
USING (table|view|sub_query) alias
USING (table|view|sub_query) alias
ON (join condition)
ON (join condition)
WHEN MATCHED THEN
WHEN MATCHED THEN
UPDATE SET
UPDATE SET
col1 = col_val1,
col1 = col_val1,
col2 = col2_val
col2 = col2_val
WHEN NOT MATCHED THEN
WHEN NOT MATCHED THEN
INSERT (column_list)
INSERT (column_list)
VALUES (column_values);
VALUES (column_values);
16. Tasks of a Database Administrator
– To plan and create databases
– To manage database availability
– To manage storage based on design
– To manage security
– Network administration
– Backup and recovery
– Database tuning
17. Database Objects
Object Description
Table Basic unit of storage; composed of rows
and columns
View Logically represents subsets of data from
one or more tables
Sequence Generates primary key values
Index Improves the performance of some queries
Synonym Alternative name for an object
18. Overview of Primary Components
Instance
User
process Shared Pool SGA
Library Redo Log
Database
Cache Buffer
Buffer Cache
Server Data Dictionary
process Cache Large Pool
Java Pool
PGA
PMON SMON DBWR LGWR CKPT Others
Data Control files Redo Log
Parameter files Archived
files
file Log files
Password
file
Database
19. Database Administration Tools
Tool Description
Oracle Universal Used to install, upgrade, or remove software
Installer (OUI) components
Oracle Database A graphical user interface tool that interacts with the
Configuration OUI, or can be used independently, to create, delete,
Assistant(DBCA) or modify a database
SQL*Plus A utility to access data in an Oracle database
Oracle Enterprise A graphical interface used to administer, monitor, and
Manager(OEM) tune one or more databases
20. Database Configuration Assistant
• With the Database Configuration Assistant we can:
• Create a database
• Configure database options
• Delete a database
• Manage templates
– Create new templates using predefined template settings
• Create new templates from an existing database
• Delete database templates
21. Data Dictionary
– Central to every Oracle database
– Describes the database and its objects
– Contains read-only tables and views
– Stored in the SYSTEM tablespace
– Owned by the user SYS
– Maintained by the Oracle server Data
files
– Accessed with SELECT Control Redo
files Log
files
Database
Data Dictionary
tables
22. Creating Data Dictionary Views
Script Purpose
catalog.sql Creates commonly used data dictionary
views and synonyms
catproc.sql Runs scripts required for server-side
PL/SQL
23. Tablespaces and Data Files
• Oracle stores data logically in tablespaces and
physically in data files.
– Tablespaces:
• Can belong to only one database at a time
• Consist of one or more data files
• Are further divided into logical units of storage
– Data files:
• Can belong to only one
tablespace and one database
• Are a repository for schema Database
object data
Tablespace
Data files
24. Password Management
Password Account
history locking
User Setting up
profiles
Password Password
expiration verification
and aging
25. Users and Security
Account Default
locking tablespace
Authentication Temporary
mechanism tablespace
Security
domain
Role Tablespace
privileges quotas
Direct Resource
privileges limits
26. Roles
Users
A B C
Roles HR_MGR HR_CLERK
Privileges
SELECT INSERT
ON JOBS ON JOBS
CREATE CREATE UPDATE
SESSION ON JOBS
27. Recovery Manager(RMAN)
We use Following three steps:
1.Set Archive Mode.
2. Backup Database through RMAN.
3.Recovery Database through RMAN.
28. 1.Set Archive Mode
1. Set ORACLE_SID=HP
2. Sqlplus
3. Update PFILE with-
log_archive_start=true
log_archive_dest_1=‘Location=D:HPARCH’
log_archive_format=‘%t_%s.ARC’
4. Shutdown immediate
5.Startup mount pfile=‘D:HPPFILEINITHP.ora’
6.Alter database archivelog;
7. Alter system switch logfile;
8. Archive log list;
29. 2. Backup Database Through RMAN
1.Set ORACLE_SID=HP
2.RMAN target /
3.RMAN> Show all;
4.RMAN> Configure controlfile Autobackup ON;
5.RMAN> Configure controlfile Autobackup format for device
type disk to ‘D:HPBACKUPCONTROLBACK%F.BAK’ ;
6.RMAN> Configure channel device type disk format
‘D:HPBACKUPDATABACKUP%U.BAK’;
7.RMAN> Backup database;
8.RMAN> List backup;
31. Recover Database(ControlFiles) Through RMAN
1.RMAN> startup
2. RMAN> set DB_ID=1425892549 (v$database)
OR
RMAN> set ORACLE_SID=HP;
3. RMAN> Restore controlfile from
‘D:HPBACKUPCONTROLC-125492_06.BAK’;
4. RMAN> Alter database mount;
5. RMAN> Recover Database;
6. RMAN> Alter database open resetlogs;