PPTS Oracle11gR2 Fundamentals
PPTS Oracle11gR2 Fundamentals
FUNDAMENTALS
Resumen de Capítulos:
01 – Creación de una Base de Datos
02 – Gestión de la Instancia
03 – Estructuras de Almacenamiento
04 – Administración de Usuarios
05 – Concurrencia
06 – Entorno de Red
07 – Conceptos de Backup y Recuperación
1
Oracle Database Server Structures
Instance
Memory structures
SGA Shared pool
Library
Database cache
User Server Redo log
buffer
process process buffer
cache Data dictionary
cache
Database
Storage structures
Instance
SGA
DB Buffer Cache Library Cache
Shared pool
Shared
SQL area
Redo log
buffer
Data dictionary
cache
2
CREACIÓN DE UNA BASE DE DATOS
3
Using the DBCA to Create a Database
4
Using the DBCA to Create a Database
Use this page to specify the passwords for the administrative accounts, such as SYS and SYSTEM
5
Using the DBCA to Create a Database
8) If required, specify a flash
recovery area and enable
archiving
10 (A) Typical or
(B) Custom mem allocation.
B
6
Using the DBCA to Create a Database
11
12
13
14
7
GESTIÓN DE LA INSTANCIA
8
Oracle Enterprise Manager
When you install an Oracle database, Oracle Universal Installer also installs Oracle Enterprise Manager
Note: https://machine_name:port/em
In Oracle Database 11g, the URL to access EM uses HTTPS (instead of HTTP)
Dflt port 1158, check portlist.ini file located in the $ORACLE_HOME\install directory.
Property pages
9
Using SQL*Plus
SQL*Plus is:
• A command-line tool
• Used interactively or in batch mode
$ sqlplus hr/hr
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing
options
LAST_NAME
-------------------------
Abel
Ande
Atkinson
…
spfileorcl.ora spfile<SID>.ora
It is a binary file that can be written to and read by the database server and must not be edited manually.
initORCL.ora
The default name of this file (which is automatically sought at startup if an SPFILE is not found) is init<SID>.ora
10
Initialization Parameters: Examples:
Parameter Specifies
11
Changing Parameter Values: Examples
SQL> ALTER SESSION
SET NLS_DATE_FORMAT ='mon dd yyyy';
Session altered.
SYSDATE
-----------
jun 12 2007
System altered.
OPEN
STARTUP
MOUNT
NOMOUNT
Instance
started
SHUTDOWN
12
Startup Options: Examples
SQL> startup 1
Shutdown Modes
Shutdown Modes A I T N
Shutdown modes:
• A = ABORT
• I = IMMEDIATE
• T = TRANSACTIONAL
• N = NORMAL
13
Shutdown Options: Examples
SQL> shutdown
14
ESTRUCTURAS DE ALMACENAMIENTO
DICTIONARY=DICT, DICT_COLUMNS
Tables
Indexes
Views
Users
Schemas
Procedures
…and so on
15
Data Dictionary Views
The view prefixes indicate the data (and how much of that data) a given user can see.
The DBA_ views can be queried by users with the SYSDBA or SELECT ANY DICTIONARY privilege
ALL_ Everyone Everything that DBA_ views Includes user’s own objects
the user has
privileges to
see
USER_ Everyone Everything that ALL_ views Is usually the same as ALL_
the user owns except for the missing
OWNER column (Some views
have abbreviated names as
PUBLIC synonyms.)
d DESCRIBE dba_indexes;
16
Storage Structures
Logical Physical
Database
Segment
Extent
Oracle data
8 KB OS block
block
Columns Blocks
Table A Table B
Rows
Segment Segment
Table
Tablespace
17
Database Block: Contents
Block header
Growth
Free space
Row data
actual data for the rows in the block
18
Enlarging the Database
SYSTEM INVENTORY
tablespace tablespace
• SYSTEM • UNDOTBS1
• SYSAUX • USERS
• TEMP • EXAMPLE
19
Viewing Tablespace Contents
select Show Tablespace Contents from the Actions drop-down list and click Go
ADMINISTRACIÓN DE USUARIOS
20
Database User Accounts
21
Predefined Roles
Creating a User
Select Server > Users, and then click the Create button.
Oracle11gR2: DBA FUNDAMENTALS
1 - 48
22
Profiles and Users
23
Privileges
A privilege is a right to execute a particular type of SQL statement or to access another user’s object
HR_DBA
CONCURRENCIA
24
Manipulating Data by Using SQL .
1 row created.
1 row updated.
1 row deleted.
To finish a transaction:
• COMMIT makes the change permanent
• ROLLBACK undoes the change
SQL> COMMIT;
Commit complete.
25
DML Locks
Transaction 1 Transaction 2
SQL> UPDATE employees SQL> UPDATE employees
2 SET salary=salary*1.1 2 SET salary=salary*1.1
3 WHERE employee_id= 107; 3 WHERE employee_id= 106;
1 row updated. 1 row updated.
Enqueue Mechanism
Requests for locks are automatically queued
26
ENTORNO DE RED
Enterprise Listener
Manager
Database
Control Oracle databases
Oracle Net
configuration files
<oracle_home>/network/admin/listener.ora
sqlnet.ora
Oracle11gR2: DBA FUNDAMENTALS
1 - 66
27
Listener Control Utility Syntax
• Prompt syntax:
LSNRCTL> <command name>
LSNRCTL> start
LSNRCTL> status
DifferentsTools for
Configuring and
Managing
the Oracle Network
28
Testing Oracle Net Connectivity
It offers a quick test to verify that the network path to a destination is good.
User Sessions
If the CONNECT packet requests a valid service name, the listener spawns a new process to deal with the connection.
This new process is known as the server process
Server
process
User process
Listener
Oracle11gR2: DBA FUNDAMENTALS
1 - 71
29
SGA and PGA
The change in the SGA and PGA is transparent to the user; however,
if you are supporting multiple users, you need to increase the LARGE_POOL_SIZE initialization parameter.
Configuring Communication
Between Databases
A database link is a schema object in one database that enables you to
access objects on another database.
30
Connecting to Another Database
HQ = tnsnames.ora
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)
(HOST = edtdr8p1.us.oracle.com)
(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.us.oracle.com)
)
)
CREATE DATABASE LINK hq.oracle.com SQL*Plus
CONNECT TO HR IDENTIFIED BY HR
USING 'hq';
CONNECT hr/hr@hq
31
Categories of Failure
User Error
32
Understanding Instance Recovery:
Checkpoint (CKPT) Process
Control
files
CKPT
33
Tuning Instance Recovery
Transactions
34
Archive Log Files
Archiver (ARCn):
SGA
• Is an optional background
process
Redo log buffer
• Automatically archives online
redo log files when
ARCHIVELOG mode is set for LGWR
the database LogWriter
• Preserves the record of all
changes made to the database Copies of
Redo log Redo log
files files
ARCn
Archiver process
Oracle11gR2: DBA FUNDAMENTALS
1 - 97
35
Enabling ARCHIVELOG Mode
In ARCHIVELOG mode, recovery is possible until
the time of the last commit.
Resumen de Capítulos:
01 – Creación de una Base de Datos
02 – Gestión de la Instancia
03 – Estructuras de Almacenamiento
04 – Administración de Usuarios
05 – Concurrencia
06 – Entorno de Red
07 – Conceptos de Backup y Recuperación
36