引用
SQL>execute dbms_xdb.sethttpport(8080);
SQL>execute dbms_xdb.setftpport(2100);
SQL>commit;
检查端口是否开启
引用
SQL> select dbms_xdb.GETHTTPPORT() from dual;
DBMS_XDB.GETHTTPPORT()
----------------------
8080
SQL> select dbms_xdb.GETFTPPORT() from dual;
DBMS_XDB.GETFTPPORT()
---------------------
2100
2、配置dispatch参数
引用
SQL> alter system set dispatchers ='(PROTOCOL=TCP) (SERVICE=rac1XDB)' scope=both sid='rac1';
System altered.
SQL> alter system set dispatchers ='(PROTOCOL=TCP) (SERVICE=rac2XDB)' scope=both sid='rac2';
System altered.
3、重启监听
引用
[oracle@node1 app]$srvctl stop listener -n node1
[oracle@node1 app]$srvctl stop listener -n node2
[oracle@node1 app]$srvctl start listener -n node2
[oracle@node1 app]$srvctl start listener -n node1
4、检查监听状态,注意端口号,协议
引用
[oracle@node1 app]$ lsnrctl status LISTENER_NODE1
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 20-JAN-2011 13:41:15
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=node1-vip)(PORT=1521)(IP=FIRST)))
STATUS of the LISTENER
------------------------
Alias LISTENER_NODE1
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 20-JAN-2011 13:40:16
Uptime 0 days 0 hr. 0 min. 58 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /app/oracle/product/10.2.0/db_1/network/log/listener_node1.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.4.182)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.4.178)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node1)(PORT=2100))(Presentation=FTP)(Session=RAW))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node1)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM2", status BLOCKED, has 1 handler(s) for this service...
Service "+ASM_XPT" has 1 instance(s).
Instance "+ASM2", status BLOCKED, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "rac" has 2 instance(s).
Instance "rac1", status READY, has 1 handler(s) for this service...
Instance "rac2", status READY, has 2 handler(s) for this service...
Service "rac1XDB" has 1 instance(s).
Instance "rac1", status READY, has 1 handler(s) for this service...
Service "rac2XDB" has 1 instance(s).
Instance "rac2", status READY, has 1 handler(s) for this service...
Service "racXDB" has 2 instance(s).
Instance "rac1", status READY, has 0 handler(s) for this service...
Instance "rac2", status READY, has 0 handler(s) for this service...
Service "racXDB1" has 1 instance(s).
Instance "rac1", status READY, has 0 handler(s) for this service...
Service "racXDB2" has 1 instance(s).
Instance "rac1", status READY, has 0 handler(s) for this service...
Service "rac_XPT" has 2 instance(s).
Instance "rac1", status READY, has 1 handler(s) for this service...
Instance "rac2", status READY, has 2 handler(s) for this service...
The command completed successfully
2、脚本开启之后,即可用用客户端进行ftp传输
引用
[ora10g@hzmc rac]$ ftp 172.16.4.178 2100
Connected to 172.16.4.178.
220- node1
Unauthorised use of this FTP server is prohibited and may be subject to civil and criminal prosecution.
220 node1 FTP Server (Oracle XML DB/Oracle Database) ready.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (172.16.4.178
ra10g): system
331 pass required for SYSTEM
Password:
230 SYSTEM logged in
Remote system type is Unix.
ftp> bin
200 Type set to I.
ftp> cd /sys/asm
250 CWD Command successful
ftp> cd DATA/rac/datafile/
250 CWD Command successful
ftp> ls -rtl
227 Entering Passive Mode (172,16,4,178,148,40)
150 ASCII Data Connection
-rw-r--r-- 1 SYS oracle 503324672 JAN 20 05:19 SYSTEM.256.740397671
-rw-r--r-- 1 SYS oracle 304095232 JAN 20 05:19 SYSAUX.257.740397673
-rw-r--r-- 1 SYS oracle 26222592 JAN 20 05:19 UNDOTBS1.258.740397675
-rw-r--r-- 1 SYS oracle 5251072 JAN 20 05:19 USERS.259.740397675
-rw-r--r-- 1 SYS oracle 26222592 JAN 20 05:19 UNDOTBS2.264.740397951
226 ASCII Transfer Complete
ftp> get SYSTEM.256.740397671
local: SYSTEM.256.740397671 remote: SYSTEM.256.740397671
227 Entering Passive Mode (172,16,4,178,49,55)
150 BIN Data Connection
226 BIN Transfer Complete
503324672 bytes received in 60 seconds (8.2e+03 Kbytes/s)
注意ftp需要用bin模式,如采用默认传输模式ascii,则会报如下错误:
引用
ftp> get UNDOTBS1.258.740397675
local: UNDOTBS1.258.740397675 remote: UNDOTBS1.258.740397675
227 Entering Passive Mode (172,16,4,178,80,157)
150 ASCII Data Connection
550- Error Response
ORA-31198: Mismatch in number of bytes transferred due to non-binary mode
550 End Error Response
271257 bytes received in 0.19 seconds (1.4e+03 Kbytes/s)