Professional Documents
Culture Documents
Fundamentals II
Electronic Presentation
D11297GC20
Production 2.0
August 2002
D37069
®
Authors Copyright © Oracle Corporation, 2002. All rights reserved.
Donna Keesling This documentation contains proprietary information of Oracle Corporation. It is provided under a
license agreement containing restrictions on use and disclosure and is also protected by copyright
James Womack law. Reverse engineering of the software is prohibited. If this documentation is delivered to a U.S.
Government Agency of the Department of Defense, then it is delivered with Restricted Rights and the
Technical Contributors following legend is applicable:
and Reviewers Restricted Rights Legend
Lance Ashdown Use, duplication or disclosure by the Government is subject to restrictions for commercial computer
Tammy Bednar software and shall be deemed to be Restricted Rights software under Federal law, as set forth in
Louise Beijer subparagraph (c)(1)(ii) of DFARS 252.227-7013, Rights in Technical Data and Computer Software
(October 1988).
Harald van Breederode
Howard Bradley This material or any portion of it may not be copied in any form or by any means without the express
prior written permission of the Education Products group of Oracle Corporation. Any other copying is
Senad Dizdar a violation of copyright law and may result in civil and/or criminal penalties.
Steven George
Joel Goodman If this documentation is delivered to a U.S. Government Agency not within the Department of
Defense, then it is delivered with “Restricted Rights,” as defined in FAR 52.227-14, Rights in Data-
Scott Gossett General, including Alternate III (June 1987).
John Hibbard
The information in this document is subject to change without notice. If you find any problems in the
Stefan Lindblad documentation, please report them in writing to Worldwide Education Services, Oracle Corporation,
Roman Niehoff 500Oracle Parkway, Box SB-6, Redwood Shores, CA 94065. Oracle Corporation does not warrant
Howard Ostrow that this document is error-free.
Radhanes Petronilla Oracle and all references to Oracle Products are trademarks or registered trademarks of Oracle
Maria Jesus Senise Garcia Corporation.
Peter Sharman All other products or company names are used for identification purposes only, and may be
Ranbir Singh trademarks of their respective owners.
Sergey Stetsenko
John Watson
Steven Wertheimer
Junichi Yamazaki
Publisher
May Lonn Chan-Villareal
Networking Overview
Network
Client
Server
Network Network
TCP/IP SSL
TCP/IP SSL
TCP/IP
• Connectivity
• Directory Services
• Scalability
• Security
• Accessibility
• Protocol independence
• Comprehensive platform support
• Integrated GUI administration tools
• Multiple configuration options
• Tracing and diagnostic toolset
• Basic security
1 2
3
Oracle Connection
Manager
Server
• Encryption
– Encodes between network nodes
– DES, RSA, 3DES
• Authentication
– Authenticates users through third-party services
and Secure Sockets Layer (SSL)
– Kerberos, Radius, CyberSafe
• Data Integrity
– Ensures data integrity during transmission
– MD5, SHA
Client Server
2
Encrypt
fdh37djf246gs’b[da,\ssk
Web browser
Application Oracle
Web server server
Oracle Protocol
JavaNet Support
Client Server
HTTP
Web
browser Oracle
server
supporting
HTTP
Oracle
Client RDBMS
HTTP
Web browser
Oracle Protocol
HTTP Support
TCP/IP TCP/IP
• Database services
• Service Name
– A logical representation of a database
– The way a database is presented to clients
• Connect Descriptor
– Location of the database
– Name of the database service
• Listener
– Receives client connection requests
– Hands requests to the database server
• Service Registration
– Database registers information with the listener
– Service handlers available for each instance
• Service Handlers
– Connection points
– Dispatcher or dedicated server
• Localized management
– Local file on each computer in the network
• Centralized management
– LDAP-compliant directory server
– Oracle Names server
listener.ora sqlnet.ora
Client Server
Listener
tnsnames.ora
sqlnet.ora listener.ora
Client Server
2 Dedicated
1 Server Process
Listener
Shared
Server
3 Process
1 2 Dispatcher
Listener
Shared
Server
Process
Client Server
Server or
dispatcher
6 process
5 3
port
4 2
port
1
Listener
1. LISTENER =
2. (ADDRESS_LIST =
3. (ADDRESS= (PROTOCOL= TCP)(Host= stc-
sun02)(Port= 1521)))
4. SID_LIST_LISTENER =
5. (SID_LIST =
6. (SID_DESC =
7. (ORACLE_HOME= /home/oracle)
8. (GLOBAL_DBNAME = ORCL.us.oracle.com)
9. (SID_NAME = ORCL)))
• Prompt syntax:
LSNRCTL> <command name>
Client Server
TCP/IP
…
names.directory_path = (HOSTNAME)
sqlnet.ora
listener.ora
Client Server
TCP/IP
1521
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = stc-sun02.us.oracle.com)
(ORACLE_HOME = /u03/ora9i/rel12)
(SID_NAME = TEST)
sqlnet.ora listener.ora
• listener.ora file:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = stc-sun02.us.oracle.com)
(ORACLE_HOME = /home1/user461/oracle)
(SID_NAME = TEST)
Client Server
sqlnet.ora
tnsnames.ora listener.ora
Client Server
Instance
SGA
User Server
process process
Snnn
Snnn
Database server
Client
User User
process process
TEST.world =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = stc-sun02)
(PORT = 1521)
)
(CONNECT_DATA=(SERVICE_NAME=TEST.us.oracle.com)
(SERVER=DEDICATED)
)
)
Dispatcher Dispatcher
process process
D001 D002
1
User User
process process
DISPATCHERS = "(PROTOCOL=TCP)(DISPATCHERS=2)\
(PROTOCOL=IPC)(DISPATCHERS=1)"
MAX_DISPATCHERS = 5
Dispatcher
D004
Dispatcher Dispatcher Dispatcher Dispatcher
D001 D002 D003 D005
TCP/IP TCP/IP IPC
SHARED_SERVERS = 6
MAX_SHARED_SERVERS = 10
CIRCUITS = 100
SHARED_SERVER_SESSIONS = 100
$ lsnrctl services
• V$CIRCUIT
• V$SHARED_SERVER
• V$DISPATCHER
• V$SHARED_SERVER_MONITOR
• V$QUEUE
• V$SESSION
• Statement failure
• User process failure
• User error
• Network failure
• Instance failure
• Media failure
• Business requirements
• Operational requirements
• Technical considerations
• Management concurrence
• 24-hour operations
• Testing and validating backups
• Database volatility
Datafile 3
Password Archived
file Database log files
Datafile 3
Password Archived
file log files
Database
Disk 1
(Member a)
log1a.rdo log2a.rdo log3a.rdo
Disk 2
(Member b)
log1b.rdo log2b.rdo log3b.rdo
• Full checkpoint
– All dirty buffers are written
– SHUTDOWN NORMAL, IMMEDIATE, or TRANSACTIONAL
– ALTER SYSTEM CHECKPOINT
• Incremental checkpoint (Fast-Start checkpoint)
– Periodic writes
– Only write the oldest blocks
• Partial checkpoint
– Dirty buffers belonging to the tablespace
– ALTER TABLESPACE BEGIN BACKUP
– ALTER TABLESPACE tablespace OFFLINE
NORMAL
Datafile 3
Password Archived
file log files
Database
Datafile 3
Password Archived
file log files
Database
1. Datafiles out-of-synch
2. Roll forward (redo) Instance
SGA
3. Committed and non- Shared pool
committed data in files Shared SQL
Java pool Large pool
and PL/SQL
4. Roll back (undo)
Database Redo log Data dict.
5. Committed data in files buffer cache buffer cache
Database
Parameter Definition
Improved
response
SMON
P000
P001
P002
Undo P003
Tables
segment
FAST_START_PARALLEL_ROLLBACK parameter
FALSE None
HIGH 4 * CPU_COUNT
Case 1 Read-Only
rman target /
RMAN> STARTUP MOUNT
RMAN> RESTORE DATABASE;
RMAN> RECOVER DATABASE;
RMAN> ALTER DATABASE OPEN;
Instance
User Server SGA
process process Shared pool
PGA Shared SQL
Locks Large Pool
and PL/SQL
Data Redo log Data dict.
buffer buffer cache
User Server
process process SMON DBWn PMON CKPT LGWR ARCn
PGA
1 1 1
Datafile 1 Control Redo log
files file 1
Parameter 1 0 Archived
Datafile 2 Redo log log files
file file 2
1
Datafile 3
Password
file
Database
Scenario:
• The current time is 12:00 p.m. on March 9, 2002.
• The EMPLOYEES table has been dropped.
• The table was dropped at approximately 11:45 a.m.
• Database activity is minimal because most staff
are currently in a meeting.
• The table must be recovered.
Scenario:
• The current time is 12:00 p.m. on March 9,2002.
• The EMPLOYEES table was dropped while someone
was trying to fix bad blocks.
• Log files exist on the same disk.
• The table was dropped at approximately 11:45 a.m.
• Staff are currently in a meeting.
Findings:
• Redo logs are not multiplexed.
• One of the online redo logs is missing.
• The missing redo log is not archived.
• The redo log contained information from 11:34
a.m.
• Twenty-six minutes of data will be lost.
• Users can recover their data.
Scenario:
• The current time is 12:00 p.m. on March 9, 2002.
• The tablespace containing the EMPLOYEES table
has been dropped.
• The error occurred around 11:45 a.m.
• Many employee records were updated this
morning, but not since 11:00 a.m.
• Backups are taken every night.
Findings:
• The backup from last night contains datafiles and
control files that are required for recovery.
• The EMP_TS tablespace has one datafile.
• The current log sequence number is 61.
• You confirm that the tablespace was dropped at
11:44:54 a.m. on March 9, 2002.
• Datafile number 4 is offline.
RMAN> RUN {
2> ALLOCATE CHANNEL c1 TYPE DISK;
3> ALLOCATE CHANNEL c2 TYPE DISK;
4> SET UNTIL TIME = ‘2001-12-09:11:44:00';
5> RESTORE DATABASE;
6> RECOVER DATABASE;
7> ALTER DATABASE OPEN RESETLOGS; }
RMAN> RUN {
2> SET UNTIL SEQUENCE 120 THREAD 1;
3> ALTER DATABASE MOUNT;
4> RESTORE DATABASE;
5> RECOVER DATABASE; # recovers through log 119
6> ALTER DATABASE OPEN RESESTLOGS;
7> }
Reporting
Target Control file REPORT Stored
LIST scripts
database
Catalog Maintenance
Register
Resynchronize
Reset Catalog
Change/Delete/Catalog database
Backup /Restore/Recover
3. Grant privileges
Catalog
4. Create catalog database
• Example on UNIX
$ ORACLE_SID=db01; export ORACLE_SID
$ rman target /
RMAN> connect catalog rman_db01/rman_db01@catdb
• Example on Windows NT
C:\> set ORACLE_SID=db01
C:\> rman target /
RMAN> connect catalog rman_db01/rman_db01@catdb
Reporting
Target Control file REPORT Stored
LIST scripts
database
Catalog Maintenance
Register
Resynchronize
Reset Catalog
Change/Delete/Catalog database
Backup /Restore/Recover
Catalog
database
RMAN >
Target
Control file database
Reporting
Target Control file REPORT Stored
LIST scripts
database
Catalog Maintenance
Register
Resynchronize
Reset Catalog
Change database
Backup /Restore/Recover
Reporting
Target Control file REPORT Stored
LIST scripts
database
Catalog Maintenance
Register
Resynchronize
Reset Catalog
Change database
Backup /Restore/Recover
Oracle
database
Export
Import
Oracle
database
• Command-line interface
• An interactive dialog
• Parameter files
• Oracle Enterprise Manager
• Syntax:
exp keyword = value, value2, … ,valuen
• Examples:
exp hr/hr TABLES=employees,departments
rows=y file=exp1.dmp
Direct Path
Direct Path
Conventional Path
•expAsparfile=<Parameter
a keyword in a parameter
file>
file:
Parameter file
…..(Other Parameters)
DIRECT = Y
…...(Other Parameters)
Mode Description
• Syntax:
imp keyword = value or keyword = value,
value2, … value n
• Examples:
imp hr/hr TABLES=employees,departments
rows=y file=exp1.dmp
• Physical investigation:
– Use views and tools to derive information
– View trace files and log files
– View command output and log files
– Use views and tools to confirm proper database
configuration
• Database configuration:
– Archiving is enabled
– Control files and log files are mirrored
– Control file is backed up
• Instructor-facilitated workshop
• Group-oriented
• Hands-on approach
• Simulated “real-world” environment
• Minimize down time and data loss
• Use tools and diagnostics to determine the type of
failure
Other applications
Oracle
database
Export
SQL*Loader
Import
Oracle
database
Direct-load INSERT
Server
EMPLOYEES table process
Slave Slave
process process
EMPLOYEES table
Parameter file
SQL*Loader Rejected
(optional)
Field processing
Discarded Accepted
Record selection
Bad
Selected file
Oracle server
Discard file Rejected
(optional) Inserted
Log file
Database datafiles
Array
insert
Conventional
Direct
Table Data path
save
High-water
mark
Space used only by conventional load
Temporary segments
load1.dat SQL*Loader
load1.ctl
SQL*Loader
load2.dat
load2.ctl
SQL*Loader
load3.dat
load3.ctl
Table
High-water
mark
$sqlldr hr/hr \
> control=case1.ctl \
> log=case1.log direct=Y
case1.ctl
SQL*Loader
EMPLOYEES table
case1.log
• Bad file
– SQL*Loader rejects records when the input format
is invalid
– If the Oracle database finds that the row is invalid,
the record is rejected and SQL*Loader puts it in the
bad file
• Discard file
– This can be used only if it has been enabled
– This file contains records that were filtered out
because they did not match any record-selection
criteria specified in the control file
• Header Information
• Global Information
• Table Information
• Datafile Information
• Table Load Information
• Summary Statistics
• Additional statistics for direct path loads and
multithreading Information