Monday, March 30, 2015

Configure RMAN Backup On Windows

Database is supported on windows and some people using Windows As Production and RMAN need to be configured to ensure backup for Database in such failure or something to do this follow the below steps :-

  • Create first text file called backup and change the format to "bat", inside the file add the following lines :-
cd E:\app\ADM-BSS01\product\11.2.0\dbhome_1\BIN
rman @E:\RMAN\Scripts\backup.rman

  • Create 3 folders in E for example :-
    • backup
    • Archivelog
    • Controlfile
  • Create second file name it Backup.rman and add the Rman Script like below 
connect target /
backup AS COMPRESSED BACKUPSET tag Full_database_open format 'E:\RMAN\backup\db_%t_%s_p%p.bkp' database;
backup AS COMPRESSED BACKUPSET archivelog all format 'E:\RMAN\backup\archivelog\al_%t_%s_p%p.arch' delete all input;
backup AS COMPRESSED BACKUPSET current controlfile tag =cf1 format 'E:\RMAN\backup\cf_%t_%s_p%p.bkp';
backup tag ORCL_CONTROL current controlfile format 'E:\RMAN\Controlfile\%d_%T_%s_%p_CONTROL';
delete noprompt expired backup;
release channel c1;
release channel c2;
release channel c3;
release channel c4;

  • Follow the screen now :-

      • Add Task Name and Description :-

      • Add The Time for this Task in this tab 

      • Another Screen :-

      • In This Screen Add Bat File in our case backup.bat


      Friday, March 27, 2015

      Install Oracle grid infrastructure On Linux 6.6

      This Post will explain Step by step provide with Screenshot how to install Oracle grid infrastructure On Linux 6.6

      Link From here


      Tuesday, March 24, 2015

      Configure ASMLIB On Oracle Linux 6.6

      In this post will show you how to configure Oracle ASMLIB On Linux 6.6

      I uploaded the document on Slideshare , check it from here

      Osama Mustafa

      Monday, March 23, 2015

      Enable/Disable SSH For Root User

      Sometimes for any reason you want to enable root ssh using any SSH Client such as putty and only the administrator can login to do this follow the below steps :-

      • vi /etc/ssh/sshd_config
      • search for line as follow :-
        • PermitRootLogin yes and change it to -->  PermitRootLogin no
      • Search for the following lines as well :-
        • DenyUsers root user2 user3
      • Remove the root from Deny User
        • DenyUsers user2 user3
      • /etc/init.d/sshd restart
      Stopping sshd: [ OK ]
      Starting sshd: [ OK ]

      If you want to disable the SSH login for root just keep everything like the above.

      Osama Mustafa

      Sunday, March 22, 2015

      Oracle Streams ORA-44001: invalid schema

      SQL> SQL> SQL> 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 job finished
      ERROR at line 1:
      ORA-23616: Failure in executing block 7 for script
      13F5CD569383406C82E7F63EE3F927E0 with
      ORA-44001: invalid schema
      ORA-06512: at "SYS.DBMS_RECO_SCRIPT_INVOK", line 139
      ORA-06512: at "SYS.DBMS_STREAMS_RPC", line 465
      ORA-06512: at "SYS.DBMS_RECOVERABLE_SCRIPT", line 659
      ORA-06512: at "SYS.DBMS_RECOVERABLE_SCRIPT", line 682
      ORA-06512: at "SYS.DBMS_STREAMS_MT", line 7972
      ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2674
      ORA-06512: at line 5

      The error related to apply_queue parameter in oracle stream is not set with valid value, therefore set the parameter correctly like the below
      apply_queue_user => 'STREAM_ADMIN' 

      Osama Mustafa 

      Friday, March 20, 2015

      Enterprise Manager : Performance Across Enterprise Databases

      The below link is very to understand the performance under #EM12c Provided by oracle, This demonstration shows you how to use AWR Warehouse a new feature of Oracle Enterprise Manager 12c Release 4.

      Osama Mustafa

      Thursday, March 19, 2015

      [INS-30131] Initial setup required for execution of installer validation failed.

      When trying to install Oracle client 12c the above error appeared , this issue can happened on windows Or linux.

      The cause i really simple :-

      On linux there is no enough space under /tmp.

      On windows the solution like the following :-

      • Open Windows Services.
      • Stop Oracle Services --> OracleRemExec
      • Remove the OracleRemExecService
      • then try to install Oracle client again

      Thank you 
      Osama Mustafa

      Tuesday, March 17, 2015



      The above error happened to Siebel CRM.

      the solution is so simple :-

      In my version Siebel configured as SSO because of this OID hold all the application user after check o i found that orcladmin have only one week for password expiration Siebel consider this as error so i increase password policy in OID.


      Creating a Local Yum Repository Using ISO Image

      In this post i will show you how to create Yum repository Using ISO Image, will save more time :-

      • Download The ISO Image and Upload it to the server.
      • Create Folder Under Root User Like the below
      cp /OEL6.6. iso /ISOs

      • now create mount point for this ISO.
      mkdir p /var/ISO/OEL6.6
      Run the below command to mount it :-

      mount o loop,ro /ISOs/OEL6.6. iso /var/ISO/OEL6.6

      • Now under /etc/yum.respos.d you can rename it or set enable=0
      •  Create the following file /etc/yum.respos.d/OEL66.repo
      • Edit the file and add 

      name=Oracle Linux 6.6

      • Run the below command to clean yum
      yum clean all
      yum respolist

      The output should be like the below :-

      repo id repo name status
      OL66 Oracle Linux 6.6 25,459 

      Thank you
      Osama Mustafa

      Sunday, March 15, 2015

      New Features in ORAchk

      The new ORAchk release is now available to download from

      Is your database healthy ?

      ORAchk can be used with any database depend on your Platform Solaris Intel, Solaris SPARC, ,HP , Linux , you can check the Oracle Support Document :-

      ORAchk - Health Checks for the Oracle Stack (Doc ID 1268927.2)

      That include the userGuide and how to Use ORAchk with any platforms,

      New Features :-

      Database performance, install, scalability & ASM
      Cross stack checks for Oracle Applications running on Solaris & Oracle Hardware
      Enterprise Manager Agents performance and failure to run
      Oracle EBS Accounts Payables

      Usually the usage like the below :-

      ./orachk  ---> regular healtcheck  + HA best practices
      ./orachk-c hacheck ---> HA best practices Only
      Osama Mustafa

      Wednesday, March 11, 2015

      Apply Jdeveloper Patch

      This blog post will show you how to apply Patch on Jdeveloper :-

      • Download the latest version of Opatch from
      • Unzip the Patch Folder.
      • Set/export ORACLE_HOME to Jdeveloper hope depend on Operating system
      • Finally Opatch Apply to Jdeveloper Home.

      If you faced any error with opatch commad try the below :-

      opatch apply -jdk /u01/app/oracle/JDK/160_24

      Osama Mustafa

      Monday, March 9, 2015

      OPATCH : Problems with the lock file

      Problems with the lock file
      Lock file exists, details are:
      Interim Patch is holding the lock from ......
      probably due to previous unsuccessful operation

      Seems the Opatch has been interrupted or hanged therefore the .opatch_storage still exists under Oracle Home

      ls -ltr $ORACLE_HOME

      Search for .patch_storage and delete it

      Try Again..

      Osama Mustafa

      Prerequisite check "CheckActiveFilesAndExecutables" failed

      Oracle Home       : /u01/app/oracle/product/11.2.0/db_home1
      Central Inventory : /u01/app/oraInventory
         from           : /u01/app/oracle/product/11.2.0/db_home1/oraInst.loc
      OPatch version    :
      OUI version       :
      Log file location : /u01/app/oracle/product/11.2.0/db_home1/cfgtoollogs/opatch/opatch2015-03-09_16-45-09PM_1.log
      Verifying environment and performing prerequisite checks...
      Prerequisite check "CheckActiveFilesAndExecutables" failed.
      The details are:

      Following executables are active :
      UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.
      Log file location: /u01/app/oracle/product/11.2.0/db_home1/cfgtoollogs/opatch/opatch2015-03-09_16-45-09PM_1.log
      When trying to apply OPatch the above error appear , 

      Some process hanged 

      oracle@--:~/database_patches/19769496$ fuser /u01/app/oracle/product/11.2.0/db_home1/lib/
      /u01/app/oracle/product/11.2.0/db_home1/lib/    58536m

      Kill -9 58536

      Thank you 

      Sunday, March 8, 2015


      This post describe how to apply PSU PATCH on Grid and DB Home Step by Step , I wrote earlier how to apply PSU Patch on single Node Read here

      To Read How to APPLY PSU PATCH ON RAC Database Here 

      Configure DBConsole as Active/passive

      Sometimes Database Configured as Active/Passive ( Cluster ) Which mean one node working/time and regarding to this if the failover happened on 2nd node the customer will expected that everything will be the same as it was on node 1 include to this Dbconsole.

      To do this follow the below steps :-

      • Database should be configured on VIP.
      • Listener should be configured on VIP.
      • Database , Configuration should be installed on Shared Storage
      • inventory Files should be on shared storage as well.
      • ORACLE_HOSTNAME Should be set to VIP Hostname.

      Listener example :-

      LISTENER  =
      Don't forget to set the LOCAL_LISTENER Parameter :-

      SQL> alter system set local_listener='LISTENER';


      SQL> alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = VIP-HOST )(PORT = 1521)) ';

      emca -config dbcontrol db -repos create

      Test the failover on node #2

      if for some reason when you try to start emctl and the error still asking for oc4j then export ORACLE_HOSTNAME is bash_profile.

      It should work


      Saturday, March 7, 2015

      Shutdown Immediate Hangs

      Today i faced Strange issue with Shutdown immediate command on cluster database which is when run shutdown immediate the command hangs and take so long and sometimes it's working and most of the time not working.

      the below command was working without any problem :-

      SQL > shutdown abort

      to solve this issue & trace the error since the alertlog not indicating to anything interesting i have to dump systemstate every 5 minutes  to know what going on :-

      connect / as sysdba
      alter session set events '10400 trace name context forever, level 1'; 

      After this you can kill the session that preventing shutdown.

      The hangs usually happened for two reasons :-

      • Query running on Database.
      • Transaction happened while you are trying to shutdown database.
      For the first reason :

      use v$session_longops Read more here.
      Run the below query to check the query.
      select count(*) from v$session_longops where time_remaining>0;

      Second reason you can use

      v$transaction Read from here.

      Useful Document :-
      Alert Log: Shutdown Waiting for Active Calls to Complete (Doc ID 1039389.6)

      Thank you
      Osama Mustafa

      Friday, March 6, 2015

      Oracle Database Patches Information

      A number of questions has been asked here and in Oracle Community Forum When/What/Date for Next Database patches ?

      in the all way you should have valid account for

      I see it's worth it to post and share the information how to find the desire patch number and how to know next patch release, i will only share MOS document number that will help you understand what i mean.

      How to Find Patch ? 

      • Oracle Recommended Patches -- Oracle Database (Doc ID 756671.1)
      • Quick Reference to Patch Numbers for Database PSU, SPU(CPU), Bundle Patches and Patchsets [1454618.1]
      • Release Schedule of Current Database Releases [742060.1]
      • Introduction to Oracle Recommended Patches [756388.1]
      • Oracle Database Patchset Information, Versions 10.2.0 to 12.1.0 (Doc ID 268895.1)
      • ALERT: Oracle 11g Release 1 (11.1) Support Status and Alerts (Doc ID 454507.1)

      The above MOS document will guide you and help you to know the next release of database patch, also as you see i included some document that helps for recommended patch.

      REGISTRY$HISTORY contains information about the applied patches PSU, SRU or CPU and you can use Oracle Base Script from here.


      $ORACLE_HOME/OPatch/opatch lsinventory

      Osama Mustafa

      Wednesday, March 4, 2015

      Dealing with Crontab

      Schedule tasks under Linux is an powerful procedure which is used by almost everyone, and to do this using program called cron. more about it here .

      Procedure :

      make a new text file, and enter this line in that text file like the below :-

      crontab myfirstjob

      Formatting crontab file :-

      what this file contains

      Allowed range
      1-12 OR First 3 letters of the Month name
      Days of the week
      0-7 OR First 3 letters of the Day name
      Name of the program
      Any program

      Some useful command can be used with cron :-

      Show all the task running under cron.

      crontab -l
      edit the crontab
      crontab -e

      Some example from crontab file :-

      # Minute   Hour      Day of Month       Month                 Day of Week        Command  
      # (0-59)     (0-23)     (1-31)             (1-12 or Jan-Dec)    (0-6 or Sun-Sat)              
          0               12           *                             *                         *            /u01/

      For more example about crontab press here

      Osama Mustafa

      Tuesday, March 3, 2015

      Sort process depend on memory

      top - display top CPU processes

      Once top starts, press F to switch to the sort field screen. Choose one of the fields listed by pressing the key listed on the left; you probably want N for MEMORY


      Sunday, March 1, 2015

      ORA-27102: out of memory

      Operating system : Solaris Sparc 11.2
      Database Version :

      When Trying to startup the database the following error appeared :-

      SQL> startup nomount ;
      ORA-27102: out of memory
      SVR4 Error: 22: Invalid argument

      Even when trying to know which instance process do this :-

      SQL> oradebug setmypid
      ORA-01034: ORACLE not available
      ORA-27101: shared memory realm does not exist
      SVR4 Error: 2: No such file or directory
      ORA-01034: ORACLE not available
      ORA-27101: shared memory realm does not exist
      SVR4 Error: 2: No such file or directory 

      SQL> oradebug ipc
      ORA-01034: ORACLE not available
      ORA-27101: shared memory realm does not exist
      SVR4 Error: 2: No such file or directory
      ORA-01034: ORACLE not available
      ORA-27101: shared memory realm does not exist
      SVR4 Error: 2: No such file or directory 

      After investigation i found the cause for this error, the solaris SHMMAX was not set correctly on OS level which mean the database was configured more than permitted memory on OS.

      to solve the above error

      Find which project oracle user run using the below command :-

      id -p
      uid=59008(oracle) gid=10001(dba) projid=3(default)  

      prctl -n project.max-shm-memory -i project 3 

      project: 3: default
      NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
              privileged      35GB      -   deny                                 -
              system          24EB    max   deny                                 -

      So i have to increase it

      prctl -n project.max-shm-memory -r -v 40G -i project 3

      Note the above changes will be temporary till the next restart.


      Apply psu on single database

      This post describes how to apply PSU Patch on Single Node Oracle Database With Screenshot

      To view the document from here

      Osama Mustafa