Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Dan's handy perl script

Re: Dan's handy perl script

From: Ban Spam <ban-spam_at_operamail.com>
Date: Wed, 19 Dec 2001 02:34:31 GMT
Message-ID: <Xns917BBCF679CABSunnySD@24.0.3.73>


Dan Bikle <dbikle_at_rahul.net> wrote in news:9vobhm$s2e$1_at_samba.rahul.net:

>
> Hi,
>
> I found a useful perl command which comes in handy.
>
> Often I use it when I install an Oracle database using an existing
> tree of Oracle software rather than from a cdrom. I refer to this
> method as a "manual install".
>
> I started using this method when Oracle released 8.1.6.
>
> The reason for this is that after 8.1.6, I found that some of
> the sql scripts under $ORACLE_HOME have $ORACLE_HOME hard-coded
> into them.
>
> So, suppose I have an existing database which was installed via
> cdrom and has this:
>
> ORACLE_HOME=/oracle/app/oracle/product/BIKLE817
>
> At this point I could tar-up ORACLE_HOME and copy it to another host.
>
> Then suppose I unpack it here:
>
> ORACLE_HOME=/oracle/app/oracle/product/SMITH817
>
> Now is when my perl command comes into use:
>
> cd /oracle/app/oracle/product/SMITH817
> /bin/find . -type f -print|xargs /bin/grep -l BIKLE817|xargs /bin/perl
> -e "s/BIKLE817/SMITH817/g" -p -i.bak
>
> The above perl command will find every file which contains the string:
> BIKLE817
>
> It will edit each file and replace BIKLE817 with SMITH817.
>
> All the files which contained BIKLE817 will be renamed with a .bak
> at the end of each file name.
>
> If we are confident we no longer need the .bak files,
> we could delete them with this command:
>
> /bin/find . -name '*.bak' -type f -print|xargs /bin/grep -l
> BIKLE817|xargs /bin/rm
>
> I have more demos on my site.
>
> ---------------------------------------------------------------------
> Daniel B. Bikle/Independent Oracle Consultant
> bikle_at_bikle.com | 650/941-6276 | P.O. BOX AG LOS ALTOS CA 94023
> http://www.bikle.com
> ---------------------------------------------------------------------

While this method in and of itself will allow Oracle to run, you might have some heart burn the next time you try to apply a patch or upgrade Oracle. Most likely OUI won't find that anything is installed & refuse to continue.

Been there, Done that & will NOT ever do that again!

HTH & YMMV! HAND! Received on Tue Dec 18 2001 - 20:34:31 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US