random technical thoughts from the Nominet technical team

Transportable Tablespace Gotcha!

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
Posted by jason on Jun 28th, 2006

We are trying to migrate our database from 10.1.0.3 running on Solaris to 10.2.0.2 running on Linux. To do this I thought using transportable tablespaces was a great idea to speed things up. However there is a major bug with using transportable tablespaces, dropping a user that has been transported might end up generating this:

SQL> drop user transported cascade;

drop user transported cascade

*
ERROR at line 1:
ORA-00600: internal error code, arguments: [ktecgetsh-inc], [2], [],
[], [], [], [], []

This actually terminates the instance, and if you try and restart the instance it will be terminated again due to the following which appears in the alert log.

Non-fatal internal error happenned while SMON was doing temporary segment drop.
SMON encountered 6 out of maximum 100 non-fatal internal errors.

Instance terminated by PMON, pid = 24149

Every time the instance is restarted this error will ocurr and the instance will be terminated. Oracle are aware of this and it is bug: 5186784, allegedly fixed in 10.2.0.3. There is a workaround to get your database back up and running and it is to set an event:

SQL> alter system set event="10061 trace name context forever, level 10" scope=spfile;

Once you have this event set, the instance will not crash and you can drop the user, you may also have to drop the tablespace. Once this is done you can safely remove the event with:

SQL> alter system reset event scope=spfile sid='*';

Eclipse search woes

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
Posted by alexd on Jun 27th, 2006

I’ve been using Eclipse for Ruby development (with the RDT) for a short while, and am quite happy with it. Having been scared off Eclipse a few years ago for Java development, I’d now almost happily move back to it from IntelliJ’s IDEA.

The only thing which would stop me is the rubbish support for file searching. Eclipse only allows you to search in your current workspace (or files attached to that workspace). If you want to search in files outside (for example, another project, or other resources), then you need to fire up a separate tool (which means that you can’t just open the file in the right place from within your IDE).

On the project I’m currently working on, this means that I often have to leave the IDE, and can lose track of where I was.

I noticed this bug report; it looks like it was decided in 2005 not to fix this issue.

Shame - perhaps we should write a plug-in? ;)

Oracle ODBC Performance Problems in Oracle 10.2

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4 out of 5)
Loading ... Loading ...
Posted by patrick on Jun 19th, 2006

Our current live database is Oracle 10.1.0.3 on Solaris. We are testing the impact of migrating to a target platform of 10.2.0.2 on Linux and have discovered a performance problem with one of our third-party applications. Some functions within the application are taking 10 times longer on 10.2 than on 10.1.

The application connects to the database using the Oracle 10.1 ODBC driver. I traced sessions on 10.1 and 10.2 and identified where the timing differences were occurring.

The Oracle ODBC driver generates many SQL statements which query the Oracle dictionary (all_synonyms and all_tab_columns). Although there are many statements which do this, they take two basic forms:

SELECT /*+ RULE */ COUNT(*)
FROM
ALL_SYNONYMS WHERE DB_LINK IS NOT NULL AND SYNONYM_NAME='TABLKEY';

SELECT /*+ RULE */ '',owner,table_name,column_name,0,data_type,
data_precision, decode(data_type, 'DATE',16,'FLOAT',8,
'LONG RAW',2147483647,'LONG',2147483647,'CLOB',2147483647,
'NCLOB',2147483647,'BLOB',2147483647,'BFILE',2147483647,
'CHAR',char_length,'NCHAR',char_length,'VARCHAR2',char_length,
'NVARCHAR2',char_length,'NUMBER',NVL(data_precision+2,40),
data_length), data_scale, 0, decode(nullable, 'Y', 1, 'N', 0),
'' , '', 0,0,
decode(data_type,'CHAR',data_length,'VARCHAR2',data_length,
'NVARCHAR2',data_length,'NCHAR',data_length, 0),column_id,
decode(nullable, 'Y', 'YES','N', 'NO')
FROM
all_tab_columns WHERE TABLE_NAME='TABLKEY'
UNION
SELECT /*+ RULE */ '',b.owner,b.synonym_name,a.column_name,
0, a.data_type, a.data_precision,a.data_length,
a.data_scale, 0, decode(a.nullable, 'Y', 1, 'N', 0),
'' , '', 0, 0, 0, a.column_id,
decode(a.nullable, 'Y', 'YES', 'N', 'NO')
FROM all_tab_columns a, all_synonyms b
WHERE
((a.table_name = b.table_name and a.owner = b.table_owner) )
AND b.synonym_name='TABLKEY'  ORDER BY 2,3,17;

These statements are much slower on 10.2 than on 10.1.

The rule based optimiser, which the Oracle ODBC driver is using, was deprecated in Oracle 10.1. For some reason the rule based optimiser performs the statements OK on 10.1 but terribly on 10.2.

This is documented on Oracle MetaLink (Note 373129.1). The Oracle bug is 4150034 and is fixed in patch 5211342. Unfortunately this fix involves updating and patching the Oracle ODBC driver, which would require an update to every PC in the organisation.

A better solution we discovered was to create a logon trigger to set the _optimizer_ignore_hints parameter to true for all sessions connecting to the database via the ODBC application:

create or replace trigger logon_trigger
after logon on application_user.schema
begin
execute immediate
'alter session set "_optimizer_ignore_hints"=TRUE';
end;
/

The Semantic Web: OWL DL datatype issues

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
Posted by Al on Jun 6th, 2006

One limitation I found when using Web Ontology Language (OWL) was that it does not support customised datatypes. I realise that the
main purpose of OWL is to recording how data relates to real world objects, but allowing authors to reference XML Schema to define OWL-related
datatypes, while keeping an OWL document in valid DL form would be most useful.

Some work has been undertaken in addressing this (see Working Group Note “XML Schema Datatypes
in RDF and OWL
” - specifically using the id attribute), adding an ID to the XML Schema. then referencing it in the OWL Document:

<owl:DatatypeProperty rdf:ID="domainNameValue">
<rdfs:domain rdf:resource="#domainName"/>
<rdfs:range rdf:resource=
"http://xml.nominet.org.uk/schema/datatypes#domainName"/>
</owl:DatatypeProperty>

..but using customised datatypes through this method turns documents into OWL Full, which is not ideal. Due to its syntactic freedom,
it is unlikely that future reasoning software will be able to support complete reasoning for OWL Full.

Interestingly enough. further to the W3C reccomendation, a possible extension
OWL-Eu has been suggested to overcome this, but as far as I know this datatype issue hasn’t yet been resolved within the W3C reccomendation,
and until this point reasoning tools will not likely support this.

Real world Semantic Web tools will only support OWL DL due to the limitations/complexities of OWL Lite/Full,
so unless users can create OWL DL documents using customised datatypes, the takeup of OWL will probably be slow.

The Semantic Web: Web Ontology Language (OWL) example

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4 out of 5)
Loading ... Loading ...
Posted by Al on Jun 6th, 2006

I have recently been exploring the Semantic Web,
looking at a few of the tools,
and also checking out the W3C’s Web Ontology Language (OWL),
by creating a simple example for WHOIS. The W3C also provide a useful overview of the OWL Web ontology language.

Useful tools
Looking at the tools out there, there are several editors/IDEs/validators, both commercial and non-commercial. Of course one can use any
XML editor/notepad to create OWL documents (which are essentially extended RDF), but code completion and validation features are useful.
For a rather exhaustive list, check out the useful if not slightly dated Xml.com
Ontology Tools Survey
(you might need a strong magnifying glass to read the table in it’s PDF form!).

I found the most useful to be SWeDE - an open source Eclipse Plugin.
This includes an OWL editor with helpful features like syntax highlighting, autocompletion, and error-detection.

Validation
A very useful validator I stumbled across was the mindswap OWL Consistency Checker, which allowed
for species validation (Lite, DL or Full) amd checked for ontology consistency.
The ability to validate by URI or pasted in test is handy too. It can also display ontologies in a tree like structure
which could well be useful for more complex ontologies.

Simple OWL example: WHOIS

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rdf:RDF [
<!ENTITY domain  "http://xml.nominet.org.uk/rdf/nom/domain#">
<!ENTITY rdf  "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
<!ENTITY xsd  "http://www.w3.org/2001/XMLSchema#">
<!ENTITY owl  "http://www.w3.org/2002/07/owl#">
]>

<!-- entities are used to make URL modification easy
for the future -->
<rdf:RDF
xmlns="&owl;"
xml:base="&domain;"
xmlns:owl="&owl;"
xmlns:rdfs="&rdfs;"
xmlns:rdf="&rdf;"
xmlns:xsd="&xsd;"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<!-- ****************** -->
<!-- Ontology metadata -->
<!-- ****************** -->
<owl:Ontology rdf:about="">
<rdfs:comment>This is a simple ontology example to
describe WHOIS</rdfs:comment>
<rdfs:label>Nominet WHOIS Ontology example</rdfs:label>
</owl:Ontology>

<!-- domain name -->
<owl:Class rdf:ID="domainName">
<rdfs:label xml:lang="en">domain name</rdfs:label>
</owl:Class>

<owl:DatatypeProperty rdf:ID="domainNameValue">
<rdfs:domain rdf:resource="#domainName"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>

<!-- ****************** -->
<!-- registrant -->
<!-- ****************** -->
<owl:Class rdf:ID="registrant">
<rdfs:label>domain name registrant</rdfs:label>
</owl:Class>

<owl:DatatypeProperty rdf:ID="registrantName">
<rdfs:domain rdf:resource="#registrant"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>

<!-- These are the object properties of a domain name/
registrant -->
<owl:ObjectProperty rdf:ID="hasRegistrant">
<rdfs:domain rdf:resource="#domainName"/>
<rdfs:range rdf:resource="#registrant"/>
<owl:inverseOf rdf:resource="#registrantOf"/>
</owl:ObjectProperty>

<owl:ObjectProperty rdf:ID="registrantOf">
<rdfs:domain rdf:resource="#registrant"/>
<rdfs:range rdf:resource="#domainName"/>
<owl:inverseOf rdf:resource="#hasRegistrant"/>
</owl:ObjectProperty>

<!-- ****************** -->
<!-- trading as -->
<!-- ****************** -->
<owl:Class rdf:ID="tradingAs">
<rdfs:label xml:lang="en">
registrant trading as
</rdfs:label>
</owl:Class>

<owl:ObjectProperty rdf:ID="tradingNameOf">
<rdfs:domain rdf:resource="#registrant"/>
<rdfs:range rdf:resource="#tradingAs"/>
</owl:ObjectProperty>

<!-- ****************** -->
<!-- registration type and it's properties -->
<!-- ****************** -->
<owl:Class rdf:ID="registrantType"/>

<owl:DatatypeProperty rdf:ID="type">
<rdfs:domain rdf:resource="#registrantType"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="numberType">
<rdfs:domain rdf:resource="#registrantType"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="organisationNumber">
<rdfs:domain rdf:resource="#registrantType"/>
<rdfs:range rdf:resource="&xsd;int"/>
</owl:DatatypeProperty>

<!-- registrant type can be either company or charity -->
<owl:Class rdf:ID="companyRegistrant">
<rdfs:subClassOf rdf:resource="#registrantType" />
</owl:Class>

<owl:Class rdf:ID="charityRegistrant">
<rdfs:subClassOf rdf:resource="#registrantType" />
</owl:Class>

<owl:Class rdf:ID="schoolRegistrant">
<rdfs:subClassOf rdf:resource="#registrantType" />
</owl:Class>

<owl:Class rdf:ID="generalRegistrant">
<rdfs:subClassOf rdf:resource="#registrantType" />
</owl:Class>

<!-- define the restrictions that make a registrant type
company or charity -->
<owl:Class rdf:about="#companyRegistrant">
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#type" />
<owl:hasValue rdf:datatype="&xsd;string">UK Limited Company</owl:hasValue>
<owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
</owl:Restriction>
</rdfs:subClassOf>

<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#numberType" />
<owl:hasValue rdf:datatype="&xsd;string">Company Number</owl:hasValue>
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>

<owl:Class rdf:about="#charityRegistrant">
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#type" />
<owl:hasValue rdf:datatype="&xsd;string">UK Registered Charity</owl:hasValue>
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
</owl:Restriction>
</rdfs:subClassOf>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#numberType" />
<owl:hasValue rdf:datatype="&xsd;string">Charity Number</owl:hasValue>
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>

<owl:Class rdf:about="#schoolRegistrant">
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#type" />
<owl:hasValue rdf:datatype="&xsd;string">UK Registered School</owl:hasValue>
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
</owl:Restriction>
</rdfs:subClassOf>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#numberType" />
<owl:hasValue rdf:datatype="&xsd;string">Charity Number</owl:hasValue>
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>

<!-- ****************** -->
<!-- Registrant Address -->
<!-- ****************** -->

<owl:Class rdf:ID="registrantAddress">
<rdfs:comment>This is the registrant's recorded address</rdfs:comment>
<rdfs:label>registrant Address</rdfs:label>
</owl:Class>

<owl:DatatypeProperty rdf:ID="addressLine1">
<rdfs:comment>First line of the registrant's address</rdfs:comment>
<rdfs:label>address line 1</rdfs:label>
<rdfs:domain rdf:resource="#registrantAddress"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID="addressLine2">
<rdfs:comment>Second line of the registrant's address</rdfs:comment>
<rdfs:label>address line 2</rdfs:label>
<rdfs:domain rdf:resource="#registrantAddress"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID="addressLine3">
<rdfs:comment>Third line of the registrant's address</rdfs:comment>
<rdfs:label>address line 3</rdfs:label>
<rdfs:domain rdf:resource="#registrantAddress"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID="addressLine4">
<rdfs:comment>Fourth line of the registrant's address</rdfs:comment>
<rdfs:label>address line 4</rdfs:label>
<rdfs:domain rdf:resource="#registrantAddress"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID="postcode">
<rdfs:comment>Registrant's address postcode</rdfs:comment>
<rdfs:label>registrant postcode</rdfs:label>
<rdfs:domain rdf:resource="#registrantAddress"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID="country">
<rdfs:comment>Registrant's address country</rdfs:comment>
<rdfs:label>country</rdfs:label>
<rdfs:domain rdf:resource="#registrantAddress"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>

<!-- ****************** -->
<!-- Registrant's agent -->
<!-- ****************** -->
<!-- The Tag class and its properties -->
<owl:Class rdf:ID="tag" />
<owl:ObjectProperty rdf:ID="hasRegistrationAgent">
<rdfs:domain rdf:resource="#domainName"/>
<rdfs:range rdf:resource="#tag"/>
<owl:inverseOf rdf:resource="#agentFor"/>
</owl:ObjectProperty>

<!-- this next bit could easily be inferred, but is included for completeness -->
<owl:ObjectProperty  rdf:ID="agentFor">
<rdfs:domain rdf:resource="#tag"/>
<rdfs:range rdf:resource="#domainName"/>
<owl:inverseOf rdf:resource="#hasRegistrationAgent"/>
</owl:ObjectProperty>

<owl:DatatypeProperty rdf:ID="publicURL">
<rdfs:comment>tag holder URL</rdfs:comment>
<rdfs:label>publicURL</rdfs:label>
<rdfs:domain rdf:resource="#tag" />
<rdfs:range rdf:resource="&xsd;anyURI"/>
</owl:DatatypeProperty>

<!-- ****************** -->
<!-- relevant dates -->
<!-- ****************** -->
<owl:DatatypeProperty rdf:ID="registeredOn">
<rdfs:domain rdf:resource="#domainName"/>
<rdfs:range rdf:resource="&xsd;date"/>
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="renewalDue">
<rdfs:domain rdf:resource="#domainName"/>
<rdfs:range rdf:resource="&xsd;date"/>
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="lastUpdated">
<rdfs:domain rdf:resource="#domainName"/>
<rdfs:range rdf:resource="&xsd;date"/>
</owl:DatatypeProperty>

<!-- certain dates are mandatory -->
<owl:Class rdf:about="#domainName">
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#registeredOn" />
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
</owl:Restriction>
</rdfs:subClassOf>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#lastUpdated" />
<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:cardinality>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>

<!-- ****************** -->
<!-- registration status -->
<!-- ****************** -->
<owl:DatatypeProperty rdf:ID="hasStatus">
<rdfs:domain rdf:resource="#domainName"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>

<!-- ****************** -->
<!-- Name servers -->
<!-- ****************** -->
<!-- add the name server property -->
<owl:DatatypeProperty rdf:ID="nameServer">
<rdfs:domain rdf:resource="#domainName"/>
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>

<!-- specify how many nameservers a domain name can have -->
<owl:Restriction>
<owl:onProperty rdf:resource="#nameServer" />
<owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
<owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger">10</owl:maxCardinality>
</owl:Restriction>

</rdf:RDF>

One bug with SWeDE I found was that it incorrectly flagged references to datatypes: <rdfs:range rdf:resource="&xsd;string"/> as being incorrect when validating.
This seems to have already been logged as a bug, yet to be resolved.
Passing the example through the validator shows it to be correct however.

Recent Posts

Highest Rated

Categories

Archives

Meta: