In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "how to install ASM on RedHat AS3". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install ASM on RedHat AS3.
= = operating system version
[root@TCLUX3245 root] # uname-a
Linux TCLUX3245 2.4.21-47.0.1.ELsmp # 1 SMP Fri Oct 13 17:56:20 EDT 2006 i686 i686 i386 GNU/Linux
Go to the oracle website to download the corresponding rpm package, where oracleasm-2.4.21-47.0.1.ELsmp-1.0.5-1.i686.rpm should be consistent with the result based on # uname-r, and the other two packages are common to each other. Address: http://www.oracle.com/technology/tech/linux/asmlib/index.html
[root@TCLUX3245 root] # uname-r
2.4.21-47.0.1.ELsmp
[root@TCLUX3245 asm_lib] # pwd
/ 10ginstaller/asm_lib
[root@TCLUX3245 asm_lib] # ls-l
Total 136
-rw-r--r-- 1 root root 94176 Mar 28 23:42 oracleasm-2.4.21-47.0.1.ELsmp-1.0.5-1.i686.rpm
-rw-r--r-- 1 oracle dba 13638 Mar 28 00:46 oracleasmlib-2.0.2-1.i386.rpm
-rw-r--r-- 1 oracle dba 22402 Mar 28 00:46 oracleasm-support-2.0.3-1.i386.rpm
= = install the package with no errors in the middle, otherwise there will be an error when starting ASM kernel module automatically after configuring the system reboot (Loading module "oracleasm": Unable to load module "oracleasm" [FAILED]'). Most of the reason is that oracleasm-2.4.21-47.0.1.ELsmp-1.0.5-1.i686.rpm does not have a download pair, which can be solved by reinstalling the correct rpm package after uninstalling.
[root@TCLUX3245 asm_lib] # rpm-ivh * .rpm
.
.
= = automatically start ASM kernel module after configuring system reboot
[root@TCLUX3245 asm_lib] # / etc/init.d/oracleasm configure
Default user to own the driver interface []: oracle
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (yzone) [n]: y
Fix permissions of Oracle ASM disks on boot (yzone) [y]: y
Writing Oracle ASM library driver configuration: [OK]
Creating / dev/oracleasm mount point: [OK]
Loading module "oracleasm": [OK]
Mounting ASMlib driver filesystem: [OK]
Scanning system for ASM disks: [OK]
In unix/linux, all devices are files, so we can build several files to simulate multiple hard drives. First use dd to create several files with a size of 1G
Root@TCLUX3245 dev] # mkdir / asmdisks
[root@TCLUX3245 dev] # dd if=/dev/sda2 of=/asmdisks/disk1 bs=1024k count=1000
Dd if=/dev/sda2 of=/asmdisks/disk2 bs=1024k count=1000
Dd if=/dev/sda2 of=/asmdisks/disk3 bs=1024k count=1000
Dd if=/dev/sda2 of=/asmdisks/disk4 bs=1024k count=1000
Dd if=/dev/sda2 of=/asmdisks/disk5 bs=1024k count=1000
Use the losetup command to make these files appear to linux as some storage device
[root@TCLUX3245 dev] # / sbin/losetup / dev/loop1 / asmdisks/disk1
/ sbin/losetup / dev/loop2 / asmdisks/disk2
/ sbin/losetup / dev/loop3 / asmdisks/disk3
/ sbin/losetup / dev/loop4 / asmdisks/disk4
/ sbin/losetup / dev/loop5 / asmdisks/disk5
Run the oracleasm command to make these storage devices spares for asm
Root@TCLUX3245 asm_lib] # / etc/init.d/oracleasm createdisk ASMD1 / dev/loop1
Marking disk "/ dev/loop1" as an ASM disk: [OK]
/ etc/init.d/oracleasm createdisk ASMD2 / dev/loop2
/ etc/init.d/oracleasm createdisk ASMD3 / dev/loop3
/ etc/init.d/oracleasm createdisk ASMD4 / dev/loop4
/ etc/init.d/oracleasm createdisk ASMD5 / dev/loop5
* [root@TCLUX3245 bin] # pwd
* / ddms01/dms/oracle/10.2.0/bin
* [root@TCLUX3245 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
* Adding to inittab
* Startup will be queued to init within 90 seconds.
* Checking the status of new Oracle init process...
* Expecting the CRS daemons to be up within 600seconds.
* CSS is active on these nodes.
* tclux3245
* CSS is active on all nodes.
* Oracle CSS service is installed and running under init (1m)
= = Edit asm init fil
[oracle@TCLUX3245 dbs] $cat init+ASM.ora
INSTANCE_TYPE=ASM
DB_UNIQUE_NAME=+ASM
LARGE_POOL_SIZE=8M
ASM_DISKSTRING='ORCL:*'
= = start ASM Instance and create disk group
[oracle@TCLUX3245 dbs] $export ORACLE_SID=+ASM
[oracle@TCLUX3245 dbs] $sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0-Production on Thu Mar 29 16:07:05 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL >
SQL > startup nomount
ASM instance started
Total System Global Area 79691776 bytes
Fixed Size 1217812 bytes
Variable Size 53308140 bytes
ASM Cache 25165824 bytes
SQL > create diskgroup DGROUP1 normal redundancy disk 'ORCL:ASMD1','ORCL:ASMD2','ORCL:ASMD3','ORCL:ASMD4','ORCL:ASMD5'
Diskgroup created.
SQL > col path format A20
SQL > select path,mount_status from v$asm_disk
PATH MOUNT_S
--
ORCL:ASMD1 CACHED
ORCL:ASMD2 CACHED
ORCL:ASMD3 CACHED
ORCL:ASMD4 CACHED
ORCL:ASMD5 CACHED
SQL > shutdown
ASM diskgroups dismounted
Add a line of ASM_DISKGROUPS='DGROUP1', to the init+ASM.ora so that asm instance can be started directly
INSTANCE_TYPE=ASM
DB_UNIQUE_NAME=+ASM
LARGE_POOL_SIZE=8M
ASM_DISKSTRING='ORCL:*'
ASM_DISKGROUPS='DGROUP1'
SQL > shutdown
ASM diskgroups dismounted
ASM instance shutdown
SQL > startup
ASM instance started
Total System Global Area 79691776 bytes
Fixed Size 1217812 bytes
Variable Size 53308140 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
Add the commands that create asm backup disks to the / etc/rc.local file so that every time the system reboot, those / asmdisks/diski files automatically become asm backup disks.
[root@TCLUX3245 etc] # cat / etc/rc.local
#! / bin/sh
#
# This script will be executed * after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
Touch / var/lock/subsys/local
/ sbin/losetup / dev/loop1 / asmdisks/disk1
/ sbin/losetup / dev/loop2 / asmdisks/disk2
/ sbin/losetup / dev/loop3 / asmdisks/disk3
/ sbin/losetup / dev/loop4 / asmdisks/disk4
/ sbin/losetup / dev/loop5 / asmdisks/disk5
/ etc/init.d/oracleasm createdisk ASMD1 / dev/loop1
/ etc/init.d/oracleasm createdisk ASMD2 / dev/loop2
/ etc/init.d/oracleasm createdisk ASMD3 / dev/loop3
/ etc/init.d/oracleasm createdisk ASMD4 / dev/loop4
/ etc/init.d/oracleasm createdisk ASMD5 / dev/loop5
=
Since then, the creation of ASM instance and ASM diskgroup has been completed, and the ASM diskgroup is created automatically after each system restart. Let's create the database.
=
= = create an initSID.ora file
[oracle@TCLUX3245 dbs] $pwd
/ ddms01/dms/oracle/10.2.0/dbs
[oracle@TCLUX3245 dbs] $cat initO01DMS0.ora
Db_name=O01DMS0
Sga_target=256M
Db_create_file_dest=+DGROUP1
= = create spfile and database
[oracle@TCLUX3245 dbs] $echo $ORACLE_SID
O01DMS0
[oracle@TCLUX3245 dbs] $sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0-Production on Thu Mar 29 18:05:00 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL > create spfile from pfile
File created.
SQL > startup nomount
ORACLE instance started.
Total System Global Area 268435456 bytes
Fixed Size 1218868 bytes
Variable Size 88082124 bytes
Database Buffers 171966464 bytes
Redo Buffers 7168000 bytes
SQL > show parameter spfile
NAME TYPE VALUE
-
Spfile string / ddms01/dms/oracle/10.2.0/dbs/
SpfileO01DMS0.ora
SQL > create database
Database created.
SQL > create temporary tablespace TEMP
Tablespace created.
SQL > create undo tablespace UNDOTBS1
Tablespace created.
SQL > @? / rdbms/admin/catalog.sql
.
SQL > @? / rdbms/admin/catproc.sql
.
SQL > alter database default temporary tablespace TEMP
Database altered.
SQL > alter system set undo_tablespace=UNDOTBS1 scope=spfile
System altered.
SQL > alter system set undo_management=AUTO scope=spfile
System altered.
SQL > startup force
ORACLE instance started.
Total System Global Area 268435456 bytes
Fixed Size 1218868 bytes
Variable Size 96470732 bytes
Database Buffers 163577856 bytes
Redo Buffers 7168000 bytes
Database mounted.
Database opened.
SQL > select file_name,bytes/1024/1024 MB from dba_data_files
FILE_NAME MB
+ DGROUP1/o01dms0/datafile/system.259.618516577 200
+ DGROUP1/o01dms0/datafile/sysaux.260.618516593 100
+ DGROUP1/o01dms0/datafile/undotbs1.262.618516647 100
SQL > select file_name,bytes/1024/1024 MB from dba_temp_files
FILE_NAME MB
+ DGROUP1/o01dms0/tempfile/temp.261.618516635 100
SQL > select a. Groupmakers Magi MEMBER Magi bytesUnix 1024 MB from v$logfile a Magi vandal log b
2 where a.group#=b.group#
GROUP# MEMBER MB
-
1 + DGROUP1/o01dms0/onlinelog/group_1.257.618516495 100
2 + DGROUP1/o01dms0/onlinelog/group_2.258.618516537 100
SQL > select BLOCK_SIZE*FILE_SIZE_BLKS from v$controlfile
BLOCK_SIZE*FILE_SIZE_BLKS
-
6062080
= the total space occupied by datafile, redo log file and control file is 705.78125MB
SQL > select 200, 100, 100, 100, 100, 60, 2080, 10, 24, 10, 24, MB from dual
MB
-
705.78125
SQL > exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the Partitioning, OLAP and Data Mining options
[oracle@TCLUX3245 oracle] $export ORACLE_SID=+ASM
[oracle@TCLUX3245 oracle] $sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0-Production on Fri Mar 30 11:24:22 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the Partitioning, OLAP and Data Mining options
SQL > select PATH,MOUNT_STATUS,NAME,TOTAL_MB,FREE_MB from v$asm_disk
PATH MOUNT_S NAME TOTAL_MB FREE_MB
--
ORCL:ASMD1 CACHED ASMD1 1000 673
ORCL:ASMD2 CACHED ASMD2 1000 675
ORCL:ASMD3 CACHED ASMD3 1000 675
ORCL:ASMD4 CACHED ASMD4 1000 676
ORCL:ASMD5 CACHED ASMD5 1000 675
= the total space used in DiskGroup is 1626MB
SQL > select 5000,673,675,675,675 MB from dual
MB
-
1626
1626MB > 2*705.78125MB
Notice the script that created the diskgroup earlier
SQL > create diskgroup DGROUP1 normal redundancy disk...
Where NORMAL REDUNDANCY: requires the existence of at least two failure groups. There is a redundancy of files in each diskgroup, coupled with some additional space needed to create asm spares, resulting in more than 700 megabytes of files taking up 1.6 gigabytes of space.
At this point, I believe you have a deeper understanding of "how to install ASM on RedHat AS3". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.