Moving a vmware player driven virtual machine between local discs

Sometimes, simple things seem to become complicated by the multitude of options being available on how to actually execute them. This was the case for me lately when i tried to just move a vm from some location on my local discs to another. This vm runs in a vmware player 4.0.1 and remembering the steps i executed during installation, that is, copy the source files (some appliance of redmine on suse, great stuff, really, see http://bitnami.org/stack/redmine) to some location and then opening them in the player, i decided to evenly do another copy as well as another open.

However, although the copy vm booted nicely, it somehow lost its network settings such that eth0 failed to come up. At a first glance, i supposed that having two vm’s of the same environment (excluding the disk location) might puzzle vmware player such that i shutdown the copy vm, renamed the original vm disk location and removed the original vm from the vmware player library entry by offer. On retry, i found the same result, eth0 not coming up.

There are other approaches, in fact, but without boring anyone out there to immediate sleep the following steps did work for me eventually:

  1. Shutdown this running vm (environment) cleanly
  2. Close vmware player (iff not self-closed)
  3. Copy, don’t move for backup reasons, this vm top directory (usually the vm name) to the new location
  4. Start vmware player again
  5. Open the settings of this vm, go to the options tab and change the general setting called working directory to point to the new location
  6. Close the settings of this vm by save
  7. Launch this vm as usual

have fun!

Reformatting empty but corruptly marked oracle blocks

What actually appeared as a top most error on the monitoring stack was:

channel ORA_DISK_2: backup set complete, elapsed time: 02:57:02
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 01/01/2012 05:17:04

RMAN-03009: failure of backup command on ORA_DISK_2 channel at 01/01/2012 02:20:02
ORA-19566: exceeded limit of 0 corrupt blocks for file H:\ORACLE\SAN_3\ORADATA\WAZ\TEXT\TEXT_DATIDX_05.DBF

Read more of this post

Recovering disk failures that comprise undo segements

This is just a snapshot of some sitation that happened quite a while ago on a 10g oracle database. I’m not going to dive into the details that much, just providing some selects to decipher the scenario and show up one of the probable ways of resolving the problem.

Jep, due to a disk failure, as i noticed during the analysis, some statements and things complained about datafiles being offline. An attempt to re-online some datafile resulted in an ORA-00376 error as follows:

SQL> ALTER DATABASE DATAFILE 'H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_06.DBF' ONLINE;
ALTER DATABASE DATAFILE 'H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_06.DBF' ONLINE
*
FEHLER in Zeile 1:
ORA-00376: Datei 6 kann zur Zeit nicht gelesen werden
ORA-01110: Datendatei 6: 'H:\app_ORACLE\SAN_3\ORADATA\appxyz\UNDOTBS03.DBF'

Looking up dba_data_files produced this output:

Read more of this post

Non-range queries on numeric fields with lucene gt 2.9

As you might know from following the ongoing development of the Lucene search engine, true indexing of numeric values is possible since version 2.9. The actual trick that implemements numeric values in a string based engine, as opposite to a regular relational database for example, is widely discussed elsewhere, e.g. (SearchNumericalFields). However, to get it in short, those guys just encode any signed numeric along a line of string encoded buckets of a certain precicion that finally allows for greater-than, greater-than-equal etc. queries. As a result you have new “numeric” classes at your disposal, namely NumericRangeQuery and NumericRangeFilter for querying and filtering, respectively. Also note that the class SortField since then allows for field types being encoded numerics.

So far, this is a huge step forward in providing professional means for semi-structured searching and sorting. However, what fairly seldom gets attention is the question how to realize equality or in-list searches (or filtering) on numeric values because launching a classic TermQuery or Filter on a numeric field will simply not work. Something quite commonly seen is to just employ a range query/filter with the same inclusive upper and lower bound to achive an equality logic like so:

Filter filter = NumericRangefilter.newIntRange("someField", 2, 2, true, true);

I do not know whether this will perform well under all circumstances but at least know that Lucene comprises some clever rewrite code to care for something chubby like this.

Jep uhh, replacing equality logic with the line above does not imply a comparable approach for in-list searches (or filtering), probably known from TermsFilter. The only way to reproduce in-list logic is to encode the numeric search tokens to the internal format by yourself. This is when the class NumericUtils comes in. It provides for several member methods that produce encoded strings from the family of common numeric datatypes like so:

long[] mdtIds = {168, 167, 151};
Filter orListFilter = new TermsFilter();
for (long mdtId : mdtIds)
((TermsFilter) orListFilter).addTerm(
  new Term(IndexField.IMP_MANDANT.name(), NumericUtils.longToPrefixCoded(mdtId)));

Someone may argue that using NumericUtils ist not a recommended employment of the Lucene library. He/she may be right … or not ;-) . Let’s see.

ps. I’m using query and filter more or less as synonyms throughout the article. In fact, a Lucene filter may just be seen as a query without scoring. This also becomes obvious iff one takes a look at classes like ConstantScoreQuery or QueryWrapperFilter.

have fun

Resolving connections errors on oci8 in jdeveloper 11gR2

Got a fresh jdev 11gR2 (11.1.2.0.0, studio) on an existing oracle client home 11.1.0.6.0 and tried to create a connection to an oracle database based on the oci8 option (thick instead of thin driver) in the Create Database Connection dialogue. The result on some test (test connection button) was a:

Test failed: oracle.jdbc.driver.T2CConnection.getLibraryVersionNumber()I

The resolution trick seems to comprise of a copy of the ojdbc6.jar of the oracle client installation, here in d:\Programme\Oracle\product\11.1.0\client_1\jdbc\lib\, to the jdeveloper app server lib path, here in d:\Programme\Oracle\Middleware\wlserver_10.3\server\lib\.

My reference to the problem solution was: this thread entry on the oracle forums.

have fun

Adding page help to a 3.x apex application

I was lately adding some help content to the create/edit form pages of an internal (dev team) change manager application. This is how i did it, discussing some aspects of the design approach as well as the actual execution with apex 3.x (I’m still with apex 3.2, since this version is quite sufficient for an internal app).

Providing on page help for form pages is usually a game like this: some input field may be called “Creation date” and the help text goes as “This is the creation date”. Wow, this is what the world needs to know! I more or less get angry or better ignorant seeing this information garbage but that’s another story. I prefer on page help content that provides page context information, just pointing out dedicated input fields only when necessary.

In fact, apex puts both approaches at your disposal. The key element with apex is the help text region that you may add with the create region dialogue on a page.

Read more of this post

Repositioning the wordpress start and posts pages

I was recently asked to provide a general, description-oriented start page on another wordpress blog (ludoix.wordpress.com). An initial direction was given by Gary Barrett with this article on the wordpress support portal. The trick is to set up another page on the Pages view and configure it to have the lowest order index. Afterwards you proceed to the Settings / Reading view and change the selection below Front page displays / Front page to the just created item. That’s great so far, on reloading the blog you’ll now find your new start page on intial display.

However, changing the settings with Settings / Reading / Front page displays I already wondered what to enter with the Front page displays / Posts page select list. I actually expected to find an entry such as posts or default-posts or whatever but to no avail. In fact, leaving out this selection removes the the posts page from the blog completely. Stuck! Just driven by some enlightment of intuition (ha ha) I tried the following: I created another (empty) page on the Pages view, not forgetting to set the order index accordingly. Thereafter, i proceeded to the Settings / Reading view again and configured Front page displays / Posts page to this new (empty) item. And, it worked! That is, wordpress obviously only needs another (empty) container page to put the posts page into.

Another functionality i employed with the new start page was page templates that you’ll find along with the order index on the Pages view. It removes all the sidebar widget stuff from the start page which i find is much more comfortable. Please note however, that the availability and the layout of page templates depend on the theme of the blog.

have fun!

Client-failover for dataguard switchover and failover

Introduction

The following is nothing more than some extension of the oracle metalink document:

[ID 740029.1] Step By Step Guide On How To Configure And Test Client-Failover For Dataguard Switchover And Failover

That is, the article does not only present the cookbook how-to of its anchestor but also examines what happens in the database and what the clients experience will be concerning a so called transparent application failover (TAF). The scenario has been tested on an oracle 10.2.0.3 on windows, please note that the metalink document points to a some more applicable technique available with oracle 11gR2 (Client Failover Best Practices for Highly Available Oracle Databases: Oracle Database 11g Release 2).

Client-failover for dataguard, away from other failover scenarios, essentially aims at using a general tnsnames entry against some server-side database endpoint, no matter what server-side database instance is currently running in a dataguard primary role. This is actually the transparency in a transparent application failover where the application, client here, does not have to care to switch its network configuration in any way (some simple implementation would be, not uncommonly, to provide some tnsnames.ora, tnsnames.ora.prm and tnsnames.ora.stb and rename the files) during a failover or switchover.

Read more of this post

Materialized views ddl and dml stati (and the infamous NEEDS_COMPILE)

introduction

Employing materialized views (or snapshot or mview for short) for producing simple sum-up reports is really cool stuff. You just launch some statement like the following:

create materialized view some_mv
  build immediate
  refresh force next (sysdate + 1/24/12)
as
select X.ts, Y.name from (
  select to_char(max(A.ts), 'dd.mm.yyyy hh24:mi') as ts, B.blubb
    from tab1 A, tab1_1 B where A.id = B.id
    group by B.blubb
) X, tab2 Y
  where X.blubb = Y.id;

and will be served with a well performing collection of data that is more or less current (that is why i call that simple). Oracle will care for the refresh of the mview by self-registering a job on calling dbms_refresh.refresh('some_mv');, that starts immediately and takes the interval from the statement. Handing in the force keyword just chooses a fast refresh method iff possible and a complete refresh method otherwise. There are more defaults applied by leaving other keywords unset, the refresh mode for example, but this is not the point of the article. It is:

Why does that … mview always show a state of NEEDS_COMPILE although no ddl action has happend along the objects dependency chain lately?

Read more of this post

RFS: No standby redo logfiles …

Some day, you may trap the following error message with your standby database alert log (seen on a 10.2.0.3):

RFS: No standby redo logfiles available

The reason for this message is most probably that you have cloned your standby database with rman and configured your dataguard environment to directly write into redo log at standby (using LGWR), instead of just transfering the archive log items from primary (using ARCH), but have missed to provide the necessary standby redo log files. RFS may also log RFS[1]: Unable to open standby log 9: 313 or something similar (the primary will also complain about connection problems to the standby destination target, which is the standby redo log, actually).

RFS: No standby redo logfiles available of size 104857600 bytes

Read more of this post

Follow

Get every new post delivered to your Inbox.