storage concepten
hard drive with filesystem vs rav device
filesystem drive : Oracle datafiles worden in jet filesystem opgeslagen. Het OS is verantwoordelijk voor het managing en organizing vd files
raw device: de database is bypassing het OS and regelt zelf toegang tot de datafiles.
Raw devices performen beter aangezien de overhead minder is en er geen locking mechanismes zijn. Nadeel is de managebility. Kleinste entiteit is een disk partitie. Kan niet extended worden.En geen files is ook een nadeel
LVM
Om nadelen van disk partities op te lossen is er een extra laag ontstaan: de Logical Volume Manager.LVM flexibel mbt allocating space (resize, stripe combineren)
LVM kan raw of met filesystem
ASM
combinatie van filesystem en LVM.Asm functionaliteit wordt gepresenteeerd aan de Database door een dedicated ASM instance.
ASM instance: provides only metadata information about what disk groups are configured, what are member disks, how info is distributed and what files are stored in the groups
A db instance does not access data through ASM instance. It only queries asm instance abouw how and where data is located. Read and write operations are directly done by dbinstance on disks.
Communication tussen instances wordt gedaan door ASMB (asm bridge). Process in DB instance dat connect met ASM als foreground process.
ASM instance: master proces RBAL cordinates work and ARBn processes.
ASM schijven configureren
Normaliter gebeurt dit tijdens installatie Oracle Grid infrastructuur. Als je het later wil configureren dan niet via DBCA maar via ASMCA in the Oracle grid infrastructure HOME>>>>> $ORA_CRS/bin/asmca
Inloggen ASM instance
export ORACLE_HOME=$ORA_CRSexport ORACLE_SID=+ASM sqlplus / as sysasm
ASM views
The ASM configuration can be viewed using theV$ASM_%
views, which often contain different information depending on whether
they are queried from the ASM instance, or a dependant database
instance.| View | ASM Instance | DB Instance |
|---|---|---|
V$ASM_ALIAS |
Displays a row for each alias present in every disk group mounted by the ASM instance. | Returns no rows |
V$ASM_CLIENT |
Displays a row for each database instance using a disk group managed by the ASM instance. | Displays a row for the ASM instance if the database has open ASM files. |
V$ASM_DISK |
Displays a row for each disk discovered by the ASM instance, including disks which are not part of any disk group. | Displays a row for each disk in disk groups in use by the database instance. |
V$ASM_DISKGROUP |
Displays a row for each disk group discovered by the ASM instance. | Displays a row for each disk group mounted by the local ASM instance. |
V$ASM_FILE |
Displays a row for each file for each disk group mounted by the ASM instance. | Displays no rows. |
V$ASM_OPERATION |
Displays a row for each file for each long running operation executing in the ASM instance. | Displays no rows. |
V$ASM_TEMPLATE |
Displays a row for each template present in each disk group mounted by the ASM instance. | Displays a row for each template present in each disk group mounted by the ASM instance with which the database instance communicates. |
v$asm_alias
In v$asm_alias is informatie terug te vinden over de files welke in ASM zijn ondergebracht. Omdat meerdere databases op een server gebruik kunnen maken van ASM, worden de files gegroepeerd per database weergegeven (TST is naam van de test-database). Onder de kop DATAFILE worden alle datafiles weergegeven (system, sysaux, undotbs1 en users).ASM instance aanmaken met het handje
Ga naar CRS_HOMEKijk of cluster draait dmv crsctl chek has
Create a initialization parameter file initasm+.ora with the following parameters set.
Instance_type=+ASM
ASM_POWER_Limit =Value from 1 to 11
ASM_Diskstring = '/dev/sda*',
ASM_DISKGROUPS=dg1,dg2
INSTANCE_TYPE
Set to ASM or RDBMS depending on the instance type. The default is RDBMS.
DB_UNIQUE_NAME
- Specifies a globally unique name for the database. This defaults to +ASM but must be altered if you intend to run multiple ASM instances.
ASM_POWER_LIMIT
-The maximum power for a rebalancing operation on an ASM instance. The valid values range from 1 to 11, with 1 being the default. The higher the limit the more resources are allocated resulting in faster rebalancing operations. This value is also used as the default when the POWER clause is omitted from a rebalance operation.
ASM_DISKGROUPS
- The list of disk groups that should be mounted by an ASM instance during instance startup, or by the ALTER DISKGROUP ALL MOUNT statement. ASM configuration changes are automatically reflected in this parameter.
ASM_DISKSTRING - Specifies a value that can be used to limit the disks considered for discovery. Altering the default value may improve the speed of disk group mount time and the speed of adding a disk to a disk group. Changing the parameter to a value which prevents the discovery of already mounted disks results in an error. The default value is NULL allowing all suitable disks to be considered.
Incorrect usage of parameters in ASM or RDBMS instances result in ORA-15021 errors.
To create an ASM instance first create a file called "init+ASM.ora" in the "/tmp" directory containing the following information.
INSTANCE_TYPE=ASM
Next, using SQL*Plus connect to the ide instance.
export ORACLE_SID=+ASM
sqlplus / as sysdba
Create an spfile using the contents of the "init+ASM.ora" file.
SQL> CREATE SPFILE FROM PFILE='/tmp/init+ASM.ora';
File created.
Finally, start the instance with the NOMOUNT option.
SQL> startup nomount
ASM instance started
Total System Global Area 125829120 bytes
Fixed Size 1301456 bytes
Variable Size 124527664 bytes
Database Buffers 0 bytes
Redo Buffers 0 bytes
SQL>
The ASM instance is now ready to use for creating and mounting disk groups.
This step creates an ASM instance.ASM cache is the SGA component specific to ASM.It takes as little as 25MB- 30MB space.Total spce needed for an ASM instance is 100MB as it doesnt have any datafiles.
Check is ASM instance is up and running using :
ps -efgrep asm
Geen opmerkingen:
Een reactie posten