So I thought that would be a nice use case to start, here is what I envisioned based on certain requirements from an actual customer I am helping at the present time.
As members of the Fusion Middleware Architecture Group (a.k.a the A-Team), we get exposed to a wide range of challenging technical issues around security and Oracle Fusion Middleware. We're using this blog to answer common questions and provide interesting solutions to the real-world scenarios that our customers encounter every day.
description "Oracle Database" # Based on blog post at # https://cdivilly.wordpress.com/2010/10/28/ubuntu-upstart-script-for-oracle-database/ # The location of the Oracle install env ORACLE_HOME=/home/oracle/database/product/11.2.0/dbhome_1 # The user to execute Oracle as env ORACLE=oracle start on runlevel  stop on runlevel  expect fork pre-start script logger "Starting Oracle DB" su - $ORACLE -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" end script post-stop script logger "Stopping Oracle DB" su - $ORACLE -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME" end scriptThen /etc/init/oid.conf for OID, OVD and the WebLogic server where I run ODSM:
start on started oracledb stop on stopping oracledb # This is good for debugging purposes but it's a bad idea to leave # this on long term. #console output # this starts OPMN, OID and OVD pre-start script logger "pre-start for OID/OVD" /bin/su - oracle -c "/home/oracle/middleware/asinst_1/bin/opmnctl startall" logger "pre-start for OID/OVD complete" end script # and this stops them post-stop script logger "pre-stop for OID/OVD complete" /bin/su - oracle -c "/home/oracle/middleware/asinst_1/bin/opmnctl stopall" logger "pre-stop for OID/OVD complete" end script # this is the AdminServer only: exec /bin/su - oracle -- /home/oracle/middleware/user_projects/domains/IDMDomain/bin/startWebLogic.shThe important thing there is the "start on started oracledb" stanza. What that says in English is much as you would expect - "start this once the 'oracledb' service is started". The "stop on" does the same for when the database is being stopped; which will cause Upstart to stop OID and OVD before it tries to stop the database. Upstart works out the dependencies automatically so no need to worry about numbers or pinging the database via sqlplus or tnsping. The Upstart config for the OAM Server looks the much the same:
start on started oracledb stop on stopping oracledb exec /bin/su - oracle -- /home/oracle/middleware/user_projects/domains/IAMDomain/bin/startWebLogic.shEnjoy.
2012-12-05 19:06:38.038 PiggyBank[24799:1303] -[__NSCFString OMJSONValue]: unrecognized selector sent to instance 0xb2be000This error appeared after the Application Profile was downloaded and I couldn't figure out what I had done wrong. Turns out I'd forgotten one step after adding the SDK bits to the XCode project - I had forgot to add the linker flags "-ObjC -all_load" under Build Settings. To fix this click on the Project, then click the Target, then click the "Build Settings" tab and find the "Other Linker Flags" row. Edit it and add -ObjC -all_load to whatever's already there. Here's a screen shot: Those flags are needed whenever a new message (function) will be passed to existing class without extending it. Inside the bits of the M&S SDK NSString doesn't have OMJSONValue but the SDK will pass OMJSONValue to NSString, so those flags are needed to make it work. Of course this is documented in a block marked "Important:" but I missed it and I'm guessing if you found this blog post via Google you did too!
start on runlevel  # This is good for debugging purposes but it's a bad idea to leave # this on long term. #console output # this starts OPMN, OID and OVD pre-start script /bin/su - oracle -c "/home/oracle/middleware/asinst_1/bin/opmnctl startall" end script # and this stops them post-stop script /bin/su - oracle -c "/home/oracle/middleware/asinst_1/bin/opmnctl stopall" end script # note that I'm only starting the AdminServer here exec /bin/su - oracle -- /home/oracle/middleware/user_projects/domains/IDMDomain/bin/startWebLogic.shNote: Because this is a little test environment and I want to keep the memory down and don't need DIP or a bunch of other stuff I simply moved ODSM from wls_ods1 to the Admin Server. That lets me run OID and ODSM without needing to start the wls_ods1 managed server.