Your SlideShare is downloading. ×
ASM
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

ASM

327
views

Published on

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
327
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
37
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Anar Godjaev ASM /*Init parameters of ASM instance*/ INSTANCE_TYPE -- must be ASM ASM_POWER_LIMIT -- [1-10] ASM_DISKSTRING ASM_DISKGROUPS Css should be up and running for synchronizing db instance and asm instance -- crsctl check cssd -- insufficient number of failure groups or disks running out of disk space select redundancy_lowered from v$asm_file; -- free_mb . required_mirror_free_mb = 2 * usable_file_mb select required_mirror_free_mb, usable_file_mb from v$asm_diskgroup; creating diskgroup -- disk names are available in v$asm_disk view -- set ORACLE_SID and ORACLE_HOME for asm instance sqlplus /nolog SQL> connect / as sysdba startup nomount; create diskgroup<disk_group_name>normal|high|external redundancy [force|noforce] [failgroup<failgroupname>] DISK •e<disk name>•' [NAME <diskname>], •e<disk name>•' [failgroup<failgroupname> DISK •e<disk name>•', •e<disk name>•'] alter diskgroup<disk_group_name> add disk •'disk_name•' NAME diska1, •'disk_name•' NAME diska2, •'disk_name[5678]•', •'disk_name*•' [FORCE] [REBALANCE POWER 5 WAIT|NOWAIT] alter diskgroup<disk_group_name> drop disk <disk_name>
  • 2. Anar Godjaev alter diskgroup<disk_group_name> resize disks [in failgroup <failgroupname> [size 100M]] alter diskgroup<disk_group_name> rebalance [WAIT|NOWAIT] [POWER n]; select * from v$asm_operation; alter diskgroup<disk_group_name>|ALL MOUNT | DISMOUNT; alter diskgroup<disk_group_name> check [REPAIR|NOREPAIR] all; drop diskgroup<disk_group_name> INCLUDING | EXCLUDING contents; alter diskgroup<disk_group_name> add directory •'+<disk_group_name>/<dir_name>/..•'; alter diskgroup<disk_group_name> rename directory •'<dir1>•' to •'<dir2>•'; alter diskgroup<disk_group_name> drop directory •'<dir_name>•'; alter diskgroup<disk_group_name> add alias •'..•' FOR •'..•'; select * from v$asm_alias; alterdiskgroup<disk_group_name> drop file „..‟; selectsoftware_version, compatible_version from v$asm_client; --fully qualified asm filename +group/dbname/file_type/file_type_tag.file.incarnation +dgroup2/sample/controlfile/Current.256.541956473 --numericasm filename +group.file.incarnation +dgroup2.257.541956473 --incomplete ASM filenames --asm creates the unique filename alter system set db_create_file_dest=‟+diskgroup1‟; --if you want asm to be default destination set the following init parameters DB_CREATE_FILE_DEST DB_CREATE_ONLINE_LOG_DEST_n DB_RECOVERY_FILE_DEST CONTROL_FILES LOG_ARCHIVE_DEST_n LOG_ARCHIVE_DEST STANDBY_ARCHIVE_DEST LARGE_POOL_SIZE – minimum 1mb -- Using an ASM Filename in a SQL Statement: Example CREATE TABLESPACE tspace2 DATAFILE '+dgroup2' SIZE 200M AUTOEXTEND ON;
  • 3. Anar Godjaev -- Creating a Database in ASM DB_CREATE_FILE_DEST = '+dgroup1' DB_RECOVERY_FILE_DEST = '+dgroup2' DB_RECOVERY_FILE_DEST_SIZE = 10G CREATE DATABASE sample; --Creating a Tablespace in ASM DB_CREATE_FILE_DEST = '+dgroup2' CREATE TABLESPACE tspace2; ‐‐the file is not an Oracle‐ managed file CREATE UNDO TABLESPACE myundo DATAFILE '+dgroup3(my_undo_template)/myfiles/my_undo_ts' SIZE 200M; ALTER DISKGROUP dgroup3 DROP FILE '+dgroup3/myfiles/my_undo_ts'; --Adding New Redo Log Files DB_CREATE_ONLINE_LOG_DEST_1 = '+dgroup1' DB_CREATE_ONLINE_LOG_DEST_2 = '+dgroup2' ALTER DATABASE ADD LOGFILE; --Creating a Control File in ASM --Noresetlogs example, script is from “alter database backup controlfile to trace” CREATE CONTROLFILE REUSE DATABASE "SAMPLE" NORESETLOGS ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 2 MAXDATAFILES 30 MAXINSTANCES 1 MAXLOGHISTORY 226 LOGFILE GROUP 1 ( '+DGROUP1/db/onlinelog/group_1.258.541956457', '+DGROUP2/db/onlinelog/group_1.256.541956473' ) SIZE 100M, GROUP 2 ( '+DGROUP1/db/onlinelog/group_2.257.541956477', '+DGROUP2/db/onlinelog/group_2.258.541956487' ) SIZE 100M DATAFILE '+DGROUP1/db/datafile/system.260.541956497', '+DGROUP1/db/datafile/sysaux.259.541956511' CHARACTER SET US7ASCII ; --resetlogs example CREATE CONTROLFILE REUSE DATABASE "SAMPLE" RESETLOGS ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 2 MAXDATAFILES 30
  • 4. Anar Godjaev MAXINSTANCES 1 MAXLOGHISTORY 226 LOGFILE GROUP 1 ( '+DGROUP1', '+DGROUP2' ) SIZE 100M, GROUP 2 ( '+DGROUP1', '+DGROUP2' ) SIZE 100M DATAFILE '+DGROUP1/db/datafile/system.260.541956497', '+DGROUP1/db/datafile/sysaux.259.541956511' CHARACTER SET US7ASCII ; --system views V$ASM_DISKGROUP V$ASM_DISK V$ASM_DISKGROUP_STAT V$ASM_DISK_STAT V$ASM_FILE V$ASM_TEMPLATE V$ASM_ALIAS V$ASM_OPERATION V$ASM_CLIENT