ASM磁盘组是作为一个逻辑单元管理的一个ASM磁盘池。与其他任何LVM一样,ASM管理大量物理卷并将其作为一个或多个逻辑卷呈交给Oracle。物理卷可以是实际的磁盘或磁
ASM磁盘组是作为一个逻辑单元管理的一个ASM磁盘池。与其他任何LVM一样,ASM管理大量物理卷并将其作为一个或多个逻辑卷呈交给Oracle。物理卷可以是实际的磁盘或磁盘的分区,或者是隶属操作系统的卷管理器的卷。无论采用哪种方式,都不能使用任何文件系统格式化,必须是裸设备。
在Linux上,ASM能引用磁盘作为裸设备,或通过使用ASMLib软件。
直接使用裸设备的方法:
1. 在RHEL6以前的可以直接通过rawdevices的管理方法,系统安装后默认已存在/etc/init.d/rawdevices和/etc/sysconfig/rawdevices这两个文件。
# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.8 (Tikanga) # rpm -qf /etc/init.d/rawdevices /etc/sysconfig/rawdevices initscripts-8.45.42-1.el5 initscripts-8.45.42-1.el5 # cat /etc/init.d/rawdevices #!/bin/bash # # rawdevices This shell script assignes rawdevices to block devices # # chkconfig: 345 56 44 # description: This scripts assignes raw devices to block devices \ # (such as hard drive partitions). This is for the use \ # of applications such as Oracle. You can set up the \ # raw device to block device mapping by editing \ # the file /etc/sysconfig/rawdevices. # config: /etc/sysconfig/rawdevices [ -f /bin/raw ] || exit 0 [ -f /etc/sysconfig/rawdevices ] || exit 0 # Exit if the file just has the default comments. LC_ALL=C /bin/egrep -q -v "^ *#" /etc/sysconfig/rawdevices 2>/dev/null || exit 0 . /etc/init.d/functions function assign_raw() { LC_ALL=C egrep -v '^ *#' /etc/sysconfig/rawdevices | while read RAW BLOCK; do if [ -n "$RAW" -a -n "$BLOCK" ]; then rawdirname=${RAW%/*} if [ "$rawdirname" = "/dev" -a -d /dev/raw ]; then echo $" Please correct your /etc/sysconfig/rawdevices:" echo $" rawdevices are now located in the directory /dev/raw/ " echo $" If the command 'raw' still refers to /dev/raw as a file." echo $" you'll have to upgrade your util-linux package" exit 0 fi if [ "$rawdirname" = "/dev/raw" -a -f /dev/raw ]; then echo $" Please correct your /etc/sysconfig/rawdevices:" echo $" rawdevices are now located in the directory /dev/raw/ " echo $" If the command 'raw' still refers to /dev/raw as a file." echo $" you'll have to upgrade your util-linux package" exit 0 fi echo " $RAW --> $BLOCK"; raw $RAW $BLOCK fi done } # See how we were called. case "$1" in start) # Assign devices echo $"Assigning devices: " assign_raw #添加以下两行(默认不存在),即默认情况下生成的裸设备为root所有, #所以必须修改属主,否则oracle用户无法使用裸设备 sleep 5 chown -R oracle:oinstall /dev/raw/ echo $"done" ;; stop) # No action to be taken here ;; status) ID=`id -u` if [ $ID -eq 0 ]; then raw -qa else echo $"You need to be root to use this command ! " fi ;; restart|reload) $0 start ;; *) echo $"Usage: $0 {start|stop|status|restart}" exit 1 esac exit 0
# vi /etc/sysconfig/rawdevices //映射将要绑定的裸设备 /dev/raw/raw10 /dev/sda10 /dev/raw/raw11 /dev/sda11 /dev/raw/raw12 /dev/sda12 /dev/raw/raw13 /dev/sda13 /dev/raw/raw14 /dev/sda14 # chkconfig rawdevices on # service rawdevices start Assigning devices: /dev/raw/raw10 --> /dev/sda10 /dev/raw/raw10: bound to major 8, minor 10 /dev/raw/raw11 --> /dev/sda11 /dev/raw/raw11: bound to major 8, minor 11 /dev/raw/raw12 --> /dev/sda12 /dev/raw/raw12: bound to major 8, minor 12 /dev/raw/raw13 --> /dev/sda13 /dev/raw/raw13: bound to major 8, minor 13 /dev/raw/raw14 --> /dev/sda14 /dev/raw/raw14: bound to major 8, minor 14 done # ls -l /dev/raw/ total 0 crw-rw----. 1 oracle oinstall 162, 10 May 27 08:37 raw10 crw-rw----. 1 oracle oinstall 162, 11 May 27 08:37 raw11 crw-rw----. 1 oracle oinstall 162, 12 May 27 08:37 raw12 crw-rw----. 1 oracle oinstall 162, 13 May 27 08:37 raw13 crw-rw----. 1 oracle oinstall 162, 14 May 27 08:37 raw14 crw-rw----. 1 oracle oinstall 162, 0 May 27 08:19 rawctl # raw -qa /dev/raw/raw10: bound to major 8, minor 10 /dev/raw/raw11: bound to major 8, minor 11 /dev/raw/raw12: bound to major 8, minor 12 /dev/raw/raw13: bound to major 8, minor 13 /dev/raw/raw14: bound to major 8, minor 14
2. 在RHEL6中,系统里面虽然已经不存在/etc/sysconfig/rawdevices和/etc/init.d/rawdevices文件了,但是依然支持rawdevices的方式,网站空间,网站空间,可以通过如下方法来管理raw文件。
手动创建/etc/sysconfig/rawdevices和/etc/init.d/rawdevices文件,然后依然以rawdevices的方式
通过udev来管理raw,同样也可以通过udev固定磁盘对应的设备名
以下介绍udev的方式:
# fdisk -l /dev/sdb Disk /dev/sdb: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 261 2096451 5 Extended /dev/sdb5 1 25 200749+ 83 Linux /dev/sdb6 26 50 200781 83 Linux /dev/sdb7 51 75 200781 83 Linux /dev/sdb8 76 100 200781 83 Linux /dev/sdb9 101 125 200781 83 Linux # vi /etc/udev/rules.d/60-raw.rules ACTION=="add",KERNEL=="sdb5",RUN+="/bin/raw /dev/raw/raw5 %N",OWNER="oracle", GROUP="oinstall", MODE="660" ACTION=="add",KERNEL=="sdb6",RUN+="/bin/raw /dev/raw/raw6 %N",OWNER="oracle", GROUP="oinstall", MODE="660" ACTION=="add",KERNEL=="sdb7",RUN+="/bin/raw /dev/raw/raw7 %N",OWNER="oracle", GROUP="oinstall", MODE="660" ACTION=="add",KERNEL=="sdb8",RUN+="/bin/raw /dev/raw/raw8 %N",OWNER="oracle", GROUP="oinstall", MODE="660" ACTION=="add",KERNEL=="sdb9",RUN+="/bin/raw /dev/raw/raw9 %N",OWNER="oracle", GROUP="oinstall", MODE="660" # raw -qa # start_udev Starting udev: [ OK ] # raw -qa /dev/raw/raw5: bound to major 8, minor 21 /dev/raw/raw6: bound to major 8, minor 22 /dev/raw/raw7: bound to major 8, minor 23 /dev/raw/raw8: bound to major 8, minor 24 /dev/raw/raw9: bound to major 8, minor 25 # ls -l /dev/raw total 0 crw-rw---- 1 oracle oinstall 162, 5 Jun 9 17:15 raw5 crw-rw---- 1 oracle oinstall 162, 6 Jun 9 17:15 raw6 crw-rw---- 1 oracle oinstall 162, 7 Jun 9 17:15 raw7 crw-rw---- 1 oracle oinstall 162, 8 Jun 9 17:15 raw8 crw-rw---- 1 oracle oinstall 162, 9 Jun 9 17:15 raw9
ASMLib:(非Linux系统只能使用裸设备的方法)
ASMLib是一组可选的位于ASM和硬件之间的一个内核驱动程序工具,也是作为一个应用程序库通过Oracle数据库软件访问ASM磁盘。
它是Oracle 10g和11g单实例数据库以及RAC的ASM特性支持库。ASM和数据库实例可以使用ASMLib作为可替代的磁盘访问接口。
ASMLib有以下三个组件:
内核驱动:oracleasm Linux中支持oracle ASMLib的内核驱动程序(需根据内核版本下载)
支持工具:oracleasm-support 提供用于配置和启动ASM驱动程序的实用工具
应用程序库:oracleasmlib 提供了实际的ASM库

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA


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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

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

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools