Development

Oracle ASCIISTR Function with Examples

Complete IT Professional - Thu, 2016-08-25 16:17
In this article, I’ll explain what the Oracle ASCIISTR function does, and show you some examples. Purpose of the Oracle ASCIISTR Function The ASCIISTR function converts a string in any character set to a string in the database character set. If there are any characters that are not ASCII, they are converted to a format […]
Categories: Development

Oracle DBTIMEZONE Function with Examples

Complete IT Professional - Thu, 2016-08-25 06:00
In this article, I’ll explain what the Oracle DBTIMEZONE function does, and show you some examples. Purpose of the Oracle DBTIMEZONE Function The DBTIMEZONE function returns the timezone offset of the database, in the format of [+|-]TZH:TZM, or a time zone region name. It’s helpful when working with dates to know what timezone the database […]
Categories: Development

The Madness of the Modern Human

FeuerThoughts - Tue, 2016-08-23 17:13
"I eat using Uber-Eats.I push a button, the food is made, the driver delivers it to me. But when it's fully autonomous, how does the food actually get to my door? There's a tech stack that can get the car through the physical world to my doorstep, but then what? Does some robot get out of my car and deliver my food? That's hard. I don't know if that's two decades out, but the point is the physical world is getting wired up fast."
As you might guess, that is a quote from Uber's Mad CEO, Something-or-Other Kalanick. A unicorn billionaire who first wants to push taxi cab drivers to poverty, replacing them with "gig" contractors, who will then (in not too many years) be replaced by driverless cars.

Seriously, what is wrong with us? With the oceans crashing against our coastal cities, the planet warming, the poles melting, the forests being razed, the Sixth Extinction well in progress, can we still be so madly obsessed with using technology in the most absurd, energy-consuming, convenience-crazed ways?

A driverless car brings the food to my building "but then what?"

BUT THEN WHAT? How about getting your big fat ever spreading butt out of your Lazy-Boy and answering the damn door yourself, maybe even walking outside to a neighborhood restaurant and partaking in a meal around others?

Silly, sad humans.
Categories: Development

Getting ready your EM12cR5 system with latest Patches for Exadata Management

Arun Bavera - Tue, 2016-08-23 10:00
As of Aug 2016 these are the latest Patches Needed:

For OMS side:
PSU (12.1.0.5.160719)    Note 2158181.1 Patch 23087400 ( latest PSU)
OMS System side Monthly bundle patch – OMS Patch 23741465 ( jul2016)

For Agent side:
Agent Core System Patch: 23639986
Agent DB 12.1.0.8.0 Discovery Patch: 22135601
Agent DB 12.1.0.8.0 Monitoring Patch: 23517257
Agent FMW 12.1.0.8.0 Discovery:  23217959
Agent FMW 12.1.0.8.0 Monitoring: 23741311

EM for Exadata Plug-in  12.1.0.6.160731
Agent Exadata 12.1.0.6.0 Monitoring: 23639890
Agent Exadata 12.1.0.6.0 Discovery:  20844924

Use the EM Patch capability to create a Patch plan and apply these patches (agent side only):



Automating the Agent Side Patching
If you want to automate applying these patches for every new agent and plugin deployment follow this process:
Install the above agent side patches on any one of the agent. Use this as Golden Template and use Clone feature to deploy the further agent. ( Each GoldenTemplate for each platform)
OR
Step 1: Copy the Agent Sytem Patch to: $OMS_HOME/install/oneoffs/<agentversion>/<platform>
For Example:
cd /u01/app/oracle/middleware/oms/install/oneoffs/12.1.0.5.0/Generic
ls -ltr
total 19987
-rw-r--r-- 1 emuser oinstall 20383932 Aug 23 10:36 p23639986_121050_Generic.zipStep2: Create the custom plugin out of the above any one Golden Agent, to bake the patches in the default plugins:
Database Custom Plugin creation:
emcli create_custom_plugin_update -agent_name="mysystem.com:3872" -plugin_id="oracle.sysman.db" -overwrite
FMW Custom Plugin creation:
emcli create_custom_plugin_update -agent_name="mysystem.com:3872" -plugin_id="oracle.sysman.emas" -overwrite
Exadata Custom Plugin creation:
emcli create_custom_plugin_update -agent_name="mysystem.com:3872" -plugin_id="oracle.sysman.xa" -overwrite
Verify the patches:
emcli list_patches_in_custom_plugin_update -plugin="oracle.sysman.db" 
emcli list_patches_in_custom_plugin_update -plugin="oracle.sysman.db" -discovery

emcli list_patches_in_custom_plugin_update -plugin="oracle.sysman.emas" 
emcli list_patches_in_custom_plugin_update -plugin="oracle.sysman.emas" -discovery

emcli list_patches_in_custom_plugin_update -plugin="oracle.sysman.emas" 
emcli list_patches_in_custom_plugin_update -plugin="oracle.sysman.xa" -discovery


Now, any new agent deployed from console or emcli, even though you forget to use clone feature will make sure the latest Agent System patches are picked up from default patch locations and plugins deployed will make sure the patches contains for plugins as they are the default plugins now.

References:
Applying Enterprise Manager Recommended Patches (Doc ID 1664074.1)
Oracle Recommended Patches (PSU) for Enterprise Manager Base Platform (All Releases) (Doc ID 822485.1)
Document 2038446.1 - Enterprise Manager 12.1.0.5.0 (PS4) Master Bundle Patch List
Enterprise Manager Cloud Control 12c Recommended Plug-Ins and Patches for Database as a Service (DBaaS) (Doc ID 1549855.1)         
Enterprise Manager for Exadata 12.1.0.6.0 Bundle Patch Bug List (Doc ID 1929659.1)
Patch Requirements for Setting up Monitoring and Administration for Exadata (Doc ID 1323298.1)
http://oraforms.blogspot.ca/2014/05/oracle-em12c-release-and-patch-schedules.html
https://blogs.oracle.com/oem/entry/simplified_agent_and_plug_in
Categories: Development

65 Business Jargon Phrases to Stop Using and What Do Use Instead

Complete IT Professional - Mon, 2016-08-22 06:00
If you’ve worked in an office for any length of time, you’ve probably heard one of these phrases. A phrase that makes no sense at all unless you explain it. A word that is used by management in not quite the correct way. A sentence that has a bunch of words but doesn’t really say […]
Categories: Development

Oracle TO_NCLOB Function with Examples

Complete IT Professional - Fri, 2016-08-19 06:00
The Oracle TO_NCLOB function is a simple function and is used for conversion. Learn what it does and see some examples in this article. Purpose of the Oracle TO_NCLOB Function The purpose of the TO_NCLOB function is to convert a value from a LOB to an NCLOB value. You may not use it very often, […]
Categories: Development

Oracle TO_CLOB Function with Examples

Complete IT Professional - Thu, 2016-08-18 06:00
In this article, I’ll take a look at the Oracle TO_CLOB function, and show you some examples. Purpose of the Oracle TO_CLOB Function The TO_CLOB function converts a value in an NCLOB column (the national character set) to a CLOB (in the database character set).   Syntax The syntax of the TO_CLOB function is quite […]
Categories: Development

5 Stages of the Software Development Cycle

Complete IT Professional - Mon, 2016-08-15 16:46
This is a guest post by Saurab Prabhakar. The Software Development Lifecycle (SDLC) defines a revolution. It is fundamentally a sequence of steps that display a model for the development and lifecycle management of certain software or even an application. The procedure can differ from business to business, but the standards remain firm. The software development […]
Categories: Development

Oracle STDDEV Function with Examples

Complete IT Professional - Fri, 2016-08-12 06:00
Have you ever seen the Oracle STDDEV function? In this article, I’ll explain what the STDDEV function does and show you some examples. Purpose of the Oracle STDDEV Function The purpose of the STDDEV function is to find the standard deviation of a set of numbers. The standard deviation is a mathematical concept, which is […]
Categories: Development

Oracle BFILENAME Function Explained with Examples

Complete IT Professional - Thu, 2016-08-11 06:00
The Oracle BFILENAME function is a useful file manipulation function. Learn what it is and how to use it in this article. Purpose of the Oracle BFILENAME Function The BFILENAME function returns an object called a “BFILE locator” from a specified directory and filename. This function is often used in PL/SQL to access the data […]
Categories: Development

Why Asking Myself How To Add Value At Work Is The Best Thing I’ve Done This Month

Complete IT Professional - Mon, 2016-08-08 06:00
I’ve been doing something at work which has been getting great results. I only started doing a lot of it a few weeks ago. But, I’ve had a few people notice, and I can see the positive impact it’s having on the team. I want to share it in this article so you can try […]
Categories: Development

Installing SQLcl on OEL/RHEL

Dimitri Gielis - Thu, 2016-08-04 16:55
In my previous post I talked about how SQLcl came in handy to work with JavaScript against the database.

The installation of SQLcl is easy... you just download the zip, unpack and run the executable.

But to be fair, before I got SQLcl running (especially the script part) I encountered a number of issues, so hopefully this post helps you be able to run SQLcl with all features in minutes as it's meant to be :)


Those were the error messages I received when running sql (script):

javax.script.ScriptException: sun.org.mozilla.javascript.EvaluatorException: Java class "java.util.ArrayList" has no public instance field or method named "0".

javax.script.ScriptException: sun.org.mozilla.javascript.EcmaError: ReferenceError: "Java" is not defined. (#1) in at line number 1

The solution for me was to upgrade my Java version to Java 8.

Here're the steps on my OEL/RHEL system to upgrade Java:

$ cd /opt

$ wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-linux-x64.tar.gz"

$ tar xzf jdk-8u102-linux-x64.tar.gz 

cd jdk1.8.0_102/

alternatives --install /usr/bin/java java /opt/jdk1.8.0_102/bin/java 2
$ alternatives --config java

There are 5 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   3           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
*+ 4           /usr/java/jre1.8.0_101/bin/java
   5           /opt/jdk1.8.0_102/bin/java

Enter to keep the current selection[+], or type selection number: 5

$ alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_102/bin/jar 2
$ alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_102/bin/javac 2
$ alternatives --set jar /opt/jdk1.8.0_102/bin/jar
$ alternatives --set javac /opt/jdk1.8.0_102/bin/javac
$ java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)


$ export JAVA_HOME=/opt/jdk1.8.0_102
export JRE_HOME=/opt/jdk1.8.0_102/jre
$ export PATH=$PATH:/opt/jdk1.8.0_102/bin:/opt/jdk1.8.0_102/jre/bin

Now when running SQLcl everything worked like a charm. Hurray :)

Categories: Development

Oracle SESSIONTIMEZONE Function with Examples

Complete IT Professional - Thu, 2016-08-04 06:00
In this article, I’ll explain what the Oracle SESSIONTIMEZONE function is, and show you some examples. Purpose of the Oracle SESSIONTIMEZONE Function The SESSIONTIMEZONE function returns the timezone offset of your session, in the format of [+|-]TZH:TZM, or a time zone region name. This can be helpful to know, especially if you’re doing a lot of […]
Categories: Development

SQLcl to the rescue when the Database and APEX fail (with JSON limitations)

Dimitri Gielis - Wed, 2016-08-03 17:29
In the last two years I've been using JSON in almost every project I was involved in.
For example with APEX Office Print our plugin is sending JSON to the backend. This JSON you can actually see yourself in the Remote Debug screen in your AOP Dashboard.
Another example is the wearables project (IoT) I showed at KScope 16; the wearable is sending data to a smartphone or tablet, which in his turn is doing a call to our backend (in ORDS) and sending JSON across.

At the end of the day we want the data in the Oracle Database, so our APEX apps can work with that data.

Since Oracle DB 12c, JSON is supported straight from the database. I wrote a number of blog posts how to read JSON from SQL within the database. Here's a quick demo of JSON in the database:

SQL> create table tbl_with_json (
  2    json_clob  clob, 
  3    constraint json_clob_chk check (json_clob is json)
  4  );

Table TBL_WITH_JSON created.

SQL> 
SQL> insert into tbl_with_json (json_clob) values ('{
  2      "items": [{
  3          "client_id": -1,
  4          "registration_date": "2016-07-29T07:46:09.941Z",
  5          "question": "My Question",
  6          "description": "My huge clob"
  7      }]
  8  }');

1 row inserted.

SQL> 
SQL> select a.json_clob.items.question as question, a.json_clob.items.description as description 
  2    from tbl_with_json a;

QUESTION
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
DESCRIPTION
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
My Question                                                                                                                                                           
My huge clob                                                                                                                                                          




Now the reason of this blog posts: what if your JSON contains some very big text (>32K) in a single node e.g. in the description field? 

If you want to follow along in your own test case, open the description record in SQL Developer for example and past a large text (>32K) in the description node (so replace "My huge clob" with some other big text). Tip: For my test cases I typically use a Lorem Ipsum generator where I can specify the number of characters for example 33000 characters.



How can we parse this JSON and store for example the content of that in a CLOB field?

As I'm on 12c, should be simple right? The database is supporting reading JSON from SQL, so I first tried with JSON_TABLE, but there you can only define VARCHAR2 or NUMBER as data type, no CLOB, so went with VARCHAR2.

Here's the result:

SQL> select jt.question, jt.description
  2    from tbl_with_json, 
  3         json_table(json_clob, '$.items[*]'
  4           columns (
  5             question     varchar2 path '$.question',
  6             description  varchar2 path '$.description'
  7           )
  8*        ) as jt;

QUESTION
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
DESCRIPTION
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
My Question                                                                                                                                                           
                                                                                                                                                                      


Oracle just returns null (nothing - blank) for the description!

But it's definitely not blank:



Next I tried the query like in my initial example, but the result was the same:

SQL> select a.json_clob.items.question as question, a.json_clob.items.description as description 
  2    from tbl_with_json a;

QUESTION
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
DESCRIPTION
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
My Question                                                                                                                                                           
                                                                                                                                                                      


So the database will return a value when there's less than 4K (or possibly 32K depending the setting of your varchar2 size in the database) and it returns null when it's over this limit.

Hopefully Oracle Database 12.2 fixes this issue, but at the moment there's no native way to get to that data by using the Oracle supplied JSON functions.

Ok, what can we try next?...

Since Oracle Application Express 5, APEX comes with a very nice package to work with JSON, APEX_JSON. This package has been heaven for us, especially with AOP.
So I thought to try to use the APEX_JSON.PARSE and store it in a temporary JSON so I can read it with the get_clob_output method:

SQL> declare
  2    l_data clob;
  3    l_json apex_json.t_values;
  4    l_return clob;
  5  begin
  6    select json_clob
  7      into l_data
  8      from tbl_with_json;
  9    apex_json.parse(l_json, l_data) ;
 10    apex_json.initialize_clob_output(dbms_lob.call, true, 0) ;
 11    apex_json.open_object;
 12    apex_json.write(l_json, 'items[1].description') ;
 13    apex_json.close_object;
 14    l_return := apex_json.get_clob_output;
 15    apex_json.free_output;
 16  end;
 17  /

Error starting at line : 1 in command -
declare
  l_data clob;
  l_json apex_json.t_values;
  l_return clob;
begin
  select json_clob
    into l_data
    from tbl_with_json;
  apex_json.parse(l_json, l_data) ;
  apex_json.initialize_clob_output(dbms_lob.call, true, 0) ;
  apex_json.open_object;
  apex_json.write(l_json, 'items[1].description') ;
  apex_json.close_object;
  l_return := apex_json.get_clob_output;
  apex_json.free_output;
end;
Error report -
ORA-20987: Error at line 6, col 18: value exceeds 32767 bytes, starting at Lorem ipsum dolor sit amet, consectetuer adipiscin
ORA-06512: at "APEX_050000.WWV_FLOW_JSON", line 928
ORA-06512: at "APEX_050000.WWV_FLOW_JSON", line 993
ORA-06512: at line 9

But as you can see, there's a limit in there as well. So APEX 5 doesn't return null, but it returns an error. Hopefully a future version of APEX removes this limit ;)


When I work with data, I prefer to do it straight in the database, but now I was stuck. At those moments you have to go for a walk, get some sleep and talk to others to get more ideas... My preferred development languages (in this order) are APEX, SQL, PL/SQL, JavaScript, Node.js, ... (and then all others)

Then I remembered a blog post of Kris Rice that SQLcl has the ability to run JavaScript too because  SQLcl includes Nashorn (A Next-Generation JavaScript Engine for the JVM). So after looking at some SQLcl script examples, I wrote my own little SQLcl script that reads out the clob and puts it in a variable "content":

SQL> script
  2     var Types = Java.type("java.sql.Types")
  3     var BufferedReader = Java.type("java.io.BufferedReader")
  4     var InputStreamReader = Java.type("java.io.InputStreamReader")
  5     
  6     var GET_CLOB = "declare " + 
  7                    "   l_clob CLOB; " + 
  8                    " begin " + 
  9                    "   select json_clob " + 
 10                    "    into l_clob " + 
 11                    "    from tbl_with_json; " +
 12                    "   ? := l_clob;" + 
 13                    " end;"; 
 14  
 15     var cs = conn.prepareCall(GET_CLOB);
 16     cs.registerOutParameter(1, Types.CLOB);
 17     cs.execute();
 18     var clob = cs.getClob(1);
 19     cs.close();
 20  
 21     var r = new BufferedReader(new InputStreamReader(clob.getAsciiStream(), "UTF-8"))
 22     var str = null; 
 23     var content = "";
 24     while ((str = r.readLine()) != null) { content = content + str; }
 25     ctx.write(content);
 26  /
{ "items": [{ "client_id": -1, "registration_date": "2016-07-29T07:46:09.941Z", "question": "My Question", "description": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fring

So the above reads the content of the clob which contains the JSON.
As we are in JavaScript I thought we can parse this JSON and navigate to the description field. Once we have it we store it in another table or do whatever we want with it.
Cool if it would work, no? And it did! :)

So lets finish this example. First we create a table to store the description field (the very big text).

SQL> create table tbl_with_description (description clob);

Table TBL_WITH_DESCRIPTION created.


Here's the final script that will store the description node to another table :
- the ctx.write calls are there to send debug output
- the obj.items[0].description is how we get to the description node and we store that in a bind variable and execute another insert statement to save the description value:

SQL> script
  2  
  3  try {
  4     var Types = Java.type("java.sql.Types")
  5     var BufferedReader = Java.type("java.io.BufferedReader")
  6     var InputStreamReader = Java.type("java.io.InputStreamReader")
  7     
  8     var GET_CLOB = "declare " + 
  9                    "   l_clob CLOB; " + 
 10                    " begin " + 
 11                    "   select json_clob " + 
 12                    "    into l_clob " + 
 13                    "    from tbl_with_json; " +
 14                    "   ? := l_clob;" + 
 15                    " end;"; 
 16  
 17     var cs = conn.prepareCall(GET_CLOB);
 18     cs.registerOutParameter(1, Types.CLOB);
 19     cs.execute();
 20     var clob = cs.getClob(1);
 21     cs.close();
 22  
 23     var r = new BufferedReader(new InputStreamReader(clob.getAsciiStream(), "UTF-8"))
 24     var str = null; 
 25     var content = "";
 26     while ((str = r.readLine()) != null) { content = content + str; }
 27     //ctx.write(content);
 28  
 29     var obj = JSON.parse(content);
 30     ctx.write("Question: " + obj.items[0].question + "\n");
 31     ctx.write("Description: " + obj.items[0].description + "\n");
 32  
 33     var binds =  {};
 34     binds.description = obj.items[0].description;
 35  
 36     var ret = util.execute("insert into tbl_with_description (description) values (:description)", binds);
 37  
 38     if (ret) {
 39       ctx.write("Insert done!\n");
 40     } else {
 41       ctx.write("Error :(\n");
 42       var err = util.getLastException();      
 43       ctx.write("\nERROR:" + err + "\n");  
 44     }
 45  
 46  } catch(e){
 47      ctx.write(e +"\n")
 48      e.printStackTrace();
 49  }
 50  
 51  /
Question: My Question
Description: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis ... eu,
Insert done!


Testing:

SQL> select count(*) from tbl_with_description;

  COUNT(*)
----------
         1

SQL> select substr(description,1,50) from tbl_with_description;

SUBSTR(DESCRIPTION,1,50)                                                        
--------------------------------------------------------------------------------
Lorem ipsum dolor sit amet, consectetuer adipiscin                              

SQL> 

I was blown away by this... and I see a lot of potential be able to run JavaScript against the database.

There's actually a way to load Nashorn in your database too, so you can do JavaScript, Node.JS etc. straight from your database. Nashorn came with Java 8, but it should run in Java 7 too, now the default version of Java in the Oracle Database is 6, so there're some extra steps to do to get it to work. Running JavaScript from the database is something I've on my list to do R&D in and I actually submitted an abstract to KScope17 where I will present my results on this topic (if it gets accepted!) :) 

So to recap this (longer) blog posts:
1) JSON is being used a lot these days and having the possibility to work with JSON in the Oracle database is very nice, but as we have seen in the above example, it can't do everything yet. It has a real issue with large nodes.
2) Knowing other languages and thinking out-of-the-box might come in handy; I would even say that JavaScript becomes more and more important for an APEX developer.
3) SQLcl is a great tool, if you don't use it yet, I would definitely recommend looking into it. 
4) Oracle Nashorn opens up an entire new set of possibilities.

In the last paragraph of this blog post I want to thank Kris Rice for his help understanding SQLcl script. Although there are many examples, it took me some time to get going and I did struggle to understand how to get to error messages for example. Although it's mostly JavaScript in the script, having some Java knowledge makes it easier. Time to refresh that a bit, it has been 15 years ago I did some real Java coding.

Hope this blog post will help you work with JSON and JavaScript within an Oracle context.
Categories: Development

Oracle 12c New Features for Developers

Complete IT Professional - Mon, 2016-08-01 06:00
Oracle 12c is Oracle’s latest version of their database engine. Learn about all of the new Oracle 12c new features for developers in this massive guide. Introduction Oracle 12c comes with a range of new features. Many of these features are great improvements for developers, and some of them are more focused on database administrators. […]
Categories: Development

Oracle FROM_TZ Function with Examples

Complete IT Professional - Thu, 2016-07-28 06:00
In this article, I’ll explain what the Oracle FROM_TZ function is and show you some examples. Purpose of the Oracle FROM_TZ Function The purpose of the FROM_TZ function is to convert a TIMESTAMP value and a specified TIME ZONE to a TIMESTAMP WITH TIME ZONE value. It seems like a simple data conversion function, but […]
Categories: Development

Oracle TZ_OFFSET Function with Examples

Complete IT Professional - Wed, 2016-07-27 06:00
The Oracle TZ_OFFSET function is a useful datetime function. Learn how to use this function and see some examples in this article. Purpose of the Oracle TZ_OFFSET Function The purpose of the TZ_OFFSET function is to display a number that indicates the number of hours from UTC that a specified time is. You can specify […]
Categories: Development

CI, DevOps and ALM for Oracle SOA Suite with Oracle Developer Cloud Service

Shay Shmeltzer - Tue, 2016-07-26 18:31

We have a lot of developers who are using JDeveloper to develop applications with Oracle SOA Suite, and in this blog I wanted to show them how the combination of JDeveloper along with Oracle Developer Cloud Service can help automate their whole development and delivery lifecycle.

One unique aspect of Developer Cloud Service is that it has an instance of JDeveloper available in the build environment. This allows customers who are building Oracle SOA artifacts to leverage the OJDeploy mechanism to package their applications as part of a continuous integration cycle just like they do during development time.

With the improved DevCS integration that we added in JDeveloper 12.2.1, developers can go beyond integration with the Git server offered by DevCS and can now interact with the DevCS task tracking system directly as well as associate code changes to specific tasks they are working on.  

In this 10 minutes video I show:

  • Creating Ant based builds for Oracle SOA artifacts
  • Automating Continuous Integration build and packaging for Oracle SOA from Developer Cloud Service
  • Managing SOA project code with Git and Developer Cloud Service 
  • Tracking tasks from JDeveloper and monitor agile development in Developer Cloud Service

By the way, for those who rather use Maven to automate their builds - this is totally possible and supported in DevCS as well. There is a set of videos that show you how to do that here

(If you haven't seen how quick and easy it is to create a DevCS project, create a git repo, track tasks and create agile team boards - see this video and this one too).

Note that developers get access to Developer Cloud Service with every subscription to the Oracle SOA Cloud Service. 

Here are the two ant files used in the video:

Note that in the build.properties you'll want to change the application and project names to match the ones you are working on.

As you see in the video the build.xml is generated for you automatically and you just need to add the line:

<property environment="env" />

build.properties

oracle.commons=../../../../oracle_common/
oracle.commons=../../../../oracle_common/
install.dir=../../../..
oracle.home=${env.ORACLE_HOME_SOA_12_2_1}
oracle.jdeveloper.workspace.path=${env.WORKSPACE}/e2e-1201-composites.jws
middleware.home=${env.MIDDLEWARE_HOME_SOA_12_2_1}
workspace=${env.WORKSPACE}
oracle.jdeveloper.ant.library=${env.ORACLE_HOME_SOA_12_2_1}/jdev/lib/ant-jdeveloper.jar
oracle.jdeveloper.deploy.dir=${env.WORKSPACE}/ProcessOrder/deploy
oracle.jdeveloper.ojdeploy.path=${oracle.home}/jdev/bin/ojdeploy
javac.nowarn=off
oracle.jdeveloper.project.name=ProcessOrder
oracle.jdeveloper.deploy.outputfile=${env.WORKSPACE}/e2e-1201-composites/ProcessOrder/deploy/${profile.name}
output.dir=classes
javac.deprecation=off
oracle.jdeveloper.deploy.profile.name=*
javac.debug=on

build.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!--Ant buildfile generated by Oracle JDeveloper-->
<!--Generated Jul 25, 2016 5:11:09 PM-->
<project xmlns="antlib:org.apache.tools.ant" name="ProcessOrder" default="all" basedir=".">
<property environment="env" />
<property file="build.properties"/>
<path id="library.SOA.Designtime">
<pathelement location="${install.dir}/soa/plugins/jdeveloper/extensions/oracle.sca.modeler.jar"/>
</path>
<path id="library.SOA.Runtime">
<pathelement location="${install.dir}/soa/soa/modules/oracle.soa.fabric_11.1.1/fabric-runtime.jar"/>
<pathelement location="${install.dir}/soa/soa/modules/oracle.soa.fabric_11.1.1/tracking-api.jar"/>
<pathelement location="${install.dir}/soa/soa/modules/oracle.soa.fabric_11.1.1/tracking-core.jar"/>
<pathelement location="${install.dir}/soa/soa/modules/oracle.soa.fabric_11.1.1/edn.jar"/>
<pathelement location="${install.dir}/soa/soa/modules/oracle.soa.mgmt_11.1.1/soa-infra-mgmt.jar"/>
<pathelement location="${oracle.commons}/modules/com.oracle.webservices.fabric-common-api.jar"/>
</path>
<path id="library.BPEL.Runtime">
<pathelement location="${install.dir}/soa/soa/modules/oracle.soa.bpel_11.1.1/orabpel.jar"/>
</path>
<path id="library.Mediator.Runtime">
<pathelement location="${install.dir}/soa/soa/modules/oracle.soa.mediator_11.1.1/mediator_client.jar"/>
</path>
<path id="library.MDS.Runtime">
<pathelement location="${oracle.commons}/modules/oracle.mds/mdsrt.jar"/>
</path>
<path id="library.BC4J.Service.Runtime">
<pathelement location="${oracle.commons}/modules/oracle.adf.model/adfbcsvc.jar"/>
<pathelement location="${oracle.commons}/modules/oracle.adf.model/adfbcsvc-share.jar"/>
<pathelement location="${oracle.commons}/modules/commonj.sdo.backward.jar"/>
<pathelement location="${oracle.commons}/modules/commonj.sdo.jar"/>
<pathelement location="${oracle.commons}/modules/oracle.toplink/eclipselink.jar"/>
<pathelement location="${oracle.commons}/modules/com.oracle.webservices.fmw.wsclient-impl.jar"/>
<pathelement location="${oracle.commons}/modules/com.oracle.webservices.fmw.jrf-ws-api.jar"/>
<pathelement location="${oracle.commons}/modules/com.oracle.webservices.fmw.web-common-schemas-impl.jar"/>
</path>
<path id="classpath">
<path refid="library.SOA.Designtime"/>
<path refid="library.SOA.Runtime"/>
<path refid="library.BPEL.Runtime"/>
<path refid="library.Mediator.Runtime"/>
<path refid="library.MDS.Runtime"/>
<path refid="library.BC4J.Service.Runtime"/>
</path>
<target name="init">
<tstamp/>
<mkdir dir="${output.dir}"/>
</target>
<target name="all" description="Build the project" depends="deploy,compile,copy"/>
<target name="clean" description="Clean the project">
<delete includeemptydirs="true" quiet="true">
<fileset dir="${output.dir}" includes="**/*"/>
</delete>
</target>
<target name="deploy" description="Deploy JDeveloper profiles" depends="init">
<taskdef name="ojdeploy" classname="oracle.jdeveloper.deploy.ant.OJDeployAntTask" uri="oraclelib:OJDeployAntTask"
classpath="${oracle.jdeveloper.ant.library}"/>
<ora:ojdeploy xmlns:ora="oraclelib:OJDeployAntTask" executable="${oracle.jdeveloper.ojdeploy.path}"
ora:buildscript="${oracle.jdeveloper.deploy.dir}/ojdeploy-build.xml"
ora:statuslog="${oracle.jdeveloper.deploy.dir}/ojdeploy-statuslog.xml">
<ora:deploy>
<ora:parameter name="workspace" value="${oracle.jdeveloper.workspace.path}"/>
<ora:parameter name="project" value="${oracle.jdeveloper.project.name}"/>
<ora:parameter name="profile" value="${oracle.jdeveloper.deploy.profile.name}"/>
<ora:parameter name="nocompile" value="false"/>
<ora:parameter name="outputfile" value="${oracle.jdeveloper.deploy.outputfile}"/>
</ora:deploy>
</ora:ojdeploy>
</target>
<target name="compile" description="Compile Java source files" depends="init">
<javac destdir="${output.dir}" classpathref="classpath" debug="${javac.debug}" nowarn="${javac.nowarn}"
deprecation="${javac.deprecation}" encoding="UTF8" source="1.8" target="1.8">
<src path="SOA/SCA-INF/src"/>
</javac>
</target>
<target name="copy" description="Copy files to output directory" depends="init">
<patternset id="copy.patterns">
<include name="**/*.GIF"/>
<include name="**/*.JPEG"/>
<include name="**/*.JPG"/>
<include name="**/*.PNG"/>
<include name="**/*.cpx"/>
<include name="**/*.dcx"/>
<include name="**/*.ejx"/>
<include name="**/*.gif"/>
<include name="**/*.ini"/>
<include name="**/*.jpeg"/>
<include name="**/*.jpg"/>
<include name="**/*.png"/>
<include name="**/*.properties"/>
<include name="**/*.sva"/>
<include name="**/*.tag"/>
<include name="**/*.tld"/>
<include name="**/*.wsdl"/>
<include name="**/*.xcfg"/>
<include name="**/*.xlf"/>
<include name="**/*.xml"/>
<include name="**/*.xsd"/>
<include name="**/*.xsl"/>
<include name="**/*.exm"/>
<include name="**/*.xml"/>
<exclude name="build.xml"/>
</patternset>
<copy todir="${output.dir}">
<fileset dir="SOA/SCA-INF/src">
<patternset refid="copy.patterns"/>
</fileset>
<fileset dir=".">
<patternset refid="copy.patterns"/>
</fileset>
</copy>
</target>
</project>

Categories: Development

How to Find the Row That Has the Maximum Value for a Column in Oracle

Complete IT Professional - Mon, 2016-07-25 06:00
Do you need to find the data for a row which has the maximum value for a specific column in Oracle? Learn how to do it and see some alternative answers in this article. The Table Structure Let’s say you have a table called sales_volume that looks like this: CITY START_DATE SALES El Paso 27/May/15 […]
Categories: Development

Oracle INITCAP Function with Examples

Complete IT Professional - Thu, 2016-07-21 06:00
The Oracle INITCAP function is a handy string manipulation function. Learn what it does and see some examples in this article. Purpose of the Oracle INITCAP Function The Oracle INITCAP function translates a specified string into another string which has the first letter of each word capitalised, and all other letters in lower case. The […]
Categories: Development

Pages

Subscribe to Oracle FAQ aggregator - Development