Monday, December 8, 2008

Fun with tar

Quick tip for copying directories between systems:

tar czf - -C /u01/app/oracle/stage/patchset cpu2008oct | ssh server2 tar xzf - -C /u01/app/oracle/stage/patchset

What's important here is the -C flag. In this case it tells tar to change working directory to /u01/app/oracle/stage/patchset, and only then begin backing up cpu2008oct. Same scenario on the extraction, change working directory then begin extracting.

Friday, November 21, 2008

Provisioning pack actually works

As we recently discussed, there are some issues with Grid Control out of the box provisioning functionality.

Want to know if your gridcon is setup for patching? Deployments>>provisioning>>directives>>Oracle Components. See Oracle Patch Prereq Checker? Common Provisioning Utilities?

No? Then you'll likely end up with the hated "Incorrect Directive URN: null" error we mentioned back in October. Will also show up in emoms.log as the following error:

ERROR em.paf_jobs executePAFCommand.142 - Problems with the directive urn parameter format.

How do you fix this?

I'll save you a week of playing with the PARDeploy app.

1) Setup your software lib in deployments>>provisioning>>administration
2) Run Refresh Metalink and Refresh OPatch from Grid control
3) Run $ORACLE_HOME/PARDeploy -action -deploy -parDir $ORACLE_HOME/sysman/prov/paf -force

Still does not work?

Here's the magic from metalink note 727001.1 and a very useful OTN forum thread.

Download the .par files from $ORACLE_HOME/sysman/prov/paf of your oms server to your local machine. Go to Deployments>>Deployment Procedures>> Upload

Select each .par file and upload it.

I found the asprov files, patchadvisor, provCommon, and prereqs were useful, the others, not so much in my installation.

After that, patches installed without much of a problem. Patching speed leaves a bit to be desired (one system took 2 hours, another, 23 minutes. YMMV).

Oh, final note, sometimes the .par files need to be banged around a little bit in order to be accepted by the app. I had to extract one of the zips that got uploaded, move the files around a bit to get them to upload successfullly. Might open a tar on that one.

Friday, November 14, 2008

VMware vs. Oracle support issue

Just found NOTE:249212.1 about Oracle support when running on VMware. Basically, they provide support up until they think it might be a VMware issue, then you get to prove to Oracle that the issue is theirs.

Pretty typical when a platform isn't "certified". But a nasty business practice.

Strange. Back in 2004 VMware and Oracle had a parternship.

... then about a year ago, Oracle releases Oracle VM, and boom, they're not going to certify on VMware. Stupid.

FYI...apparently Oracle does work on VMware, and according to a blog on their site, it runs *best* on VMware.

Strange. Is this just Oracle taking a support stance via not certifying to lure customers away from VMware onto their shiny new toy? Or is there some fundamental problem with VMware that Oracle is saving us from?

It's unlikely. I think someone in the VMware world might have gotten under the skin of one of the higherups at Oracle, cause they have certified Solaris 10 containers:

# Oracle does support Oracle non-RAC databases (10gR2, 10gR1, and 9.2 for SPARC and 10gR2 and 10gR1 for x86-64) with Solaris 10 non-global (local) Containers on the existing supported platforms for SPARC and x86-64. See metalink note 317257.1 for best practices document for deploying Oracle database in a Solaris 10 non-global Container
# Oracle RAC does not work in Solaris 10 local Containers.
# Oracle does not support Oracle with Solaris 8 or 9 containers on a Solaris 10 Operating Environment or any other combination not mentioned in the statement listed above. NOTE:567849.1

Still looking around for a rationale on why Oracle won't certify on VMware.

Friday, October 31, 2008

Provisioning, Patching, and Grid Control

Attempted (again) to get Grid Control to patch a few databases. Fail. Hard.

Eventually, we found the following glorious DocID on Metalink: 427577.1. Bookmark it now.

It identifies a few patches you'll need to install on GC in order for patching to work. Or you end up with some very irritating, strange, and mostly undocumented errors:

ERROR em.paf_jobs executePAFCommand.142 - Problems with the directive urn parameter format.

oracle.sysman.emgc.provision.UrnException: The URN, 'null', is not properly formatted

There are others, not totally related:

There was an error saving 'p4898608_10.2.0.4_2000' below 'OracleSoftwareUpdates' in the deployment library
Fixed that one by deleting from Deployments>>Provisioning select and deleted p4898608.

There's a really handy guide to look at -- grid-automation-deployment-procedures.pdf Found that to be pretty useful.

Couple more random things:
1) Setup your software library: info here
2) Run the metalink & opatch update scripts. Now.
3) Patch the system from the docid above.

Should work. Hasn't for me yet, but when it does I'll post the last lil bits.

Friday, May 9, 2008

Clean Up Indentations in vi

Pasting or adding to existing scripts can often get ugly. To help clean up, you can set tab and shift widths to custom sizes in vi.

To set the length of tabs to n spaces:
  • :set tabstop=n

To shift a block of text n spaces:
  • :set shiftwidth=n

  • mx

  • >

  • move cursor to end of block)

  • `x

To use spaces instead of tab characters with future presses of the TAB key (vim only):
  • :set expandtab

Monday, April 7, 2008

Multi user screen

Setting up screen for multiple users...

# screen -S screen_name
ctrl-A :addacl add someone_else,and_another_someone_else
ctrl-A :chacl username -w "#"
ctrl-A :multiuser on

They can connect to your screen via

# screen -x owners_user_name/screen_name

Obviously replace owners_user_name with whoever started the first screen, and change someone_else, and_another_someone_else, and screen_name to the useful settings....

More good tricks here, including some fancy tabs for the bottom of your screen

Tuesday, April 1, 2008

Fun with chmod

To carefully add permissions to files in a directory tree, keep capital letters in mind.

The following is dangerous:
chmod -R a+x directoryname

That would give execute permissions to all files underneath directoryname.

To give execute permissions to only files that currently have execute permissions use:
chmod -R a+X directoryname

That would give execute permissions to only those files that already have some other execute permission -- great for allowing others to look in directories.


Wednesday, March 26, 2008

Redirection for the win

Fancy pants way to diff the contents of two directories.

diff <(ls exe) <(ls exe9ibkup)

Tuesday, March 25, 2008

Sed tricks

Find something in files and replace it with something else.
find . -name "somefiles" -exec sed -i 's/this/that/' {} \;

For an or condition...
sed 's/this/that/g;s/other/totheother/g'

Hey guess what, that inline flag -i doesn't work with Solaris 8's default sed install. We've already badgered our Solaris admin enough for one day, what else can we do?

Perl pie.

perl -pi -e 's/foo/bar/g' filename*


Friday, February 29, 2008

Who can log in during restricted session?

Couple of quick statements to identify potentially problem users during an upgrade or patch:

select grantee from dba_sys_privs where privilege = 'RESTRICTED SESSION'

Some of the results will be roles... for example, the dba role will be in that result set.

You'll need to track down who has the dba role as well:

select grantee from dba_role_privs where granted_role = 'DBA';

Saturday, February 16, 2008

AT&T SMTP issue

In an effort to cut down on spam, AT&T by default blocks pretty much all external smtp servers.

You can remove this block by submitting an abuse report here:

Choose Opt-out Port 25 from the abuse type list.

They recommend that mail hosts use an authenticated port 587 instead of 25, so you wouldn't need to worry about the port block.

(As for reaching work smtp from at&t? You can always use vpn, no?)

Telnet in windows vista?

Looks like the telnet client isn't installed by default with vista.

Try typing telnet from the command line. D'oh!

Fix? Start >> Control Panel >> Programs >> Turn Windows features on or off

Find Telnet Client in the client list, check the box to install and click OK.

Now from the command prompt, telnet works as expected.