oracle-asm,acfs
两个类比
asm与lvm比较
asm实例与oracle实例比较
ASM是OMF的一个扩展,通过ASM和OMF的结合,oracle在上层将数据文件进行自我管理,在底层将存储进行自我管理。同时,ASM模式下,备份恢复只能由rman来承担,真正做到了“3M融合”。同时也是向上兼容的体现,简化RAC中存储端的配置。
oracle将extents播撒在它所管理的磁盘组的磁盘上,与LVM基本对应。
ASM diskgroup VG
ASM disk PV
ASM file LV
ASM实例和oracle实例都是由SGA和一堆后台进程构成,但他们所面对的对象是不同的,oracle实例管理的是数据库,而ASM实例用于对磁盘组的管理。
启动和停止实例的命令也基本一样。
NOMOUNT :仅启动实例
MOUNT 、OPEN:启动实例并加载磁盘,注意加载的是磁盘组,OPEN选项对于ASM实例无意义,等同于MOUNT
FORCE :相当于先执行shutdown abort,然后再startup
但是,ASM 实例没有数据字典之类的东东存储用户系统。
[root@rac02 ~]# acfsutil --help Usage: acfsutil [-h] command ... # (Version 11.2.0.1.0.0) -h - help Command Subcmd Arguments
-------- ------ ----------------------------------------------------------------
help - display this message
version - display ACFS version information
info fs - Display all ACFS file systems
info fs [<path> ...] - Display specific ACFS file sys
info fs -o <item> <path> - Display specific file sys item:
info fs -o freespace, totalspace,
info fs -o mountpoints, volumes,
info fs -o available, ismountpoint,
info fs -o isavailable, iscorrupt,
info fs -o isadvm, diskgroup,
info fs -o redundancy, resizeincrement,
info fs -o stripewidth, stripecolumns,
info fs -o primaryvolume
info file <path> [<path> ...] - Display specific file info
info id <file-identifier> <mountpoint> -
info id Display the pathname associated with the given
info id ACFS file identifier and mountpoint.
rmfs <device> - Remove unmounted ACFS file sys
size [-|+]nnn[K|M|G|T|P] [-d <device>] <path> - Resize file system
registry [-l] - Display registry contents
registry -l <mountpoint> - Display a specific mount point
registry -l <device> - Display a specific device
registry -m <device> - Display a specific mount point associated with a device
registry -a [-f] [-o <opts>] [-n <nodes>] <device> <mountpoint> - Add a mount point
registry -d [<mountpoint> | <device>] - Delete a mount point or a device
tune AcfsMaxOpenFiles - Maximum number of open files
tune (Windows only)
snap create <snap_name> <mountpoint> - create a file system snapshot
snap delete <snap_name> <mountpoint> - delete a file system snapshot
[root@rac02 ~]# acfsutil registry -l
Device : /dev/asm/archlv- : Mount Point : /archive : Options : none : Nodes : all : Disk Group : ARCH : Volume : ARCHLV
[root@rac02 ~]# acfsutil info fs
/archive
ACFS Version: 11.2.0.1.0.0
flags: MountPoint,Available
mount time: Wed Nov ::
volumes:
total size:
total free:
primary volume: /dev/asm/archlv-
label:
flags: Primary,Available,ADVM
on-disk version: 39.0
allocation unit:
major, minor: ,
size:
free:
ADVM diskgroup ARCH
ADVM resize increment:
ADVM redundancy: unprotected
ADVM stripe columns:
ADVM stripe width:
number of snapshots:
snapshot space usage:
####oracle ASM 安装这三个包
[root@rac01 /]# rpm -qa|grep oracl
oracleasm-2.6.18-308.el5-2.0.5-1.el5
oracleasm-support-2.1.8-1.el5
oracleasmlib-2.0.4-1.el5
[root@rac01 /]# find / -name oracleasm
/sys/module/oracleasm
/lib/modules/2.6.18-308.el5/kernel/drivers/addon/oracleasm
/proc/fs/oracleasm
/usr/lib/oracleasm
/usr/sbin/oracleasm
/etc/rc.d/init.d/oracleasm
/etc/sysconfig/oracleasm
/dev/oracleasm
/var/log/oracleasm ####配置ASMlib,再使用ASMlib之前,必须运行配置脚本准备驱动程序
/etc/init.d/oracleasm configure
/etc/init.d/oracleasm enable
####检查驱动加载情况
[root@rac01 dev]# lsmod | grep oracleasm
检查oracleasmfs文件系统:
[root@rac01 ~]# df -a |head -1;df -a | grep oracleasm
asm disk创建成功后,会在/dev/oracleasm/disks目录下有相应的文件
[root@rac01 ~]# cat /var/log/oracleasm 及时查看日志
创建asm磁盘
[root@rac01 ~]# fdisk -l
[root@rac01 ~]# fdisk /dev/sdf
[root@rac01 ~]# partprobe
[root@rac01 ~]# oracleasm --help
[root@rac01 ~]# oracleasm createdisk ARCHVOL1 /dev/sde1
[root@rac01 ~]# oracleasm createdisk CRSVOL1 /dev/sdc1
[root@rac01 ~]# oracleasm createdisk DATAVOL1 /dev/sdf1
[root@rac01 ~]# oracleasm createdisk FLASHVOL1 /dev/sdd1
[root@rac01 ~]# oracleasm scandisks
[root@rac02 ~]# oracleasm listdisks
ARCHVOL1
CRSVOL1
DATAVOL1
FLASHVOL1
[root@rac02 ~]# oracleasm querydisk -p ARCHVOL1
Disk "ARCHVOL1" is a valid ASM disk
/dev/sde1: LABEL="ARCHVOL1" TYPE="oracleasm"
[root@rac01 ~]# oracleasm querydisk -d ARCHVOL1
Disk "ARCHVOL1" is a valid ASM disk on device /dev/sde1[8,65]
[root@rac01 ~]# oracleasm querydisk -d CRSVOL1
Disk "CRSVOL1" is a valid ASM disk on device /dev/sdc1[8,33]
[root@rac01 ~]# oracleasm querydisk -d DATAVOL1
Disk "DATAVOL1" is a valid ASM disk on device /dev/sdf1[8,81]
[root@rac01 ~]# oracleasm querydisk -d FLASHVOL1
Disk "FLASHVOL1" is a valid ASM disk on device /dev/sdd1[8,49]
SQL> select * from v$asm_client;
SQL> select * from v$asm_diskgroup; 4块盘,4个磁盘组
http://blog.csdn.net/leshami/article/details/6134071 ASM 磁盘、目录的管理
创建asm磁盘组
切换到 grid 用户下,执行 ASMCA 创建 ASM 磁盘组
要在 ASM diskgroup 上创建 Oracle ADVM volume,diskgroup 的 COMPATIBLE.ASM和COMPATIBLE.ADVM兼容性必须 设置为 11.2.0.2。
可以在创建磁盘组时选择“Advanced Options”设置diskgroup的该属性,也可以通过 sql 命令创建磁盘组或者修改磁盘组的该属性, 创建Oracle ADVM volume
ASMCMD [+] > volcreate -G GOLDENGATE -s 1900m GOLDENGATE 创建Oracle ACFS 文件系统
[root@rac1 ~]# /sbin/mkfs -t acfs /dev/asm/goldengate-
在节点1和2上分别创建 ACFS 文件系统的挂载点
在集群 mount registery 中注册刚刚创建的 ACFS 文件系统,也可以不注册,直接手动挂载。注册 ACFS 文件系统的好处是在集群每隔30秒检查 mount registery 时会在每个节点自动挂载该文件系统,同时当集群软件或系统重启后也会自动挂载该文件系统。
[root@rac1 ~]# /sbin/acfsutil registry -a /dev/asm/goldengate- /home/oracle/ggs
acfsutil registry: mount point /home/oracle/ggs successfully added to Oracle Registry
手动挂载命令如下:
[root@rac1 ~]# /bin/mount -t acfs /dev/asm/goldengate- /home/oracle/ggs
执行注册命令后等待30秒,然后在各节点查看ACFS文件系统是否挂载
[root@rac1 ~]# df -h
[root@rac2 ~]# df -h 测试文件系统
[root@rac1 ~]# chown -R oracle:oinstall /home/oracle/ggs
第一节点
[oracle@rac1 ~]$ echo "Oracle ACFS File System" > /home/oracle/ggs/acfs.log
[oracle@rac1 ggs]$ more /home/oracle/ggs/acfs.log
Oracle ACFS File System
第二节点
[oracle@rac2 ~]$ more /home/oracle/ggs/acfs.log
Oracle ACFS File System ####下面是一个已设置好的实例,所以只查看相关信息
[root@rac02 ~]# su - grid
[grid@rac02 ~]$ echo $ORACLE_SID
+ASM2
####如果没有上面的,就会连接到一个空的实例上
[oracle@rac02 ~]$ asmcmd
Connected to an idle instance.
ASMCMD>
[grid@rac02 ~]$ asmcmd -p
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8:zh_CN.gb2312"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8:zh_CN.gb2312"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
ASMCMD [+] > lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N N ARCH/
MOUNTED EXTERN N N CRS/
MOUNTED EXTERN N N DATA/
MOUNTED EXTERN N N FLASH/
ASMCMD [+] > lsdsk
Path
ORCL:ARCHVOL1
ORCL:CRSVOL1
ORCL:DATAVOL1
ORCL:FLASHVOL1
ASMCMD [+] > lsct
DB_Name Status Software_Version Compatible_version Instance_Name Disk_Group
+ASM CONNECTED 11.2.0.1. 11.2.0.1. +ASM2 CRS
asmvol CONNECTED 11.2.0.1. 11.2.0.1. +ASM2 ARCH
bus CONNECTED 11.2.0.1. 11.2.0.0. bus DATA
bus CONNECTED 11.2.0.1. 11.2.0.0. bus FLASH
ASMCMD [+] > help lsof
lsof [-G dgroup] [--dbname dbname] [-C clientinstname] Lists the open files in an ASM instance.
[--dbname <dbname>] list files only from database <dbname>
[-G <dgname>] list files only from from disk group <dgname>
[-C <clientinstname>] list files only from instance <clientinstname>
ASMCMD [+] > lsof --dbname asmvol
DB_Name Instance_Name Path
asmvol +ASM2 +arch/ARCHLV.256.828288767
ASMCMD [+] > lsof --dbname bus
DB_Name Instance_Name Path
bus bus +data/bus/changetracking/ctf.1271.843239387
bus bus +data/bus/controlfile/current.507.843164017
bus bus +data/bus/datafile/example.263.843164031
ASMCMD [+] > volinfo -a
Diskgroup Name: ARCH
Volume Name: ARCHLV
Volume Device: /dev/asm/archlv-215
State: ENABLED
Size (MB): 102144
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage: ACFS
Mountpath: /archive
ASMCMD [+] > volstat DISKGROUP NUMBER / NAME: / ARCH
---------------------------------------
VOLUME_NAME
READS BYTES_READ READ_TIME READ_ERRS
WRITES BYTES_WRITTEN WRITE_TIME WRITE_ERRS
-------------------------------------------------------------
ARCHLV ASMCMD [+] > volinfo -G ARCH ARCHLV
Diskgroup Name: ARCH Volume Name: ARCHLV
Volume Device: /dev/asm/archlv-
State: ENABLED
Size (MB):
Resize Unit (MB):
Redundancy: UNPROT
Stripe Columns:
Stripe Width (K):
Usage: ACFS
Mountpath: /archive
ASMCMD [+] > pwd
+
ASMCMD [+] > ls
ARCH/
CRS/
DATA/
FLASH/
ASMCMD [+] > cd flash
ASMCMD [+flash] > ls
BUS/
FLT/
MAN/
ASMCMD [+crs/rac-cluster] > du ocrfile
Used_MB Mirror_used_MB ASMCMD [+data/bus/tempfile] > ls -l
Type Redund Striped Time Sys Name
TEMPFILE UNPROT COARSE NOV :: Y TEMP.266.843164027
ASMCMD [+data/bus] > iostat
Group_Name Dsk_Name Reads Writes
ARCH ARCHVOL1
CRS CRSVOL1
DATA DATAVOL1
FLASH FLASHVOL1
ASMCMD [+data/bus] > iostat --io
Group_Name Dsk_Name Reads Writes
ARCH ARCHVOL1
CRS CRSVOL1
DATA DATAVOL1
FLASH FLASHVOL1
ASMCMD [+data/bus] > iostat -t
Group_Name Dsk_Name Reads Writes Read_Time Write_Time
ARCH ARCHVOL1 . .
CRS CRSVOL1 3.835 .
DATA DATAVOL1 2107092.656861 160237.009142
FLASH FLASHVOL1 3062.787 715411.780234
ASMCMD [+data/bus] > lsdsk --statistics
Reads Write Read_Errs Write_Errs Read_time Write_Time Bytes_Read Bytes_Written Voting_File Path
. . N ORCL:ARCHVOL1
3.838 . Y ORCL:CRSVOL1
2107092.775861 160237.608142 N ORCL:DATAVOL1
3062.794 715412.346234 N ORCL:FLASHVOL1
ASMCMD [+data/bus] > help lsod
lsod [-H] [-G <group>] [--process <proc>] [disk] Displays the open devices -G <group> Filters devices belonging to diskgroup <group> --process <proc> Filters processes of name <proc>. <disk> Filters disks of name <disk>. -H Suppresses column header from the output. ASMCMD [+data/bus] > lsod
Instance Process OSPID Path
oracle@rac02 (DBW0) ORCL:ARCHVOL1
oracle@rac02 (DBW0) ORCL:CRSVOL1
oracle@rac02 (DBW0) ORCL:DATAVOL1
oracle@rac02 (DBW0) ORCL:FLASHVOL1
oracle@rac02 (GMON) ORCL:ARCHVOL1
oracle@rac02 (GMON) ORCL:CRSVOL1
oracle@rac02 (GMON) ORCL:DATAVOL1
oracle@rac02 (GMON) ORCL:FLASHVOL1
oracle@rac02 (LGWR) ORCL:ARCHVOL1
oracle@rac02 (LGWR) ORCL:CRSVOL1
oracle@rac02 (LGWR) ORCL:DATAVOL1
oracle@rac02 (LGWR) ORCL:FLASHVOL1
oracle@rac02 (RBAL) ORCL:ARCHVOL1
oracle@rac02 (RBAL) ORCL:ARCHVOL1
oracle@rac02 (RBAL) ORCL:CRSVOL1
oracle@rac02 (RBAL) ORCL:CRSVOL1
oracle@rac02 (RBAL) ORCL:DATAVOL1
oracle@rac02 (RBAL) ORCL:DATAVOL1
oracle@rac02 (RBAL) ORCL:FLASHVOL1
oracle@rac02 (RBAL) ORCL:FLASHVOL1
oracle@rac02 (TNS V1-V3) ORCL:CRSVOL1
oracle@rac02 (VBG0) ORCL:ARCHVOL1
ASMCMD [+data/bus] > help lstmpl
lstmpl [-Hl] [-G dgname] [pattern] Lists ASM templates in a disk group.
[-G dgname] shows the templates that belong to a certain disk group.
[-l] shows detailed information about the templates.
[-H] supress headers.
[pattern] filter out template names that match a given pattern. ASMCMD [+data/bus] > lstmpl
Group_Name Group_Num Name
ARCH ARCHIVELOG
ARCH ASMPARAMETERBAKFILE
ARCH ASMPARAMETERFILE
ARCH ASM_STALE
ARCH AUTOBACKUP
ARCH BACKUPSET
ASMCMD [+data/bus] > help lspwusr
lspwusr [-H] List the users from an orapwd file. [-H] suppress headers ASMCMD [+data/bus] > lspwusr
Username sysdba sysoper sysasm
SYS TRUE TRUE TRUE
ASMSNMP TRUE FALSE FALSE
SYSASM FALSE FALSE TRUE
多实例的启动,先启动asm实例,再启动bus或man实例。
1.13 启动 ASM 数据库的步骤
由于启动 ASM 数据库必须要先启动ASM 实例, 所以基本上启动步骤如下.
1) 先启动ASM实例
$ export ORACLE_SID=+ASM
$ sqlplus / as sysdba
SQL> startup;
SQL> exit;
2) 再启动数据库
$ export ORACLE_SID=EUIS
$ sqlplus / as sysdba
SQL> startup;
SQL> exit; 单instance使用ASM rac环境使用ASM 使用ASM必须先启动CSS服务,只有启动ASM服务,ASM磁盘组才可以被挂载 Cluster Synchronization Services daemon [root@rac02 bin]# ./localconfig add 启动CSS服务 [root@rac02 bin]# find /u01 -name localconfig
/u01/app/11.2.0/grid/crs/utl/localconfig 11g里没有localconfig了。你需要安装grid。用crs_start 命令来启动,要单独用GRID软件 Oracle Grid Infrastructure
http://www.oracle.com/technetwork/cn/articles/index-094679-zhs.html [root@rac02 bin]# su - oracle
[oracle@rac02 ~]$ export ORACLE_SID=+ASM
[oracle@rac02 ~]$ asmcmd
Connected to an idle instance.
ASMCMD> startup
ERROR:
ORA-01031: insufficient privileges
Enter password:
ERROR:
ORA-01005: null password given; logon denied
Connected to an idle instance. 查看自己的环境变量
export ORACLE_BASE=/grid
export ORACLE_HOME=$ORACLE_BASE/product/11.2.3
跟运行的不一样,所以所环境变量改好就行了。 ASMCMD-08102: no connection to ASM; command requires ASM to run 11G R2 有专门的grid用户维护ASM和cluster ware
而且你看看你的ASMinstance到底启动了没?
看看进程也行啊 两种方式 sqlplus / as sysasm和grid用户的asmcmd命令 11g r2 不能用 sqlplus / as sysdba这样启动的 用 sqlplus / as sysasm ps -ef | grep asm* 从上面看,ASM instance好像已经起来了
但是我使用grid 用户,asmcmd 进去之后,任何的命令都无法执行
报错提示全部都是:ASMCMD-08102: no connection to ASM; command requires ASM to run 我用 sysasm 启动也是这样,说已经有实例在运行了,现在关也关不掉,难道让我重启服务器吗? 正如楼上说的,这是环境变量设置错误的结果
我当时做实验的时候没有新建grid用户,所以,我的操作是
export ORACLE_SID=+ASM
export ORACLE_HOME=/u01/app/11.2.0/grid 可以看出diskgroup没有mount,所以先把diskgroup mount
oracle-asm,acfs的更多相关文章
- Oracle 11g RAC database on ASM, ACFS or OCFS2
I see a lot of questions on shared file systems that can be used when people move from single instan ...
- Linux CentOS6.5下安装Oracle ASM
Oracle版本:Oracle 11g 1.确定自己的Linux版本: [root@localhost ~]#uname -r 2.6.32-431.el6.x86_64 2.6.32-431.el6 ...
- oracle asm 概念
automated storage management ,即自动存储管理,简称asm .. 在oracle 10g 这个版本之前,管理一个大型数据库成千上万的数据文件对数据库管理员来说是一个既无技术 ...
- Oracle ASM
一 Oracle ASM簡介 Oracle 10g推出的管理磁盤的新方式,用於取代LVM技術.主要用于RAC環境 二 Oracle ASM的配置安裝 1.安裝asm包 RedHat Linux5.x ...
- 使用裸设备配置Oracle ASM实例一例
1.查看当前磁盘 [root@std u01]# fdisk -l Disk /dev/sda: bytes heads, sectors/track, cylinders Units = cylin ...
- [置顶] Oracle 11g R2 ASM:了解 Oracle ASM 基本概念
About Oracle ASM Instances About Oracle ASM Disk Groups About Mirroring and Failure Groups About Ora ...
- Oracle asm介绍和安装linux+oracle10g+asm过程
Oracle asm介绍和安装linux5.2+oracle10g+asm过程 1)ASM(自动存储管理)的来由: ASM是Oracle 10g R2中为了简化Oracle数据库的管理而推出来 ...
- 转://Window下安装Oracle ASM单实例数据库
之前做的Oracle ASM实验都是基于Linux或者Unix操作系统的,最近想试试如何在Windows环境下使用Oracle ASM.本文介绍如何在windows下创建裸设备,并创建ASM磁盘组以及 ...
- [转载] 虚拟机下面安装windows+oracle ASM的过程
转帖:https://www.2cto.com/database/201303/195261.html 最开始的时候 我找了一个挺好的教程 安装过 但是已经找不到了,先转载一下这个内容,后续再测试完善 ...
- Oracle ASM 详解
ASM:Automatic Storage Management, 是Oracle 主推的一种面向Oracle的存储解决方案, ASM 和 RDBMS 非常相似,ASM 也是由实例和文件组成, 也可以 ...
随机推荐
- sublime3笔记
选择类Ctrl+D 选中光标所占的文本,继续操作则会选中下一个相同的文本. Alt+F3 选中文本按下快捷键,即可一次性选择全部的相同文本进行同时编辑.举个栗子:快速选中并更改所有相同的变量名.函数名 ...
- 爬虫再探之mysql简单使用
在爬取数据量比较大时,用EXCEL存取就不太方便了,这里简单介绍一下python操作mysql数据库的一些操作.本人也是借助别人的博客学习的这些,但是找不到原来博客链接了,就把自己的笔记写在这里,这里 ...
- HTTP Live Streaming直播(iOS直播)技术分析与实现
前些日子,也是项目需要,花了一些时间研究了HTTP Live Streaming(HLS)技术,并实现了一个HLS编码器HLSLiveEncoder,当然,C++写的.其功能是采集摄像头与麦克风,实时 ...
- Redis - 事物控制和发布订阅
multi命令后续命令将进入队列,不会马上执行,当执行exec后,一次输出所有结果 事物回滚使用discard命令,放弃之前的输入执行. SUBSCRIBE/PUBLISH SUBSCRIBE KEY ...
- [转]Raft [Why Not Paxos]
http://blog.csdn.net/cszhouwei/article/details/38374603 动画讲解 http://thesecretlivesofdata.com/raft/ W ...
- Jquery autocomplete插件的使用
简单用法: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEnc ...
- iOS开发环境C语言基础 变量 、 数据类型和变量赋值 、 其他 、 运算符
1 变量使用常用错误汇总 1.1 问题 在我们使用变量的过程中,会遇到一些问题,在此将这些问题进行汇总,在今后使用的过程中,不出错.即使出现错误也可以很快地找到问题所在. 1.2 方案 变量在使用的过 ...
- LeetCode Search a 2D Matrix(二分查找)
题意: 有一个矩阵,每行都有序,每行接在上一行尾后仍然有序.在此矩阵中查找是否存在某个数target. 思路: 这相当于用一个指针连续扫二维数组一样,一直p++就能到最后一个元素了.由于用vector ...
- LeetCode Find the Duplicate Number 找重复出现的数(技巧)
题意: 有一个含有n+1个元素的数组,元素值是在1-n之间的整数,请找出其中出现超过1次的数.(保证仅有1个出现次数是超过1的数) 思路: 方法一:O(nlogn).根据鸽笼原理及题意,每次如果< ...
- cannot find -lgcc_s
在64位centos6上编译32位的汇编程序,如果程序中使用了C库,比如printf.因为是编译32位的目标程序,所以使用gcc编译的时候需要加上-m32选项,但是如果编译的话会报错,以print.s ...