Database


A step by step guide to using oracle’s impdp datapump over NETWORK LINK
by a novice non linux user

OK there are plenty of web results for how to use impdp but none of them singularly gave a good end to end description of the process.

Some background
My project have been piggybacking on another project’s DB for testing, and now want to move on to their own.
So we needed to copy all common data from the other project’s DB.

Having set up a shiny new oracle install (installing oracle 10.2 xe on suse) here’s what I had to do.

This post has moved to:
http://www.setupsteps.net/2008/07/step-by-step-guide-to-using-impdp-over.html

Was given a linux server (SUSE 10.3) in work (Dell PowerEdge300SC 512MB RAM) and asked to install Oracle 10.2 XE (oracle-xe-10.2.01.1-1.0.i386.rpm)
Here’s a list of some of the problems and solutions I encountered:

P1. Need to be root to perform the install.

P2. Now that you’ve changed user you may not be able to find where you downloaded everything!

P3. Some dependencies may not be present for the install to go ahead – i had the following issue
“Failed dependencies:
libaio >= 0.3.96 is needed by oracle-xe-10.2.01.1-1.0.i386.rpm

P4. insufficient swapsize (Machine’s was set to 1019, needed 1024, so close but yet so far)
This system does not meet the minimum requirements for swap space. Based on the amount of physical memory available on the system, Oracle Database 10g Express Edition requires 1024 MB of swap space. This system has 1019 MB of swap space. Configure more swap space on the system and retry the installation.
error: %pre(oracle-xe-10.2.01.1-1.0.i386) scriplet failed, exit status 1
error: install: %pre scriptlet failed (2), skipping oracle-xe-10.2.01.1-1.0.

This post has moved to Installing Oracle 10.2 Express Edition (SuSe 10.3) at SetupSteps.net:

http://www.setupsteps.net/2008/07/installing-oracle-102-express-edition.html

A few small nightmares over the last two days, in our haste to synchronize builds ready for deploying to Dermot tomorrow (now rescheduled by Dermot to Tuesday!) our build got slightly broken and skewed. Got it back up and running this morning, just some of my flex components hadn’t been updated correctly. Sigh of relief.

Slightly more worrying is the rattling noise coming from Kevin’s PC, it has also refused to switch on a few times. So we’ve backed everything up from it (including his blog, now available right next door here on wordpress.) and plan for him to move development to his laptop. Could be its just a fan needing replacement but we’re not going to take any risks so close to May 2nd!

Back on track, I’m carrying on finishing the policy PDF document, he’s carrying on with CMS testing 🙂

Plans for the week ahead

We’re meeting with Dermot to give a release next Friday, here are my plans between now and then:

Create templates and editable text for the offline products
Add in login functionality

Validation of form fields

Email component

Server side validation

Form field persistence – a handler that fires on quote Generate? or quote Generate and copletePurchase handler passing request to FormFieldPersister, FormFieldDAO.

Similarly, a requestHandler for form field value requester.

Spent today finalizing the Customer Database interface for OBS, its nearly completely
wrapped up. Adding new customers, updating existing ones and deleting (marking as
inactive). The flex UI sends a newCustomerDetails request with either a brand new customer
or updated customer details, the newCustomerDetailsRequestHandler determines which it is,
and persists the changes to the database.

Some learning curves today included using a WHERE clause with a hibernate select, deciding
how to deduce whether a customer was new or an update, without relying on information from
flex (Did this using whether or not a clientid was in use), how best to use multiple
constraints.

Flex was sending back the string ‘null’ which was being persisted to the database, rather
than the value null, I overcame this by inserting a simple check on each entry received from flex.

Validation layer will add more concrete assurance to this.

I need to allocate some time to mastering the hibernate mapping technique, particularly in
those instances where multiple tables play a part in creating an object, for example a
customer, with many policies, a contact log and a document library.

Again, our choice between hibernate 2 and 3 will play a part here. Hibernate 3 is the
obvious choice, but some inconsistencies within Spring have caused some headaches here.
[UPDATE: Successfully migrated to Hibernate 3 (headaches included)]

Also need to figure out how to automatically derive the CLIENTCODE as in previous post.

Having exported DM’s legacy customers to our new mySQL database, today it fell to me to
figure out how to create a new customer [from the management system, or from a customer
sign up] and enter them into the database.

DM’s legacy clients have CLIENTCODEs which aren’t at all uniform, probably dependent on the
database system he was using at their inception. I had to create a hibernate mapping that
could ensure unique codes would be assigned to new customers upon their persistence to the
database.

I created a new ‘id’ column in the client table, which has an autoincrement property, all
of his original 2000 or so clients now share this common column, while new and online
cliets will have a new CLIENTCODE which is based on this column, prefixed by some
characters, thus ensuring all CLIENTCODEs are unique.

It’s been a long time since we worked on the OBS, but now that the exams are out of the way
it’s full steam ahead to get each production phase delivered as per the schedule. First up
it’s a working subset of the Management System, as Dermot needs to view his customers,
which we have exported from his previous MS Access database system.

Exporting the database was working out to be quite a nightmare, trying to track down all
the little incompatibilities between the format of the CSV file exported from MS Access-
Date format, commas within data etc, causing rows to be excluded from the mySql copy.

A mySql ODBC driver came to the rescue here, allowing a direct export over ODBC from Access.

Also this week, we have migrated Dermot’s Access database (to which he was subscribing with an annual fee) and integrated it into a mySql database belong to the OBS. Dermot will now be able to see his _existing_ customers, and run his old queries as before.

The process was quite painstaking, to ensure data consistency and no loss of information. All tables were exported from Access into delimited files and loaded into the mySql database. It took a few tries to ensure no data was lost in respect of each table.