Oracle RAC系列之:ASM基本操作维护
ASM(自动存储管理)是一个专门为Oracle数据库服务的数据文件存储机制,通过ASM管理数据文件,DBA不用再担心I/O性能问题,也不需要知道文件的名称,同时ASM也提
ASM(自动存储管理)是一个专门为Oracle数据库服务的数据文件存储机制,通过ASM管理数据文件,DBA不用再担心I/O性能问题,也不需要知道文件的名称,同时ASM也提供了文件系统到卷管理器的集成,下面依次介绍。
一、 ASM的特点
(1)自动调整I/O负载
ASM可以在所有可用的磁盘中自动调整I/O负载,不但避免了人工调整I/O的难度,而且也优化了性能,同时,利用ASM可以在线增加数据库的大小,而无需关闭数据库。
(2)条带化存储
ASM将文件分为多个分配单元(Allocation Units, AU)进行存储,并在所有磁盘间平均分配每个文件的AU。
(3)在线自动负载均衡
当共享存储设备有变化时,ASM中的数据会自动均匀分配到现有存储设备中。同时,还可以调节数据的负载均衡速度。
(4)自动管理数据库文件
在ASM存储管理中,Oracle数据文件是ASM自动管理的。ASM创建的任何文件一旦不再需要,就会被自动删除。但是,ASM不管理二进制文件、跟踪文件、预警日志和口令文件。
(5)数据冗余
ASM通过磁盘组镜像可以实现数据冗余,不需要第三方工具。
(6)支持各种Oracle数据文件
ASM存储支持Oracle数据文件、日志文件、控制文件、归档日志、RMAN备份集等。
二、ASM的体系结构与后台进程
图1显示了ASM的物理构成。
从图1可以看出,在顶层是ASM磁盘组,ASM实例和数据库实例可以直接访问这些磁盘组;然后是ASM文件,每个ASM文件只能包含在一个磁盘组中,不过,一个磁盘组中可以包含属于多个数据库的多个ASM文件,并且单个数据库可以使用来自多个磁盘组的存储空间;第三部分是ASM磁盘,多个ASM磁盘组成了ASM磁盘组,但每个ASM磁盘只能属于一个磁盘组;接着是AU(分配单元),AU是ASM磁盘组分配的最小连续磁盘空间,ASM磁盘按照AU进行分区,每个AU的大小为1MB;这个结构的底层是Oracle数据块,由于AU是ASM分配的最小连续磁盘空间,因此,ASM是不允许跨分配单元拆分一个Oracle数据块的。
要使用ASM,需要在启动数据库实例之前,先启动一个名为“+ASM”的实例,ASM实例不会装载数据库,启动它的目的是为了管理磁盘组和保护其中的数据。同时,ASM实例还可以向数据库实例传递有关文件布局的信息。通过这种方式,数据库实例就可以直接访问磁盘组中存储的文件。图2显示了ASM的一般体系结构。
从图2可以看出,香港服务器租用,ASM实例与数据库实例进行通信的桥梁是ASMB进程,此进程运行在每个数据库实例上,是两个实例间信息交换的通道。ASMB进程先利用磁盘组名称通过CSS获得管理该磁盘组的ASM实例连接串,然后建立一个到ASM的持久连接,这样两个实例之间就可以通过这条连接定期交换信息,同时这也是一种心跳监控机制。
另外,在ASM实例中还存在另外一个新的进程,即RBAL,此进程负责规划和协调磁盘组的重新平衡活动。除此之外,ASM实例还有一些与数据库实例中的进程相同的后台进程,例如LGWR、SMON、PMON、DBWR 、CKPT等。
如果一个数据库实例使用ASM作为存储,那么它将多出两个后台进程,即RBAL和ASMB。RBAL 负责打开磁盘组中所有磁盘和数据,而ASMB负责和ASM实例进程通信。
三、管理ASM实例
在使用ASM作为数据存储时,ASM实例管理显得非常重要,香港服务器,Oracle提供了丰富的管理功能,对ASM实例进行管理需要具备SYSDBA权限,在Oracle 11g中可以使用一个新角色 ,即SYSASM,此角色只用于管理ASM实例。
1.创建ASM实例
创建ASM实例有两种方法,第一种是利用dbca创建,这种方法只需运行Database Configuration Assistant(DBCA),然后根据提示即可创建一个ASM实例,此种方式在前面已有讲述,这里不再多说。第二中方法是用命令行方式创建ASM实例,下面进行简单介绍。
(1)创建ASM磁盘
可以使用RAID划分的LUN、分区和裸设备等来创建ASM磁盘,但是在使用LUN、分区或裸设备时,要注意将属主和属组改为Oracle用户及其对应的组,这个在前面节已经讲述过,另外一种简单的方法就是使用Oracle提供的ASMLib来完成ASM磁盘的创建,下面将讲述这种方法。
在创建ASM实例之前,首先应该确保节点上已经安装了ASMlib包,同时确认ASMLib是否已经自动加载:
[root@node1 ~]# lsmod | grep oracleasm
oracleasm 46356 1
然后,通过ASMlib提供的oracleasm将已经划分好的磁盘分区转化为ASM磁盘,例如:
[root@node1 ~]#/etc/init.d/oracleasm createdisk ASMDISK1 /dev/sdc5
Marking disk "/dev/sdc5" as an ASM disk [ OK ]
[root@node1 ~]#/etc/init.d/oracleasm createdisk ASMDISK2 /dev/sdc6
Marking disk "/dev/sdc6" as an ASM disk [ OK ]
[root@node1 ~]#/etc/init.d/oracleasm createdisk ASMDISK3 /dev/sdc7
Marking disk "/dev/sdc7" as an ASM disk [ OK ]
[root@node1 ~]#/etc/init.d/oracleasm createdisk ASMDISK4 /dev/sdc8
Marking disk "/dev/sdc8" as an ASM disk [ OK ]
[root@node1 ~]#/etc/init.d/oracleasm createdisk ASMdisk5 /dev/sdc9
Marking disk "/dev/sdc9" as an ASM disk [ OK ]
创建完ASM磁盘后,可以查看系统的/dev/oracleasm/disks/目录下是否已经生成磁盘设备,可以采用的命令如如下:
[root@node1 ~]# ll /dev/oracleasm/disks/ASMDISK*
brw-rw---- 1 oracle oinstall 8, 21 Sep 10 23:40 /dev/oracleasm/disks/ASMDISK1
brw-rw---- 1 oracle oinstall 8, 22 Sep 10 23:40 /dev/oracleasm/disks/ASMDISK2
brw-rw---- 1 oracle oinstall 8, 23 Sep 10 23:36 /dev/oracleasm/disks/ASMDISK3
brw-rw---- 1 oracle oinstall 8, 24 Sep 10 23:40 /dev/oracleasm/disks/ASMDISK4
brw-rw---- 1 oracle oinstall 8, 25 Sep 10 23:40 /dev/oracleasm/disks/ASMDISK5
也可以通过如下方式查看:
[root@node1 ~]#service oracleasm listdisks
ASMDISK1
ASMDISK2
ASMDISK3
ASMDISK4
ASMDISK5
如果要删除 ASM磁盘可通过以下命令:
[root@node1 ~]#/etc/init.d/oracleasm deletedisk ASMDISK5
Removing ASM disk "ASMdisk5" [ OK ]
在RAC环境中,要注意另外一个节点是否能够发现对应的ASM磁盘,执行如下命令,让另外一个节点来获取这种变化。
[root@node2 ~]#/etc/init.d/oracleasm scandisks
到此位置,ASM磁盘已经创建完毕了。
(2)初始化参数
启动ASM实例只需要如下几个参数即可,利用这些参数可以实现ASM实例的内存的自动分配和自动管理。
下面介绍ASM实例初始化参数:
instance_type=asm
cluster_database=true
DB_UNIQUE_NAME=+ASM
ASM_POWER_LIMIT=1
large_pool_size=60M
asm_diskgroups='FLASH_DISK','ARCH_DISK','DATA_DISK'
asm_diskstring='/dev/oracleasm/disks/*'
每个参数的含义如下:
instance_type,指定实例的类型,对于ASM实例,应设置为ASM
cluster_database,指定是否是数据库集群,true表示是ASM集群
DB_UNIQUE_NAME,指定ASM实例的名称,默认是+ASM
ASM_POWER_LIMIT,该参数用来控制ASM中数据的负载均衡速度
large_pool_size,设置大池的大小,由于ASM文件的分配单元映射是从large_pool分配的,因此large_pool_size至少要8MB,建议越大越好
asm_diskgroups,指定实例启动时可用的ASM磁盘组,ASM实例将在启动时自动挂载这些磁盘组
asm_diskstring,用于限制ASM实例可用于创建磁盘组的磁盘设备。如果该值为NULL,则ASM实例可见的所有磁盘都可以成为创建磁盘组的可选磁盘
(3)创建密码文件
[oracle@node1 ~]$su - oracle
[oracle@node1 ~]$ cd $ORACLE_HOME/dbs
[oracle@node1 ~]$orapwd file=orapw+ASM password=oracle
(4)创建目录结构
[oracle@node 1~]$su – oracle
[oracle@node1 ~]$cd $ORACLE_HOME/dbs
[oracle@node1 ~]$mkdir –p $ORALCE_BASE/admin/+ASM/udump
[oracle@node1 ~]$ mkdir –p $ORALCE_BASE/admin/+ASM/bdump
[oracle@node1 ~]$mkdir –p $ORALCE_BASE/admin/+ASM/adump
[oracle@node1~]$ mkdir –p $ORALCE_BASE/admin/+ASM/cdump
2.启动ASM实例
无论在RAC环境中还是单实例环境,ASM实例都需要用到CSS进程,在RAC环境中,启动CRS后CSS已经运行,而在单实例环境下,需要以root用户运行脚本,初始化CSS服务,否则,在启动ASM实例时会报如下错误:
ORA-29701: unable to connect to Cluster Manager
执行初始化脚本的过程如下:
[root@node1 ~]#$ORACLE_HOME/bin/localconfig add
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Error 801c03ed is usually accompanied by the following message: Administrator policy does not allow this user to join the device. This error message will prevent you from installing Windows and joining a network, thereby preventing you from using your computer, so it is important to resolve this issue as soon as possible. What is error code 801c03ed? This is a Windows installation error that occurs due to the following reason: Azure setup does not allow new users to join. Device objects are not enabled on Azure. Hardware hash failure in Azure panel. How to fix error code 03c11ed on Windows 801? 1. Check Intune settings Log in to Azure portal. Navigate to Devices and select Device Settings. Change "Users can

Is the "This device is disabled" code 22 error in Device Manager preventing you from using a new or old device on your PC? Don’t worry because we are here to help you solve this problem. A code 22 error means the device has been manually disabled and sometimes re-enabling it does not help. Whatever the cause, here are 10 ways to fix the “This device is disabled” code 10 error on Windows 22/PC and make that hardware work again. 1. Unplug and replug new hardware New hardware you plug into your PC may start working again after a quick removal and reinstallation. So if it's a device plugged in via USB, go ahead and unplug it. Then, wait a few seconds and plug it back in. Now, check if the device is showing up in device manager

Web browsing is an essential function of mobile devices, and browsers facilitate it effectively. These browsers also support the installation of content blockers and other tools to personalize your browsing experience. Apple's iOS platform uses Safari as its default browser. In rare cases, you may find that Safari browser is missing from your device. If you encounter this situation, the following steps will guide you on how to restore it. Can you reinstall Safari on iPhone? Safari is a built-in application on iOS devices and cannot be deleted or uninstalled due to its protected system status. If the app seems to be missing from your device, you may be dealing with an error, or the app may be hidden for various reasons.

How to set up keyboard startup on Gigabyte's motherboard. First, if it needs to support keyboard startup, it must be a PS2 keyboard! ! The setting steps are as follows: Step 1: Press Del or F2 to enter the BIOS after booting, and go to the Advanced (Advanced) mode of the BIOS. Ordinary motherboards enter the EZ (Easy) mode of the motherboard by default. You need to press F7 to switch to the Advanced mode. ROG series motherboards enter the BIOS by default. Advanced mode (we use Simplified Chinese to demonstrate) Step 2: Select to - [Advanced] - [Advanced Power Management (APM)] Step 3: Find the option [Wake up by PS2 keyboard] Step 4: This option The default is Disabled. After pulling down, you can see three different setting options, namely press [space bar] to turn on the computer, press group

PRRU refers to pico base station equipment, which is an active device. It is a small, low-power, low-power indoor coverage radio frequency unit, that is, an indoor base station. The PRRU has the functions of a receiver and a transmitter, that is, it converts the digital signal (first converted into an intermediate frequency signal) into a radio frequency signal at the remote end, and then amplifies and transmits it; or it receives the radio frequency signal received by the antenna and converts it into a digital signal. and then passed to the baseband processing unit.

Drivers are key software that facilitates command relay between the operating system and the corresponding device. But what if you encounter Adrivercannotloadonthisdevice error in Windows 11? You will see this error message when booting the operating system, and its effects may or may not be noticeable initially, depending on the affected drivers. However, over time, the driver may stop functioning with the corresponding device. Therefore, you must troubleshoot the error. Also, in most cases, the faulty driver will be listed in the error box, making it easier for you to continue. How to fix A driver could not be loaded on this device error in Windows 11? 1.

1. Processor When choosing a computer configuration, the processor is one of the most important components. For playing games like CS, the performance of the processor directly affects the smoothness and response speed of the game. It is recommended to choose Intel Core i5 or i7 series processors because they have powerful multi-core processing capabilities and high frequencies, and can easily cope with the high requirements of CS. 2. Graphics card Graphics card is one of the important factors in game performance. For shooting games such as CS, the performance of the graphics card directly affects the clarity and smoothness of the game screen. It is recommended to choose NVIDIA GeForce GTX series or AMD Radeon RX series graphics cards. They have excellent graphics processing capabilities and high frame rate output, and can provide a better gaming experience. 3. Memory power

The laptop's cellular capabilities generally work fine, and users can insert a SIM card or use an eSIM. But recently, some people have reported that the cellular option is missing in Windows 11. Regardless of whether they restart the PC or unplug and reinsert the SIM card, the cellular option does not appear in Windows 11. Keep in mind that some Windows 10 users are also facing the same issue. Why don't my mobile network settings show up on Windows 11? Outdated, incompatible, corrupt or problematic drivers Cellular data network operators are facing issues Network adapter is disabled eSIM profile is not working or corrupt How to enable missing cellular option again on Windows 11? Before we start using a slightly complex
