Tuesday, June 28, 2016

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:

 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.     Non- Pro-grammatically.

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 opinion, 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  library package to inherit this Alert object & it's code to all application forms 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


Oracle Forms Errors & Informative 
English Script Messages 

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,

 For beginners is the following script to customize Oracle forms informative and error messages in English Language.   Insha'Allah, I will update this script from time to another.

INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40401, '1', 'No changes currently made to be saved.');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40202, '1', 'This field must be entered, navigation not allowed.');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40301, '1', 'No records retrieved.');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40400, '1', 'Data is successfully saved.');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40600, '1', ' This record is already exist');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40508, '1', ' unable to insert record.');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (50000, '1',' Attention pls. your characters inputs exceeded the allowed limits.');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (50001, '1',' Acceptable characters are a-z, A-Z, and space.');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (50002, '1', 'Months must be between 1 and 12');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (50003, '1', 'Year must be in proper range.);
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (50004, '1', 'The Day must be between 1 and last day of the month');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (50025, '1', 'Attention pls. your date or time must be in the proper format. ');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (50026, '1', ' pls. re-enter the date in the requested format. ');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (50006, '1',' Legal characters are 0-9 + and -.');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
 VALUES (50007, '1',' Attention pls. too many digits after the decimal point.');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (50009, '1',' Attention pls. too many decimal points.');
  
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (50016, '1', 'Accepts Numbers Only');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40100, '1', ' The First Record');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (41830, '1', ' No LOV Entries.');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (41049, '1', 'Delete Is Not Allowed');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40509, '1', 'Update Is Not Allowed');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (41051, '1', 'Insert Is Not Allowed');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40360, '1', 'Query Is Not Allowed');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40510, '1', 'This Record Related to Other Data');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40102, '1', 'Record Must Be Inserted or Deleted');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (41003, '1', 'Query Is Not Allowed.');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40212, '1', 'Incorrect Value Inserted');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40352, '1', 'Last Record');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40350, '1', 'No Data Retrieved');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40200, '1', 'Protected Against Update');
INSERT INTO ERROR_MESSAGES (MSG_CODE, MSG_TYPE, MSG_DESC)
VALUES (40353, '1', ' Query Cancelled');
COMMIT;




Hope this helps…


Learn More about:


The Best 3 Steps To Suppress Messages Oracle Forms



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