oracle FTP服务——Using FTP with Oracle ASM Files

来源:互联网 发布:淘宝旗舰店天猫多少钱 编辑:程序博客网 时间:2024/06/10 07:33

若数据库用ASM文件系统进行管理,那么在文件下载、上传方面有些困难,即使使用了asmcmd工具,也没有类似cp的命令来复制其中的文件,于是oracle提供了ftp来实现一系列ASM文件的管理。


Using FTP with Oracle ASM Files

http://docs.oracle.com/cd/E11882_01/appdev.112/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 mirroring 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 are DATA and RECOVERY; 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.

要使用ftp必须先再监听内配置端口:

如:SQL> @$ORACLE_HOME/rdbms/admin/catxdbdbca.sql 7777 8888

用sys用户执行以上语句,后面的两个端口可以自己指定,7070是ftp端口,8080是web端口。

查看下监听:

oel57t1:oracle:rac2 > lsnrctl status

出现以下内容,表示配置成功:

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 database myhost (first four lines), FTP methodscdandls are used to navigate and list folders, respectively. When in folder/sys/asm/DATA/dbs, FTP commandgetis used to copy filest_db1.f and t_ax1.f to the current folder of the local file system. Then, FTP commandputis used to copy filemy_db2.f from the local file system to folder/sys/asm/DATA/dbs.


最常用的命令有:

ls 列出远程机的当前目录
cd 在远程机上改变工作目录
lcd 在本地机上改变工作目录
ascii 设置文件传输方式为ASCII模式
binary 设置文件传输方式为二进制模式
close 终止当前的ftp会话
hash 每次传输完数据缓冲区中的数据后就显示一个#号
get(mget) 从远程机传送指定文件到本地机
put(mput) 从本地机传送指定文件到远程机
open 连接远程ftp站点
bye 断开与远程机的连接并退出ftp
? 显示本地帮助信息
! 转到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



原创粉丝点击