前几天用OB9导入导出表空间的时候,发现一个问题,
如果RAC连接字符串写的不全,是无论如何都导不进去的,
而OB9大哥的连接字符串却又有长度限制,可怜我一个晚上啊。
最后改用监听,OK了。
(DESCRIPTION=(ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.120.220)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.120.221)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.120.222)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.120.223)(PORT=1521))(LOAD_BALANCE=yes)(FAILOVER=on))(CONNECT_DATA=(SERVICE_NAME=ractest)))
OB9导入导出数据库,也是用了oracle自带的命令行工具(imp.exe和exp.exe)
导入时,其调用命令行就是:
D:\oracle\product\10.2.0\db_1\BIN\imp.exe 'user2/pass2@(DESCRIPTION=(ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.120.220)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.120.221)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.120.222)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.120.223)(PORT=1521))(LOAD_BALANCE=yes)(FAILOVER=on))(CONNECT_DATA=(SERVICE_NAME=ractest)))' PARFILE="D:\OB9\temp\Imp.PRM"
而Imp.PRM是一个配置文件
FILE="D:\OB9\XXX.DMP" LOG="D:\OB9\IMP.LOG" BUFFER=4096 RECORDLENGTH=1024 GRANTS=Y INDEXES=Y ROWS=Y IGNORE=Y COMMIT=N DESTROY=N FROMUSER=( "user1" ) TOUSER=( "user2" )
导出时,其调用命令行就是:
D:\oracle\product\10.2.0\db_1\BIN\exp.exe 'user1/pass1@(DESCRIPTION=(ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.120.220)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.120.221)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.120.222)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.120.223)(PORT=1521))(LOAD_BALANCE=yes)(FAILOVER=on))(CONNECT_DATA=(SERVICE_NAME=ractest)))' PARFILE="D:\OB9\temp\Exp.PRM"
而Exp.PRM是一个配置文件
FILE="D:\OB9\xxx.DMP" LOG="D:\OB9\EXP.LOG" BUFFER=4096 RECORDLENGTH=1024 COMPRESS=Y GRANTS=Y INDEXES=Y ROWS=Y CONSTRAINTS=Y RECORD=Y CONSISTENT=N STATISTICS=NONE OWNER=( "user1" )