Documente Academic
Documente Profesional
Documente Cultură
Objectives
After completing this lesson, you should be able to: Describe the Oracle Database architecture Describe Automatic Storage Management (ASM) Set up initialization parameter files for ASM and database instances Start up and shut down ASM instances Administer ASM disk groups
1-2
1-3
User process
Data files
1-4
USER
SQL> Select
User
Session
Connection
1-5
User process
Server process
Processes
DBWn
CKPT
LGWR
SMON
Database
Storage structures
Data files
Control files
1-6
Server process 1
PGA
Server process 2
PGA
Background process
PGA
Shared SQL area Library cache Redo log buffer Database buffer cache Java pool Streams pool
SGA
Shared pool I/O Buffer Response queue Free memory Request queue
Large pool
1-7
Process Architecture
User process
Is started when a database user or a batch process connects to Oracle Database
Database processes
Server process: Connects to the Oracle instance and is started when a user establishes a session Background processes: Are started when an Oracle instance is started Instance
SGA Database buffer cache Shared pool Library cache Data dictionary cache
PGA
User process Server process DBWn
Background processes
CKPT LGWR SMON PMON ARCn Others
1-9
Process Structures
Server
Server
Server
Server
Server
Server n processes
SGA Database buffer cache Shared pool Redo log buffer Library cache Data dict. cache
SGA
CKPT
RECO
PMON
SMON
DBWn
LGWR
ARCn
Others
Control files
Data files
Parameter file
Backup files
Password file
1 - 12
Schema
Tablespace
Data file
Segment
Extent
OS block
1 - 14
Data file 1
Data file 2
USERS tablespace
1 - 16
1 - 17
Segment
Extents
Data blocks
Disk blocks
1 - 18
Process structures:
User process and server process Background processes: SMON, PMON, DBWn, CKPT, LGWR, ARCn, and so on
Storage structures:
Logical: Database, schema, tablespace, segment, extent, and Oracle block Physical: data files, control files, and redo log files
1 - 19
ASM
Operating system
1 - 20
DB instance SID=SALES
DBW0 ASMB FG RBAL
RBAL ARB0
ARBA
ASM disks
ASM disks
ASM disks
ASM disks
ASM disks
ASM disks
1 - 22
1 - 23
INSTANCE_TYPE = ASM DB_UNIQUE_NAME = +ASM ASM_POWER_LIMIT = 1 ASM_DISKSTRING = '/dev/rdsk/*s2', '/dev/rdsk/c1*' ASM_DISKGROUPS = dgroupA, dgroupB SPFILE = '$ORACLE_HOME/dbs/spfile+ASM.ora'
1 - 24
$ export ORACLE_SID='+ASM' $ sqlplus /nolog SQL> CONNECT / AS sysasm Connected to an idle instance. SQL> STARTUP; Total System Global Area 284565504 Fixed Size 1299428 Variable Size 258100252 ASM Cache 25165824 ASM diskgroups mounted
1 - 25
SYSASM Role
SYSASM role to manage ASM instances avoids overlap between DBAs and storage administrators
SQL> CONNECT / AS SYSASM SQL> CREATE USER ossysasmusername IDENTIFIED by passwd; SQL> GRANT SYSASM TO ossysasmusername; SQL> CONNECT ossysasmusername / passwd AS SYSASM; SQL> DROP USER ossysasmusername;
1 - 26
As SYSOPER
All operations
Disk group
Storage system
1 - 27
1 - 28
Database instance A 2
Database instance B
1 - 29
Database
Tablespace
ASM disk
Extent
Allocation unit
Oracle block
Physical block
1 - 30
ASM instance
Disk group
1 - 31
Failure Group
Controller 1
6 5 4 3 2 1 1 1 7 7 7 13 13 13
Controller 2
Controller 3
1 1 1
7 7 7
13 13 13
1 1 1
7 7 7
13 13 13
Failure group 1
Failure group 3
1 - 33
High redundancy:
Three-way mirroring At least three failure groups
1 - 34
DROP DISKGROUP
1 - 36
CREATE DISKGROUP dgroupA NORMAL REDUNDANCY FAILGROUP controller1 DISK '/devices/A1' NAME diskA1 SIZE 120G FORCE, '/devices/A2', '/devices/A3' FAILGROUP controller2 DISK '/devices/B1', '/devices/B2', '/devices/B3';
1 - 37
ALTER DISKGROUP dgroupA ADD '/dev/rdsk/c0t4d0s2' NAME '/dev/rdsk/c0t5d0s2' NAME '/dev/rdsk/c0t6d0s2' NAME '/dev/rdsk/c0t7d0s2' NAME
Disk formatting
1 - 38
DB instance
ASM instance
1 - 39
Description
Size of allocation units in the disk group Format of messages exchanged between DB and ASM Format of ASM metadata structures on disk Length of time before removing a disk once OFFLINE Redundancy of specified template Striping attribute of specified template
COARSE|FINE
C: CREATE A: ALTER
1 - 41
1 - 42
Secondary extent
Primary extent
1 - 43
1 - 44
1 - 45
ASMCMD Utility
SQL> CREATE TABLESPACE tbsasm DATAFILE '+DGROUP1' SIZE 100M; Tablespace created. SQL> CREATE TABLESPACE hrapps DATAFILE '+DGROUP1' SIZE 10M; Tablespace created.
$ export ORACLE_SID=+ASM $ asmcmd ASMCMD> ls -l DGROUP1/ORCL/DATAFILE Type Redund Striped Time DATAFILE MIRROR COARSE OCT 05 21:00:00 DATAFILE MIRROR COARSE OCT 05 21:00:00 ASMCMD>
Sys Y Y
1 - 46
ASMCMD Utility
User created directories Templates Disk group compatibility Disk group name Disk names and failure groups
md_backup
full
repair/remap
$ asmcmd help
md_restore
nodg
newdg
lsdsk
ASMCMD> md_backup b /tmp/dgbackup070222 g admdsk1 g asmdsk2 ASMCMD> md_restore t full g asmdsk1 i backup_file ASMCMD> lsdsk -k DATA *_0001
1 - 47
1 - 48
Summary
In this lesson, you should have learned how to: Describe the Oracle Database architecture Describe Automatic Storage Management (ASM) Set up initialization parameter files for ASM and database instances Start up and shut down ASM instances Administer ASM disk groups
1 - 50
1 - 51