Giving Data Backup Option in Oracle Forms 6i

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/[email protected] 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.

时间: 2024-10-14 16:17:08

Giving Data Backup Option in Oracle Forms 6i的相关文章

Displaying Window In Center In Oracle Forms 6i

Center window automatically  in Oracle Forms 6i, use the following procedure by passing window name as parameter: Example PROCEDURE auto_centre (pwn in varchar2) ISvw number := get_window_property(forms_mdi_window, width);vh number := get_window_prop

Freebie - Utility Form: Generate Excel Report From SQL Query In Oracle Forms 6i And 11g

Sharing a form to generate Excel file report from SQL query in Oracle Forms. This form can be used in Oracle Forms 6i and 10g / 11g. Below is the screen shot of this form and could be download from the following link: Excel_Rep.Fmb A procedure Create

Run_Product Example Form - Oracle Forms 6i

I have already posted in my previous post Running Reports Using Run_Product to run reports in Oracle Forms 6i and in this post I am using the same procedure to run report but I am providing a demo form also. Below is the screen shot of this form and

Date Picker Calendar For Oracle Forms 6i

Giving date picker calendar option to user for date type fields in Oracle Forms. I am providing you the form (FoxCal.Fmx) and two libraries (General.plx and Calendar.pll). You can download these files by clicking below link: Download Form and require

Download Oracle Forms 6i

To download Oracle Forms Developer 6i from Oracle click this link http://download.oracle.com/otn/nt/forms/6i_rel2_xp.zip Note.  You must have Oracle username and password to download any software from Oracle site, if not then sign-up its free.

How To Use DBLink In Oracle Forms 6i

You want to connect multiple databases in oracle forms to perform certain tasks, for example you need to execute ddl or dml statements against databases but when you try to use dblink it gives you error or suddenly quits from the oracle forms. Soluti

Freebie: Date Picker Calendar Demo Form For Oracle Forms 6i

I have already posted and provided the required PLSQL Library and the Calendar FMX file in my previous blog post Date Picker Calendar For Oracle Forms but some people were still not able to use this utility in their forms, so I thought to provide a d

How To Commit Just One Data Block Changes In Oracle Forms

You have an Oracle Form in which you have multiple data blocks and requirement is to commit just one data block changes and not to effect any other data blocks. But suppose you have a commit_form button also in form which will commit all the data blo

An Example of On-Error Trigger in Oracle Forms

I wrote this trigger around 4 years ago to handle errors in an application based on Oracle Forms 6i. This trigger handles all errors with some custom messages for some specific errors and not only this after giving an appropriate message to the user