ASMCMD> ls
Current.260.563388683
Current.261.563388685
Current.262.563388685
Recover disk space, use ASMCMD :
Assume that you have three RAC session nodes, the database stores logs and backup sets placed on ASM storage. After a while you see that they are no longer needed and want to delete them to reclaim disk space in ASM. Do as follows:
ASMCMD> CD + BACKUPDEST # change disc groups
ASMCMD> PWD # current directory
ASMCMD> find.-t BACKUPSET. * # to find backup file sets in disk groups
After the files are listed, you can use the rm command of the operating system to delete them and use RMAN to cross-check the deleted backups.
Note that the -t flag can have values such as DATAFILE, ARCHIVELOG, CONTROLFILE, ONLINELOG.
ASMCMD> help
asmcmd [-p] [command]
The ORACLE_HOME and ORACLE_SID environment variables determine the session the program is connecting to. ASMCMD establishes a retransmission connection to it, similar to SQLPLUS / AS SYSDBA. The user must be a member of the system administrator group (SYSDBA).
The -p option allows the current directory to be displayed in the Command Prompt command window, similar to:
ASMCMD [+ DATAFILE / ORCL / CONTROLFILE]>
[command] describes one of the following commands, accompanied by its parameters.
(Type 'help [command]' to see more help with ASMCMD if needed).
Commands:
CD
du
tìm
help
ls
lsct
lsdg
mkalias
mkdir
pwd
rm
rmalias
4, 10G R2 provides a more flexible way of transferring files between databases and an internal database: There is a more interesting way of transferring files between ASM disk groups (ASM Disk Group ) is to use RMAN. RMAN is an important component of Automatic Storage Management automatic storage management. It is responsible for monitoring ASM file names and deleting obsolete ASM files. Since the ASM file cannot be accessed via the normal operating system interface, RMAN becomes a useful means of copying ASM files.
However, in some cases you may want to transfer the file on the remote database server, not using RMAN or installing datagaurd. Then we have the DBMS package called DBMS_FILE_TRANSFER. 10G R2 version supports 'ASM to OS' file and 'OS File to ASM'. Previous versions of 10G also supported the transfer of 'ASM to ASM' file (between two ASM files) and 'OS to OS' (between two operating system files).
Using this function, DBA can transfer data files from within Oracle without physically "logging" the operating system itself. In addition, this function provides additional options for general database administration, such as simple storage management (need to free up disk space). Let's take a look at the following example to understand how to transfer an ASM file to the operating system directory:
SQL> select tablespace_name, file_name from dba_Data_files; TABLESPACE_NAME ------------------------------ FILE_NAME ------------------ -------------------------------------------------- -------------------------------------------------- - USERS + DATABASE_DG / qprv / users01.dbf SYSAUX + DATABASE_DG / qprv / sysaux01.dbf UNDOTBS1 + DATABASE_DG / qprv / undotbs01.dbf SYSTEM + DATABASE_DG / qprv / system01.dbf UNDOTBS2 + DATABASE_DG / qprv / undotbs02.dbf DEVICES + DATABASE_DG /qprv/devices_01.dbf SERVICES + DATABASE_DG / qprv / services_01.dbf OPERATIONS + DATABASE_DG / qprv / operations_01.dbf BBIDS_TBS + DATABASE_DG / qprv / bbids_tbs_01.dbf USERS + DATABASE_DG / qprv / users02.dbf TEST + DATABASE_DG / qprv / test. dbf 11 rows selected. SQL> create or replace directory oracle_10g as '+ DATABASE_DG / qprv /'; Thư mục tạo. SQL> grant read, write on directory oracle_10g to ram; Grant succeeded. SQL> create or replace oracle_dest directory as '+ db04 / oradata / qprv /'; Thư mục tạo. SQL> grant read, write on directory oracle_dest to ram; The offline succeeded SQL> ALTER DATABASE DATAFILE '+ DATABASE_DG / qprv / test.dbf'; Database altered.
Now, copy the file from the ASM target disk group to the normal OS file system directory.
BEGIN DBMS_FILE_TRANSFER.COPY_FILE (source_directory_object => 'ORACLE_10G', source_file_name => test.dbf, destination_directory_object => 'ORACLE_DEST', destination_file_name => 'TEST.DBF); END; Database altered
5, ASM / XDB FTP support is another new feature, allowing the use of XDB and ASM with the user interface to retrieve files and putting files into ASM managed storage areas. When selecting the XML Database component during the installation process, you can create a virtual ASM directory. This directory is empty and placed on / sys / asm, inside the XML Database hierarchical tree. Any activity on the ASM virtual directory is controlled by ASM. Administrators can exploit this function to configure different folders with different disk groups. A disk group folder can have internal subdirectories with several files, folders. The FTP component is quite useful in transferring files in / out of these directories.
6, Virtual tables and new ASM columns:
Conclude
New components in ASM make DBA's administration easier, especially multi-session management on the same node. You do not need to use any third party software in ASM disk management and database file system. The additional auto function helps ASM become a more stable, efficient and economical solution.