设置XDB使用FTP和HTTP来访问ASM磁盘组

我们可以设置XDB,进而使用FTPHTTP来管理ASM卷组.这么做有一个好处,就是我们直接可以通过FTP把ASM卷组里面的datafile进行备份.省去了使用RMAN或者ASMCMD的麻烦.

1.使用DBMS_XDB配置FTPHTTP端口

[oracle@oracle11g ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 26 01:18:05 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area  839282688 bytes

Fixed Size                  2233000 bytes

Variable Size             499125592 bytes

Database Buffers          335544320 bytes

Redo Buffers                2379776 bytes

Database mounted.

Database opened.

SQL> execute dbms_xdb.sethttpport(8080); 

PL/SQL procedure successfully completed.

SQL> execute dbms_xdb.setftpport(2100); 

PL/SQL procedure successfully completed.

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup

ORACLE instance started.

Total System Global Area  839282688 bytes

Fixed Size                  2233000 bytes

Variable Size             499125592 bytes

Database Buffers          335544320 bytes

Redo Buffers                2379776 bytes

Database mounted.

Database opened.

2.查看监听状态

[oracle@oracle11g ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 26-OCT-2012 01:22:36

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Start Date                24-OCT-2012 13:20:44

Uptime                    1 days 12 hr. 1 min. 51 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /oracle/app/11.2.0/grid/network/admin/listener.ora

Listener Log File         /oracle/app/grid/diag/tnslsnr/oracle11g/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle11g.localdomain)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle11g.localdomain)(PORT=8080))(Presentation=HTTP)(Session=RAW))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle11g.localdomain)(PORT=2100))(Presentation=FTP)(Session=RAW)) 

Services Summary...

Service "+ASM" has 1 instance(s).

  Instance "+ASM", status READY, has 1 handler(s) for this service...

Service "orcl" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

The command completed successfully

3.FTP测试

C:\Documents and Settings\Administrator>ftp -n

ftp> open 192.168.56.131 2100

Connected to 192.168.56.131.

220- oracle11g.localdomain

Unauthorised use of this FTP server is prohibited and may be subject to civil an

d criminal prosecution.

220 oracle11g.localdomain FTP Server (Oracle XML DB/Oracle Database) ready.

ftp> user system oracle

331 pass required for SYSTEM

230 SYSTEM logged in

ftp> ls

200 PORT Command successful

150 ASCII Data Connection

OLAP_XDS

home

images

olapdatasecurity

public

sys

xdbconfig.xml

xds

226 ASCII Transfer Complete

ftp: 77 bytes received in 0.00Seconds 77000.00Kbytes/sec.

ftp> cd sys

250 CWD Command successful

ftp> ls

200 PORT Command successful

150 ASCII Data Connection

acloids

acls

apps

asm

log

oid

principals

schemas

version

workspaces

xs

226 ASCII Transfer Complete

ftp: 82 bytes received in 0.00Seconds 82000.00Kbytes/sec.

ftp> cd asm

250 CWD Command successful

ftp> ls

200 PORT Command successful

150 ASCII Data Connection

DATADG

DATADG3

DATADG2

226 ASCII Transfer Complete

ftp: 26 bytes received in 0.16Seconds 0.17Kbytes/sec.

ftp> cd datadg

250 CWD Command successful

ftp> ls

200 PORT Command successful

150 ASCII Data Connection

ORCL

226 ASCII Transfer Complete

ftp: 6 bytes received in 0.01Seconds 0.40Kbytes/sec.

ftp> cd orcl

250 CWD Command successful

ftp> ls

200 PORT Command successful

150 ASCII Data Connection

DATAFILE

226 ASCII Transfer Complete

ftp: 10 bytes received in 0.00Seconds 10000.00Kbytes/sec.

ftp> cd daafile

550- Error Response

ORA-31001: Invalid resource handle or path name "datadg/orcl/daafile"

ORA-15173: entry 'daafile' does not exist in directory 'orcl'

550 End Error Response

ftp> cd datafile

250 CWD Command successful

ftp> ls

200 PORT Command successful

150 ASCII Data Connection

T1.256.797529045

226 ASCII Transfer Complete

ftp: 18 bytes received in 0.00Seconds 18000.00Kbytes/sec.

ftp> bin

200  Type set to I.

ftp> get T1.256.797529045

200 PORT Command successful

150 BIN Data Connection

226 BIN Transfer Complete

ftp: 10493952 bytes received in 2.45Seconds 4278.01Kbytes/sec.

ftp> bye

221 QUIT Goodbye.

4.HTTP测试


可以直接下载下来.

分享到: 更多

Post a Comment

Your email is never published nor shared. Required fields are marked *