Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

ASM Enhancement in Oracle 11g R1

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Http://tech.it168.com/a2008/1120/211/000000211426.shtml

This article mainly summarizes the enhancements to automatic Storage Management (ASM) in Oracle Database 11g version 1, including:

Oracle Database Storage Administrator's Guide

New disk group compatibility properties

Fast resynchronization of mirror

Rolling upgrade

SYSMAN privileges and OSASM operating system group

Scalability and performance enhancements

New ASMCMD commands and options

Preferred Read Failure (preferred read failure) group

Rapid rebalancing

Hybrid disk group maintenance enhancement

Oracle Database Storage Administrator's Guide

The storage administrator's guide is released for the first time on the official Oracle website, see http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/toc.htm.

New disk group compatibility properties

Oracle 11g includes two new compatibility attributes that allow database software to use special disk groups:

(1) COMPATIBLE.ASM: the minimum version of the ASM software that can access the disk group. In 11g, the default setting is 10.1

(2) COMPATIBLE.RDBMS: for any database instance that uses disk groups, the minimum value of the COMPATIBLE database initialization parameters. In 11g, the default setting is 10.1.

A compatible version of the disk group can only be increased, not decreased, and if you make a mistake in adding the version, you can only recreate a new one.

The compatibility properties of disk groups can be set by adding an ATTRIBUTE clause to the CREATE DISKGROUP directory during disk group creation.

CREATE DISKGROUP data DISK'/dev/raw/*'

ATTRIBUTE 'compatible.asm'='11.1'

CREATE DISKGROUP data DISK'/dev/raw/*'

ATTRIBUTE 'compatible.rdbms'='11.1',' compatible.asm'='11.1'

You can add a SET ATTRIBUTE clause to the ALTER DISKGROUP command to change the compatibility properties of an existing disk group.

ALTER DISKGROUP data SET ATTRIBUTE 'compatible.asm'='11.1'

ALTER DISKGROUP data SET ATTRIBUTE 'compatible.rdbms'='11.1'

You can view the currently valid compatibility settings from the V$ASM_DISKGROUP and V$ASM_ATTRIBUTE views.

COLUMN name FORMAT A10

COLUMN compatibility FORMAT A20

COLUMN database_compatibility FORMAT A20

SELECT group_number, name, compatibility, database_compatibility FROM v$asm_diskgroup

GROUP_NUMBER NAME COMPATIBILITY DATABASE_COMPATIBILI

--

1 DATA 11.1.0.0.011.1.0.0.0

1 row selected.

SQL >

COLUMN name FORMAT A20

COLUMN value FORMAT A20

SELECT group_number, name, value FROM v$asm_attribute ORDERBY group_number, name

GROUP_NUMBER NAME VALUE

1 au_size 1048576

1 compatible.asm 11.1.0.0.0

1 compatible.rdbms 11.1

1 disk_repair_time 3.6h

4 rows selected.

SQL >

Fast resynchronization of mirror

During a brief disk failure, ASM tracks changing intervals (extend) that must be applied to offline disks, and once the disk is available, only those changed intervals are synchronized back to disk, not all of the disk contents, significantly increasing the speed of the resynchronization process.

Quick mirror resynchronization is available only if the compatibility property of the disk group is set to 11.1 or higher.

ALTER DISKGROUP disk_group_1 SET ATTRIBUTE 'compatible.asm'='11.1'

ALTER DISKGROUP disk_group_1 SET ATTRIBUTE 'compatible.rdbms'='11.1

ASM deletes disks that have been offline for more than 3.6 hours, and you can set the disk group default time limit by modifying the DISK_REPAIR_TIME (in minutes, M or m, or hours, H or h) parameters.

-- set in hours

ALTER DISKGROUP disk_group_1 SET ATTRIBUTE 'disk_repair_time'='4.5h'

-- set in minutes

ALTER DISKGROUP disk_group_1 SET ATTRIBUTE 'disk_repair_time'='300m'

The DROP AFTER clause of the ALTER DISKGROUP command is used to abolish the default time for the DISK_REPAIR_TIME parameter setting.

-- use the default DISK_REPAIR_TIME.

ALTER DISKGROUP disk_group_1 OFFLINE DISK D1_0001

-- abolish the default DISK_REPAIR_TIME.

ALTER DISKGROUP disk_group_1 OFFLINE DISK D1_0001 DROP AFTER 30m

If the disk is offline during a rolling upgrade, the timer will not start until the rolling upgrade is complete.

Rolling upgrade

11g ASM cluster instances can be upgraded forward using rolling upgrade, and ASM clusters in rolling upgrade mode can be rolled up on one of the nodes using the following command:

ALTER SYSTEM START ROLLING MIGRATION TO11.2.0.0.0

As long as the cluster is in rolling upgrade mode, each node can perform shutdown, upgrade, and startup sequentially, and during the upgrade process, the cluster is in a mixed version of the environment until all upgrades are complete, in which case, the cluster is limited by the following operations:

Mount and dismount disk groups

Open, close, resize, and delete database files

Access local fixed views and fixed packages

Use the following query statement to query the current state of the ASM cluster:

SELECT SYS_CONTEXT ('sys_cluster_properties',' cluster_state') FROM dual

When the last node upgrade is complete, use the following command to stop the rolling upgrade, which checks that all ASM instances have the correct version, then turns off the rolling upgrade mode and restarts the pending balance operation.

ALTER SYSTEM STOP ROLLING MIGRATION

The rolling upgrade process includes the following restrictions and other conventions:

All Oracle clusterware patches must be applied before the ASM rolling upgrade starts.

Rolling upgrades are only available from 11g, so this approach is not suitable for upgrading from 10g to 11g.

If you fail before the rolling upgrade is complete, you can fall back to the previous version.

If the upgrade fails, you must complete the balancing operation before attempting a new upgrade.

New instances that join the cluster during a rolling upgrade automatically enter rolling upgrade mode.

If all instances in the cluster are stopped during a rolling upgrade, once the instances are restarted, they will no longer be in rolling upgrade mode and the upgrade must be reinitialized as if it were a new process.

SYSMAN privileges and OSASM operating system group

After the introduction of ASM, the management of storage has been transferred from the domain of system administrators to the domain of DBA. Unfortunately, this is not the case in every company. As a result, some system administrators have to obtain privileged users to deal with disk storage. Oracle introduces SYSASM privileges and OSASM operating system groups to solve this problem. It provides two mechanisms to separate the responsibilities of storage and database management.

You can create a user on an ASM instance like a database user, granting these users SYSASM privileges so that they can connect to the ASM instance to handle administrative tasks. First, connect to the ASM instance:

$export ORACLE_SID=+ASM

$sqlplus / as sysasm

Next, create a new user in the ASM instance and grant it the SYSASM privilege, and the user can connect with the SYSASM privilege:

SQL > CREATEUSER asm_user_1 IDENTIFIED by asm_password

User created.

SQL > GRANT SYSASM TO asm_user_1

Grant succeeded.

SQL > CONN asm_user_1/asm_password AS SYSASM

Connected.

SQL >

In addition, assign an operating system user to the OSASM group (asmadmin) to allow operating system authentication to be used when connecting as SYSASM. The following example creates a new operating system user and assigns it to the OSASM group (asmadmin):

# useradd tim_hall-G asmadmin

# su-tim_hall

$export ORACLE_SID=+ASM

$export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1

$$ORACLE_HOME/bin/sqlplus / as sysasm

SQL*Plus: Release 11.1.0.6.0-Production on Fri Aug 816

Copyright (c) 1982, 2007, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.1.0.6.0-Production

With the Partitioning, OLAP, Data Mining andReal Application Testing options

SQL >

Scalability and performance enhancements

ASM files are stored as interval sets on disk groups. In Oracle 10g, each interval is mapped directly to an allocation unit (AU), but in Oracle 11g, an interval can be composed of one or more allocation units, because the file is getting larger, and the interval size can be larger to reduce the size of interval mapped files, thus saving memory.

When the disk group compatibility attribute is set to 11.1 or higher, the interval size automatically increases according to the file size, the first 20000 interval matches the allocation unit (AU) size, and the next 20000 interval size consists of eight allocation units (8*AU), except for this, the interval size is all 64 allocation units (64*AU).

In addition to automatically expanding the interval size, Oracle 11g also allows the use of ATTRIBUTE clauses in CREATE DISKGROUP statements to control the size of allocation units, ranging from 1m to 64m.

CREATE DISKGROUP disk_group_2

EXTERNAL REDUNDANCY

DISK'/dev/sde1'

ATRRIBUTE 'au_size'='32M'

For very large databases, using extended interval size and allocating larger allocation units at the same time will make Icano more expensive.

New ASMCMD commands and options

The ASM command line utility includes several new commands, and the following sample output assumes that you have started the utility with the-p option:

$asmcmd-p

ASMCMD [+] >

Enter help in asmcmd to see the usage of each command.

The lsdsk command queries information for all ASM disks from the V$ASM_DISK_STAT and V$ASM_DISK view, and the brief usage is as follows:

Lsdsk [- ksptcgHI] [- d] [pattern]

The following is an example of the output without the-k option and without the-k option:

ASMCMD [+] > lsdsk

Path

/ dev/sdc1

/ dev/sdd1

/ dev/sde1

ASMCMD [+] > lsdsk-d data-k

Total_MB Free_MB OS_MB Name Failgroup Library Label UDID Product Redund Path

818969618189 DATA_0000 DATA_0000 System UNKNOWN / dev/sdc1

818969618189 DATA_0001 DATA_0001 System UNKNOWN / dev/sdd1

818969508189 DATA_0002 DATA_0002 System UNKNOWN / dev/sde1

ASMCMD [+] >

The cp command allows files to be copied between ASM and a local or remote destination, with the following brief usage:

Cp [- ifr]

The following example copies the USERS data file from ASM to the local file system:

ASMCMD [+] > cp + DATA/db11g/datafile/users.273.661514191/tmp/users.dbf

Source + DATA/db11g/datafile/users.273.661514191

Target / tmp/users.dbf

Copying file (s)...

File, / tmp/users.dbf, copy committed.

ASMCMD [+] >

Unfortunately, the cp command cannot copy the control file.

The md_backup command copies the metadata of one or more disk groups, and the brief usage is as follows:

Md_backup [- b location_of_backup] [- g dgname [- g dgname?]]

The following is an example command that results in all the metadata required to recreate the ASM settings:

ASMCMD [+] > md_backup-b / tmp/backup.txt-g data

Diskgroupto be backed up: DATA

ASMCMD [+] >

The md_restore command allows you to restore disk group settings from metadata created by the md_backup command, briefly as follows:

Md_restore-b [- li]

[- t (full) | nodg | newdg] [- f]

[- g',.']

[- o':,']

The command to restore directly from a previous backup is as follows:

ASMCMD [+] > md_restore-b / tmp/backup.txt-t full-g data

The remap command repairs a range of physical blocks on disk, and the contents of each block are invalid, so only the blocks that show read errors are repaired, as shown in the following brief usage;

Remap

Here is an example of this command:

ASMCMD [+] > remap data data_0001 5000-5999

Preferred Read Failure (preferred read failure) group

In Oracle 10g, ASM always reads the primary copy of the mirror interval set, which is fine when two nodes and two failure groups are in the same site, but as the cluster expands, it becomes inefficient because it causes a lot of unnecessary network traffic. Oracle 11g allows each node to define a preferred failure group and allows nodes in the cluster to access the local failure group over the remote failure group.

In order to configure the preferred read failure group, the disk group compatibility property must be set to 11.1 or higher, and once the compatibility options are set correctly, you can use the ASM_PREFERRED_READ_FAILURE_GROUPS parameter to set the preferred failure group for each node.

SELECT name, failgroup FROM v$asm_disk

NAME FAILGROUP

DATA_0000 DATA_0000

DATA_0001 DATA_0001

DATA_0002 DATA_0002

3 rows selected.

SQL >

ALTER SYSTEM SET ASM_PREFERRED_READ_FAILURE_GROUPS = 'data.data_0000',' data.data_0001', 'data.data_0002'

Rapid rebalancing

ALTER DISKGROUP... The MOUNT statement allows disk groups to be mounted in RESTRICTED mode:

SQL > SELECT name FROM v$asm_diskgroup

NAME

--

DATA

SQL > ALTER DISKGROUP data DISMOUNT

Diskgroup altered.

SQL > ALTER DISKGROUP data MOUNT RESTRICTED

Diskgroup altered.

SQL > ALTER DISKGROUP data DISMOUNT

Diskgroup altered.

SQL > ALTER DISKGROUP data MOUNT

Diskgroup altered.

SQL >

In a RAC environment, when a disk group is mounted in RESTRICTED mode, only one instance can access it, and limited disk groups are not available to any ASM client, even if the node is mounted.

The use of RESTRICTED mode improves the performance of the rebalance operation in the RAC environment, and when the rebalance operation is complete, the disk group should be unmounted and then mounted in NORMAL mode (the default mode).

Hybrid disk group maintenance enhancement

CREATE DISKGROUP and ALTER DISKGROUP include new ATTRIBUTE clauses (compatible, disk_repair_time, au_size).

The CHECK clause of the ALTER DISKGROUP command has been simplified, leaving only two options: NOREPAIR and REPAIR. NOREPAIR is used by default. At this point, only a summary of the error is displayed, and the detailed error information is written to the warning log.

ALTER DISKGROUP data CHECK;-Like NOREPAIR

ALTER DISKGROUP data CHECK NOREPAIR

ALTER DISKGROUP data CHECK REPAIR

Disk groups can now be mounted in RESTRICTED mode, which improves the performance of some maintenance tasks.

The ALTER DISKGOUP command includes ONLINE and OFFLINE clauses, which can be taken offline during disk maintenance, repaired and then returned to the online state.

Individual disk.

ALTER DISKGROUP data OFFLINE DISK'disk_0000', 'disk_0001'

ALTER DISKGROUP data ONLINE DISK'disk_0000', 'disk_0001'

-- failure group.

ALTER DISKGROUP data OFFLINE DISKS IN FAILGROUP 'fg_0000'

ALTER DISKGROUP data ONLINE DISKS IN FAILGROUP 'fg_0000'

-- restore all disks to online as a disk group.

ALTER DISKGROUP data ONLINE ALL

Disk groups that cannot be mounted by ASM can now be forcibly deleted using the DROP DISKGROUP command plus the FORCE keyword.

DROP DISKGROUP data FORCE

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report