码迷,mamicode.com
首页 > 数据库 > 详细

Giving Data Backup Option in Oracle Forms 6i

时间:2016-12-25 23:31:28      阅读:289      评论:0      收藏:0      [点我收藏+]

标签:ddl   option   for   acl   bsp   word   rom   user   follow   

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

标签:ddl   option   for   acl   bsp   word   rom   user   follow   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!