Wednesday, December 9, 2015

Oracle Toad Team Coding

Oracle Toad Team Coding


Sure you can use source control and Team work server with Toad IDE that helps Developers and database Administrators to manage code changes in Oracle Database with confidence of no overwriting the changes of other team members .
Developers and Admins can work with same Procedures , Functions , packages triggers and Types and check-in – check-out their source code …Developer can reserve his source code to prevent any other developer to overwrite same source code .

Setup Team Coding:
-      Login in Toad with DBA privileges (system , sys ..)
-      Setup will create a new database schema in Database server with “ Toad ” User Name (recommended to leave default name Toad) witch will be as metadata provides the functionality to team work .
-      This schema will be shared with all Work team without risk of override the      changes made by other developers .

--------------------------------------------------------------------------------------------------------
Remember : Developers could not edit source code unless 
check-out File or database objects
Source code will be locked after Checked-in
--------------------------------------------------------------------------------------------------------
 Let us Start
Steps:

Login to TOAD as sysdba (use DBA privileges )










Select Configure Team Coding: 
Utilities menu > Team Coding > Configure Team Coding

Following message will appear. Click OK:

Click on Install Team Coding:

It is preferable to install Team Coding objects in standard TOAD schema. Select the tablespaces for the Team coding metadata. The database role TC_ADMIN_ROLE is used for:
  1. 1.     Edit Team Coding Configuration
  1. 2.     Edit Code Collections
  1. 3.     Freeze Team Coding Objects
  1. 4.     Break another user’s Team Coding lock
-      Let us Test Team coding to record editing source code 
 







The script to generate the Team Coding Objects will be displayed on screen. Click Execute:

Enter the password for the TOAD database user:

Installation for Team Coding is completed (took less than a minute):

Now the database is configured to use Team Coding across all the schemas. Above steps are needed to be completed only once per database. Click on “Enable Team Coding for this Database”:

This setup is the basic setup, where working on a single object at a time gives enough control. Once you check out any object, it is available in Team Coding Dashboard.

-       Create new Procedure


-       Now press Check-in to lock your code and prevent update
-       

-                
-          Press Check in from toolbar or Team coding menu to lock your code 

Record comment on your code before check-in




-                                            To update source code – press chek-out



-                                     Previewed and open team coding – Edit History
-      




-       Now as you see , any edit in Database objects from any member in your team will record in team Coding 

Friday, November 27, 2015

ADF – Parent Action Activity in Bounded Taskflow

(ADF Region trigger parent navigation Control flow )


What if you need to trigger a parent Taskflow activity from ADF region or Child bounded task flow, 

Actually ADF Region could not see parent navigate flow case in a direct way.

Parent action activity is a component in ADF Taskflow components, which allow child bounded Taskflow to generate outcomes that used to navigate throw parent activity rather than child activity

In this example I’ll create Parent Tasflow to preview departments as ADF region . and throw this region we can navigate into parent activity to EmployeesList Taskflow , Employees form page and global navigate page.

let us Start

  1. -          Create new ADF application “ CallPArentActivity”
  2. -          Create BC and create Employees and Departments VOs
  3. -          Create new Bounded Taskflow “Parent-TaskFlowDepartment ”(remove fragment option)
  4. -          Add Parent adf page activity as default (create page)
  5. -          Add “employeesForm” as adf page activity (create page)
  6. -          Add  “ employeesList “  as bounded Taskflow
  7. -          Add “information ”  as adf page activity (create page)





  1. -          Open employeesList bounded Taskflow
  2. -          Add “employeesPgae“ as adf page activity (create a apage)
  3. -          Add return activity
  4. -          Create flow-case “back” from emploeespage to retrun activity
  5. -          Drage employeesVO as table
  6. -          Add button and set action = back






  1. -          Create new bounded Taskflow with fragment Option “departmentTK”
  2. -     Add new  "departmentPage " as adf page activity 
  3. -          Add three Parent action Activities into Taskflow
  4. -          Add three navigation flow from departmentPage to parent Activities
-          goEmployeesList
-          goEmployeesForm
-          goInformation

     4-          set property <Parent Outcome> to refer to Parent outcome we need to trigger
                    
                         parentAction1.PrentOutcome = goList
                   parentAction1.PrentOutcome = goForm
                   parentAction1.PrentOutcome = goInfo






 - Set Action property to Flow case name in DepartmentPage







-  Drag DepartmentTF  as region into parent adf page 

Run and Test .................
now you can trigger parent navigation flow activity from Region or child bounded taskflow 
when you use Parent action activity ...
  



Tuesday, November 3, 2015

Install and Deinstall Oracle Patches use Opatch command.

Opatch (Apply Oracle Patches )

Install and Deinstall Oracle Patches use Opatch command.
(After complete this demo you will able to Apply oracle Patches on Middleware home or Jdeveloper Home)

Download patches
1-      Download your patch from Oracle Support .
             Login to Oracle Support > Patches and Updates
·         Go to search tab and write your patch number or search criteria.
·         Download your patch .






2-      Create a new folder in OS root to locate your patch , and unzip  patch file  into this folder

                                          C:\OraclePatches



             
               ------------------------------------------------------------

Pre Installation

3-      Set System environment variable ORACLE_HOME

-          Weblogic set variable to  your middleware directory (For Weblogic )

          Oracle_Home =  [MW_HOME]\ oracle_common  

-          Jdeveloper set variable to you Jdeveloper Home

        Oracle_Home =   [Jdeveloper_HOME]\jdeveloper






4-      Stop All managed servers and Admin Server before apply patch. I prefer to backup your MW_HOME directory.
                If you apply patch in Jdeveloper ,  please shutdown Integrated Weblogic  and close Jdeveloper IDE.

5-      Open cmd Command and set your current directory to directory where your patch is located .
                   
                                     cd  C:\OraclePatches\21768703\oui

6-      Use Opatch Apply command to apply current patch .
(may you will face a conflict when applying the patch ,because patch already applied before )

                       C:\OraclePatches\21768703\oui>opatch apply –Jdk [JDK path]



------------------------------------------------------------


  Post Installation
7-      For Jdeveloper: Open Jdeveloper and clean project and rebuild, then start Integrated Weblogic and run and test your application after patch and check problem is resolved .
8-       For standalone Weblogic server : start Admin Server , then start node manager , then start Managed Server . and check your Problem is resolved .
      
          ------------------------------------------------------------


List Patches installed in your Oracle_Home
   
             to list all patches installed in your Oeracle_Home 

                  Open cmd command and write command
   
                                 /> Opatch lsinventory





------------------------------------------------------------


Deinstall patch  

1-      Stop All managed servers and Admin Server before apply patch . If you apply patch in Jdeveloper ,  please shutdown Integrated Weblogic  and close Jdeveloper IDE.

2-      Open cmd Command and set your current directory to directory where your patch is located .

cd  C:\OraclePatches\21768703\oui

3-      Use Opatch rollback  command to deinstall current patch .

C:\OraclePatches\21768703\oui>opatch rollback –Jdk [JDK path]

4-      Clean you all files in tmp folder in OS User Directory

Jdeveloper  :
  [JDEV_USER_DIR]\DefaultDomain\servers\DefaultServer\tmp\*


Middleware:
  [MW_HOME]/user_projects/domains/[DOMAIN_NAME]/servers/[SERVER NAME]/tmp/*

               ------------------------------------------------------------

Post DeInstallation
1-      For Jdeveloper: Open Jdeveloper and clean project and rebuild, then start Integrated Weblogic and run and test your application after patch and check problem is resolved .
2-       For standalone Weblogic server : start Admin Server , then start node manager , then start Managed Server . and check your Problem is resolved .





Sunday, November 1, 2015

Weblogic does not start ,throw Exception: java.lang.NumberFormatException BEA-000386


Weblogic does not start and throw an exception: java.lang.NumberFormatException
    <Critical> <WebLogicServer> <BEA-000386>

When i tried to start Weblogic Server , server did not work , and gave me an exception java.lang.NumberFormatException= null


<01/11/2015 6:17:36 AM UTC> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /u02/Oracle/user_projects/domains/mcitucm_domain/servers/AdminServer/logs/AdminServer.log42150. Log messages will continue to be logged in /u02/Oracle/user_projects/domains/mcitucm_domain/servers/AdminServer/logs/AdminServer.log.>
<01/11/2015 6:17:36 AM UTC> <Notice> <Log Management> <BEA-170019> <The server log file /u02/Oracle/user_projects/domains/mcitucm_domain/servers/AdminServer/logs/AdminServer.log is opened. All server side log events will be written to this file.>
<01/11/2015 6:17:38 AM UTC> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: java.lang.NumberFormatException: null
java.lang.NumberFormatException: null
        at java.lang.Integer.parseInt(Integer.java:417)
        at java.lang.Integer.parseInt(Integer.java:499)
        at weblogic.ldap.EmbeddedLDAP.validateVDEDirectories(EmbeddedLDAP.java:1104)
        at weblogic.ldap.EmbeddedLDAP.start(EmbeddedLDAP.java:242)
        at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
        Truncated. see log file for complete stacktrace
>
<01/11/2015 6:17:38 AM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FAILED>
<01/11/2015 6:17:38 AM UTC> <Error> <WebLogicServer> <BEA-000383> <A critical service failed. The server will shut itself down>
<01/11/2015 6:17:38 AM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN>
 This problem may happen because i changed some server configurations when server running and made a corruption if file replicas.prop in the server .
Solution  : Remove this corrupted file , and let Weblogic auto generate this file again when server restart .
1- Open your server which weblogic installed.
2- go to this path
$<YourDomain>/servers/AdminServer/data/ldap/conf



3- rename this file replicas.prop to old-replicas.prop
4- restart  Weblogic server .
5- Smile every thing is Okay now ....

Wednesday, October 28, 2015

Windows Internet Explorer IE11 Compatibility with ADF


Compatibility between Windows Internet Explorer IE11 and ADF

Final solution for Compatibility between IE11 and ADF application .without upgrade your Application or downgrade your Windows .

Discussion :

The Problem will appear when upgrade your MS windows to Windows 8.x , when  user try to request ADF application , some ADF rich component will not compatible with IE11 , because MS change agent Certificate to new agent and ADF  component could not work with it 
.
to resolve this isssue you face three solutions to resolve this Problem :

-   1-Upgrade You Weblogic and Application to 12c .
          
                You have to create new server and upgrade application to ADF 12c ..

     2-Manual Configuration by change Compatibly to old version

You can sesolve this issue by change manual compatibly from  IE11 browse
by press F12  from browser then change Compatibility = IE10 or IE9 .
By this way, Compatibility will back to default after close page .


-       3- Add custom Prosperity in Windows Registry .
                      (Good solution if you could not upgrade your application )

in this solution you will enforce IE11 to change Compatability to old version .


o    Press Run and write regedit to call windows registrty





·         Go to Key User Agent


HKEY_CURRENT_USER\
   Software\
      Microsoft\
         Windows\
   CurrentVersion\
     Internet Settings\
                            5.0\
                 User Agent\


-        Create three String values under User Agent Key



Set values as you need and compatible. in this demo , I’ll make compatibility with IE9
In addition, My Windows Platform is Windows 8.1
String
Value
Compatible

compatible

Platform

Windows NT 6.1

Version

MSIE 9.0




   Restart Internet explorer . now Press F12 . you will see Compatibility become IE9 . (User Agent String become IE9)



----------------------------

Another solution for change Compatability from Windows Registry

you can add this key in windows Policy to change windows compatbility

Direct from Regedit command and add key and value

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\BrowserEmulation\PolicyList]
"appsstuff:7071"="appsstuff:7071" 

"AllSitesCompatibilityMode"="dword:00000001"



HKEY_CURRENT_USER\
 Software\
    Policies\
        Microsoft\
             Internet Explorer\
                   BrowserEmulation\
                                     PolicyList 
"<Server>:<Port>"="<Server>:<Port>"

"AllSitesCompatibilityMode"="dword:00000001"



O racle  SQL WITH Clause         subquery factoring     or         Materializing   subqueries                                 (Sim...