ASM instances using the Asmcmd tool to manage ASM catalogs and files

Source: Internet
Author: User
Tags mkdir

In the ASM instance, all files stored in the ASM Disk group are inaccessible to the operating system commands and therefore cannot be manipulated using regular commands to manipulate the files on the ASM disk. Fortunately, we have asmcmd tools to do this work in lieu of operating system commands. The Asmcmd tool provides common commands similar to the operating system, such as LS, Du, FIND,CD, RM, mkdir, and so on. These tools make it easier to complete the management of ASM instances.

1.ASMCMD the location of the file

[Root@oradb ~]# Su-oracle

[Oracle@oradb ~]$ which asmcmd

/u01/oracle/10g/bin/asmcmd

2. Start Asmcmd

[oracle@oradb ~]$ Export Oracle_sid=+asm--set ORACLE_SID environment variables before startup

[Oracle@oradb ~]$ Asmcmd

Asmcmd> Help

Asmcmd [-p] [command]-this way you can complete the function directly without having to go to the Asmcmd prompt

The environment variables Oracle_home and ORACLE_SID determine the instance to which the program connects, and Asmcmd esta  Blishes a bequeath connection to it, in the same manner as a sqlplus/as SYSDBA. The user must is a member of the SYSDBA group. Specifying THE-P option allows the current directory to is 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.

--At the asmcmd command prompt, enter help [command] to display the command assistance information

Commands

--------

Cd

Du

Find

Help

Ls

Lsct

Lsdg

Mkalias

Mkdir

Pwd

Rm

Rmalias

3. Specific usage

[Oracle@oradb ~]$ asmcmd-p ls-l--no need to go to the Asmcmd command prompt to complete the appropriate functions

State Type Rebal Unbal Name

Mounted NORMAL n N dg1/

Mounted NORMAL n N dg2/

Mounted EXTERN n N rev/

Asmcmd> ls-l--View basic information about a disk group

State Type Rebal Unbal Name

Mounted NORMAL n N dg1/

Mounted NORMAL n N dg2/

Mounted EXTERN n N rev/

Asmcmd> ls-s--View disk group details such as disk size, free space, sector size, etc.

Sector block AU total_mb free_mb req_mir_free_mb usable_file_mb offline_disks Name

4096 1048576 3058 1498 0 749 0 dg1/

4096 1048576 0 0 dg2/

4096 1048576 3074 2949 0 2949 0 rev/

Asmcmd> du-View the capacity used by the current directory disk

USED_MB MIRROR_USED_MB

804 1541

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.