Download presentation
Presentation is loading. Please wait.
Published byRuth McKinney Modified over 8 years ago
1
14 Copyright © 2004, Oracle. All rights reserved. Automatic Storage Management
2
14-2 Copyright © 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to: Describe the concepts of Automatic Storage Management (ASM) Set up initialization parameter files for ASM and database instances Execute SQL commands with ASM file names Start up and shut down ASM instances Administer ASM disk groups Use RMAN to migrate your database to ASM
3
14-3 Copyright © 2004, Oracle. All rights reserved. What Is Automatic Storage Management? Portable and high performance cluster file system Manages Oracle database files Data is spread across disks to balance load Integrated mirroring across disks Solves many storage management challenges ASM File System Volume Manager Operating System Application Database
4
14-4 Copyright © 2004, Oracle. All rights reserved. ASM Key Features and Benefits Stripes files, not logical volumes Online disk reconfiguration and dynamic rebalancing Adjustable rebalancing speed Provide redundancy on a file basis ASM only supports Oracle database files Cluster aware Automatically installed
5
14-5 Copyright © 2004, Oracle. All rights reserved. ASM 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
6
14-6 Copyright © 2004, Oracle. All rights reserved. ASM General Architecture ASM Instance SID=ant ASM Instance SID=bee ASM Disks ASM Diskgroup TomASM Diskgroup DickASM Diskgroup Harry DB Instance SID= sales DB Instance SID=test DB Instance SID= sales DB Instance SID=test ASMB FG Node2Node1 Group Services tom=ant dick=ant harry=ant Group Services tom=bee dick=bee harry=bee DBW 0 ASMB RBAL ARB 0 ARB A … ARB 0 ARB A … ASMB RBAL
7
14-7 Copyright © 2004, Oracle. All rights reserved.
8
14-8 Copyright © 2004, Oracle. All rights reserved. ASM Instance Functionalities CREATE DISKGROUP ALTER DISKGROUPDROP DISKGROUP ALTER SYSTEM RESTRICTED SESSION ASM instance Database instance
9
14-9 Copyright © 2004, Oracle. All rights reserved. ASM Instance Creation
10
14-10 Copyright © 2004, Oracle. All rights reserved. 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 LARGE_POOL_SIZE = 8MB
11
14-11 Copyright © 2004, Oracle. All rights reserved. Accessing an ASM Instance Disk group Storage system AS SYSDBA AS SYSOPER ASM instance All operationsNondestructive operations
12
14-12 Copyright © 2004, Oracle. All rights reserved. Dynamic Performance View Additions Storage system V$ASM_DISKGROUP V$ASM_CLIENT V$ASM_DISK V$ASM_FILE V$ASM_TEMPLATE V$ASM_ALIAS V$ASM_OPERATION Disk group ADisk group B
13
14-13 Copyright © 2004, Oracle. All rights reserved.
14
14-14 Copyright © 2004, Oracle. All rights reserved. ASM Home Page
15
14-15 Copyright © 2004, Oracle. All rights reserved. ASM Performance Page
16
14-16 Copyright © 2004, Oracle. All rights reserved. ASM Configuration Page
17
14-17 Copyright © 2004, Oracle. All rights reserved. Starting Up an ASM Instance $ sqlplus /nolog SQL> CONNECT / AS sysdba Connected to an idle instance. SQL> STARTUP; ASM instance started Total System Global Area 147936196 bytes Fixed Size 324548 bytes Variable Size 96468992 bytes Database Buffers 50331648 bytes Redo Buffers 811008 bytes ASM diskgroups mounted
18
14-18 Copyright © 2004, Oracle. All rights reserved. Shutting Down an ASM Instance SHUTDOWN NORMAL ASM Instance Database Instance ADatabase Instance B 11 2 3
19
14-19 Copyright © 2004, Oracle. All rights reserved. ASM Disk Groups 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 based on file type Administer disk groups not files Disk Group ASM Instance
20
14-20 Copyright © 2004, Oracle. All rights reserved. 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
21
14-21 Copyright © 2004, Oracle. All rights reserved. Disk Group Mirroring Mirror at extent level Mix primary and mirror extents 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
22
14-22 Copyright © 2004, Oracle. All rights reserved. Disk Group Dynamic Rebalancing Automatic online rebalance whenever storage configuration changes Only move data proportional to storage added No need for manual I/O tuning Online migration to new storage
23
14-23 Copyright © 2004, Oracle. All rights reserved. ASM Administration Page
24
14-24 Copyright © 2004, Oracle. All rights reserved. Create Disk Group Page
25
14-25 Copyright © 2004, Oracle. All rights reserved. Create or Delete 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;
26
14-26 Copyright © 2004, Oracle. All rights reserved. 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
27
14-27 Copyright © 2004, Oracle. All rights reserved. Miscellaneous Alter Commands ALTER DISKGROUP dgroupA DROP DISK A5; ALTER DISKGROUP dgroupA DROP DISK A6 ADD FAILGROUP fred DISK '/dev/rdsk/c0t8d0s2' NAME A9; ALTER DISKGROUP dgroupB REBALANCE POWER 5; ALTER DISKGROUP dgroupA UNDROP DISKS; ALTER DISKGROUP dgroupA DISMOUNT; ALTER DISKGROUP dgroupA CHECK ALL;
28
14-28 Copyright © 2004, Oracle. All rights reserved. Notes only slide
29
14-29 Copyright © 2004, Oracle. All rights reserved. Monitoring Long-Running Operations Using V$ASM_OPERATION ColumnDescription GROUP_NUMBER Disk group OPERATION Type of operation: REBAL STATE State of operation: QUEUED or RUNNING POWER Power requested for this operation ACTUAL Power allocated to this operation SOFAR Number of allocation units moved so far EST_WORK Estimated number of remaining allocation units EST_RATE Estimated number of allocation units moved per minute EST_MINUTES Estimated amount of time (in minutes) for operation termination
30
14-30 Copyright © 2004, Oracle. All rights reserved. ASM Files Database File ASM File automatically spread inside Disk Group dgroupA CREATE TABLESPACE sample DATAFILE '+dgroupA'; 1 2 3 4 1 2 3 4 Automatic ASM file Creation RMAN
31
14-31 Copyright © 2004, Oracle. All rights reserved. ASM Filenames ASM Filename Fully- qualified Incomplete with template NumericAlias Alias with template Incomplete Reference Single-file Creation Multiple-file Creation
32
14-32 Copyright © 2004, Oracle. All rights reserved. ASM File Name Syntax 1. 2. 3. 4. 5. 6. + / / /.. +.. + / /…/ / + + ( ) + / /…/ / ( )
33
14-33 Copyright © 2004, Oracle. All rights reserved. Notes only slide
34
14-34 Copyright © 2004, Oracle. All rights reserved. ASM File Name Mapping Oracle File Type Def Template Control filescontrolfileCF/BCFCONTROLFILE Data filesdatafile _ DATAFILE Online logsonline_loglog_ ONLINELOG Archive logsarchive_logparameterARCHIVELOG Temp filestemp _ TEMPFILE Data file backup piecesbackupsetClient SpecifiedBACKUPSET Data file incremental backup pieces backupsetClient SpecifiedBACKUPSET Arch log backup piecebackupsetClient SpecifiedBACKUPSET Data file copydatafile _ DATAFILE Initialization parametersinitspfilePARAMETERFILE Broker configurationsdrc DATAGUARDCONFIG Flashback logsrlog _ FLASHBACK Change tracking bitmapsCTBBITMAPCHANGETRACKING Auto backupAutoBackupClient SpecifiedAUTOBACKUP Data Pump dump setDumpsetdumpDUMPSET Cross-platform converted data files XTRANSPORT
35
14-35 Copyright © 2004, Oracle. All rights reserved. ASM File Templates System TemplateStripedExternalNormalHigh CONTROLFILEfineunprotected2-way mirror3-way mirror DATAFILEcoarseunprotected2-way mirror3-way mirror ONLINELOGfineunprotected2-way mirror3-way mirror ARCHIVELOGcoarseunprotected2-way mirror3-way mirror TEMPFILEcoarseunprotected2-way mirror3-way mirror BACKUPSETcoarseunprotected2-way mirror3-way mirror XTRANSPORTcoarseunprotected2-way mirror3-way mirror PARAMETERFILEcoarseunprotected2-way mirror3-way mirror DATAGUARDCONFIGcoarseunprotected2-way mirror3-way mirror FLASHBACKfineunprotected2-way mirror3-way mirror CHANGETRACKINGcoarseunprotected2-way mirror3-way mirror AUTOBACKUPcoarseunprotected2-way mirror3-way mirror DUMPSETcoarseunprotected2-way mirror3-way mirror UnprotectedUnprotected 2-wayMirror2-wayMirror 3-wayMirror3-wayMirror
36
14-36 Copyright © 2004, Oracle. All rights reserved. ALTER DISKGROUP dgroupA ADD TEMPLATE reliable ATTRIBUTES (MIRROR); ALTER DISKGROUP dgroupA DROP TEMPLATE reliable; ALTER DISKGROUP dgroupA DROP FILE '+dgroupA.268.8675309'; ALTER DISKGROUP dgroupA ADD DIRECTORY '+dgroupA/mydir'; ALTER DISKGROUP dgroupA ADD ALIAS '+dgroupA/mydir/datafile.dbf' FOR '+dgroupA.274.38745'; ALTER DISKGROUP dgroupA DROP ALIAS '+dgroupA/mydir/datafile.dbf'; Template and Alias Examples
37
14-37 Copyright © 2004, Oracle. All rights reserved. Retrieving Aliases SELECT reference_index INTO :alias_id FROM V$ASM_ALIAS WHERE name = '+dgroupA'; SELECT reference_index INTO :alias_id FROM V$ASM_ALIAS WHERE parent_index = :alias_id AND name = 'mydir'; SELECT name FROM V$ASM_ALIAS WHERE parent_index = :alias_id;
38
14-38 Copyright © 2004, Oracle. All rights reserved. SQL Commands and File Naming CREATE CONTROLFILE DATABASE sample RESETLOGS ARCHIVELOG MAXLOGFILES 5 MAXLOGHISTORY 100 MAXDATAFILES 10 MAXINSTANCES 2 LOGFILE GROUP 1 ('+dgroupA','+dgroupB') SIZE 100M, GROUP 2 ('+dgroupA','+dgroupB') SIZE 100M DATAFILE '+dgroupA.261.12345678' SIZE 100M DATAFILE '+dgroupA.262.87654321' SIZE 100M;
39
14-39 Copyright © 2004, Oracle. All rights reserved. DBCA and Storage Options
40
14-40 Copyright © 2004, Oracle. All rights reserved. Database Instance Parameter Changes … INSTANCE_TYPE = RDBMS LOG_ARCHIVE_FORMAT DB_BLOCK_SIZE DB_CREATE_ONLINE_LOG_DEST_n DB_CREATE_FILE_DEST DB_RECOVERY_FILE_DEST CONTROL_FILES LOG_ARCHIVE_DEST_n LOG_ARCHIVE_DEST STANDBY_ARCHIVE_DEST LARGE_POOL_SIZE = 8MB …
41
14-41 Copyright © 2004, Oracle. All rights reserved. Migrating Your Database to ASM Storage 1.Shut down your database cleanly 2.Shutdown the database and modify your server parameter file to use Oracle Managed Files (OMF) 3.Edit and execute the following RMAN script: STARTUP NOMOUNT; RESTORE CONTROLFILE FROM '/u1/c1.ctl'; ALTER DATABASE MOUNT; BACKUP AS COPY DATABASE FORMAT '+dgroup1'; SWITCH DATABASE TO COPY; SQL "ALTER DATABASE RENAME '/u1/log1' TO '+dgroup1' "; # Repeat RENAME command for all online redo log members... ALTER DATABASE OPEN RESETLOGS; SQL "ALTER DATABASE TEMPFILE '/u1/temp1' DROP";
42
14-42 Copyright © 2004, Oracle. All rights reserved. Summary In this lesson, you should have learned how to: Describe the concepts of Automatic Storage Management (ASM) Set up initialization parameter files for ASM and database instances Execute SQL commands with ASM file names Start up and shut down ASM instances Administer ASM disk groups Use RMAN to migrate your database to ASM
43
14-43 Copyright © 2004, Oracle. All rights reserved. Practice 14 Overview: Using ASM This practice covers the following topics: Creating an ASM instance Creating tablespaces that use ASM storage Viewing ASM information Migrating a tablespace to use ASM storage
44
14-44 Copyright © 2004, Oracle. All rights reserved.
45
14-45 Copyright © 2004, Oracle. All rights reserved.
46
14-46 Copyright © 2004, Oracle. All rights reserved.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.