首页 > 数据库技术 > 详细

Giving Data Backup Option in Oracle Forms 6i

时间:2016-12-25 23:31:16      阅读:301      评论:0      收藏:0      [点我收藏+]
Suppose you want to give the data backup option in Oracle Forms application to some client users, where you have installed Oracle 11g client or direct from server.

The following procedure executes a batch file placed in current working directory of the application and the batch file contains the following line:

exp.exe userid=%1 FULL=N FILE=%2

Means you have to pass two parameters to this batch file one is username/password@connectstring and another is the filename with location. The following procedure runs this batch file and passes the required parameters.

Example:

PROCEDURE DO_BACKUP IS
    USERID VARCHAR2(50) := GET_APPLICATION_PROPERTY(USERNAME);
    PSW    VARCHAR2(50) := GET_APPLICATION_PROPERTY(PASSWORD);
    CSTRING VARCHAR2(50) := GET_APPLICATION_PROPERTY(CONNECT_STRING);
    fPathName varchar2(200);
    BDIR VARCHAR2(1000);
    DMPFILENAME VARCHAR2(100);
BEGIN    
    MESSAGE( ‘Doing Backup...‘);
    SYNCHRONIZE;
    if bdir is null then
            select BKPDIR into bdir 
              from URparam 
              where Pcode = ‘BACKUP‘;
    end if;
     if Substr(bdir,length(bdir),1) != ‘\‘ then
         bdir := rtrim(bdir) || ‘\‘;
    end if;        
    bdir := ltrim(rtrim(bdir));
             dmpfilename := to_char(sysdate, ‘ddMONyy‘)||‘_‘||dbms_random.string(‘x‘, 5);
            host(‘backup.bat ‘||USERID||‘/‘||PSW||‘@‘||cstRING||‘ ‘||bdir||dmpfilename);
    exception
         when others then
            message(‘Please check parameters for the backup option.‘);
END;

Note: The connect string is used by oracle forms client should be the same as oracle 11g client or oracle servers connect string.


技术分享
    

Giving Data Backup Option in Oracle Forms 6i

原文:http://www.cnblogs.com/quanweiru/p/6220544.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!