If the database uses the ASM file system for management, it may be difficult to download and upload files. Even if the asmcmd tool is used, there is no command similar to CP to copy files, oracle provides FTP to manage a series of ASM files. Using FTP with Oracle ASM fileshttp: // docs.oracle.com/cd/e11882_01/appdev.#/e23094/xdb22pro.htm?adxdb5537
Oracle Automatic Storage Management (Oracle ASM) organizes database files into disk groups for simplified management and added benefits such as database sorting and I/O balancing. Database administrators can use protocols and
Resource APIs to access Oracle ASM files in the Oracle xml db repositoryvirtual folder/sys/asm
.
All files in/sys/asm
Are binary.
Typical uses are listing, copying, moving, creating, and deleting Oracle ASM files and folders. Example 28-1 is an example of navigating
The Oracle ASM virtual folder and listing the files in a subfolder.
The structure of the Oracle ASM virtual folder,/sys/asm
, Is described inChapter 21, "accessing Oracle xml db repository data". inexample
28-1, the disk groups areDATA
AndRECOVERY
; The database name isMFG
; And the directories created for aliases aredbs
Andtmp
. This example navigates to a subfolder, lists its files, and copies
A file to the local file system.
To use ftp, you must first listen to the configured port:
For example:SQL> @ $ ORACLE_HOME/rdbms/admin/catxdbdbca. SQL 7777 8888
Run the preceding statement using SYS. You can specify the following two ports. Port 7070 is the ftp port and port 8080 is the Web port.
View the listener:
Oel57t1: oracle: rac2> LSNRCTL status
The following message is displayed, indicating that the configuration is successful:
Listening endpoints summary...
(Description = (address = (Protocol = TCP) (host = 192.168.0.241) (Port = 1521 )))
(Description = (address = (Protocol = TCP) (host = 192.168.0.51) (Port = 1521 )))
(Description = (address = (Protocol = TCP) (host = oel57t1) (Port = 7777) (Presentation = FTP) (session = raw ))
(Description = (address = (Protocol = TCP) (host = oel57t1) (Port = 8888) (Presentation = http) (session = raw ))
Example 28-1 navigating Oracle ASM folders
ftp> open myhost 7777ftp> user systemPassword required for SYSTEMPassword: passwordftp> cd /sys/asmftp> lsDATARECOVERYftp> cd DATAftp> lsdbsMFGftp> cd dbsftp> lst_dbl.ft_axl.fftp> binaryftp> get t_dbl.f, t_axl.fftp> put my_db2.f
In
Example 28-1, after connecting to and logging onto Databasemyhost
(First four lines), FTP Methodscd
And
ls
Are used to navigate and list folders, respectively. When in folder/sys/asm/DATA/dbs
, FTP commandget
Is used
Copy filest_db1.f
Andt_ax1.f
To the current folder of the local file system. Then, FTP commandput
Is used to copy filemy_db2.f
From the local file system
To folder/sys/asm/DATA/dbs
.
The most common commands are:
Ls to list the current directory of the remote machine
CD changes the working directory on a remote machine
LCD changes the working directory on the local machine
Set the file transmission mode to ASCII in ASCII mode.
Set the file transfer mode to binary.
Close to terminate the current FTP session
Each time the hash data is transmitted in the data buffer, A # number is displayed.
Get (mget) transfers specified files from a remote machine to a Local Machine
Put (mput) transfers the specified file from the local machine to the remote machine
Open connection to remote FTP site
Bye disconnects from the remote machine and exits FTP
? Display local help information
! Go to Shell
Ftp>?
Commands may be abbreviated. commands are:
! Cr mdir proxy send
$ Delete mget sendport site
Account debug mkdir put size
Append dir mls pwd status
ASCII disconnect mode quit struct
Bell form modtime quote System
Binary get mput Recv sunique
Bye glob newer reget tenex
Case hash NMAP rstatus trace
CCC help NLIST rhelp type
CD idle ntrans rename user
Cdup image open reset umask
Chmod LCD passive restart verbose
Clear ls private rmdir?
Close macdef prompt runique
Cprotect mdelete protect safe