Wednesday, 5 November 2014

DB2 - Changing Database and Log Path on an active database

This ties up with something that I need to do, where we have a DB2 database that has been created in the instance account's home directory rather than being created on a given path.

This example uses three subdirectories underneath the instance's home directory, BUT that's merely an example; in the "real" world, the data and logs should go onto dedicated and, perhaps, separate file-systems.

This post assumes that one is using the DB2 Sample database, as created using the db2sampl command.

Create the Backup Subdirectory

mkdir /home/db2inst1/backups

Create the Target Data and Log Subdirectories

mkdir /home/db2inst1dbdata
mkdir /home/db2inst1 dblogs

Start the DB2 Instance

db2start

Connect to the Database

db2 connect to sample

Quiesce the Database

db2 quiesce database immediate force connections

Drop the Connection

db2 connect reset

Backup the Database

db2 backup database sample to /home/db2inst1/backups/ compress without prompting

Validate the Backup

ls /home/db2inst1/backups/

SAMPLE.0.db2inst1.DBPART000.20141105200247.001

Connect to the Database

db2 connect to sample

Unquiesce the Database

db2 unquiesce database

Drop the Connection

db2 connect reset

Drop the Database

db2 drop db sample

Restore the Database into the new path

db2 restore database sample from /home/db2inst1/backups/ on /home/db2inst1/dbdata/ dbpath on /home/db2inst1/dbdata/

Validate the Restore

ls /home/db2inst1/dbdata/

db2inst1

Connect to the Database

db2 connect to sample

Update the Log Path

db2 update database configuration using NEWLOGPATH /home/db2inst1/dblogs/

Terminate the Connection

db2 terminate

Restart the Database Manager

db2stop
db2start

Connect to the Database

db2 connect to sample

Query the Employee Table

db2 "select * from db2inst1.employee"

Validate that the Log Path is being used

ls /home/db2inst1/dblogs/

NODE0000

The job, she is a good 'un

Kudos to this for guidance on the DB2 BACKUP command: -

DB2 Backup and Restore Commands

WebSphere Application Server - Liberty Profile - Accessing Liberty’s JMX REST APIs

Just added to WASDev: -

Liberty has always exposed a JMX REST connector Java client to be used remotely. In the August/September Beta, the REST APIs used by that Java client were made public, which means that non-Java languages can now access Liberty's JMX data!

Accessing Liberty's JMX REST APIs

WebSphere Application Server - Scripting 101

So a colleague asked me how to create (a) users and groups and (b) JDBC data sources in WAS using a Jython script.

Here's my answer: -

Create a Group

AdminTask.createGroup('[-cn Testers]')

Create A User

AdminTask.createUser ('[-uid TestUser1 -password P455w0rd -confirmPassword P455w0rd -cn  Test -sn User1]')

Add User to Group

AdminTask.addMemberToGroup('[-memberUniqueName uid=TestUser1,o=defaultWIMFileBasedRealm -groupUniqueName cn=Testers,o=defaultWIMFileBasedRealm]')

Create Another User

AdminTask.createUser ('[-uid TestUser2 -password P455w0rd -confirmPassword P455w0rd -cn  Test -sn User2]')

Add User to Group

AdminTask.addMemberToGroup('[-memberUniqueName uid=TestUser2,o=defaultWIMFileBasedRealm -groupUniqueName cn=Testers,o=defaultWIMFileBasedRealm]')

and: -

Create JDBC Provider

provider = AdminTask.createJDBCProvider('[-scope Cell=tameb -databaseType DB2 -providerType "DB2 Universal JDBC Driver Provider" -implementationType "Connection pool data source" -name "DB2 Universal JDBC Driver Provider" -description "DB2" -classpath [${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar ${UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cu.jar ${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cisuz.jar ] -nativePath [${DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH} ] ]')
AdminConfig.save() 
AdminNodeManagement.syncActiveNodes() 


Create J2C Authentication Alias

AdminTask.setAdminActiveSecuritySettings('[-customProperties["com.ibm.websphere.security.JAASAuthData.removeNodeNameGlobal=true"]]') 
AdminTask.createAuthDataEntry('[-alias db2inst1 -user db2inst1 -password passw0rd -description ]')
AdminConfig.save() 
AdminNodeManagement.syncActiveNodes()


Create JDBC Data Source

databaseName='SAMPLE'
serverName='tameb.uk.ibm.com'
portNumber=60008

ds = AdminTask.createDatasource(provider, '[-name sample -jndiName jdbc/sample -dataStoreHelperClassName com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper -containerManagedPersistence false -componentManagedAuthenticationAlias db2inst1 -xaRecoveryAuthAlias db2inst1 -configureResourceProperties [[databaseName java.lang.String '+str(databaseName)+'] [driverType java.lang.Integer 4] [serverName java.lang.String '+str(serverName)+'] [portNumber java.lang.Integer '+str(portNumber)+']]')

AdminConfig.create('MappingModule', ds, '[[authDataAlias db2inst1] [mappingConfigAlias ""]]')

AdminConfig.save() 
AdminNodeManagement.syncActiveNodes() 


Sweet :-)

Back on the Mac - Restoring Volume Defaults after upgrading to OS X Yosemite ( Sam )

Thanks to these two posts: -

I now have the "old" blobby-clicky sound when I increase/decrease the volume on OS X Yosemite.

In essence, the first link includes a .AIFF file with which one replaces the default ( and new ) sounds, setting it back to pre-Yosemite.

In addition, it also shows one how to change the System Preferences to ensure that the sound is heard when pressing [Volume Up] and [Volume Down], rather than the ( now default ) shifted versions of those keys.

It's all good.

Monday, 3 November 2014

IBM Business Process Manager V8.5 Performance Tuning - More good stuff

Hot on the heels of my earlier post: -

IBM Business Process Manager V8.5 Performance Tuning and Best Practices

we have this: -


...
Abstract

IBM® Business Process Manager is a middleware suite that enables managed execution of the processes that keep your business running. It includes a graphical authoring environment that is used for modeling processes and a sophisticated runtime engine that is capable of integrating workflow for the people and automated systems that comprise your organization.

Every day IBM Business Process Manager customers use their IT infrastructure to deliver business value at a fast pace. However, as with any complex system, care must be taken to define performance objectives appropriate to the solution and to ensure that those objectives are met. The IBM Redbooks® publication IBM Business Process Manager V8.5 Performance Tuning and Best Practices, SG24-8216, provides the details necessary to ensure a high performance business process management project. This IBM Redbooks Solution Guide provides an overview of the most critical topics from that book.

For related information about this topic, refer to the following IBM Redbooks publication:
IBM Business Process Manager V8.5 Performance Tuning and Best Practices, SG24-8216-00
...

and this: -


...
Performance tuning can be a complex task. It is often time-consuming and requires different subject matter experts to work together closely. Tuning IBM Business Process Manager (BPM) systems for performance, in particular, requires knowledge of the modeled business processes all the way down to the Java Virtual Machine (JVM), the database, and sometimes even the hardware layers.
The need for tuning a system can have different drivers. In a best-case scenario, tuning is part of your project plan from the start. But sometimes, issues arise in the production system due to changes to the planned workload or less-than-optimal system maintenance.
...


Sunday, 2 November 2014

Book Review - Hieroglyph: Stories & Visions for a Better Future

http://hieroglyph.asu.edu/wp-content/themes/hieroglyph-child/images/logo4.png

Big Ideas Real Science Great Stories

( all of the above lifted from the Hieroglyph websites - http://hieroglyph.asu.edu/story/degrees-of-freedom/ and http://hieroglyph.asu.edu/ )

I first heard about the science fiction anthology, Hieroglyph: Stories & Visions for a Better Future, on  a podcast, from the TWiT network, called Triangluation where the host, Leo Laporte, interviewed Lawrence M. Krauss.

Dr Krauss wrote the foreword to Hieroglyph, and his description of the novel peaked my interest, especially in the assertion that it was science fiction for scientists ( not to say that it's not suitable for every reader ), where all/most of the science referenced is based upon what exists today, or what can be extrapolated from in-flight projects.

In addition, most of the stories are written in the light of the environmental crises ( overpopulation, global warming, resource depletion etc. ), and most show how science can save us.

Despite Dr Krauss' assertion, warp drive does sneak into one of the stories - all right, it's a FTL drive, but that is not the main point of the story. In other words, humans can't just just into FTL ships and use matter transporters to save humanity. The solutions proposed will take longer to develop, require much more commitment from humankind, and take longer to implement.

Edited by Kathryn Cramer and Ed Finn, the book contains stories by a number of authors, including Neal Stephenson, Cory Doctorow, Gregory Benford, Elizabeth Bear, David Brin and Bruce Sterling.

I've got a fair few sci-fi books by Neal Stephenson, and have been impressed with what I've read by Cory Doctorow. The others were authors that I've heard of and, in some cases, read, albeit in the past ( well, obviously ).

To mis-quote the advert, I was so impressed with the pitch that I bought the book, despite needing to pre-order it from Wordery in the US and pay a relatively hefty price of more than 13 English pounds :-)

Worse still, I then had to wait several weeks for it to arrive :-)

In this world of "I need it, I want it, I have it", waiting for a book to arrive was actually quite old-skool.

So, once the book finally made it into the house, it joined the queue of books needing to be read. I was in the middle of the last book in the Game of Thrones series ( well, the last to date, namely Dance with Dragons - After the Feast ), and also snuck in a brief Lee ChildThe Visitor ).

However, I started Hieroglyph about a week ago, and have galloped through it since then.

As with all anthologies, I had favourite stories, specifically Atmosphæra Incognita ( by Neal Stephenson ), Girl In Wave : Wave in Girl ( by Kathleen Ann Goonan ), The Man Who Sold the Moon ( by Cory Doctorow ), Degrees of Freedom ( by Karl Schroeder ), Elephant Angels ( by Brenda Cooper ) and The Man Who Sold the Stars ( by Gregory Benford ).

However, this is a book that I will definitely re-read, and almost certainly get more out of it with each subsequent reading. Whilst there were some stories that didn't grab my attention ( and these were typically a lot more left field, more fantasy than fiction ), they will all get a revisit further down the 'pike.

So, in conclusion, this IS a book that I would gladly recommend to anyone and everyone, despite their interest, or lack therein, in science. Whilst it is most definitely science fiction ( or to put it another way, fiction with a large dollop of science ), that should NOT put one off.

PS When I say science, I mean the science of everything - so-called 3D printers, space travel, assisted learning, drones, the Internet, big data etc. etc. etc.

Want to know more ? Then read the book already ......

*UPDATE*

Strewth, the thing that prompted me to write this review, apart from actually reading the darn book, was the terrible incident that brought down the Virgin Galactic test flight in California this weekend. Even though I'm unlikely to be able to afford the initial fees ( ~£250K ) for a flight, I'd still volunteer to fly with VG or, in the future, any other service offering spaceflight, even after these most recent and horrendous events.

For me, humankind absolutely must break free of the boundaries of this single planet. As an IT consultant, I know about Single Points of Failure or, as my granny would've said, putting all of ones eggs in a single basket.

Therefore, space travel MUST form part of our future, hopefully sooner rather than later, partly to give humanity an outlet to a Plan B ( and Plan C and Plan D .... ) future, and also to help remove the resource constraints under which we've placed ourselves.

Some of the stories in Project Hieroglyph make this very very clear. The solar system, let alone the rest of the universe, is a resource-rich environment, and we've known since the 1940s that the first 100 miles ( or so ) are the hardest.

Let's get out there .......

*UPDATE*

Note to self - Firefox and local connections

 Whilst trying to hit my NAS from Firefox on my Mac, I kept seeing errors such as:- Unable to connect Firefox can’t establish a connection t...