oracle ASM概念详解4
5. ASMCMD 工具
ASM 实例的管理除了sqlplus, Oracle 还提供了asmcmd 命令, 具体参考help。
[oracle@node1 bin]$ which asmcmd
/u01/app/oracle/product/10.2.0/db_1/bin/asmcmd
[oracle@node1 bin]$ cd /u01/app/oracle/product/10.2.0/db_1/bin/
[oracle@node1 bin]$ ./asmcmd
ASMCMD> ls
DATA/
FLASH_RECOVERY_AREA/
ASMCMD> help
asmcmd [-p] [command]
The environment variables ORACLE_HOME and ORACLE_SID determine the
instance to which the program connects, and ASMCMD establishes a
bequeath connection to it, in the same manner as a SQLPLUS / AS
SYSDBA. The user must be a member of the SYSDBA group.
Specifying the -p option allows the current directory to be displayed
in the command prompt, like so:
ASMCMD [+DATAFILE/ORCL/CONTROLFILE] >
[command] specifies one of the following commands, along with its
parameters.
Type “help [command]” to get help on a specific ASMCMD command.
commands:
——–
cd
du
find
help
ls
lsct
lsdg
mkalias
mkdir
pwd
rm
rmalias
ASMCMD>
—– 2010年9月23日补充——–
里面有删除别名的语法, 现在已经不支持了。 之前没有测试,写文章不严禁。 在google上搜这个问题的时候,发现有人转载了我的文章,但是这个错误还是没有发现。
刚查阅了一下Oracle 的联机文档, 删除别名用的也是drop。
Example 7-5 Dropping an alias name for an Oracle ASM filename
ALTER DISKGROUP data DROP ALIAS ‘+data/payroll/compensation.dbf’;
地址:
https://download.oracle.com/docs/cd/E11882_01/server.112/e16102/asmfiles.htm#CHDDHIGG
这里面有对ASM 有详细的说明。 可以参考。
顺便补充一点知识:
C:\Users\Administrator.DavidDai>sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on 星期四 9月
Copyright (c) 1982, 2010, Oracle. All rights reserved
SQL> conn sys/oracle@rac2 as sysdba;
已连接。
SQL> select file_name from dba_data_files;
FILE_NAME
——————————————————
+DATA/orcl/datafile/users.279.730181053
+DATA/orcl/datafile/sysaux.277.730181053
+DATA/orcl/datafile/undotbs1.278.730181053
+DATA/orcl/datafile/system.276.730181051
+DATA/orcl/datafile/undotbs2.284.730181347
ASM文件名字的格式是固定的:+group/dbname/file type/tag.file.incarnation
在创建db时系统自动创建的几个表空间(system,undotbs,sysaux,users)对应的都是真实的数据文件,即ASM 文件默认的命名格式。
而且这个信息都写到了控制文件里。 如果我们使用别名的话,会方便很多。 对于这些创建数据库时自动创建的表空间,我们要他们使用别名,
除了手工创建对应别名外,还需要重建控制文件,并且在重建时,datafile 里写别名的信息。 这样数据库也就使用别名了。
声明: 除非转自他站(如有侵权,请联系处理)外,本文采用 BY-NC-SA 协议进行授权 | 嗅谱网
转载请注明:转自《oracle ASM概念详解4》
本文地址:http://www.xiupu.net/archives-460.html
关注公众号:
微信赞赏
支付宝赞赏