Wednesday, December 19, 2012

APEX Listener 2.0 !

The Oracle APEX Listener 2.0 is officially out. There's a TON of changes in this release. The first how you get it up and running. For the standalone version, it's very simple to be up and running quickly. Simply type "java -jar apex.war" and follow the prompts. This will get you up and running.  The biggest changes are in the REST services and I'll blog more on that later.

The command line has a options now.
$ java -jar apex.war help
java -jar apex.war  [Options] [Arguments]

The following commands are available:

               configdir         Set the value of the web.xml
                                 config.dir property

               help              Describe the usage of this
                                 program or its commands

               map-url           Map a URL pattern to the
                                 named database connection

               migrate           Migrate a 1.x configuration
                                 to 2.x format

               setup             Configure database connection

               standalone        Launch Oracle Application
                                 Express Listener in
                                 standalone mode

               static            Generate a Web Application
                                 Archive (WAR) to serve Oracle
                                 Application Express static
                                 resources

               user              Create or update credentials
                                 for a user

To see instructions on how to use each of these commands, type help
followed by the command name, for example

 java -jar apex.war help configdir

If no command is provided the Listener is started in standalone mode

The important one to not using the command line is the "user" command. You can use sqldeveloper 3.2.2 to now administer the APEX Listener. The user command lets you setup the authentication that sqldev will use to connect and administer in standalone mode.

java -jar apex.war user klrice "Listener Administrator"

SQL Developer 3.2.2 is the current and required version to administer the listener.  Use the View -> APEX Listener menu and change anything. Once the settings are done, use the test button in the tool bar to validate setting and finalize with the Upload Setting button. Alternatively, you can save the setting to a zip file and manually put them in place.



Java Script Validations?

In the new listener there's an option for the normal PL/SQL Validations.  Nothing has changed there however if you change the select box to javascript, you can now validate the request before hitting the database at all.  This has the obvious advantage of no database hit, no connection borrowed from the pool, no extra load on the database to simply refuse some requests.  The following are all available in javascript as variables.

HOST
PORT
REFERER
USER_AGENT
URI
QUERY_STRING
REMOTE_ADDR
REQUEST_METHOD
REQUEST_PROTOCOL
REQUEST_SCHEME
SCRIPT_NAME
SERVER_NAME
SERVER_PORT
SERVER_PROTOCOL
Also all querystring params and headers are put in as variables with their names. 
The only requirement is that there be a function named "isValid" that returns the string "true" or "false".  

function isValid(){ 
 // no more ie6 
    if ( USER_AGENT.indexOf("MSIE 6") > 0 ) {
        return "false";
     }
 // a procedure in the klrice schema named HI has been performing poorly so shut it off
   if ( SCRIPT_NAME == 'klrice.hi' ) { 
       return "FALSE";
   }
  return "true";
}

Friday, October 12, 2012

SQL Developer and Cloud.oracle.com

Cloud accounts are trickling out so figured I'd do a quick post showing how to connect SQL Developer to the Database Service. Check out http://cloud.oracle.com for details on the service offerings and to sign up for a trial.



Once your service is activated, connecting SQL Developer is pretty easy. You have to go into the Application Express and create new user. To get to the screens, simply choose Create user off the Administration menu.


The key is that the User Groups listed at the bottom of the page have to all be granted. This is to allow SQL Developer an OAuth2 client to connect to the RESTful calls we have created. I'll get into that in another blog post.


Now in SQL Developer, enter the username just created and the URL of the apex service into the URL field. Also the SFTP credential can be entered for doing data deployment ( also in another blog post coming soon ).



Then you simply use the tree widget as normal. Expand the tree, expand the tables and see the ones we seeded in for initial tinkering.



These are the clouds you are looking for.

Friday, August 03, 2012

APEX Listener 2.0 EA1 is out !


The new APEX Listener that will be powering the Oracle Cloud is out for an Early Access.  There have been huge changes so be sure to check the documentation.  The first change is that there's a more robust command line now.

Give it a try with this:
java –jar apex.war help


This new version supports multiple databases.  Be sure to check out "Configuring Multiple Databases" there's lots of flexibility on how to route which requests to which database.  Here's a jump start to getting it up and going.

To setup the database configuration information:
 java -jar apex.war setup --database sales_db

Then the how to route what to where has to be done.  There's 2 choices for this entire base URL or just the base path.

1) Base Path :  This will route anything /apex/sales/* to the sales_db

  java -jar apex.war map-url --type base-path --workspace-id sales_rest /sales sales_db



2) Base URL :  This will ONLY route exact matches of the enture url to the sales_db.  This include http vs. https.  This example would give a 404 for any https request.

java -jar apex.war map-url --type base-url --workspace-id sales_rest http://example.com/apex/sales sales_db



Coming soon....



Here's a screenshot of the upcoming configuration screens in sqldev to give an idea of some of the changes in the listener.  Everything is still driven off xml config files so everything in this screenshot is there today to try out.


Friday, July 06, 2012

KScope DB Symposium Slides / Thirsty Games

Here's all the slides from ODTUG's Kscope12 DB Symposium which took place on Sunday.  The flow of the day was meant to be from a blank or reversed diagram in the modeler and the through deploying and tuning.

If you missed it, be sure to check out the slides it was a great set of speakers.  Be sure to check out the video referenced in Tom Kyte's talk.  Anyone that is using a connection pool where the knee jerk reaction to performance is to increase the size of the pool will find it useful.

SQL Developer Data Modeler  
    - Kris Rice, Oracle Corporation
SQL Developer  
    - Jeff Smith, Oracle Corporation
Continuous Integration with Database Projects 
    - Kris Rice, Oracle Corporation
How to "Tune" a Query 
    - Tom Kyte, Oracle Corporation
    - Referenced YouTube video from the talk
SQLDeveloper with Enterprise Manager: Integrating Changes from Developer to DBA 
    - Jagan Athreya, Oracle Corporation
Oracle Optimizer - Top Tips to get Optimal SQL Execution All the Time 
    - Maria Colgan, Oracle Corporation

Can't talk about how great kscope was without mentioning the Thirsty Games.  Team Dev Tools represented us very well.

Here's @thatjeffsmith v.  @martindsouza 


And here's Ashley Chen v. Barbara Morris

Wednesday, May 16, 2012

New OBE series

I'm sure most people know by now that we have a VM we build and run the OTN Developer Day events based on those VMs.  The key to running the events is the Oracle By Example labs.  They are a great way to learn the tools and software in the VM.

What everyone may not know is all the OBEs are online as well.  The are runnable anywhere not just in the VM we build.  The Oracle Learning Library has TONS of great labs to learn.  The labs are tagged to make it very easy to find what you are looking for.


The latest addition is something we kicked around and everyone liked.  That's a series where the labs build upon the previous lab to learn more than 1 topic for 1 hour then switch to another topic.

What we came up with is the Application Developer Days Workshop Series .  This series starts in the SQL Developer Data modeler, then writing plsql in SQL Developer, then creating an app in APEX.  So a soup-to-nuts idea.  Starting from a clean slate and progressing into a functioning application.

Give it a try!