eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« I 服了 You,北京 | Blog首页 | Oracle 10g Release 2 all available »

Oracle 10g Release 2 new tools:asmcmd

为了简化加强asm管理,OracleR2推出了一个新的命令行工具:asmcmd.
让我们简单来看一下这个工具的用法。
1.登录
需要首先设置ORACLE_SID为ASM实例:
[oracle@danaly ~]$ export ORACLE_SID=+ASM
[oracle@danaly ~]$ asmcmd
ASMCMD> 


2.第一版asmcmd提供的功能
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

3.同常用的Unix/Linux命令类似
cd,pwd,ls,find等命令,可以帮助用户来检索asm管理下的文件:
ASMCMD> pwd
+
ASMCMD> ls
ORADG/
ASMCMD> ls -l
State    Type    Rebal  Unbal  Name
MOUNTED  EXTERN  N      N      ORADG/
ASMCMD> cd ORADG
ASMCMD> ls   
DANALY/
ASMCMD> cd DANALY
ASMCMD> ls -l
Type           Redund  Striped  Time             Sys  Name
                                                 Y    CONTROLFILE/
                                                 Y    DATAFILE/
                                                 Y    ONLINELOG/
                                                 Y    PARAMETERFILE/
                                                 Y    TEMPFILE/
                                                 N    spfiledanaly.ora => +ORADG/DANALY/PARAMETERFILE/ \
                                                                            spfile.269.600019515
ASMCMD> ls -l DATAFILE/
Type      Redund  Striped  Time             Sys  Name
DATAFILE  UNPROT  COARSE   SEP 01 18:00:00  Y    SYSAUX.266.600016977
DATAFILE  UNPROT  COARSE   SEP 01 18:00:00  Y    SYSTEM.264.600016955
DATAFILE  UNPROT  COARSE   SEP 01 18:00:00  Y    UNDOTBS1.265.600016969
DATAFILE  UNPROT  COARSE   SEP 01 18:00:00  Y    USERS.268.600016987

4.可以在asmcmd中创建删除目录,删除文件等
ASMCMD> mkdir test
ASMCMD> ls -l test
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfiledanaly.ora
test/
ASMCMD> rm test/
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfiledanaly.ora

5.lsct查看当前asm客户端
ASMCMD> lsct
DB_Name   Status        Software_Version  Compatible_version  Instance_Name
danaly    CONNECTED           10.2.0.1.0          10.2.0.1.0  danaly


6.lsdg查看当前磁盘组的状态
ASMCMD> lsdg
State    Type    Rebal  Unbal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Name
MOUNTED  EXTERN  N      N         512   4096  1048576     69459    68060                0           68060              0  ORADG/


总的看来,asmcmd只是带来了管理上的一些方便之处,本质上没有带来新的东西。但是可以猜测,有了这个命令行接口之后,Oracle将逐渐增加它的新功能。相信很快通过asmcmd来和操作系统交互,来备份拷贝文件将会成为可能。

历史上的今天...
    >> 2015-09-01文章:
    >> 2011-09-01文章:
    >> 2009-09-01文章:
    >> 2007-09-01文章:
           Oracle view V$SQLAREA Definition
    >> 2006-09-01文章:
           终于收到ITPUB的T-Shirt衫

无觅

By eygle on 2005-09-01 21:45 | Comments (0) | FAQ | 413 |


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com