- 浏览: 1320992 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (351)
- Java General (37)
- .net General (2)
- Linux Toy (55)
- Oracle (81)
- Mysql (11)
- Programer Career (12)
- Oh, my living ! (2)
- Shell Script (8)
- Web Service (0)
- Linux Server (22)
- Php/Python/Perl (3P) (2)
- Javascript General (5)
- Saleforce Apex Dev (2)
- Web General (5)
- Xen & VM tech. (17)
- PSP (13)
- OpenSolaris (34)
- php (1)
- RAI/flex/action script (16)
- asterisk/CTI (7)
- 交互设计 (6)
- English (3)
- Lucene (1)
最新评论
-
GuolinLee:
markmark
JVM调优总结 -Xms -Xmx -Xmn -Xss -
di1984HIT:
写的太好啊。
JVM调优总结 -Xms -Xmx -Xmn -Xss -
javajdbc:
javajdbc 写道
JVM调优总结 -Xms -Xmx -Xmn -Xss -
javajdbc:
...
JVM调优总结 -Xms -Xmx -Xmn -Xss -
alvin198761:
非常感谢,国外的被封杀了,你这里还有一份
How to Convert An Image-Based Guest To An LVM-Based Guest
How To Set Up Oracle ASM on Ubuntu Gutsy Gibbon
Posted in Group Blog Posts • Oracle
Tags: ASM • Gutsy Gibbon • Linux • Oracle • Oracle 11g • raw devices • Ubuntu • Ubuntu 7.10
I’ve recently moved to Ubuntu Linux , and this post describes my attempt to play around with Oracle ASM on Ubuntu. For this demonstration, I used Oracle 11.1.0.6 on Gutsy Gibbon . I hope it will be useful to somebody out there.
Important Notice: What I describe below is among the worst thing you can ever do with ASM. You can use it to play around but never use it with anything other than test data. If you lose something because of me, you’ll be the only one to blame !
Question #1: How do you simulate a disk from a file?
(See here for more details.)
If you have a free partition or disk to be used as an ASM disk, just
skip this step. If you don’t, you can create a file with the dd
command and create a device that actually loops to the file with the losetup
command.
Let’s assume you’ve created a directory named /asmdisks
(and you have write access to it). Run the command below to create a file named disk1 that is 3GB in size:
$ dd if=/dev/zero of=/asmdisks/disk1 bs=1024k count=3072 3072+0 records in 3072+0 records out 3221225472 bytes (3.2 GB) copied, 80.9113 seconds, 39.8 MB/s
Once you’ve created the file, map it to a device named loopN in /dev
. You can list the used loop devices with the losetup -a
command.
Once you’ve made sure the one you plan to used is free, e.g. /dev/loop1
, you can map the device to the file with the following commands (you have to be root) :
# losetup /dev/loop1 /asmdisks/disk1 # losetup -a /dev/loop1: [0802]:7438407 (/asmdisks/disk1)
Question #2: How do you create an interface to the disk that is usable by ASM?
Actually, the preferred way to access a disk from ASM on Linux is ASMLib . To be fair, I must say I didn’t even give it a try. Of course, I’d be more than interested if anybody could make it work on Ubuntu. You’ll have to recompile the source code and I doubt I’ll be able to do it myself.
So you may think, why not use Raw Devices ? Because you don’t need raw devices. You can just map the ASM disks to your disk/partition or loop devices.
So the only thing you need to do to start is change the ownership of the device so that ASM can access it in read/write mode as oracle
:
# chown oracle:dba /dev/loop1 # ls -l /dev/loop1 brw-rw—- 1 oracle dba 7, 1 2008-02-06 23:32 /dev/loop1
If you have a real disk partition (e.g. /dev/sdb1
):
# chown oracle:dba /dev/sdb1 # ls -l /dev/sdb1
Note 1:
I couldn’t manage to demonstrate 11g’s very cool offline ASM without
ASMLib or raw devices. Nonetheless, I’ll describe how to set up raw
devices on Gutsy later in this post.
Note 2:
If you want losetup
run and ownership set up automatically at boot time, you’ll have to define the correct rules in /etc/udev/rules.d
.
Question #3: How do you start up the Cluster Synchronization Service Daemon?
You may not have paid attention to it before, but ASM relies on the CSS Daemon. Who cares? I do, because CSSD relies on /etc/inittab
to startup and there is no such a file in Ubuntu. Nevermind, run the setup script as root :
# /u01/app/oracle/product/11.1.0/db_1/bin/localconfig reset 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 30 seconds. Checking the status of new Oracle init process… Expecting the CRS daemons to be up within 600 seconds.
Once you get the message about the 600 seconds, hit CRTL+C to stop the script, and then run the command below to actually run the CSS Daemon:
# nohup /etc/init.d/init.cssd run >/dev/null 2>&1 </dev/null &
Note 3: If you want the CSSD daemon to startup automatically, you’ll have to create a service in Ubuntu.
Question #4: How do you create the ASM instance, add a diskgroup, etc?
This is not really the subject of this post, but assuming you’ve already installed Oracle 11g accordingly to Augusto’s Installing Oracle 11g on Ubuntu Linux 7.10 (Gutsy Gibbon)
and you’ve setup the PATH
, ORACLE_HOME
and ORACLE_BASE
variables, you can do everything in one command:
$ dbca -silent -configureASM \ -asmSysPassword change_on_install \ -diskString "/dev/loop*" \ -diskList /dev/loop1 \ -diskGroupName DG1 \ -redundancy EXTERNAL
Once that is done, you can connect to the ASM instance with SQL*Plus:
$ source oraenv
ORACLE_SID = [oracle] ?+ASM
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1 is /u01/app/oracle
$ sqlplus / as sysdba
SQL> select NAME, TOTAL_MB
from v$asm_diskgroup;
NAME TOTAL_MB
---- --------
DG1 3072
Or you can use ASMCMD as below:
$ source oraenv ORACLE_SID = [oracle] ?+ASM The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1 is /u01/app/oracle $ asmcmd ASMCMD> ls DG1/
Question #5: How do you create a database that uses ASM?
I cannot resist providing the syntax for 11g (totalMemory
will have to be replaced by memoryPercentage
in 10g):
$ dbca -silent -createDatabase \ -templateName General_Purpose.dbc \ -gdbName BLUJ \ -sysPassword change_on_install \ -systemPassword manager \ -emConfiguration NONE \ -storageType ASM \ -asmSysPassword change_on_install \ -diskGroupName DG1 \ -characterSet WE8ISO8859P15 \ -totalMemory 250 ulimit: 1: Illegal option -u ulimit: 1: Illegal option -u ulimit: 1: Illegal option -u ulimit: 1: Illegal option -u Copying database files 1% complete 3% complete 37% complete Creating and starting Oracle instance 40% complete 45% complete 50% complete 55% complete 56% complete 60% complete 62% complete Completing Database Creation 66% complete 70% complete 73% complete 77% complete 88% complete 100% complete Look at the log file “/u01/app/oracle/cfgtoollogs/dbca/BLUJ/BLUJ.log” for further details.
Question #2 (Revisited): How do you create an interface to the disk that is usable by ASM ?
For 11g ASM offline tests, raw devices can actually be useful. And,
despite the missing pieces, creating a raw device that maps the loop
device (or real disk/partition) is straightforward. The first step
consists in filling the holes in Ubuntu, i.e. in creating some
character files that are not created by default on Gutsy Gibbon (rawctl
, raw0
. . . raw1
).
Run the set of commands below as root
:
modprobe raw
# mknod /dev/rawctl c 162 0 # mknod /dev/raw/raw1 c 162 1 # mknod /dev/raw/raw2 c 162 2 # ln -s /dev/rawctl /dev/raw/rawctl
Once the missing pieces rebuilt, mapping a raw devices to your disk or loop interface is as easy as:
# raw /dev/raw/raw1 /dev/loop1
Or if you use a partition named /dev/sdb1
:
# raw /dev/raw/raw1 /dev/sdb1
You can display the result of your settings with the command below.
# raw -qa /dev/raw/raw1: bound to major 7, minor 0
The raw devices won’t change anything but the path to the device when you’ll go from Question #3 to Question #5.
Note 4: If you want the raw devices to be setup automatically at boot time, you’ll have to define the correct rules in /etc/udev/rules.d
.
Conclusion
What I really like about Oracle is that once you’ve done something, you have ten different ways to go. I hope this post will enable you to explore some 11g’s new features on your favorite operating system.
发表评论
-
About Dedicated and Shared Server Processes
2010-11-29 15:46 1555一句话, shared server 就是为了省 SGA. ... -
oracle11GR2上建立一个新用户的过程,同时更改字符集.
2010-11-15 16:21 2922写道 SQL> create user mygmccr ... -
comment on table and column
2009-11-20 16:16 3367comment [Oracle SQL] ... -
解决ASM无法启动问题
2009-11-07 15:11 7123启动报错如下所 ... -
在Oracle中实现可扩展的多级编目结构
2009-10-23 13:49 13832009-10-16 ... -
用户帐号解锁
2009-10-21 08:06 1285SQL> alter user scott accoun ... -
按上下键调出 sqlplus 中的历史命令
2009-10-21 07:50 1995在sqlplus中不能按上下键不能显示出之前的命令, 也 ... -
简单的oracle物化视图
2009-09-28 22:29 1258物化视图是一种特殊的物理表,“物化”(Mate ... -
PL/SQL 总结(4)
2009-09-19 17:40 1070存储过程 create or replace PROCEDU ... -
PL/SQL 总结(3)
2009-09-19 17:40 1054使用游标 1)显示游标: CURSOR name_curs ... -
PL/SQL 总结(2)
2009-09-19 17:39 1095)将select 嵌入到PL/SQL中 ... -
PL/SQL 总结(1)
2009-09-19 17:38 1279我们开始学习PL/SQL PL/SQ ... -
Oracle 中的 Merge 语句
2008-07-29 15:45 1385Merge Statement Demo MERGE & ... -
SQL*Plus FAQ
2008-07-24 10:04 2181SQL*Pl ... -
Oracle Default Listener
2008-07-15 15:41 2287042 第23题 关于动态注册监听器 23.Your data ... -
自动安装 Oracle 数据库 10g 和 Red Hat Enterprise Linux
2008-07-13 09:52 2325自动安装 Oracle 数据库 10g 和 Red Hat ... -
在 Linux x86 上安装 Oracle 数据库 10g
2008-07-13 09:46 1352... -
Vmware server1.0 + Linux As4 + Oracle 10g RAC
2008-07-05 15:19 3248Vmware server1.0 + Linux A ... -
Installing Oracle10g R2 RAC on vmware suse
2008-07-04 10:47 4924Installing Oracle10g R2 RAC Par ... -
oracle rac 10.2 的在 linux 上的存储选项
2008-07-04 10:20 2722Oracle 集群需要存储的软 ...
相关推荐
kmod-oracleasm-2.0.8-15.el6_9.x86_64 oracleasm-support-2.1.8-1.el6.x86_64 oracleasmlib-2.0.4-1.el6.x86_64 安装顺序: rpm -ivh kmod-oracleasm-2.0.8-15.el6_9.x86_64.rpm rpm -ivh oracleasm-support-2.1.8...
包含如下oracleasm包: kmod-oracleasm-2.0.6.rh1-3.el6.x86_64.rpm oracleasm-2.0.8-4.el6_6.src.rpm oracleasm-2.0.8-6.el6_7.src.rpm oracleasm-2.0.8-8.el7.src.rpm oracleasm-2.0.8-15.el7.centos.src.rpm ...
Oracle ASM(Automatic Storage Management)是Oracle数据库系统中用于管理存储的一种高效、集成的解决方案。它提供了自动化的磁盘管理和故障恢复功能,简化了数据库管理员的工作。在安装Oracle ASM之前,必须先安装...
Oracle Support for Oracle ASM (Automatic Storage Management) 和 Kmod-OracleASM 包是Oracle数据库系统在Linux环境下进行存储管理的关键组件。这些包确保了在Red Hat Enterprise Linux (RHEL)、CentOS以及Oracle ...
Oracle ASM (Automatic Storage Management) 是 Oracle 公司推出的一种集成化的存储管理解决方案,它为数据库提供了高性能、高可用性和易于管理的存储环境。在Linux系统中,Oracle ASM 需要与特定的驱动程序协同工作...
Oracle ASM (Automatic Storage Management) 是 Oracle 公司提供的一种高效、自动化的磁盘管理解决方案,尤其在Oracle数据库环境中被广泛使用。它简化了存储管理,提供了高性能、高可用性和高可扩展性。Oracleasmlib...
Oracle ASM (Automatic Storage Management) 是 Oracle 公司提供的一种先进的存储管理解决方案,它为数据库和其他应用程序提供了统一的、高性能的磁盘管理功能。Oracle ASMLib(Oracle ASM Library)是与ASM配套使用...
oracleasm-2.6.18-128.el5-2.0.5-1.el5.i686.rpm oracleasmlib-2.0.4-1.el5.i386.rpm oracleasm-support-2.1.1-1.el4.i386.rpm X64: oracleasm-support-2.1.8-1.el5.x86_64.rpm oracleasmlib-2.0.4-1.el5.x86_64....
Oracle ASM (Automatic Storage Management) 是Oracle数据库管理系统中的一个组件,用于高效管理数据库的存储。它提供了集成的卷管理和文件系统,简化了存储管理和性能优化。在Oracle ASM环境中,Oracle ASMLib ...
Oracle ASM(Automatic Storage Management)是Oracle数据库公司提供的一种先进的存储管理解决方案,专为Oracle数据库设计。它整合了文件系统和卷管理器的功能,为数据库提供高效、可靠的存储管理。在Red Hat ...
Oracle ASM(Automatic Storage Management)是Oracle数据库公司提供的一种高级存储管理解决方案,主要用于简化和优化Oracle数据库的存储管理。Oracle ASM可以自动地管理和分配磁盘空间,提供数据冗余和容错功能,...
kmod-oracleasm-*,oracleasmlib*,oracleasm-support*。 虽然现在oracle-rac基本上已经都是用UEDV的来固化UUID了但是有些同学还不太会,然后看的教程都是使用asmlib来制作的,但是自己上机以后发现根本装不上啊,...
oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm oracleasmlib-2.0.4-1.el5.x86_64.rpm oracleasm-support-2.1.7-1.el5.x86_64.rpm kmod-oracleasm-2.0.8-15.el6_9.x86_64.rpm oracleasmlib-2.0.4-1.el6.x86_64....
Oracle ASM(Automatic Storage Management)是Oracle数据库系统中的一个组件,用于提供高效、自动化的存储管理功能。在Linux环境中安装Oracle 11g数据库时,ASM是必不可少的一部分,它可以帮助管理员轻松管理和配置...
Oracle ASM(Automatic Storage Management)是Oracle数据库公司提供的一种先进的存储管理解决方案,主要用于简化数据库和相关应用的数据存储。kmod-oracleasm是Oracle ASM在Linux操作系统上的内核模块,它允许系统...
centos 7.4 asm安装包包括三个(kmod-oracleasm-2.0.8-19.0.1.el7.x86_64,oracleasmlib-2.0.12-1.el7.x86_64,oracleasm-support-2.1.8-3.el7.x86_64)
Oracle ASM (Automatic Storage Management) 是Oracle数据库系统中的一个重要组件,用于提供高效、自动化的存储管理。kmod-oracleasm 是一个专门为CentOS操作系统编译的内核模块,它允许操作系统与Oracle ASM进行...
标题 "kmod-oracleasm-2.0.6.rh1-2.el6.x86_64.rpm" 指向的是一个针对Oracle Automatic Storage Management (Oracle ASM) 的内核模块,它被设计用于Red Hat Enterprise Linux 6 (RHEL 6) 平台的64位体系结构。Oracle...
### Oracle 不使用 OracleASM 的包配置 ASM 磁盘配置方法 #### 概述 在 Oracle 数据库系统中,自动存储管理(ASM)是用于管理数据库文件的一种高性能、高可用性的解决方案。通常情况下,ASM 依赖于 Oracle 提供的 ...