Re-linking oracle

Doug's Oracle Blog

  • Home
  • Papers
  • Books
  • C.V.
  • Fun
  • Oracle Blog
  • Personal Blog

May 6: Re-linking oracle

Hooray! Something vaguely technical - at last.

My new client is hot on software licence compliance and what seemed a minor issue to me reared it's slightly ugly head this week. When connecting to our 10.2.0.2 database instances using sqlplus, the version banner displays options that we aren't using, for example Data Mining and OLAP.

$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.2.0 - Production on Sun May 6 13:39:46 2007

Copyright (c) 1982, 2005, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

You've probably seen a similar banner on most databases you use. The reality is that we don't have the dictionary objects created for these options so they aren't usable, but that message was still a concern for the managers. Here are the contents of DBA_REGISTRY to show that the options aren't fully installed, but the banner messages indicate that they're still embedded in the binaries.

SQL> column comp_name format a40
SQL> select comp_name, status from dba_registry;

COMP_NAME STATUS
---------------------------------------- ---------------------------------
Oracle Workspace Manager VALID
Oracle Enterprise Manager VALID
Oracle Database Catalog Views VALID
Oracle Database Packages and Types VALID

The solution is pretty straightforward, but it occurred to me that re-linking the Oracle executables is probably a less common activity than it used to be. In fact I know that from personal experience and it didn't seem to be common knowledge in the office. I remember regular re-links during the early part of my career, whether it to be to fix problems with system libraries not being available at installation time, or more creative uses such as linking the exp and imp binaries so that they used a single task architecture for improved performance.

Anyway, here's what was required to get rid of the banner messages.

First I'll shutdown the single instance using that ORACLE_HOME. Note - it's the binaries in the home that I'll be relinking, so I should shut down all instances that use that home, but there's only one in this case.

SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

Now I switch to the rdbms/lib directory, where I'll find the make file I need to relink oracle.

$ cd $ORACLE_HOME/rdbms/lib
$ ls -ltra *.mk
-rw-r----- 1 oracle oinstall 24664 May 12 2006 ins_rdbms.mk
-rw-r----- 1 oracle oinstall 97674 May 12 2006 env_rdbms.mk

If you look in the ins_rdbms.mk file, you'll see sections like this for the various options.

olap_on:        $(KNLOPT_LOCAL) $(RDBMSLIB)$(OLAP_ON)
$(SILENT)if $(ARPRINT) $(LIBKNLOPT) | $(GREP) '^'$(OLAP_OFF) > /dev/null ; then \
$(ECHODO) $(ARDELETE) $(LIBKNLOPT) $(OLAP_OFF) ; \
fi
$(ARCREATE) $(LIBKNLOPT) $(RDBMSLIB)$(OLAP_ON) $(RANLIBL)

olap_off: $(KNLOPT_LOCAL) $(RDBMSLIB)$(OLAP_OFF)
$(SILENT)if $(ARPRINT) $(LIBKNLOPT) | $(GREP) '^'$(OLAP_ON) > /dev/null ; then \
$(ECHODO) $(ARDELETE) $(LIBKNLOPT) $(OLAP_ON) ; \
fi
$(ARCREATE) $(LIBKNLOPT) $(RDBMSLIB)$(OLAP_OFF) $(RANLIBL)

By specifying the relevant flags, plus ioracle, I can relink the oracle executable so that it doesn't include those options.

$ /usr/ccs/bin/make -f ins_rdbms.mk olap_off dm_off ioracle

At this point you'll see some standard ld linker messages being pumped out. One side-effect of relinking executables is that the make file will save the existing version as a new file with O at the end. So, if you've ever wondered what those oracleO and impO files are in your $ORACLE_HOME/bin directory, they're previous versions saved as part of a relink operation. They're also one of the first things I look to delete when I have an ORACLE_HOME that's in danger of filling a filesystem.

$ ls -ltra $ORACLE_HOME/bin/oracle*
-rwxr-xr-x 1 oracle oinstall 106057264 Oct 7 2006 /oracle/1020/bin/oracleO
-rwsr-s--x 1 oracle oinstall 95826132 May 6 13:51 /oracle/1020/bin/oracle

Now I just need to restart the instances and perform a test connection to check that the messages have disappeared.

$ sqlplus testuser/testuser

SQL*Plus: Release 10.2.0.2.0 - Production on Sun May 6 13:52:42 2007

Copyright (c) 1982, 2005, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning option

I read an interesting post on Dominic Delmolino's blog recently about the value of browsing through the SQL scripts in $ORACLE_HOME/rdbms/admin to learn more about how Oracle works - particularly sql.bsq - and I'd recommend a glance at some of the make files, for the same reason. But, please, if you're going to start relinking executables, think carefully about it first, consult Metalink and if you screw up your server, don't come running to me! ;-)
Posted by Doug Burns Comments: (21) Trackback: (1)

Trackbacks
Trackback specific URI for this entry

Real Application Testing and more Relinking
I'd been thinking of blogging about the appearance of Real Application Testing in 10.2.0.4 since I noticed it post-upgrade, just before the course in Prague. Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - ProductionWith the Par
Weblog: Doug's Oracle Blog
Tracked: Jun 08, 15:52

Comments
Display comments as (Linear | Threaded)

#1 - Connor 2007-05-06 15:05 - (Reply)

Not such a great idea by your managers I reckon...Think about how many people relink these products *out* ... very very few. Which means you're now running an Oracle binary that very very few are running...not so nice when it comes to patches etc etc...

#1.1 - Doug Burns said:
2007-05-06 15:10 - (Reply)

Connor,

Good point.

In fairness, you included the word 'managers' in the first sentence so I won't take it personally ;-) I had my doubts about the necessity of implementing this change, given that the features were unusable anyway, but I had the argument and I lost

As I was re-linking, though, it occurred to me that it's something DBAs should know about. Even then, I worry that people might decide this is a great idea to try!

#2 - Dominic Delmolino said:
2007-05-06 18:22 - (Reply)

I had the same problem once where I went to install "only" SQL*Net. The customer was concerned because they had received a 1/4" tape from Oracle with the full distribution on it (there was no standalone SQL*Net tape at the time). They wanted to be sure they were't going to be charged for the other stuff.

Incidently, you can't "de-install" the partitioning option -- my wife told me it's used for AWR...

#2.1 - Doug Burns said:
2007-05-06 21:55 - (Reply)

Incidently, you can't "de-install" the partitioning option -- my wife told me it's used for AWR...

Mmm, hadn't thought of that, actually. I was aware that AWR uses partitioning but hadn't thought of the licensing implications. I suppose Oracle didn't, either, given the mess that the licensing of 'automatic tuning' features is.

#2.1.1 - Mike King 2008-01-17 23:00 - (Reply)

Oracle has certainly thought about the implications of using licensable features inside other things that may include the free word. The samples are a good example. OE needs spatial. PM points to OE. When you add a node to your grid & activate the agent Oracle turns on packs regardless of your licensing status. You must go in later & turn them off.

I think it's all part of Oracle's grand plan to put all kinds of unlicensed software on your servers. When times turn bad for Oracle they'll play the audit card.

#3 - Noons said:
2007-05-07 01:03 - (Reply)

yeah, that little snag of partitioning being needed for AWR had me in stitches for a while. Obviously another case of the left hand not knowing what the right hand is doing!

Also found that some of the relinked executables have "0" - the digit - as the last instead of "O" - the letter. Can't for the life of me figure out why, but it happens: probably a typo in one of the re-link scripts somewhere. I just get rid of anything terminated by any of those two in $ORACLE_HOME/bin and be done with it.

Anyways, in this day and age of a GUI front-end for even the most basic operations, I wonder how long before no one knows how to do this?

#3.1 - Doug Burns said:
2007-05-07 08:06 - (Reply)

Thanks, Noons.

Also found that some of the relinked executables have "0" - the digit - as the last instead of "O" - the letter.

You know, I'd forgotten that one but now that you mention it, it sounds familiar.

Anyways, in this day and age of a GUI front-end for even the most basic operations, I wonder how long before no one knows how to do this?

In fairness, I suppose the GUI tools have made it less (un-?)necessary. I'm not suggesting everyone goes around relinking their executables, but I'm a little concerned that this might not be common knowledge any more.

I think it's worth knowing about the linking process, if only to recognise when it goes wrong, and it's the type of activity the documentation isn't strong on.

#4 - Howard Rogers said:
2007-05-08 03:47 - (Reply)

I think Vista users of the world have a responsibility to tell us how to do this sort of thing on a non-Linux/non-Unix platform, don't you?? :-)

Oh alright then, you're excused...

#4.1 - Doug Burns said:
2007-05-08 07:31 - (Reply)

You know, my last thought before going to sleep last night was - 'Ah! I forgot to say that example was on Solaris 10. Your make executable might be in a different directory.'

Then I thought about Windows. Briefly ;-)

#5 - Shervin 2007-05-10 04:37 - (Reply)

Hi,
What about v$option ?

#5.1 - Doug Burns said:
2007-05-15 21:32 - (Reply)

Shervin,

I'm not sure what you mean?

For the record, before the relink, here are the values

select * from v$option
where upper(parameter) like '%MINING%'
or upper(parameter) like '%OLAP%'

PARAMETER VALUE
----------------------------- -----
OLAP Window Functions TRUE
OLAP TRUE
Data Mining TRUE
Data Mining Scoring Engine FALSE

and after the relink ...

PARAMETER VALUE
------------------------------ -----
OLAP Window Functions TRUE
OLAP FALSE
Data Mining FALSE
Data Mining Scoring Engine FALSE

#6 - Mathias Magnusson said:
2007-05-13 18:38 - (Reply)

When writing my last post I noticed that Oracle actually uses partitioning for three things. WRH, Log Miner, and even the SH sample schema (10G).

I guess this is "Oracle can use it for you, but you have to pay to do the same". I wonder if the scripts that create these functions verifies if partitioning is available and then installs a version of them that is supported on the database. I guess they have to as SE cannot be licensed for partitioning. Or is that just a licensing issue, it is installed and works, you're just not allowed to use it?

#6.1 - Doug Burns said:
2007-05-13 22:43 - (Reply)

Mathias,

Interesting points. Again, if I'd thought it through, I would definitely have remembered the SH schema because I've used that in a few tests. I'd forgotten about Log Miner, though.

I would guess that the position is as you said ...

Oracle can use it for you, but you have to pay to do the same

It would be nice if they simplified the whole thing though, eh, but I gave up on that a long time ago. Licencing should not be this hard!

#6.1.1 - koert 2007-05-14 14:47 - (Reply)

In fact the SH partitioned table use block compression too

I don't think table compression is a seperate license tho ... they just used
all the bells and whistles on that schema ;-)

#7 - Paul G. Matuszyk 2007-05-15 13:08 - (Reply)

look at this:

DBA_HIGH_WATER_MARK_STATISTICS

This gives you information about the usage statistics of various database attributes at its highest usage point. So if it is compiled-in you can always prove that you haven't used it.

#7.1 - Doug Burns said:
2007-05-15 20:52 - (Reply)

All good suggestions and they'll probably suit most people's requirements very well. Sadly, I was told 'the banner has to go' :-(

#8 - Tam 2008-03-27 14:08 - (Reply)

Here's another which is apparently used by Oracle Audit teams - dba_feature_usage_statistics
- you'll see that it actually distinguishes the partitioning between 'system' and 'user'

#8.1 - Doug Burns said:
2008-03-27 14:22 - (Reply)

That's weird - I was just looking at that last night for one of the course slides!

Not only does it show what you've used and when, it appears to preserve the information for previous versions because I couldn't work out why I had two rows for each feature then realised it was because I'd applied the 10.2.0.4 patchset.

It's very detailed and yes, I noticed that System and User partitioning were seperated ;-)

#9 - RSO 2008-04-15 03:01 - (Reply)

Found this page while looking;thanks for the useful info. Please keep it up!

#10 - Tam 2008-07-03 11:08 - (Reply)

As a continuation, I raised a SR with Oracle on this and had confirmation that we a supported configuration was maintained. However I'd caveat that with the fact that a specific version was stated and specific options stated as removed. That suggests that you should re-ask the question if you have a different version, or remove different options.

#11 - Doug Burns said:
2010-06-01 02:14 - (Reply)

I see from Marco's blog post that there's a better way of doing this in 11.2


Add Comment

Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
BBCode format allowed
 
 

Statistics on Partitioned Tables

Contents

Part 1 - Default options - GLOBAL AND PARTITION
Part 2 - Estimated Global Stats
Part 3 - Stats Aggregation Problems I
Part 4 - Stats Aggregation Problems II
Part 5 - Minimal Stats Aggregation
Part 6a - COPY_TABLE_STATS - Intro
Part 6b - COPY_TABLE_STATS - Mistakes
Part 6c - COPY_TABLE_STATS - Bugs and Patches
Part 6d - COPY_TABLE_STATS - A Light-bulb Moment
Part 6e - COPY_TABLE_STATS - Bug 10268597

Comments

Doug Burns about 10053 Trace Files - Different Plan in Different Environments
Tue, 02.04.2013 08:57
You're welcome. Now I just nee d to pull my finger out and ac tually come up [...]
Howard Rogers about 10053 Trace Files - Different Plan in Different Environments
Mon, 01.04.2013 23:08
Makes a big difference, so tha nks for that! With two brow ser windows, o [...]
stelioscharalambides.com about 10053 Trace Files
Sat, 30.03.2013 16:28

Upcoming Presentations

Bookmark

Open All | Close All

Syndicate This Blog

  • XML RSS 2.0 feed
  • ATOM/XML ATOM 1.0 feed
  • XML RSS 2.0 Comments
  • Feedburner Feed

Powered by

Serendipity PHP Weblog

Show tagged entries

xml 11g
xml ACE
xml adaptive thresholds
xml ASH
xml Audit Vault
xml AWR
xml Blogging
xml conferences
xml Cuddly Toys
xml Database Refresh
xml DBMS_STATS
xml Direct Path Reads
xml Fun
xml grid control
xml hotsos 2010
xml listener
xml Locking
xml oow
xml oow2009
xml optimiser
xml OTN
xml Parallel
xml Partitions
xml Patching
xml swingbench
xml The Reality Gap
xml time matters
xml ukoug
xml ukoug2009
xml Unix/Shell
xml Useful Links

Disclaimer

For the avoidance of any doubt, all views expressed here are my own and not those of past or current employers, clients, friends, Oracle Corporation, my Mum or, indeed, Flatcat. If you want to sue someone, I suggest you pick on Tigger, but I hope you have a good lawyer. Frankly, I doubt any of the former agree with my views or would want to be associated with them in any way.

Design by Andreas Viklund | Conversion to s9y by Carl