Tuesday, June 28, 2016

Export Oracle Database

Export Oracle Database


In the name of Allah, Most Gracious, Most Merciful
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,


Well, it's quite important to realize how you keep up your existing data safe
Taking a backup file from your database user is the key to safe guard your data.

Task Definition:   

Export data from Oracle database

       What Is the Export Utility?

        The Export utility provides a simple way for you to transfer data objects between Oracle  databases,  even if they reside on platforms with different hardware and software configurations.The extracted data is written to an Export file.


        Before using Export :            

  • Ensure there is sufficient disk or tape storage to write the export file
  • Verify that you have the required access privileges. 

  
Task Solution:

There are two Export utility methods:

1.  Exp.      
2.   Expdp. 

       Both methods will generate a dump file with extension file_name .dmp
    The  Export dump file is an Oracle binary-format dump file. The dump file name and  path directory is pre-determined before running the export utility.

      Start Exporting Data:

     Select Start menu> Run> write CMD then a window will open write the following command according to your naming requirements:


                              exp /@ file=.dmp log=.log full=y;

exp  user_name/password@database_instance  file= file_name.dmp
 log=log_file_name.log   full=y;

Example:

Exp Scott/tiger@orcl file=test.dmp  log= test_log.log full=y;


·                      It is  recommended to start exporting data with expdp command as follow:

    Expdp user_name/password@database_instance  file= file_name.dmp
 log=log_file_name.log   full=y;

            Example:


Expdb Scott/tiger@orcl file=test.dmp  log= test_log.log full=y;

The Data Pump Export utility is invoked using the expdp command. The characteristics of the export operation are determined by the export parameters you specify. These parameters can be specified either on the command line or in a parameter  file. 


Expdp Vs. Exp


  • Both does the same functionality; Exporting data.
  •   The original Export utility dates back to the earliest releases of Oracle, and it's quite slow and primitive compared to Data Pump that  gives 15 – 50%  performance improvement than exp/imp.


Note:


The contents of an export file can be displayed without actually performing an import.  How ???  using the Import   SHOW   parameter.

 The SHOW parameter Default: 'N' can be used ONLY with the FULL=Y 

When SHOW=y, the contents of the export file are listed to the display and not imported. 
The SQL statements contained in the export are displayed in the order in which Import will execute them.

Learn more about:

 ·        Import Oracle Database


Hope this helps...

My success only comes from Allah, pls. note your comments and suggestions are great help for me in progress thanks in advance.




Monday, June 27, 2016

Oracle Database Installation
 Environmental Path Error


In the name of Allah, Most Gracious, Most Merciful      
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,


Today, I am going to explain to you one of the common problem you may face during your oracle database installation.


Task Problem Challenge:   

   Raise an error on Oracle database installation as follow:
·        In Oracle 10G the error is: The environmental path is more than 1023 characters.



·        In Oracle 11G the error is: The environment variable path is too long.  


Task Solution idea

If  you encountered an error during Oracle database installation it is recommended by Oracle NOT exit  the Oracle Universal Installer. I also recommend you to read the pre-installation requirements or Google for this error.


Why do we encountered such error ?


Oracle data base software is subject to the path environmental variable limitation which is predefined in Oracle universal installer. This path size limitation differs according to the Windows version.

Task Solution

     In order to reach to the System Environmental Variables path For Win 7 - 64 bit 
pls follow the steps:

     You can click ignore and continue installation or correct the error from
Control Panel >  System > Advanced System Settings > 
Advanced TAB click Environment Variables > Select PATH in System Variables. Then, follow the following solution steps.

The Solution Steps:

·          Step 1: Copy of your environmental variable path to any text-editor (e.g. notepad) and save this file on your desk top as backup file.
·         Step 2: Reduce the path size to less than 1023 characters. Remove path variables at the end.
·         Step 3: Continue the oracle installation by pressing “retry” button.
·         Step 4: Add the removed path values again  at the end of the current environmental path after Oracle installation has successfully completed.


 Note:
 Please, DO NOT  remove any system related paths which contain %SYSTEMROOT% etc.. ) this will lead to Windows damage. 

    Learn more about:



Hope this helps...

My success only comes from Allah, pls. note your comments and suggestions are great help for me in progress thanks in advance.





Tuesday, June 21, 2016

Oracle Form Alert



In the name of Allah, Most Gracious, Most Merciful
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,


     Oracle forms is quite aware of  the need of the user interactive messages. For this purpose  it specifies a form object called 'Alert'  An Alert creates a modal window like  with a tailored button actions  fits his needs

   In fact, the user needs an application to realize and prospect his needs to facilitate his job tasks at the least expected time and effort.

 One of the ways that leads to an application user satisfaction is creating a dialog with him as if he is setting at a restaurant talking with the waiter about his preferences through these Alert buttons that enable interactive message. It grants  more secure and  flexible interactive choices.


Task Definition:   


Create and display an Alert message.


Task Solution:

There are two ways for performing this task:

1.     Pro-grammatically.
2.     Manually.

     Both methods will display an interactive alert message. The only difference is in the programmatic method you can use only one Form's Alert with many customized message text as needed. On the other hand, the non-programmatic method needs you to create a predefined  form's Alert for every interactive message, since it uses the text message defined in the for's Alert property. 

I will discuss the programmatic methods for it's flexibility and reliability.

Now, let's assume

programmatic Our requirement is to create and display an interactive message to the application user before taking a specific action as ensuring him if he intending to delete the current record or not.


Three Steps to Follow:

 1- Create a form's Alert; select an Alert object's node from Object navigator. Then, press the create button on the toolbar to create an alert. Rename it DELETE_ALERT.

2- Create a  KEY-DELREC Trigger form level.

3- Use the following code:  


DECLARE
     al_id      ALERT;
     al_btn   NUMBER;

BEGIN

     -- Check  the Alert's name  existence ----
     
          al_id := Find_Alert('DELETE_ALERT');

     IF Id_Null(al_id) THEN NULL;

         ELSE
   
      --- If  the alert exists then label buttons
                      
                Set_Alert_Property(al_id,ALERT_MESSAGE_TEXT,'Do you want  to delete this record ? ');
                Set_Alert_Button_Property(al_id, ALERT_BUTTON1,LABEL,'YES');
                Set_Alert_Button_Property(al_id, ALERT_BUTTON2,LABEL,'NO');         
     
        --- Display The Alert's message ---

      al_btn := Show_Alert( al_id );
   
      -- Start customizing Alert's buttons functionality --
   
      IF (al_btn = ALERT_BUTTON1) THEN

                 DELETE_RECORD;
                 COMMIT_FORM;

      ELSIF (al_btn = ALERT_BUTTON2) THEN
  
          MESSAGE('Deletion is cancelled');
           PAUSE;
           GO_BLOCK('current_block');
           GO_ITEM('current_block.item_name');

       END IF;

   END IF;

END;



Note:

    In my point of view, i think an Oracle Developer can optimize his time by creating at most one or three Alert objects  for the whole  application.
     It's a quite good idea to create a pl/sql library which includes an Alert procedure in a package to inherit this Alert object and it's code to all forms application to simplify this task.

Learn more about:

·             Menu Item Enable/Disable


Hope this helps...

My success only comes from Allah, pls. note your comments and suggestions are great help for me in progress thanks in advance.





Sunday, June 19, 2016

Customizing Oracle Forms Errors & Informative Messages In English


Customizing Oracle Forms 
Errors & Informative Messages In English

In the name of Allah, Most Gracious, Most Merciful
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,

According to the previous blog i had created to share my experience regarding:
The Best 3 Steps Handling Oracle Forms Messages,
 I was inspired by Allah swt for creating the following data script to facilitate customizing Oracle forms informative and error messages in English Language.

Saturday, June 11, 2016

Menu Item  Enable/Disable



In the name of Allah, Most Gracious, Most Merciful
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,

One of the greatest tasks an Oracle  developer should learn is Menu Security.
Your application has a certain amount of security by default, because only users with access privileges to the database schema that is used can access the application.

      Once the users and roles are created in the database, then you must grant these roles to the application developers or  users.
  Developer can assign those roles to the security role properties of the  menu module or menu items.


Task Definition:   


Enable/Disable a Menu Item



Task Solution:

We can use Toggle_Enabled  procedure . This is a ready made procedure existing in almost all Oracle forms versions On Line Help. You can look for it  under GET_MENU_ITEM_PROPERTY Built-in.

PROCEDURE Toggle_Enabled (menuitem_name VARCHAR2)
IS
   mi_id   MenuItem;
BEGIN
   mi_id := FIND_MENU_ITEM (menuitem_name);

   IF GET_MENU_ITEM_PROPERTY (mi_id, ENABLED) = 'TRUE'
   THEN
      SET_MENU_ITEM_PROPERTY (mi_id, ENABLED, PROPERTY_FALSE);
   ELSE
      SET_MENU_ITEM_PROPERTY (mi_id, ENABLED, PROPERTY_TRUE);
   END IF;
END;

SET_MENU_ITEM_PROPERTY Restrictions :

Note the following  restrictions apply only if the menu module's Use :
Security property is set to Yes

·        Once the menu module Use Security property is Yes, you can use the SET_MENU_ITEM_PROPERTY  if  the form operator has access privileges for that item.
·         You cannot set the property of a menu item using SET_MENU_ITEM_PROPERTY if the item is currently hidden.
·         If the menu item is displayed w/o Privileges, but disabled Oracle Forms  Run form displays the item in a disabled state. In this case, you can set the menu item properties pro-grammatically.

This creates the overall  access controls  to  any user to any part of the menu application .


 Learn more about:


·          Dependent Drop Down list


Hope this helps...

My success only comes from Allah, pls. note your comments and suggestions are great help for me in progress thanks in advance.