Download presentation
Presentation is loading. Please wait.
Published byTristan Searing Modified over 9 years ago
1
1 Copyright © 2008, Oracle. All rights reserved. Database Architecture and ASM
2
Copyright © 2008, Oracle. All rights reserved. 1 - 2 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
3
Copyright © 2008, Oracle. All rights reserved. 1 - 3 The Oracle Database The Oracle Relational Database Management System (RDBMS) is a database management system that provides an open, comprehensive, integrated approach to information management.
4
Copyright © 2008, Oracle. All rights reserved. 1 - 4 Database Data files Online redo log files Control files Oracle Database Architecture: Overview Database buffer cache Shared pool Data dictionary cache Library cache PMONSMON Others Server process PGA Archived log files User process Instance ARCn SGA DBWn Redo log buffer LGWRCKPT
5
Copyright © 2008, Oracle. All rights reserved. 1 - 5 Connecting to the Database Connection: Communication between a user process and an instance Session: Specific connection of a user to an instance through a user process SQL> Select … Session Connection USER User
6
Copyright © 2008, Oracle. All rights reserved. 1 - 6 Database Oracle Database Server Structures PMONSMONOthers Data files Online redo log files Control files Instance ARCn DBWn LGWRCKPT Storage structures User process Server process Memory structures Processes Database buffer cache Shared pool Data dict. cache Library cache SGA Redo log buffer
7
Copyright © 2008, Oracle. All rights reserved. 1 - 7 Oracle Memory Architecture SGA Database buffer cache Redo log buffer Java pool Streams pool Shared pool Large pool PGA Background process Server process 1 Server process 2 Shared SQL area Library cache Data Dictionary cache Other I/O Buffer Response queue Request queue Free memory
8
Copyright © 2008, Oracle. All rights reserved. 1 - 8 Oracle Memory Architecture Full Notes Page
9
Copyright © 2008, Oracle. All rights reserved. 1 - 9 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 PMONSMONOthers Instance ARCn DBWn LGWRCKPT PGA User process Server process Background processes Database buffer cache Shared pool Data dictionary cache Library cache SGA Redo log buffer
10
Copyright © 2008, Oracle. All rights reserved. 1 - 10 Process Structures …Server n processes SGA …Oracle background processes PMONSMON Others RECOARCn DBWn LGWRCKPT Server Database buffer cache Shared pool Data dict. cache Library cache SGA Redo log buffer
11
Copyright © 2008, Oracle. All rights reserved. 1 - 11 Process Structures Full Notes Page
12
Copyright © 2008, Oracle. All rights reserved. 1 - 12 Database Storage Architecture Online redo log files Password file Parameter fileArchived redo log files Control files Data files Alert log and trace files Backup files
13
Copyright © 2008, Oracle. All rights reserved. 1 - 13 Database Storage Architecture Full Notes Page
14
Copyright © 2008, Oracle. All rights reserved. 1 - 14 Logical and Physical Database Structures Database LogicalPhysical Tablespace Data file OS block Segment Extent Oracle data block Schema
15
Copyright © 2008, Oracle. All rights reserved. 1 - 15 Database Structures Full Notes Page
16
Copyright © 2008, Oracle. All rights reserved. 1 - 16 Tablespaces and Data Files Tablespaces consist of one or more data files. Data files belong to only one tablespace. USERS tablespace Data file 1 Data file 2
17
Copyright © 2008, Oracle. All rights reserved. 1 - 17 SYSTEM and SYSAUX Tablespaces The SYSTEM and SYSAUX tablespaces are mandatory tablespaces. They are created at the time of database creation. The SYSTEM tablespace is used for core functionality (for example, data dictionary tables). The auxiliary SYSAUX tablespace is used for additional database components (such as the Enterprise Manager Repository).
18
Copyright © 2008, Oracle. All rights reserved. 1 - 18 Segments, Extents, and Blocks Segments exist within a tablespace. Segments are made up of a collection of extents. Extents are a collection of data blocks. Data blocks are mapped to disk blocks. SegmentExtentsData blocks Disk blocks
19
Copyright © 2008, Oracle. All rights reserved. 1 - 19 Database Architecture: Summary of Structural Components Memory structures: –System Global Area (SGA): Database buffer cache, redo buffer, and various pools –Program Global Area (PGA) 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
20
Copyright © 2008, Oracle. All rights reserved. 1 - 20 Automatic Storage Management: Review Portable and high-performance cluster file system Manages Oracle database files Data spread across disks to balance load Integrated mirroring across disks Solves many storage management challenges ASM File system Volume manager Operating system Application Database
21
Copyright © 2008, Oracle. All rights reserved. 1 - 21 Automatic Storage Management: Review Full Notes Page
22
Copyright © 2008, Oracle. All rights reserved. 1 - 22 ASM: General Architecture ASM instance SID=+ASM ASM disks ASM disk group 1 DB instance SID= SALES ASMB RBAL ARB 0 ARB A … ASM disks ASM disk group 2 ASM disks DBW 0 RBAL FG GMON
23
Copyright © 2008, Oracle. All rights reserved. 1 - 23 Creating an ASM Instance
24
Copyright © 2008, Oracle. All rights reserved. 1 - 24 ASM Instance Initialization Parameters 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'
25
Copyright © 2008, Oracle. All rights reserved. 1 - 25 Starting Up an ASM Instance $ export ORACLE_SID='+ASM' $ sqlplus /nolog SQL> CONNECT / AS sysasm Connected to an idle instance. SQL> STARTUP; Total System Global Area 284565504 bytes Fixed Size 1299428 bytes Variable Size 258100252 bytes ASM Cache 25165824 bytes ASM diskgroups mounted
26
Copyright © 2008, Oracle. All rights reserved. 1 - 26 SYSASM Role SYSASM role to manage ASM instances avoids overlap between DBAs and storage administrators For ASM instances, SYSDBA will be deprecated in the future: –Oracle Database 11g Release 1 behaves as in 10g –In future releases SYSDBA privileges restricted in ASM instances SQL> CONNECT / AS SYSASM SQL> CREATE USER ossysasmusername IDENTIFIED by passwd; SQL> GRANT SYSASM TO ossysasmusername; SQL> DROP USER ossysasmusername; SQL> CONNECT ossysasmusername / passwd AS SYSASM;
27
Copyright © 2008, Oracle. All rights reserved. 1 - 27 Accessing an ASM Instance Disk group Storage system As SYSASM or SYSDBA As SYSOPER ASM instance All operationsLimited operations
28
Copyright © 2008, Oracle. All rights reserved. 1 - 28 Using Enterprise Manager to Manage ASM Users
29
Copyright © 2008, Oracle. All rights reserved. 1 - 29 Shutting Down an ASM Instance SHUTDOWN NORMAL ASM instance Database instance ADatabase instance B 11 2 3
30
Copyright © 2008, Oracle. All rights reserved. 1 - 30 ASM Storage: Concepts Database Tablespace Segment Extent Oracle block Data file Physical block ASM disk group ASM disk ASM file Allocation unit File-system file or raw device
31
Copyright © 2008, Oracle. All rights reserved. 1 - 31 ASM Disk Group Is a pool of disks managed as a logical unit Partitions total disk space into uniform sized units Spreads each file evenly across all disks Uses coarse- or fine-grain striping on the basis of file type Administers disk groups, not files Disk group ASM instance
32
Copyright © 2008, Oracle. All rights reserved. 1 - 32 ASM Disk Group Full Notes Page
33
Copyright © 2008, Oracle. All rights reserved. 1 - 33 Failure Group Controller 1Controller 2 Failure group 1Failure group 2 Disk group A Controller 3 Failure group 3 1713 17 17 17 17 17 17 17 17 2 3 4 5 6
34
Copyright © 2008, Oracle. All rights reserved. 1 - 34 Disk Group Mirroring Mirror at extent level Mix primary and mirror AUs on each disk External redundancy: Defers to hardware mirroring Normal redundancy: –Two-way mirroring –At least two failure groups High redundancy: –Three-way mirroring –At least three failure groups
35
Copyright © 2008, Oracle. All rights reserved. 1 - 35 Disk Group Dynamic Rebalancing Automatic online rebalance whenever storage configuration changes Moving only the amount of data that is proportional to the storage added No need for manual I/O tuning Online migration to new storage Configurable load on system using ASM_POWER_LIMIT
36
Copyright © 2008, Oracle. All rights reserved. 1 - 36 Managing Disk Groups CREATE DISKGROUP ALTER DISKGROUP DROP DISKGROUP ASM instance Database instance
37
Copyright © 2008, Oracle. All rights reserved. 1 - 37 Creating and Dropping Disk Groups 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'; DROP DISKGROUP dgroupA INCLUDING CONTENTS;
38
Copyright © 2008, Oracle. All rights reserved. 1 - 38 Adding Disks to Disk Groups ALTER DISKGROUP dgroupA ADD DISK '/dev/rdsk/c0t4d0s2' NAME A5, '/dev/rdsk/c0t5d0s2' NAME A6, '/dev/rdsk/c0t6d0s2' NAME A7, '/dev/rdsk/c0t7d0s2' NAME A8; ALTER DISKGROUP dgroupA ADD DISK '/devices/A*'; Disk formatting Disk group rebalancing
39
Copyright © 2008, Oracle. All rights reserved. 1 - 39 ASM Disk Group Compatibility Compatibility of each disk group is separately controllable: –ASM compatibility controls ASM metadata on-disk structure –RDBMS compatibility controls minimum consumer client level –Useful with heterogeneous environments Setting disk group compatibility is irreversible. DB instance COMPATIBLE.RDBMS COMPATIBLE ASM disk group >= <= COMPATIBLE.ASM ASM instance <= COMPATIBLE
40
Copyright © 2008, Oracle. All rights reserved. 1 - 40 ASM Disk Group Compatibility Full Notes Page
41
Copyright © 2008, Oracle. All rights reserved. 1 - 41 ASM Disk Group Attributes NamePropertyValuesDescription au_sizeC 1 | 2 | 4 | 8 | 16 | 32 | 64MB Size of allocation units in the disk group compatible.rdbmsAC Valid database versionFormat of messages exchanged between DB and ASM compatible.asmAC Valid ASM instance versionFormat of ASM metadata structures on disk disk_repair_timeAC 0 M to 2 32 DLength of time before removing a disk once OFFLINE template. tname. redundancy A UNPROTECT | MIRROR | HIGH Redundancy of specified template template. tname. stripe A COARSE | FINE Striping attribute of specified template CREATE DISKGROUP DATA NORMAL REDUNDANCY DISK '/dev/raw/raw1','/dev/raw/raw2' ATTRIBUTE 'compatible.asm'='11.1'; C: CREATE A: ALTER
42
Copyright © 2008, Oracle. All rights reserved. 1 - 42 Using Enterprise Manager to Edit Disk Group Attributes
43
Copyright © 2008, Oracle. All rights reserved. 1 - 43 ASM Fast Mirror Resync Overview Disk access failure Failure time < DISK_REPAIR_TIME ASM redundancy is used Disk again accessible: Only need to resync modified extents 1 2 3 4 Oracle Database 11 g Primary extent Secondary extent
44
Copyright © 2008, Oracle. All rights reserved. 1 - 44 Using EM to Perform Fast Mirror Resync
45
Copyright © 2008, Oracle. All rights reserved. 1 - 45 Miscellaneous ALTER Commands Remove a disk from dgroupA : Add and drop a disk in a single command: Cancel a disk drop operation: ALTER DISKGROUP dgroupA DROP DISK A5; ALTER DISKGROUP dgroupA DROP DISK A6 ADD FAILGROUP fred DISK '/dev/rdsk/c0t8d0s2' NAME A9; ALTER DISKGROUP dgroupA UNDROP DISKS;
46
Copyright © 2008, Oracle. All rights reserved. 1 - 46 ASMCMD Utility $ export ORACLE_SID=+ASM $ asmcmd ASMCMD> ls -l DGROUP1/ORCL/DATAFILE Type Redund Striped Time Sys Name DATAFILE MIRROR COARSE OCT 05 21:00:00 Y HRAPPS.257.570923611 DATAFILE MIRROR COARSE OCT 05 21:00:00 Y TBSASM.256.570922917 ASMCMD> SQL> CREATE TABLESPACE tbsasm DATAFILE '+DGROUP1' SIZE 100M; Tablespace created. SQL> CREATE TABLESPACE hrapps DATAFILE '+DGROUP1' SIZE 10M; Tablespace created.
47
Copyright © 2008, Oracle. All rights reserved. 1 - 47 ASMCMD Utility $ asmcmd help md_backupmd_restorelsdsk full nodg newdg User created directories Templates Disk group compatibility Disk group name Disk names and failure groups 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 repair/remap
48
Copyright © 2008, Oracle. All rights reserved. 1 - 48 ASM Scalability and Performance Extent size grows automatically according to file size. ASM support variable extents size to: –Raise maximum possible file size –Reduce memory utilization in shared pool ASM imposes the following limits: –63 disk groups in a storage system –10,000 ASM disks in a storage system –4 petabyte maximum storage for each ASM disk –40 exabyte maximum storage for each storage system –1 million files for each disk group
49
Copyright © 2008, Oracle. All rights reserved. 1 - 49 ASM Scalability and Performance Full Notes Page
50
Copyright © 2008, Oracle. All rights reserved. 1 - 50 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
51
Copyright © 2008, Oracle. All rights reserved. 1 - 51 Practice 1 Overview: Database Architecture and ASM This practice covers the following topics: Creating and starting an ASM instance Creating and using ASM disk groups Managing an ASM instance Dynamic disk group rebalancing
52
Copyright © 2008, Oracle. All rights reserved. 1 - 52
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.