Supporting 4K Sector Disks [Video] (Doc ID 1133713.1)
Click to add to Favorites Supporting 4K Sector Disks [Video] (Doc ID 1133713.1) To BottomTo Bottom
Modified:Jun 3, 2013Type:BULLETIN
Rate this document Email link to this document Open document in new window Printable Page
In this Document
Purpose
Scope
Details
Supporting 4Kb Sector Disks
Datafile Support of 4kb Sector Disks
ASM and 4kb Sector Disks
Redo Logs and 4kb Sector Disks
Offline Migration to 4Kb Sector Disks
References
Applies to:
Oracle Database - Enterprise Edition - Version 11.2.0.1.0 to 11.2.0.2 [Release 11.2]
Information in this document applies to any platform.
Purpose
The purpose of this document is to introduce Oracle DBAs to Oracle's support of 4Kb sector disks, to outline the extent of the support and to illustrate the steps that need to be followed to make use of this support.
Scope
This document is intended for DBAs
Details
Supporting 4Kb Sector Disks
Video - Oracle's Support of 4k Sector Size Disks (08:15) [Trouble seeing this video?]
The disk drive industry has been considering a move to using larger sector disks for some time, to allow for higher storage capacity, improve data integrity and allow faster drive performance. The default, for many years, has been a sector size of 512 bytes but now some 4kb sector disks are beginning to appear on the market.
The Oracle database accesses the hard disk via a platform specific device driver and DBWR, LGWR and the ASM processes can write directly to disk without going through the operating system. From 11.2 onwards the RDBMS is aware of 4kb sector disks and will align with them without performance being affected.
There are two types of 4kb sector disk available: emulation mode and native mode.
Emulation mode has 512 byte logical sectors over the 4kb physical sector to allow applications which are not 4kb sector aware to work successfully.
However applications can see performance degradation with emulation mode if they are not 4kb sector aware as additional steps need to be performed if the write does not align with the 4kb sector boundary. Oracle in 11.2 is 4kb sector aware so will avoid this performance degradation.
Native mode has 4kb logical sectors aligned with 4kb physical sectors. Only applications such as Oracle RDBMS 11.2, which are 4kb sector aware, can work with native mode 4kb sector disks.
Datafile Support of 4kb Sector Disks
Standard filesystem datafiles can take advantage of 4kb sector disks by using a blocksize of 4kb, or a multiple of 4kb. This can either be the default database block size, specified by db_block_size in the intialization file, or specified for an individual tablespace when it is created. Please note, however, that, on Linux, this only applies when the initialization parameter filesystemio_options=none or asynch; direct I/O is not currently supported on Linux against 4kb sector disks. This means that you may have issues if filesystemio_options is set to 'DIRECTIO' or 'SETALL'. It is not yet known in which version this support will be available.
ASM and 4kb Sector Disks
When you create a diskgroup in Oracle ASM from 11.2 onwards you can use the SECTOR_SIZE diskgroup attribute.
CREATE DISKGROUP data NORMAL REDUNDANCY
FAILGROUP controller1 DISK '/devices/diska1', '/devices/diska2', '/devices/diska3', '/devices/diska4' FAILGROUP controller2 DISK '/devices/diskb1', '/devices/diskb2', '/devices/diskb3', '/devices/diskb4'
ATTRIBUTE 'compatible.asm' = '11.2', 'compatible.rdbms' = '11.2', 'sector_size'='4096';
SECTOR_SIZE can be set to either 4096, 512 or 4K. The default, if you do not specify a value for SECTOR_SIZE, depends on the platform you are using.
Note that the diskgroup parameters compatible.asm and compatible.rdbms also have to be set to 11.2.
Oracle's Automatic Storage Management Cluster File System, known as Oracle ACFS, does not support 4k sector drives because it would experience a performance penalty.
Oracle ASM performs checks when a diskgroup is created, altered or added to ensure that the same sector size is being used for all disks in the diskgroup. This validation is also performed when the diskgroup is mounted. If the disk sector sizes vary within a group, or for some reason Oracle ASM cannot verify the disk sector size, then whichever operation is being performed will fail.
You can check the sector size being used by ASM diskgroups in several ways:
the attribute_name sector_size in v$asm_attribute
the sector_size column in v$asm_diskgroup
in ASMCMD with lsattr -G -l sector_size
Redo Logs and 4kb Sector Disks
Redo log files can also be created to align to 4kb sectors by using the BLOCKSIZE keyword. If this is not defined then Oracle will use the underlying disk sector size. If the BLOCKSIZE specified is smaller than the platform sector size then a warning will be given to the DBA that performance may be affected. If the BLOCKSIZE is greater than the platform sector size, for instance you tried to create redo logs with a 4k sector size, when your machine only supported 512 byte sectors, then log creation will fail with ORA-1378.
Redo Logs can be created with 4kb blocksize as part of the create database, the alter database add log file or the create controlfile commands.
Create database:
CREATE DATABASE sample NORESETLOGS ARCHIVELOG
LOGFILE
GROUP 1 ‘$ORACLE_BASE/oradata/sample/redo0.log’ SIZE 100M BLOCKSIZE 4096
GROUP 2 ‘$ORACLE_BASE/oradata/sample/redo02.log’ SIZE 100M BLOCKSIZE 4096 …
Alter database add logfile:
ALTER DATABASE sample ADD LOGFILE GROUP 3 ('diska:log3.log', 'diskb:log3.log') SIZE 200M BLOCKSIZE 4096 REUSE;
Create controlfile:
CREATE CONTROLFILE REUSE DATABASE sample NORESETLOGS
FORCE LOGGING ARCHIVELOG
...
LOGFILE
GROUP 1 '$ORACLE_BASE/oradata/sample/redo01.log' SIZE 100M BLOCKSIZE 4096,
GROUP 2 '$ORACLE_BASE/oradata/smaple/redo02.log' SIZE 100M BLOCKSIZE 4096
DATAFILE ...
To start using any new redo log group created with 4kb sector size then you just need to switch into it.
Offline Migration to 4Kb Sector Disks
If you have an existing database and want to move to disks using 4kb sectors then you can do an offline migration. There are three stages:
pre-migration
migration
post-migration
Pre-migration
The first stage should be to upgrade the Oracle RDBMS to 11.2 and ensure that the initialization parameter, COMPATIBILITY is set to 11.2.
Once this is done the database should be shutdown and backed up. The 4kb sector disks can be plugged in.
Migration
The backed up datafiles are restored to the 4kb sector disks before the database is mounted.
With the database mounted, add as many redo log groups as you will need, with a minimum of two, specifying the 4kb blocksize. The database can then be opened. Once it is open, switch logs to use the new redo logs with 4k blocksize.
SQL>alter system switch logfile;
Post-Migration
The view v$log will show you the status of the redo log groups. Ensure that all groups with a blocksize of 512 bytes are INACTIVE. These logs can now be dropped.
SQL>alter database drop logfile ....
Check again in v$log to ensure that only redo logs with 4kb blocksize remain.
Click to add to Favorites Supporting 4K Sector Disks [Video] (Doc ID 1133713.1) To BottomTo Bottom
Modified:Jun 3, 2013Type:BULLETIN
Rate this document Email link to this document Open document in new window Printable Page
In this Document
Purpose
Scope
Details
Supporting 4Kb Sector Disks
Datafile Support of 4kb Sector Disks
ASM and 4kb Sector Disks
Redo Logs and 4kb Sector Disks
Offline Migration to 4Kb Sector Disks
References
Applies to:
Oracle Database - Enterprise Edition - Version 11.2.0.1.0 to 11.2.0.2 [Release 11.2]
Information in this document applies to any platform.
Purpose
The purpose of this document is to introduce Oracle DBAs to Oracle's support of 4Kb sector disks, to outline the extent of the support and to illustrate the steps that need to be followed to make use of this support.
Scope
This document is intended for DBAs
Details
Supporting 4Kb Sector Disks
Video - Oracle's Support of 4k Sector Size Disks (08:15) [Trouble seeing this video?]
The disk drive industry has been considering a move to using larger sector disks for some time, to allow for higher storage capacity, improve data integrity and allow faster drive performance. The default, for many years, has been a sector size of 512 bytes but now some 4kb sector disks are beginning to appear on the market.
The Oracle database accesses the hard disk via a platform specific device driver and DBWR, LGWR and the ASM processes can write directly to disk without going through the operating system. From 11.2 onwards the RDBMS is aware of 4kb sector disks and will align with them without performance being affected.
There are two types of 4kb sector disk available: emulation mode and native mode.
Emulation mode has 512 byte logical sectors over the 4kb physical sector to allow applications which are not 4kb sector aware to work successfully.
However applications can see performance degradation with emulation mode if they are not 4kb sector aware as additional steps need to be performed if the write does not align with the 4kb sector boundary. Oracle in 11.2 is 4kb sector aware so will avoid this performance degradation.
Native mode has 4kb logical sectors aligned with 4kb physical sectors. Only applications such as Oracle RDBMS 11.2, which are 4kb sector aware, can work with native mode 4kb sector disks.
Datafile Support of 4kb Sector Disks
Standard filesystem datafiles can take advantage of 4kb sector disks by using a blocksize of 4kb, or a multiple of 4kb. This can either be the default database block size, specified by db_block_size in the intialization file, or specified for an individual tablespace when it is created. Please note, however, that, on Linux, this only applies when the initialization parameter filesystemio_options=none or asynch; direct I/O is not currently supported on Linux against 4kb sector disks. This means that you may have issues if filesystemio_options is set to 'DIRECTIO' or 'SETALL'. It is not yet known in which version this support will be available.
ASM and 4kb Sector Disks
When you create a diskgroup in Oracle ASM from 11.2 onwards you can use the SECTOR_SIZE diskgroup attribute.
CREATE DISKGROUP data NORMAL REDUNDANCY
FAILGROUP controller1 DISK '/devices/diska1', '/devices/diska2', '/devices/diska3', '/devices/diska4' FAILGROUP controller2 DISK '/devices/diskb1', '/devices/diskb2', '/devices/diskb3', '/devices/diskb4'
ATTRIBUTE 'compatible.asm' = '11.2', 'compatible.rdbms' = '11.2', 'sector_size'='4096';
SECTOR_SIZE can be set to either 4096, 512 or 4K. The default, if you do not specify a value for SECTOR_SIZE, depends on the platform you are using.
Note that the diskgroup parameters compatible.asm and compatible.rdbms also have to be set to 11.2.
Oracle's Automatic Storage Management Cluster File System, known as Oracle ACFS, does not support 4k sector drives because it would experience a performance penalty.
Oracle ASM performs checks when a diskgroup is created, altered or added to ensure that the same sector size is being used for all disks in the diskgroup. This validation is also performed when the diskgroup is mounted. If the disk sector sizes vary within a group, or for some reason Oracle ASM cannot verify the disk sector size, then whichever operation is being performed will fail.
You can check the sector size being used by ASM diskgroups in several ways:
the attribute_name sector_size in v$asm_attribute
the sector_size column in v$asm_diskgroup
in ASMCMD with lsattr -G -l sector_size
Redo Logs and 4kb Sector Disks
Redo log files can also be created to align to 4kb sectors by using the BLOCKSIZE keyword. If this is not defined then Oracle will use the underlying disk sector size. If the BLOCKSIZE specified is smaller than the platform sector size then a warning will be given to the DBA that performance may be affected. If the BLOCKSIZE is greater than the platform sector size, for instance you tried to create redo logs with a 4k sector size, when your machine only supported 512 byte sectors, then log creation will fail with ORA-1378.
Redo Logs can be created with 4kb blocksize as part of the create database, the alter database add log file or the create controlfile commands.
Create database:
CREATE DATABASE sample NORESETLOGS ARCHIVELOG
LOGFILE
GROUP 1 ‘$ORACLE_BASE/oradata/sample/redo0.log’ SIZE 100M BLOCKSIZE 4096
GROUP 2 ‘$ORACLE_BASE/oradata/sample/redo02.log’ SIZE 100M BLOCKSIZE 4096 …
Alter database add logfile:
ALTER DATABASE sample ADD LOGFILE GROUP 3 ('diska:log3.log', 'diskb:log3.log') SIZE 200M BLOCKSIZE 4096 REUSE;
Create controlfile:
CREATE CONTROLFILE REUSE DATABASE sample NORESETLOGS
FORCE LOGGING ARCHIVELOG
...
LOGFILE
GROUP 1 '$ORACLE_BASE/oradata/sample/redo01.log' SIZE 100M BLOCKSIZE 4096,
GROUP 2 '$ORACLE_BASE/oradata/smaple/redo02.log' SIZE 100M BLOCKSIZE 4096
DATAFILE ...
To start using any new redo log group created with 4kb sector size then you just need to switch into it.
Offline Migration to 4Kb Sector Disks
If you have an existing database and want to move to disks using 4kb sectors then you can do an offline migration. There are three stages:
pre-migration
migration
post-migration
Pre-migration
The first stage should be to upgrade the Oracle RDBMS to 11.2 and ensure that the initialization parameter, COMPATIBILITY is set to 11.2.
Once this is done the database should be shutdown and backed up. The 4kb sector disks can be plugged in.
Migration
The backed up datafiles are restored to the 4kb sector disks before the database is mounted.
With the database mounted, add as many redo log groups as you will need, with a minimum of two, specifying the 4kb blocksize. The database can then be opened. Once it is open, switch logs to use the new redo logs with 4k blocksize.
SQL>alter system switch logfile;
Post-Migration
The view v$log will show you the status of the redo log groups. Ensure that all groups with a blocksize of 512 bytes are INACTIVE. These logs can now be dropped.
SQL>alter database drop logfile ....
Check again in v$log to ensure that only redo logs with 4kb blocksize remain.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21754115/viewspace-1181534/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/21754115/viewspace-1181534/