exp userid= ... 不可以吗

解决方案 »

  1.   

    比较简单的处理是在程序中构造exp的命令参数。执行exp命令。这样就要求客户机必须安装oracle的exp程序。
      

  2.   

    提供delphi例子:
    WinExec('f:\oracle\ora92\bin\exp.EXE test/test file=c:\test.dmp', SW_SHOWNORMAL);DELPHI里有一个函数ShellExecute,在USERS加上SHELLAPI
    这个函数是直接运行你脚本
    这是C++BU的用法,跟DELPHI是一样的。你修改一下。  ShellExecute(0, "open", "EXP system/manager FILE=EXP.DMP FULL=Y", NULL, NULL, SW_SHOWDEFAULT);
    ShellExecute(0, "open", "imp system/manager FILE=EXP.DMP fromuser=user_name to user=user_name1", NULL, NULL, SW_SHOWDEFAULT);要与远程建立dblink
      

  3.   

    这样要求客户端有装有oracle呀。
    不合适,况且有的时候很不好用。
    不知道oracle有没有提供别的机制?
      

  4.   

    /************导出导入库******************/
    /********服务器端*************/
    exp system/eport file="oracledatabackup.dmp" log="oracledatabackup.log" owner=(offline_ems3,offline_dec,offline_trn)  grants=Y; 
    imp system/eport file="oracledatabackup.dmp"  full=Y Ignore=y;
    /********客户端*************/
    exp system/eport@ora8 file="oracledatabackup.dmp" log="oracledatabackup.log" owner=(offline_ems3,offline_dec,offline_trn)  grants=Y; 
    imp system/eport@ora8 file="oracledatabackup.dmp"  full=Y Ignore=y;区别在于:客户段需要加上服务名
      

  5.   

    多谢
    我想在程序里面实现的,并且运行这个机器的程序不需要有oracle的客户端。
    现在的做法得到表数据的xml文件可以实现的,不过这样恢复很麻烦的。