Edd Grant :: Code, Compose, Bike, Brew etc ... though not necessarily in that order
 

Nov 21, 2011

 

Back when I was a student I used to run a home server to provide various services for my housemates and I, the 'server' was an old desktop I had spare at the time and sat in a cupboard running 24x7x365, well that was the plan anyway... Everything ran fine for 4 or 5 months before it started to behave very strangely indeed, I spent many hours diagnosing some pretty weird and often unreproducible issues and in doing so learnt that normal desktop hardware is not intended for 24x7x365 usage, particularly cheap power supplies and hard disks of which I went through several of each during this short period.

When it was time to pay the electricity bill we also discovered that standard desktop PC's consume an astonishing amount of electricity and therefore cost lots to run 24x7x365, this wasn't a very welcome surprise for a bunch of skint students!

Eventually I grew bored of replacing el cheapo disks and budget power supplies and retired the home server, I moved a few of the services (eddgrant.com etc) over to a linux VPS. The VPS was fine for modest resources, but for the price I was able to pay was very constrained both in terms of disk space (~ 5GB), RAM (~316MB!) and firewall configuration (default ports only unless I doubled my monthly spend). So whilst the VPS was able to run eddgrant.com it wasn't able to take on a lot of duties that the old server took care of (backups, file serving etc).

After a while I started looking around for some suitable hardware to build a new home server on, I have somewhat of a fascination (err... obsession?) with electrical efficiency and saving the amount of electricity used at home so I wanted to build something which fitted the following requirements:

  1. Extremely low power consumption: <= 10 watts under load (or as close as possible).
  2. Robust enough for 24x7x364 operation.
  3. Near silent operation.
  4. Capable of taking on routing and modem duties i.e. replace my modem/ router to further reduce electrical usage at home.

The Contenders:

There seem to be quite a few devices in the low power arena, each with it's own pros and cons. Certain things that one would take for granted with a desktop/ server grade machine, such as having a wealth of expansion slots or input/ output controllers becomes less common with lower power devices, the result being that you really need to plan carefully in order to be sure that the device can provide the required interfaces for the task at hand. Having said that I was impressed that there are several really capable low power devices which provide a reasonable range of connectivity/ expansion.

I looked at the following devices:

Soekris NET5501, CompuLab fit-PC2(i), Netgear ReadyNAS

The NET5501, is based on a single core 500 MHz AMD Geode CPU and comes with up to 512MB RAM. It has 4 10/100 Mbit ethernet ports and a SATA 1.0 controller. It is incredibly power efficient drawing about 7 watts under load. It is intended for industrial application and so is built robustly, it also has 1 x PCI and 1 x MiniPCI slot so could take on routing and modem duties with the appropriate card. The presence of the PCI slots makes this device incredibly flexible in terms of it's configuration. However one frustrating thing about the NET5501 is the small amount of RAM, being limited to 512MB, is really a deal breaker for me. Also there is a distinct lack of any documentation for the 5501 which concerns me (the only available documentation refers to the 5501's predecessor, the NET4801).

The fit-PC2(i) is based on a single core 2GHz Intel Atom Z550 CPU and comes with 2GM RAM. It has 2 10/100/1000 Mbit ethernet port and a SATA controller and an internal 9.5mm SATA bay for an onboard HDD. It draws 8 watts under full load (excluding HDD) and, whilst not quite as robust as the soekris is built sturdily for continual use. The fit-PC2(i) also has a build in SD card slot and onboard sound and graphics which, while not required for a headless server hugely simplifies initial O/S installation. It also has onboard 802.11n WLAN and 4 USB 2.0 ports for further expandability.

The Netgear ReadyNAS is an altogether different beast but is worth looking at, it comes in a range of different guises but is generally more aimed at providing super configurable storage than being a low power linux server. It can however be modded to the extent that you can consider it a normal linux server, however it suffers from slow CPU and lack of RAM. It also has a relatively high power consumption of around 20 watts (excluding disks) although it does have a clever timer function which can power it down based on a user defined schedule, thus reducing total power consumption.

Re-evaluating my priorities.

I initially prioritised having a device which could replace my router/modem, the most likely candidate for this would be to obtain a PCI ADSL modem card and a MiniPCI wireless access point card. From the devices I found available the only one which had the available expansion for this was the Soekris, costing up the options looked prohibitively expensive, furthermore, moving routing/ modem to a single box would also create a single point of failure in terms of internet access from home, which could be an almighty pain if the box went down unexpectedly. With this in mind I decided to remove this requirement and leave my existing router in place for the time being.

In order to be able to run several services on the device I was concerned that I was going to need a reasonable amount of RAM (reasonable being >= 1GB in my estimation). The Soekris does not allow increasing of RAM from it's 512MB stock, unless you want to get handy with a soldering iron, this was a limitation too far for me so the Soekris was eliminated from the runnings. It appears to be possible to increase the RAM in the ReadyNas but I felt that the power consumption of the device was too high for me to be willing to run it 24x7x365 which essentially ruled it out. This leaves us looking at the FIT PC, it comes loaded with 2GB of RAM, draws an absolutely tiny amount of electricity and has reasonably good explansion options, albeit based more around USB devices than PCI/ MiniPCI. It is also the only device which has onboard graphics which makes installation and initial configuration dead easy compared to the “fun and games setting baud rates with a serial cable” required to get a Soekris up and running. The only area that the FIT PC doesn't do so well is when compared to the native RAID and multiple disk capability of the NetGear, however having multiple disks creates an issue of power consumption so this is something I'm wiling to work around, perhaps with some more creative/ robust backup strategies. So that was it, decision made, time to order a fit-PC2(i).

Introducing Pico:

The FIT PC arrived in no time, I've named it PICO after it's PICO-ITX architecture and the fact that it's absolutely tiny!

This is PICO:

So what am I going to do with it?

Well, I want to squeeze every last CPU cycle out of it, so I plan to run as many services as feasably possible whilst ensuring that each of the services provides an adequate response/ user experience. My initial ideas being:

  • SqueezeServer

  • Jenkins Server for my personal projects

  • Master backup server

  • LDAP Schema master

  • Music/ Video fileshare

  • eddgrant.com svn repo

  • MythTv master backend running MythWeb

  • Puppet master server

  • ssh/ sftp server and point of entry to home network

  • OpenVPN

I think that's a reasonable list to start off with. I think it could be quite an interesting project to see how it copes with the running of each of the above so will probably blog further entries as I get each bit setup.


Comments[0]
Trackback URL for this entry

Mar 25, 2011

 

Just a quick one today...

Barry Cranford and James Bowkett from the London Java Community (LJC) and Graduate Developer Community (GDC) have been putting together a series of online interviews intended to help graduates and undergraduates get a feel for what it's like in the professional world of I.T. Barry and James were kind enough to invite me to do an interview on my experiences to date as a consultant, I was really keen to get involved since this is exactly the kind of information which I would have found invaluable when I was looking in to the various graduate employment possibilities when leaving University. 

I found it a useful exercise providing me with a good opportunity to reflect on my experiences so far, I hope it is of interest/ use to the GDC community.

You can read my interview on the GDC Careers site.

Cheers,

EdD

Comments[0]
Trackback URL for this entry

Mar 10, 2011

 

Wow! Last weekend was truly a special one! A few folk from CGCC, ThisIsSheffield and notably Steve Peat himself, had  been busy at work organising a downhill race in Grenoside Woods. Titled 'Peaty's Steel City Downhill'  the race took place on the Saturday. Tash and I drove up to Sheffield and stayed with some CGCC mates on Friday before heading over to Greno woods on Saturday.

The weather wasn't great on Saturday (it was Sheffield - what do you expect!) but the constant mist that hung in the air made the woods look great and made for some great photos. I'd not ridden the track before, it was pretty great though - very pedally throughout, full of rocks and as slippery as hell, especially on my balding high rollers.

I really enjoyed the track despite not really being able to get to grips with it. Some of the faster boys and girls were managing to carry speed through the rocky, muddy, heather mid-section where I just seemed to lose all control! The drop at the finish was top fun though, although I did have a moment of panic during practise when someone fell at the finish directly where I was about to land!! Fortunately we managed to avoid a collision so all was well... *phew*.

Despite the wet the turnout was fantastic - I couldn't believe how many people came down both to race and spectate. I was also impressed at the number of companies who had rocked up with their various bits and pieces, some were even giving out free stuff!

After the results and (frankly incredible) prizes were handed out at Greno we finished the day at the Showroom watching a series of Alex Rankin films followed by a short interview with Rob Warner and Steve Peat.

One of my favourite aspects of the day was the fact that all the pro bikers were so easy going and were happy to race with all the people who just ride bikes for fun - quite rightly thrashing us in the process! I love the fact that there was no elitism in this way and that world champs like Steve Peat make an effort to get so involved with the general mountain biking community. Can you imagine this happening in Formula 1? I think not!

Also - I should mention - one of the main points of the race was to raise money for the Greno Woods Appeal - in an attempt to raise money to save the woods. A worthy cause!

There are already a few photos and videos of the event cropping up, here are some links which I'd highly recommend checking out:

This Is Sheffield race report

Roots and Rain photos - Various Photographers

Rob Haines photos of the event on Flickr

John Alexander's photos on Flickr

And the vids (I don't know how these guys get their stuff edited and put together so quickly!)

 

 

 

Just want to say a HUGE thanks to the organisers Steve Peat, Nick Hamilton, Joe Bowman, Steve Hardcastle and Henry Norman for organising such a great event, also to the marshals who braved the grim Sheffield weather all day and to John and Anna for being such generous hosts! I won't be forgetting this weekend for a long long time!

Cheers everyone!

EdD

Comments[0]
Trackback URL for this entry

Mar 08, 2011

 

I use zoneedit to manage some of my DNS domains and subdomains, they're one of the only TLD DNS services who offer a free service with dynamic dns and allow you use your own domain rather than a suffix on their TLD. In order to access certain services hosted on machines at home I have created a subdomain of my eddgrant.com domain, called home.eddgrant.com. I then used the dynamic DNS capabilities of my ADSL modem/router (a Thomson TG585 v7) to update my zoneedit account on a regular basis to ensure that home.eddgrant.com always points to my current home IP address.

Getting this setup wasn't the most straight forward process so I thought I'd document the steps I took and some of the problems I encountered during the process.

The Thomson TG585 v7  provides several preconfigured 'service' templates for use with certain dynamic DNS vendors, I looked at these providers but they were all either paid services or only offered dynamic addressing using a subdomain of their TLD e.g. eddhome.dyndns.org. Fortunately the speedtouch also provides a 'custom' dyndns template which allows for the configuration of a custom provider e.g. zoneedit. Unfortunately the speedtouch makes some rather unhelpful assumptions about the list of parameter names and values it supplies to the dyndns provider and as far as I can tell some of the necessary parameters are totally inaccessible through the web admin GUI. So in order to get everything working it is necessary to use a combination of telnet and web GUI access, here's how you do it:

  • telnet on to your modem/ router e.g. telnet bebox.config/ telnet 192.168.1.254 etc, log in as the Administrator account.
  • Type dyndns service, this will locate you in to the dynamic dns services menu.
  • Type list, this will list all of the available services, one of which will be 'custom', this is the one we're going to edit to work with ZoneEdit).
  • Type modify, the device will prompt you for the name of the service you wish to modify, type custom and hit return.
  • The device will prompt you to enter details for each configuration attribute of the service, enter the following (ensuring that you replace home.eddgrant.com with whatever domain you're going to be updating).

{Administrator}[dyndns service]=>modify
name = custom
[server] = dynamic.zoneedit.com
[port] = www-http
[request] = /auth/dynamic.html?host=home.eddgrant.com&ignoreTheFollowing=
[updateinterval] = 8600
[retryinterval] = 30
[max_retry] = 3
:dyndns service modify name=custom

Notes on the above:

  • The &ignoreTheFollowing might look odd but it is required to render the default URL parameters which the device sends ineffective by ensuring they are treated as the content of the ignoreTheFollowing URl parameter.
  • The above configuration essentially instructs the device to make an http call, every 8600 seconds, to http://dynamic.zoneedit.com/auth/dynamic.html?host=home.mredd.co.uk&ignoreTheFollowing=<device's original URL parameters>.
  • You should now be back at the menu, type list again to list the services, this time you should see your changes reflected in the 'custom' service.
  • That's all we need to do in the telnet interface so exit the session.
  • Now you've configured the custom service you need to configure it as the active service and add authentication details, this is easiest done in the web gui.
  • Open a browser and log in to your modem/ router (again as the Administrator) e.g. http://bebox.config
  • Click Toolbox from the menu on the left.
  • Click Dynamic DNS Service
  • Click Configure
  • Enter your ZoneEdit username and password in the appropriate fields
  • Select the 'custom' service
  • Set the Host as: dynamic.zoneedit.com (not sure if this is entirely necessary since we've set it up in the telnet session but let's do it anyway)
  • Click apply (it should look something like the image below).

 

You're done! Your device should pretty much immediately call the ZoneEdit update page updating your IP address - you can confirm that this by logging in to your ZoneEdit control panel and verifying your WAN IP address against something like whatismyip.com.

What to do if it doesn't work?

Essentially you're going to need to debug the requests being made by the device. I found the easiest method was to reconfigure the server property of the custom service (in the telnet steps above) to point to one of my webservers and to change the updateinterval period to 30 seconds and then tail the web server's access logs. This process gives you visibility of http requests that the device is making which makes the whole process much easier to understand and debug. Here's an example from my apache logs:

87.194.250.230 - - [06/Mar/2011:10:40:53 -0500] "GET auth/dynamic.html?host=home.eddgrant.com&ignoreTheFollowing=?system=custom&hostname=home.eddgrant.com&myip=87.194.250.23
0&wildcard=OFF&offline=NO HTTP/1.0" 400 303 "-" "SpeedTouch-6.1.4.3"

Well that's pretty much it, hope that helps someone. Just want to add my thanks to the contributors of this post who made the task much easier .

Cheers,

EdD

Comments[2]
Trackback URL for this entry

Feb 03, 2011

 
A couple of days ago I celebrated my 30th Birthday, Tash and I took a few days off work and travelled to Langollen in North Wales. We spent a couple of days biking at the Coed Llandegla trail centre and stayed at the Riverside Mews which is in close driving distance to the trails. Llandegla has always been one of my favourite trail centres in the UK but has been greatly improved with the addition of dedicated skills and free ride areas, we spent quite a bit of time playing on these, rode the main red/ black route and also rode the new black section 'Parallel Universe' which was great fun. The next morning we departed Wales and drove back to London.

On my birthday we drove over to
Chicksands Bike Park and spent the day riding the various tracks and trails. We virtually had the place to ourselves which was great so we got in a good few runs on the dual slalom,  4X and freeride areas. I spent a bit of time trying to clear the 4X double cleanly...


... had a play in the freeride area...


... and had a bash at the small set of tables in the jump area


Tash got some great practise in and really enjoyed the dual course! After riding all day we were absolutely knackered so we went home, ate some awesome Indian food from the Bombay Bicycle Club and drank a great bottle of Champagne! To my surprise the next day Tash had arranged a secret meal where we met up with my sister Jo and her boyfriend Dave - it was great to see them both - cheers for coming down guys!

I must admit I was half expecting to feel a bit weird about turning 30, but actually I feel pretty good about it. The fact that I got a good 3 days off work, riding bikes with Tash fixes it firmly as my favourite birthday so far! Big thanks to Tash for everything!!

Today I went back to work and got stuck in to a fun technical problem which has been plaguing our project for a while, I was fortunate to find a good solution - something I will probably blog about once I've tidied it all up as it's a very poorly documented area.

Anyway that's about it, I'm enjoying being 30 and am looking forward to what this year brings!

EdD

Comments[0]
Trackback URL for this entry

Nov 21, 2010

 

Heard this tune by James Blake yesterday for the first time, on Radio 1 of all places, and completely fell in love with it. It's a cover of a track originally by Fiest.

I absolutely love the feeling of space that he's created, there's a mournful edge to it initially but wierdly the sub-bass and the way the track builds yields to an almost comforting, yet still dark feeling (which  for some reason reminds me of dancing to the dub sound systems at Notting Hill Carnival).

Each time I hear this is totally blows me away, brilliantly covered, performed and produced. And a great video too.

Oh and if you like your production/ sounds then definitely listen to this one on a system with some serious bass, or some good headphones!


EdD


Comments[0]
Trackback URL for this entry

May 08, 2010

 

I recently sat and passed the Sun Certified Java Programmer 1.6 exam (310-065). Throughout my life I have found exams unusually difficult so I wanted to share some tips which I found invaluable in case they are of help to others.

The exam:

Before explaining my revision tactics it might be useful to give a bit of background on the exam itself. The exam is a multiple choice test which consists of 60 questions, has a pass mark of 58% and a duration of 180 minutes. This gives approximately 3 minutes to answer each question. Questions with more than one correct answer will state how many answers should be picked, but exactly the right answers must be selected for each question to get the mark. Most of the questions involve reading a code excerpt and detailing the outcome of the execution of the code, some questions involve dragging code snippits in to the appropriate place in a code excerpt. The exam is not negatively marked.

So without further ado, here are my revision tactics:

  • Read the official book(s) - There are several books on the market which exist specifically to teach the exam subject content, reading at least one of these in detail is one of the most important things you can do. I chose the study guide by Kath Sierra and Bert Bates and found it to be excellent; the book covers all the official certification objectives in detail and also provides a useful section on how to prepare for the exam. As an added bonus the book comes with a free CD which contains the book content as a PDF plus an exam simulator containing 2 full length mock exams. Note that there are many other SCJP 1.6 books available which are definitely worth checking out before you decide which to buy as you never know which will suit you most.
  • Learn the chapters and objectives - The SCJP exam will only test you on the official objectives, the exam questions are notorious for being deliberately ambiguous about what they are testing (by including red herrings) and for often referencing at least one objective even when the answer refers only to a sigle objective. Thus knowing the objectives can give you a distinct advantage in helping to quickly identify what a question is really testing you on, it also makes it quickly to spot and eliminate red herrings allowing you to answer questions more accurately.
  • Do mock exams - Mock exams are important since they allow you to test your skills, identify strong/weak areas and determine your question answering speed. Having worried that I would run out of time in the real exam I found this really beneficial as I determined early on that I generally took about 90 seconds to answer each question. This was comforting to know and made me much more relaxed in the real exam as I knew I would have time to complete all questions and review my marked questions. There are several sites which offer free mock exams, I used www.certpal.com which contains full mock exams for both the SCJP 1.5 and 1.6 certifications. Don't be put off by the slightly basic design of the site, or by the occasionally badly worded question explanations as the quality of the questions outweighs both these things. With retrospect, having now taken the exam, I can see that the certpal questions were consistently harder than the real exam questions, so if you can consistently get a good pass mark on certpal that's a good indicator of being ready for the exam. However if you don't like certpal then JavaRanch maintain a useful list of SCJP mock tests.
  • Code! - Seems obvious doesn't it but you'd be suprised how many people apparently don't sit down and learn through coding. I found that writing small pieces of code, specifically targeted in testing an individual objective or API, to be hugely beneficial in enhancing my understanding of my weaker areas. Coding also helped me  in learning a new objective/API that I hadn't previously used much before (java.util.NavigableSet and java.util.Scanner were pretty new to me). I also found coding really useful in a couple of instances where I didn't understand the answers to certain mock exam questions, being able to code the question and then debug through the code line by line caused me to unlearn a couple of my own mis-understandings which would have otherwise tripped me up in the exam.
  • Use forums - Again when reviewing my mock exam question failures there were a few instances when, even after coding and debugging a question, I failed to understand WHY the JVM would demonstrate a certain behaviour. I found JavaRanch to be an invaluable resource here, particularly the Big Moose Saloon forums which have friendly and dedicated boards for SCJP questions and answers.
  • Make revision a regular practise - Revise regularly and often, in a consistent manner each time. I gave myself 8 weeks to revise for the exam and changed my daily routine by doing the following:
    • I stopped cycling to work and instead took the train.
    • Each morning and evening on the train I revised by reading new material or re-covering old material or by reading flashcards
    • During lunch each day I took 15-30 minutes to make detailed revision notes on what I had read that morning.
    • Each evening I varied my revision by either coding, condensing my detailed notes to concise revision flashcards or doing mock questions (not whole exams though).
    • On each of the last 3 weekends I sat a full length mock exam and went through my question failures and flash cards.
  • The above is what worked for me and what suits each person is going to be highly subjective. My point here is that you should try and find something that works for you, whatever that may be.
  • Make flash cards - Flash cards are a brilliant and very portable means of concisely documenting  information. Keep them brief, use bullet points and mnemonics where possible, carry them with you and test yourself (or get others to test you) as often as possible.

I think that's about it, ultimately the SCJP does take a small chunk of time out of your life so it's worth making sure you can dedicate that time before you commit to booking the exam. However I think it's a useful certification to have and as someone who has been developing Java for several years I am pleased that taught me some new things that I didn't know and helped me un-learn a couple of things I thought I knew! Hopefully this will serve to make me a better software engineer!

I hope this is helpful to anyone considering/ already studying for the SCJP exam - good luck!

Cheers,

EdD.



Comments[5]
Trackback URL for this entry

Mar 30, 2010

 

It always seems to be when I'm preparing software releases that certain tunes flutter in to my mind; today it's Joy Orbison's remix of Love Cry by Four Tet. The original is good but there's something about this remix which I adore. So without further interruption get your lugs around this one and wang it up nice and loud:

Four Tet - Love Cry (Joy Orbison Remix)

EdD
Comments[0]
Trackback URL for this entry

Mar 12, 2010

 

Checking and double checking everything for tonight's production release. All the prep looks good so far, fingers crossed everything goes smoothly.

So while I have a minute here's today's song for the day:  Deep bass, beautiful vocals, beats to die for and in a weird time signature to boot.

Lamb - Lusty

Lamb - Lusty
Comments[2]
Trackback URL for this entry

Mar 11, 2010

 

Today's song for the day, and a rather calming video to accompany it:

The Cinematic Orchestra - All Things to All Men (Feat. Roots Manuva)

Comments[0]
Trackback URL for this entry

Jan 20, 2010

 

I meant to post this ages ago but forgot until I came across the issue again today.

When developing a system which runs against an Oracle Database, Oracle XE can be very useful. XE is a cut down version of Oracle's standard edition Database and is available completely free for development purposes. It is built from the same code base as the standard edition Database, albeit with a very restricted configuration to stop people deploying it in production in lieu of a paid for version.

One of the restrictions in XE is that the number of concurrent sessions and processes that the Database will allow is set to a very low figure, again presumably to deter from production use. This can result in issues during development, whereby seemingly innocuous tasks such as running automated test suites will cause the database to hit the default limits and fail.

The errors that are raised when these limits are reached are often apparently unrelated to the task being performed. Once learned however these errors are easy to spot, this is one reason why it's useful to know about this default limitation of XE. Below are some of the errors which can manifest from Oracle running out of sessions/ processes:

  • ORA-00018: maximum number of sessions exceeded
  • ORA-00020: maximum number of processes (%s)
  • TNS Name Not Found - yep this really can be raised when the Database runs out of  sessions or processes!
Thankfully the solution to this problem is simple: Increase the number of sessions and processes that the Database instance allows. Here's how you do it:

 1: Log on to the Database with a sysdba account.

sqlplus system@XE as sysdba

2: Check the current session and processes limits

SQL> show parameter session

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
java_max_sessionspace_size           integer     0
java_soft_sessionspace_limit         integer     0
license_max_sessions                 integer     0
license_sessions_warning             integer     0
logmnr_max_persistent_sessions       integer     1
session_cached_cursors               integer     20
session_max_open_files               integer     10
sessions                             integer     20
shared_server_sessions               integer

SQL> show parameter processes

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes                      integer     0
db_writer_processes                  integer     1
gcs_server_processes                 integer     0
job_queue_processes                  integer     4
log_archive_max_processes            integer     2
processes                            integer     20

3: Increase the session and processes limits to something sensible, the important thing here is to choose values which solve your particular issue. I tend to find that anything around 250 is fine for most development projects, but remember that the higher the values the more resources Oracle will try and consume when it needs to maintain those extra sessions and processes.

SQL> alter system set sessions=300 scope=spfile;

System altered.

SQL> alter system set processes=300 scope=spfile;

System altered.

4: Shutdown the Database instance.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

5: Restart the Database instance.

I don't know why but issuing the 'startup' command doesn't work for me when using XE. I think this may have something to do with the Oracle Listener not being able to identify the instance once it has stopped but I haven't yet figured it out. Instead I have to restart the Oracle service/ daemon using the following command:

C:\>net start OracleServiceXE
The OracleServiceXE service is starting.....
The OracleServiceXE service was started successfully.

Note: The above is obviously a windows example, I believe that there is usually an /etc/init.d script which has the same effect under a Linux installation.

6: Close the SQLPLUS session and open a new one (otherwise you will receive an error when entering commands as the session cannot persist across the Database restart).

SQL> exit
Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

C:\development\stsworkspace\compliance>sqlplus system@XE as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 20 17:13:49 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

SQL>

7: Check that the new values have been persisted across the restart and are now in effect. 

SQL> show parameter session

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
java_max_sessionspace_size           integer     0
java_soft_sessionspace_limit         integer     0
license_max_sessions                 integer     0
license_sessions_warning             integer     0
logmnr_max_persistent_sessions       integer     1
session_cached_cursors               integer     20
session_max_open_files               integer     10
sessions                             integer     335
shared_server_sessions               integer
SQL> show parameter processes

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes                      integer     0
db_writer_processes                  integer     1
gcs_server_processes                 integer     0
job_queue_processes                  integer     4
log_archive_max_processes            integer     2
processes                            integer     300

Note: I'm not yet sure why but my 'sessions' value always seems to be higher than the value I set. Regardless the value should be different from the initial value and close to the one you set (in my case it is usually above by a value of 15 or 35!)

et voila! That should do it.

Hope that helps someone,

EdD

Comments[4]
Trackback URL for this entry

Jan 06, 2010

 

Today is a sad day for Tash and I as one of our Chickens, Ethel, died in the night.

In September 2009 we re-homed Ethel, along with 2 other Chickens, Mabel and Maud through the Battery Hen Welfare Trust. Ethel was the smallest of the 3 Chooks, despite her small size she was an absolute expert of the 'run around the garden very quickly so they can't put me back in the coop' game.

Although she was only with us for a short while we hope that she enjoyed a better quality of life than she would have otherwise done as a battery hen.

RIP Ethel, we will miss you.

Edd and Tash

A picture of Ethel eating some food in the snow while her coop was being cleaned out
Comments[0]
Trackback URL for this entry

Nov 20, 2009

 

I recently inherited an application which has a few issues with referential integrity, unfortunately the existing constraints were not named when they were created so I see lots of this:

ORA-02291: integrity constraint (CCRS_OWNR2.SYS_C00293422) violated - parent key not found

At this point I usually end up yelling something along the lines of ' What the badgering folly is SYS_C00293422?!?! Why didn't you name your constraints you massive uberbastards!!!' at the closest unsuspecting random in the office - I fear this practice is making me unpopular.

So to lessen the damage to my office popularity I set about figuring out how to trace the table from which a constraint originates, based on the constraint name. Turns out it's pretty easy as Oracle (I'm using 10g) provides a table (or maybe a view?)  called 'all_constraints' which describes constraint definitions on tables accessible to the current user.

describe all_constraints;
Name                           Null     Type
------------------------------ -------- ------------
OWNER                          NOT NULL VARCHAR2(30)
CONSTRAINT_NAME                NOT NULL VARCHAR2(30)
CONSTRAINT_TYPE                         VARCHAR2(1)
TABLE_NAME                     NOT NULL VARCHAR2(30)
SEARCH_CONDITION                        LONG()
R_OWNER                                 VARCHAR2(30)
R_CONSTRAINT_NAME                       VARCHAR2(30)
DELETE_RULE                             VARCHAR2(9)
STATUS                                  VARCHAR2(8)
DEFERRABLE                              VARCHAR2(14)
DEFERRED                                VARCHAR2(9)
VALIDATED                               VARCHAR2(13)
GENERATED                               VARCHAR2(14)
BAD                                     VARCHAR2(3)
RELY                                    VARCHAR2(4)
LAST_CHANGE                             DATE
INDEX_OWNER                             VARCHAR2(30)
INDEX_NAME                              VARCHAR2(30)
INVALID                                 VARCHAR2(7)
VIEW_RELATED                            VARCHAR2(14)

20 rows selected

We can use this table to identify various properties of a given constraing, based on the constraint name, like in the following example:

select * from all_constraints where owner = '&&schemaName' and constraint_name = '&&constraintName';

One great thing about this method is that it does not require sysdba privileges, this is a major benefit for developers working on locked down schemas as it allows for cracking straight on rather than having to borrow the time of a neighbouring DBA.

This approach is useful in identifying constraint origins however it is frustrating to have to do in the first place, instead I would advocate coming up with a simple naming convention as demonstrated here and using that throughout the Database, this is something that will save the development team time and energy, particularly when your Database grows to tens or hundreds of tables each with several constraints.

Cheers,

EdD



Comments[2]
Trackback URL for this entry

Nov 18, 2009

 

It may be the case that I'm not looking hard enough but I can't find this anywhere in the documentation:

To achieve a cascade type of 'none' using Hibernate annotations you'll need to do the following:

@OneToMany(cascade = {})

Exactly why they couldn't have provided CascadeType.NONE enum I don't know.

EdD

Comments[0]
Trackback URL for this entry

Nov 05, 2009

 

Just a quick post to say that the London Java Community (LJC) now has its own website. Barry Cranford has set the site up to publicise the group, which is rapidly growing in size, and its activities and events. Barry has done a great job with the community so far and continues to provide great events for Java technologists.

If you're interested in the LJC's activities or want to get involved you can find the site at http://www.londonjavacommunity.co.uk.

Cheers,

EdD

Comments[0]
Trackback URL for this entry