iSelfSchooling.com - Copyright © 1999-2009  References  |  Job Openings  | Login (Staff | Members)
    Home  | Search more...  | Community of Sharing Knowledge (with FREE Online Video Training)
    Oracle Syntax  | Suggestions  | Private Tutoring  | Member Collaboration  | Get Translations...

  Copyright & User Agreement

    Email2aFriend  | Homepage us! |  Bookmark

Services

 Vision/Mission

 Services

 Biography

 Contact Us

 

 FREE Training

 SQL

 PL/SQL

 Forms 

 Reports

 Other TOOLS

 Fundamentals

 Performance

 OEM

 Application Server

 Grid Control

 Articles

 Prepare for OCP

 

More to know...

Acknowledgement___

 Who is who

 University Directory

 Links...

 

 

 

 

FREE Online Oracle Training for beginners and advanced - The most comprehensive Oracle tutorial

The authors do not guarantee or take any responsibility for the accuracy, or completeness of the information.

BASICS

SQL | PL/SQL

DEVELOPERS

FORMS 2 | REPORTS | Other TOOLS

DBAs

FUNDAMENTALS 2 | PERFORMANCE | OEM

ADVANCE

APPLICATION SERVER | GRID CONTROL | ARTICLES 2 3 4

Advanced - Articles I

Lesson 01 | Lesson 02 | Lesson 03 | Lesson 04 | Lesson 05 | Lesson 06 | Lesson 07 | Lesson 08 | Lesson 09 | Lesson 10 | Lesson 11 | Lesson 12 | Lesson 13 | Lesson 14 | Lesson 15 | Lesson 16 | Lesson 17 | Lesson 18 | Lesson 19 | Lesson 20 | Lesson 21 | Lesson 22 | Lesson 23 | Lesson 24 | Lesson 25 | Lesson 26 | Lesson 27 | Lesson 28 | Lesson 29 | Lesson 30 | Lesson 31 | Lesson 32 | Lesson 33 | Lesson 34 | Lesson 35 |

Lesson 14

‘Non-violence is the greatest force at the disposal of mankind. It is mightier than the mightiest weapon of destruction devised by the ingenuity of man.’ Gandhi

Automatic Storage Management (ASM) in the Oracle 10g database

Introduction

ASM provides a vertical integration of the file system and the volume manager that is specifically built for Oracle database files. Its key features and benefits are:

· Stripes files rather than logical volumes

· Online disk reconfiguration and dynamic rebalancing

· Adjustable rebalancing speed

· Provides redundancy on a file basis

· Supports only Oracle database files

· Custer-aware

· Automatically installed

ASM instance do not have a data dictionary and it is restricted to few SQL commands and Dynamic Performance view. The following are some example of SQL commands.

Commands:

SQL> STARTUP/SHUTDOWN

SQL> ALTER DISKGROUP MOUNT/DISMOUNT

SQL> ALTER DISKGROUP ONLINE/OFFLINE DISK

SQL> ALTER DISKGROUP REBALANCE

SQL> ALTER DISKGROUP CHECK

…

Views:

V$ASM_TEMPLATE

V$ASM_DISKGROUP

V$ASM_CLIENT

V$ASM_FILE

V$ASM_ALIAS

V$ASM_DISK

V$ASM_OPERATION

…

Hands-On #1-Creating and deleting disk groups

The following are examples of creating and deleting disk groups.

Creating a disk-group:

SQL> CREATE DISKGROUP dgora1 NORMAL REDUNDANCY

FAILGROUP controller1 DISK

‘/dev/rdsk/c0t0d0s2’ NAME mydisk SIZE 200G FORCE,

‘/dev/rdsk/c0t1d0s2’,

‘/dev/rdsk/c0t2d0s2’

FAILGROUP controller2 DISK

‘/dev/rdsk/c1t0d0s2’,

‘/dev/rdsk/c1t1d0s2’,

‘/dev/rdsk/c1t2d0s2’;

Dropping a diskgroup:

SQL> DROP DISKGROUP dgora1 INCLUDING CONTENTS;

 

Hands-On #2-Adding and removing disks

The following are examples of how to add disks to an existing disk group.

SQL> ALTER DISKGROUP dgora1

ADD FAILGROUP controller1

‘/dev/rdsk/c0t3d0s2’ NAME a5;

To remove a disk:

SQL> ALTER DISKGROUP dgora1 DROP DISK a5;

To undo the removed disk do the following SQL statement. This only works if the status of drop is pending or the drop function was not completed yet.

SQL> ALTER DISKGROUP dgora1 UNDROP DISKS;

 

Hands-On # 3-Starting ASM and Displaying diskgroups

Assuming you started your ASM instance.

$ ORACLE_SID=+ASM; export ORACLE_SID

$ sqlplus /nolog

SQL> CONNECT / AS SYSDBA

SQL> STARTUP

Display a list of your diskgroups.

SQL> SELECT name FROM v$asm_diskgroup;

Display a list of associated ASM disks.

SQL> COL name FORMAT a20

SQL> COL failgroup FORMAT a20

SQL> SELECT name, failgroup, bytes_read, bytes_written

FROM v$asm_disk

/

Display a list of associated ASM files.

SQL> SELECT group_number, file_number, bytes, type, striped

FROM v$asm_file

/

Open another session with different instance:

$ ORACLE_SID=school; export ORACLE_SID

$ $ sqlplus /nolog

SQL> CONNECT / AS SYSDBA

Display a list of all your datafiles.

SQL> COL file_name FORMAT a40

SQL> SELECT file_name, tablespace_name

FROM dba_data_files

/

 

Hands-On # 4-Using the ASM diskgroup

Create a tablespace that is stored in the ASM disk group dgora1.

SQL> CREATE TABLESPACE mytablespace2

DATAFILE ‘+dgora1’ SIZE 100m

/

Display a list of all your datafiles. What do see?

SQL> COL file_name FORMAT a40

SQL> SELECT file_name, tablespace_name

FROM dba_data_files

/

Now, you should have one more line.

Go back on your ASM instance and display a list of associated ASM files.

SQL> SELECT group_number, file_number, bytes, type, striped

FROM v$asm_file

/

The result should be different from before. You added one more datafile to it.

Add one addition disk to your system.

SQL> HOST dd if=/dev/zero of=/u02/oradata/school/diska abs=1024k count=200

SQL> SELECT name, failgroup, bytes_read, bytes_written

FROM v$asm_disk

/

SQL> ALTER DISKGROUP dgora1

ADD DISK ‘/u02/oradata/school/diska’

/

Execute the following query until you get ‘no rows selected.’

SQL> SELECT operation, est_minutes

FROM v$asm_operation

/

Again, display a list of associated ASM disks.

SQL> SELECT name, failgroup, bytes_read, bytes_written

FROM v$asm_disk

/

Now, you should see one more disk was added to disk group.

 

 

 

“We must learn to live together as brothers or perish together as fools.” Martin Luther King Jr.

Questions:

Questions on

Automatic Storage Management (ASM) in the Oracle 10g database

Q: What does ASM provide?

Q: What are its key features and benefits?

Q: Does ASM have a data dictionary?

Q: How do you create a disk group by using ASM?

Q: How do you delete a disk group by using ASM?

Q: How do you add a disk to an existing disk group?

Q: How do you remove a disk to an existing disk group?

Q: Can you undo the removed disk? How?

Q: How do you display a list of your diskgroups?

Q: How do you display a list of associated ASM disks?

Q: How do you display a list of associated ASM files?

Q: How do you create a tablespace that uses an ASM disk group?

Q: How do you add one addition disk to your system?

 

 

 
 
Google
 
Web web site