2012-09-27

Cloning Oracle 11.2 database installation on Solaris


Environment

Oracle 11.2.0.2, Solaris 10

Packing Source Oracle Home

export CLONE=/oracle/stage/clone11.2.0.2
echo $CLONE
cd $ORACLE_HOME

Optionally you can create Exclude List for tar command to exclude some files from source home.
Log files:
find . -name "*.log" >$CLONE/ExcludeList.txt
find . -name "*.err" >>$CLONE/ExcludeList.txt
Database templates:
find ./assistants/dbca/templates >>$CLONE/ExcludeList.txt
Network files:
find ./network/admin >>$CLONE/ExcludeList.txt

Check your Exclude file:
cat $CLONE/ExcludeList.txt

tar -cvfX - $CLONE/ExcludeList.txt . | gzip -c >$CLONE/oracle_home11.2.tar.gz

If source and target are on the same host you can use
cp -Rp $ORACLE_HOME
Ignore errors for files owned by root (nmb, nmo, etc.)

Cloning Oracle Home

Check or create oraInst.loc
cat /var/opt/oracle/oraInst.loc

Optionally J check known issues in
Master Note For Cloning Oracle Database Server ORACLE_HOME's Using the Oracle Universal Installer (OUI) [ID 1154613.1]

Navigate to new Oracle home:
cd /oracle/product/11.2.0.2/db_2
or if you have set the variables
cd $ORACLE_HOME
pwd
Unpack Oracle home to new location
gunzip < /oracle/stage/clone11.2.0.2/oracle_home11.2.tar.gz | tar xvf –

unset LD_LIBRARY_PATH
unset LD_LIBRARY_PATH_64
Check that other variables do not point to different Oracle home or unset them
echo $PATH
unset ORACLE_HOME
unset ORACLE_BASE
unset TNS_ADMIN

cd clone/bin

perl clone.pl ORACLE_HOME="/oracle/product/11.2.0.2/db_2" ORACLE_HOME_NAME="OraDB11g_home2" ORACLE_BASE="/oracle" OSDBA_GROUP=dba OSOPER_GROUP=oper

as root run
/oracle/rdbms/11.2.0.2/ora10R4/root.sh

Update
listener.ora
tnsnames.ora

Useful Links

Master Note For Cloning Oracle Database Server ORACLE_HOME's Using the Oracle Universal Installer (OUI) [ID 1154613.1]
How To Clone An Existing RDBMS Installation Using OUI [ID 300062.1]
FAQs on RDBMS Oracle Home Cloning Using OUI [ID 565009.1]


2012-05-17

Host preferred credentials failure after cloning Agent OEM 11g

Environment
AIX 6.1
Oracle Enterprise Manager (OEM) Grid Control 11.1

Problem
There is an issue with host preferred credentials in Grid Control .
Agent cannot connect to host .
Agent home and database home are owned by different UNIX users.

Cause
OUI is run as part of agent cloning procedure, e.g.:
cd $ORACLE_HOME/oui/bin
./runInstaller -clone -forceClone ORACLE_HOME=/oracle/oem/agent11g ORACLE_HOME_NAME=OH_agent11g -noconfig -silent OMS_HOST=oms.domain.com OMS_PORT=4889

During the cloning OUI creates about a hundred backup files (*.ouibak).
You can see and delete them as:
find $ORACLE_HOME -name "*.ouibak" -ls
find $ORACLE_HOME -name "*.ouibak" -exec rm {} \;

There is a catch here. OUI creates new files with different permissions.
For example in $ORACLE_HOME/perl/bin, all files have 755 before cloning, and 700 after cloning.
If oracle agent and oracle database homes are owned by different UNIX users, even the same group (oinstall), Oracle agent cannot connect to host when you test host preferred credentials in OEM.

When switching the agent into DEBUG mode, you can see in the trace file $ORACLE_HOME/sysman/log/emagent.trc, that the user (database owner) cannot execute perl.
In emagent.nohup, you can see “ERROR: Execution failed due to binary missing or permission issues”.

Solution
At least grant 750 (if owners in the same group - oinstall) or 755 to $OH/perl/bin/perl
Or for all files in $OH/perl
find $ORACLE_HOME/perl -perm 700 -exec chmod g+rx {} \;

Useful info
How to debug agent:
Troubleshooting Host Credentials Issues in Grid Control Console [ID 565414.1]
About perl permission issue:
Testing Host Credentials fails with ERROR: Execution failed due to binary missing or permission issues [ID 1294136.1]

Configuring standby OMS (OEM 11g)


Environment
Oracle Enterprise Manager 11.1
UNIX AIX 6.1

This is a simple configuration. There are two OMS hosts in different co-locations (host1, host2) and common DNS alias (oms).
There is no hardware SLB in this example.

Tips
When you configure OMS with SLB, DNS alias (oms.domain.com) should have different IP address from local hostname.

If they are the same, the result is:
Console Server Host : oms.domain.com
OMS is not configured with SLB or virtual hostname

If they are different, the result is:
Console Server Host : host1.domain.com
SLB or virtual hostname: oms.domain.com

After securing OMS with SLB alias, restart OMS (I didn’t see it in Oracle documentation), otherwise agents will not be able to register with the alias:
emctl secure oms -host oms.domain.com
emctl stop oms -all
emctl start oms

After configuring OMS as SLB/alias, you can point the alias oms.domain.com to host1.

Here is Oracle documentation how to Setup Standby Management Server.

2012-04-24

Installing BusinessObjects Data Services 4.0 on AIX

Summary

This post describes installation of BusinessObjects Data Services 4.0 in test environment.
SAP BusinessObjects Information Platform Services 4.0 (IPS) is required component to install BODS.

Official product names (as on SAP support website):
(SBOP INFORMATION PLAT SVCS 4.0) - SAP BusinessObjects Information Platform Services 4.0
(SBOP DATA SERVICES 4.0) - SAP BusinessObjects Data Services 4.0 (14.0.1)
(SBOP DS DESIGNER 4.0) - SBOP Data Services Designer for 4.0

Environment

OS: UNIX AIX 6.1 TL6 SP2
Database: Oracle 11.2.0.3
SBOP Data Services 4.0 SP02 Patch3

All BODS components and Oracle database are on the same host.
BO and Oracle installations are owned by different UNIX users.

Prerequisites

Authorise user (pocadm) to use UNIX cron.
Verify that all ports to be used by BO are available.
For more details use BODS Installation Guide for UNIX (sbo401_ds_install_unix_en.pdf).

Locale requirements problems

Set variables according to documentation:
export LANG=en_US.utf8
export LC_ALL=en_US.utf8

pocadm@host01:/deve/TEST01/POC/software/IPS$./setup.sh
The UTF-8 locale is not recognized by Perl. Please set a valid UTF-8 locale in $LC_ALL.
Please consult setlocale(3) for the list of available locales on your system.
If that fails, please try the following commands:
    locale -a
    nlsinfo
    ls /usr/lib/nls/loc
    ls /usr/lib/locale
    ls /usr/lib/nls
    ls /usr/share/locale

pocadm@host01:/deve/TEST01/POC/software/IPS$locale -a
C
POSIX
de_DE.8859-15@euro
de_DE.8859-15@preeuro
de_DE.8859-15
de_DE.IBM-1252@euro
de_DE.IBM-1252@preeuro
de_DE.IBM-1252
de_DE.ISO8859-1
de_DE
en_US.8859-15
en_US.ISO8859-1
en_US

The current AIX 6.1 TL6 SP2 does not have locale UTF-8
There is no bos.loc.com.utf on the lpp_source_6162_bund that was supplied for AIX 6.1 TL6 SP2

If LC_ALL is set to non UTF-8 existing locale, e.g. LC_ALL=en_US, setup.sh returns:
Non-UTF-8 locale is detected in LC_ALL.

Locale requirements solution

Only bos.loc.com.utf for AIX 6.1 TL4 is found.
EN_US.UTF-8 for AIX 6.1 TL4 was installed on host01 (AIX 6.1 TL6)

locale -a
C
POSIX
EN_US.UTF-8
EN_US
de_DE.8859-15@euro
de_DE.8859-15@preeuro
de_DE.8859-15
de_DE.IBM-1252@euro
de_DE.IBM-1252@preeuro
de_DE.IBM-1252
de_DE.ISO8859-1
de_DE
en_US.8859-15
en_US.ISO8859-1
en_US

Use the following variables. They are different from SAP documentation (UTF-8 instead of utf8).
They are case sensitive and have to match “locale -a”
export LANG=EN_US.UTF-8
export LC_ALL=EN_US.UTF-8

Configuring Oracle database

Oracle database for BO repositories must have character set UTF-8
Create new tablespace SAP_BO.
Create Oracle user for Central Management Server (CMS) repository.
CREATE USER "BO_CMS" PROFILE "DEFAULT" IDENTIFIED BY "BO_CMS" DEFAULT TABLESPACE "SAP_BO" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMITED ON "SAP_BO" ACCOUNT UNLOCK;
GRANT CREATE VIEW TO "BO_CMS";
GRANT "CONNECT" TO "BO_CMS";
GRANT "RESOURCE" TO "BO_CMS";

Configuring Oracle Client

For BO owner (pocadm) add $ORACLE_HOME to .profile and $ORACLE_HOME/bin into $PATH
Add $ORACLE_HOME/lib into $LIBPATH
export LIBPATH=$ORACLE_HOME/lib:/usr/lib:/lib

Configure tnsnames.ora. Test sqlplus connection from UNIX user (pocadm) to Oracle database (SAP_BO@repdb01).
As everything is on the same host, database Oracle home is used as Oracle client.

Installing IPS

IPS has to be installed before BO Data Services.
You have to install base release first and then patch it.
Download base release of IPS from SAP website:
51041259_part1.exe
51041259_part2.rar

Unpack them on PC and copy to UNIX (I didn’t have unrar on AIX).
pwd
/deve/TEST01/POC/software/IPS
chmod -R u+rx 51041259
cd /deve/TEST01/POC/software/IPS/51041259/DATA_UNITS/SBOP_INFO_PLAT_SVCS_40_AIX64

Do not run ./setup.sh. This will require separate product key. BTW, temporary key of “BI (Business Intelligence) Platform - BI 4.0” is accepted.
For IPS as a part of Data Services, run InstallIPS:

./InstallIPS
Destination directory chosen in the following step will be used for Data Services installation as well. Both components are installed into the same directory.

  1. Specify the destination folder
destination folder: /deve/TEST01/POC/BODS4/

  1. Prerequisite checking
Summary of the missing critical and optional prerequisites
Succeeded: Cannot be installed on the same machine as SAP BusinessObjects BI platform (Critical)
Succeeded: Minimum patch level requirements for OS (Optional)
Succeeded: Bundled DB - user's home directory must have minimum mode of 755 (Optional)
Succeeded: Bundled DB - these directories cannot exist: ~/sqllib and ~/$USER (Optional)
Succeeded: Bundled DB - the gunzip utility needs to be on the system path (Optional)
Succeeded: Check for required disk space in /tmp (Critical)
Succeeded: Bundled DB - meet restrictions on UID and GID (Optional)
Succeeded: Bundled DB - meet restrictions on the user's ID and primary group (Optional)
Succeeded: Validate network settings (Critical)
Succeeded: Platform Memory Architecture Requirement (Critical)
Succeeded: Root User Rights (Critical)

  1. Licence
  2. Product Key is automatically inserted, just hit Enter
  3. Language – English
  4. Select a user install or a system install
System install requires root access to run initialization scripts after install
 1  -   User install - regular Information Platform Services installation
 2  -   System install - user install plus system initialization scripts

  1. Choose Install Type
1  -   Full
2  -   Custom / Expand
3  -   Web Tier

  1. Select Features
Please select which features you would like to install.
-[~]Instances
  +[X]WebTier
  -[~]Platform Services
     [X]Central Management Server
     [X]File Repository Server
     [ ]Integrated Database
     [X]Platform Processing Services
     [X]Platform Scheduling Services
     [X]Client Auditing Proxy Processing Service
     [X]Lifecycle Management Processing Services
     [X]Monitoring Processing Service
     [X]Security Token Service
    +[X]Advanced Analysis Services
     [X]System Landscape Directory - Data Supplier
     [X]Destination Scheduling Service
     [X]Program Scheduling Service
     [X]Subversion
  -[X]Administrator Tools
     [X]Upgrade management tool
  +[ ]Database Access

Unselect Integrated Database as we plan to use Oracle.
Unselect Database Access as we are not planning to plug into JD Edwards, Oracle EBS, etc

  1. Choose new deployment:
1  -   Start a new Information Platform Services deployment
2  -   Expand an existing Information Platform Services deployment. (Requires a remotely installed CMS)

  1.  Select existing CMS Database Type
Specify the database type to use for the CMS repository
 1  -   MySQL
 2  -   IBM DB2
 3  -   Oracle
 4  -   MaxDB
 5  -   Sybase

  1. Select existing Auditing Database Type
Specify the database to use for the Auditing Database.  Select No Auditing Database to configure auditing at a later time.
 1  -   MySQL
 2  -   IBM DB2
 3  -   Oracle
 4  -   MaxDB
 5  -   Sybase
 6  -   No Auditing Database

  1. SIA and Smart Server Configuration
Enter the SIA port and listing port range for Smart Servers
Node Name
[host01                                                    ]
SIA Port
[6410  ]

  1. Configure Central Managament Server
Enter the port number to use for the new CMS
CMS Port
[6400  ]

  1. Configure CMS Account
Specify the new password for the CMS Administrator account, and a value for the CMS Cluster Key.
Administrator Account Password:
[********                                                    ]
Confirm Password:
[********                                                    ]
Cluster Key:
[********                                                    ]
Confirm Cluster Key:
[********                                                    ]

  1. Configure CMS Repository Database - Oracle
Enter details for the database to use for storing CMS information.
Oracle TNSNAME
[repdb01                                                    ]
Username
[BO_CMS                                                      ]
Password
[******                                                      ]
Reset existing database (1 = yes, 0 = no)
[1]

  1. Choose to start or stop servers
Start the servers after installation?
 1  -   Yes
 2  -   No

  1. Configure Tomcat
Enter the port information for Tomcat application server
Connection Port
[8080  ]
Shutdown Port
[8005  ]
Redirect Port
[8443  ]

  1. Subversion Configuration
Subversion will installed and used as the version control system for Lifecycle Manager. Provide the port and user name for Subversion.
Repository (LCM_repository) Port
[3690  ]
Repository User (LCM) Password
[*********                                                   ]
Confirm Password
[*********                                                   ]

  1. Configure Connectivity to SMD (Solution Manager Diagnostics) Agent
Enable connectivity to SMD Agent
 1  -   Do not configure connectivity to SMD Agent.
 2  -   Configure connectivity to SMD Agent. You will be prompted for information.

  1. Introscope Integration
Enable connectivity to Introscope Enterprise Manager
 1  -   Do not integrate connectivity to Introscope Enterprise Manager.
 2  -   Integrate connectivity to Introscope Enterprise Manager. You will be prompted for information.

This installation is (BuildVersion=14.0.2.364.)
After installation try to login to CMC http://host01:8080/BOE/CMC as Administrator.

Patching IPS

Download and unpack IPS_4.0_SP02_patch14
Do not use AIX tar command as it causes the following error:
tar: can't create ././@LongLink: Permission denied

Cause: TDI uses AIX tar which has a limitation on the maximum buffer size. The prefix buffer can be a maximum of 155 bytes and the name buffer can hold a maximum of 100 bytes. If the path name cannot be split into these two parts by a slash, it cannot be archived.

Install and use GNU version of tar: /opt/freeware/bin/tar
gunzip INFOPLATSVCS02P_14-20007540.TGZ
/opt/freeware/bin/tar -xvf INFOPLATSVCS02P_14-20007540.tar

cd /deve/TEST01/POC/software/IPS_patch
./setup.sh InstallDir=/deve/TEST01/POC/BODS4

  1. Setup Language
Please choose setup language
 1  -   English

  1. Specify the destination folder
The destination folder is where the product was or will be installed. Please enter the full path.
Destination Folder
[/deve/TEST01/POC/BODS4/                                     ]

  1. Prerequisite checking
Summary of the missing critical and optional prerequisites
Succeeded: Detect updates are applicable (Optional)
Succeeded: Detect Information Platform Services 4.0 installed (Critical)
Succeeded: Root User Rights (Critical)

  1. Existing CMS Deployment Information
Specify the CMS and Administrator logon information of your existing CMS deployment.
CMS Name
[host01                                                    ]
CMS Port
[6400  ]
User
[Administrator                                               ]
Password
[*********                                                   ]

  1. Start Installation
Are you ready to have the Information Platform Services 4.0 SP2 Patch 14 Installation Wizard begin the install?

Installing BODS

Create oracle user for local repository
CREATE USER "BO_REPO1" PROFILE "DEFAULT" IDENTIFIED BY "BO_REPO1" DEFAULT TABLESPACE "SAP_BO" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMITED ON "SAP_BO" ACCOUNT UNLOCK;
GRANT CREATE VIEW TO "BO_REPO1";
GRANT "CONNECT" TO "BO_REPO1";
GRANT "RESOURCE" TO "BO_REPO1";

Download and copy SAP BusinessObjects Data Services 4.0 Support Pack 2 Patch 3 (DATASERV02P_3-10010590.TGZ).

You don’t have to install base release of BODS 4.0 as if  there  is  no  version  of  Data  Services  already  installed  on  the  system,  BODS4.0SP02patch3  will  go  through  the normal full installation.

Use GNU version of tar: /opt/freeware/bin/tar
gunzip DATASERV02P_3-10010590.TGZ
/opt/freeware/bin/tar -xvf DATASERV02P_3-10010590.tar

cd /deve/TEST01/POC/software/BODS4.0
InstallDir has to be the same as IPS installation:
./setup.sh InstallDir=/deve/TEST01/POC/BODS4

  1. Setup Language
Please choose setup language
 1  -   English

  1. Specify the destination folder
The destination folder is where the product was or will be installed. Please enter the full path.
Destination Folder
[/deve/TEST01/POC/BODS4/                                ]

  1. Prerequisite checking
Summary of the missing critical and optional prerequisites
Succeeded: Minimum patch level requirements for OS (Optional)
Succeeded: Existing Data Services version (Critical)
Missing: SAP HostAgent (Optional)
         Reason: The SAP HostAgent was not detected. You will not be able to integrate Data Services with SLD
during installation.
Succeeded: Platform Memory Architecture (Critical)
Succeeded: SAP BusinessObjects Enterprise (Optional)
Succeeded: SAP BusinessObjects Enterprise Version (Critical)
Succeeded: Root User Rights (Critical)

  1. License Agreement

  1. User Information
Please fill in your product key to proceed
Product Keycode: xxxx-xxxx-xxxx
 (Temporary key is used)

  1. Choose Language Packs
A language pack gives the product the ability to interact with users in a specific language.
[X]  English
[ ]  Japanese
[ ]  Turkish

  1. SAP BusinessObjects Data Services 4.0 SP2 Patch 3 Setup
Select DataServices Installed with CMS Server or not.
 1  -   Install DataServices with CMS Server
 2  -   Install DataServices without CMS Server

  1. SAP BusinessObjects Enterprise Server Login
SAP BusinessObjects Enterprise Server (CMS)
System:
[host01                                                    ]
User:
[Administrator                                               ]
Password:
[*********                                                   ]
Authentication mode (Enterprise is the only allowed value)
[Enterprise]

  1. Select Features
Please select which features you would like to install.
-[~]BusinessObjects Data Services
  -[X]Data Services Server
     [X]Job Server
     [X]AccessServer
   [X]Data Services Management Console
  -[X]Data Services APS Services
     [X]Data Services RFC Server Service
     [X]Data Services Administrator Service
     [X]Data Services Metadata Browsing Service
     [X]Data Services View Data Service
   [X]Data Services MessageClient
  -[~]Text Data Processing Languages
     [ ]French
     [ ]German
     [ ]Japanese
     [ ]Simplified Chinese
     [ ]Spanish
   [X]DataDirect ODBC Drivers
   [X]Data Services Documentation

  1. SAP BusinessObjects Data Services 4.0 SP2 Patch 3 Setup
Specify if you would like to use existing DataServices configuration (DSConfig.txt)
 1  -   Skip configuration
 2  -   Reuse existing DataServices configuration

  1. SAP BusinessObjects Data Services 4.0 SP2 Patch 3 Setup
Repository Selection
 1  -   Use an existing database
 2  -   Skip configuration

  1. SAP BusinessObjects Data Services 4.0 SP2 Patch 3 Setup
Local Repository Database Type
 1  -   Oracle
 2  -   DB2
 3  -   MySQL
 4  -   Sybase ASE
 5  -   Oracle RAC

  1. SAP BusinessObjects Data Services 4.0 SP2 Patch 3 Setup
Local Repository Location
Repository name for CMS registry
[edw_repo1                                                   ]
Please specify the oracle client install location 'ORACLE_HOME'
[/oracle/rdbms/11.2.0/orax01                                 ]
Oracle TNSNAME
[repdb01                                                    ]
Database port
[1526  ]
SID
[repdb01                                                    ]
Repository host server name
[host01                                                    ]
User ID
[BO_REPO1                                                    ]
Password
[********                                                    ]

  1. SAP BusinessObjects Data Services 4.0 SP2 Patch 3 Setup
Which operation do you want to do for the local repository
 1  -   Create

  1. SAP BusinessObjects Data Services 4.0 SP2 Patch 3 Setup
Configure Job Server
 1  -   Configure a new Job Server
 2  -   Skip Job Server configure

  1. SAP BusinessObjects Data Services 4.0 SP2 Patch 3 Setup
Configure a new Job Server
Job Server name
[JobServer_1                                                 ]
Job Server port (Defaults to 3500)
[3500  ]
Enable SNMP (Y/N, Defaults to N)
[N]
Enable SSL (Y/N, Defaults to Y)
[Y]
Job Server advance configure (Y/N, Defaults to N)
[N]

  1. SAP BusinessObjects Data Services 4.0 SP2 Patch 3 Setup
Configure Access Server
 1  -   Configure a new Access Server
 2  -   Skip Access Server configure

  1. SAP BusinessObjects Data Services 4.0 SP2 Patch 3 Setup
Configure Access Server
Access Server Directory
[/deve/TEST01/POC/BODS4/dataservices/conf/AS1                ]
Access Server Port (Defaults to 4000)
[4000  ]
Enable Access Server (Y/N, Defaults to Y)
[Y]
Enable SSL (Y/N, Defaults to Y)
[Y]

  1. Configure Metadata Service
Specify Metadata Service configuration information.
Metadata service:
[4010  ]
JMX connector:
[4011  ]

  1. Configure Viewdata Service
Specify Viewdata Service configuration information.
Viewdata service:
[4012  ]
JMX connector:
[4013  ]

  1. Start Installation
Are you ready to have the SAP BusinessObjects Data Services 4.0 SP2 Patch 3 Installation Wizard begin the install?

Installing Data Services Designer

If there is a previous version of Designer on your PC, you have to uninstall it.

Download latest DS Designer from SAP “SUPPORT PACKAGES AND PATCHES”: SBOP Data Services Designer for 4.0 SP02 Patch 3
For Windows 32-bit: DATASERVDESIGN02P_3-20007461.EXE
It is self-extracting archive and it creates temporary folder (1.17GB) in your TEMP directory.
The installation needs 2.35GB.

Update Oracle tnsnames.ora on your PC before starting DS Designer.

2011-12-22

Cloning Oracle Management Agent OEM 11g

Environment
AIX 5.3.0.0
Oracle Enterprise Manager (OEM) Grid Control 11.1

Agent Installation
Create oracle user, groups and prepare .profile in UNIX.
Install agent by any method, e.g. agentDownload script.

Download file agentDownload.aix from OMS to target host.
wget http://omshost:4889/agent_download/11.1.0.1.0/aix/agentDownload.aix

Optionally change file agentDownload.aix:
doDiscovery=FALSE
startAgent=FALSE

Install agent:
./agentDownload.aix -b /oracle/oem -r 4889
Port number 4889 is necessary otherwise it will try to use HTTPS and port 1159, which didn’t work in my case.

Run root.sh script

Patch oracle agent
1. install latest OPatch (6880880)
2. apply proper TZ patch (6672979 for Australia)
3. apply recommended patches (PSU and others)

If you are going to use agent on this host then configure agent
agentca –f
Otherwise we don’t need to configure or start agent.

Prepare master archive file
It can be ZIP or TAR.GZ (or something similar)

Advantage of ZIP: it can be used as source file by Grid Control Cloning Wizard (in GC click Deployments > Install Agent > Clone Agent)
Disadvantage of ZIP: unzip cannot read from pipe or standard input, so zip file is copied to target host and then unzipped by Wizard or manual method. It takes bit extra space (1GB) and time.
Advantage of tar.gz: it can be uncompressed directly from SSH or WGET, see examples below
Disadvantage of tar.gz: it cannot be used by Grid Control Cloning Wizard

Prepare exclude list
# CLONE is any temp location
export CLONE=/oracle/software/clones
cd $ORACLE_HOME
find . -name "*.log" >$CLONE/ExcludeList.txt
find . -name "*.err" >>$CLONE/ExcludeList.txt
vi $CLONE/ExcludeList.txt
Add the following to the exclude list. It is taken from OMS host $OH/sysman/prov/agentpush/resources/scripts/exclude.lst
./sysman/upload/*
./sysman/emd/state/*
./sysman/emd/*
./sysman/log/*
./sysman/j2ee/*
./ccr/hosts/*
./ccr/state/*
./sysman/emd/*/*
./sysman/emd/*/*/*
./sysman/emd/*/*/*/*
./ccr/hosts/*/*
./ccr/hosts/*/*/*
./ccr/hosts/*/*/*/*
./bin/nmo
./bin/nmhs
./bin/nmb

Create tar.gz archive
cd $ORACLE_HOME
tar -X $CLONE/ExcludeList.txt -cvf - . | gzip -c >$CLONE/agent11g_home_11.1.0.1.5.tar.gz

Create zip archive
Attention: when you create the ZIP file, create it from the parent directory of the Oracle home (that’s GC wizard requirement)
cd $ORACLE_HOME
cd ..
zip -ry $CLONE/agent11g_home_11.1.0.1.5.zip agent11g -x@$CLONE/ExcludeList.txt 

Copy archived home (zip or tar.gz) to OMS host, e.g.
$ORACLE_HOME/sysman/agent_download/11.1.0.1.0/clones
You can see the files in Web browser
http://omshost:4889/agent_download/11.1.0.1.0/clones/

Deploying agent from tar.gz
Create oracle user on target host
Prepare .profile

Using SSH (method 1):
cd $ORACLE_HOME
ssh oracle@omshost 'cat /oracle/middleware/oms11g/sysman/agent_download/11.1.0.1.0/clones/agent11g_home_11.1.0.1.5.tar.gz' | gunzip | tar xvf –

Using WGET (method 2):
cd $ORACLE_HOME
wget -q -O- http://omshost:4889/agent_download/11.1.0.1.0/clones/agent11g_home_11.1.0.1.5.tar.gz | gunzip | tar xvf -

Run Installer:
cd $ORACLE_HOME/oui/bin
./runInstaller -clone -forceClone ORACLE_HOME=/oracle/oem/agent11g ORACLE_HOME_NAME=OH_agent11g -noconfig -silent OMS_HOST=omshost OMS_PORT=4889

As root
/oracle/oem/agent11g/root.sh

Continue as oracle user
Configure the Management Agent by running the following script:
$ORACLE_HOME/bin/agentca –f

Deploying agent from zip manually
You cannot pipe into unzip. So you have to download zip file to target and then unzip.
wget http://omshost:4889/agent_download/11.1.0.1.0/clones/agent11g_home_11.1.0.1.5.zip
Then run Installer and etc. as in example above.

Deploying agent from zip by Grid Control Wizard
Attention: in this method Oracle Home Name is assigned automatically; it looks something like AGT3561027

In Grid Control click Deployments > Install Agent > Clone Agent
Well, the rest is trivial.

2011-11-28

Editors handy commands

Insert TEXT at beginning of a line
Notepad++
Search mode – regular expression
Find:   
^(.)
Replace with:   
TEXT\1

Vi
:%s/^/TEXT/

Append TEXT to end of a line
Notepad++
Search mode – regular expression
Find:
(.)$
Replace with:   
\1TEXT

Vi
:%s/$/TEXT/

Delete blank lines
Notepad++
Menu: TextFX -> TextFX Edit -> Delete blank lines

vi
:g/^$/d
Blank line with spaces (there is a space after backslash):
:g/^\ *$/d

Find “db.world” and replace with “db, db.world”
Notepad++
Search mode – regular expression
Find:   
^(\w*).world
Replace with:   
\1, \1.world

2011-10-27

Time Zone DST patch for Oracle grid control agent 11g on AIX


Patch 6672979 has to be applied. Product: CORE (not agent!).
This patch installs TZ DST version 7, which includes Australian TZ changes in 2008.
Grid control agent 11.1.0.1.0 has Core Files 11.1.0.7.0

To see Core files for agent run:
opatch lsinventory -detail | grep "Oracle Core Required Support Files"

To see the current time zone info:
head $ORACLE_HOME/oracore/zoneinfo/readme.txt

Proper $TZ for AIX in NSW is:
echo $TZ
EET-10EETDT,M10.1.0/02:00,M4.1.0/03:00

To validate TZ:
echo $ORACLE_HOME
export EMDROOT=$ORACLE_HOME
export EMSTATE=$ORACLE_HOME
emdctl validateTZ agent Australia/Sydney

With TZ DST versions 10 and 14, I had the following errors:
emdctl validateTZ agent Australia/Sydney
tzOffset for Australia/Sydney is 0(min), but agent is runnning with tzOffset 660(min)
trying again after waiting for 1 sec to account for daylight transition
tzOffset for Australia/Sydney is 0(min), but agent is runnning with tzOffset 660(min)

Check the TZ settings in the Operating System environment:
emctl config agent getTZ

Reset time zone:
emctl resetTZ agent
grep TZ $ORACLE_HOME/sysman/config/emd.properties

sqlplus SYSMAN@OMS_repository
exec mgmt_target.set_agent_tzrgn('agenthost.gov.au:3872','Australia/Sydney');
commit;


Start agent
emctl start agent

Useful documents:
DST: Is your Grid Control ready for the next Daylight Saving Time - second half 2010? [ID 739116.1]
Grid Agent Configuration: How to Troubleshoot Timezone Issues in Enterprise Manager Grid Agent Setup? [ID 330737.1]

Recommended patches for agent 11.1.0.1.0 on AIX on 2011-10-26
1. 6880880 - OPatch version: 11.1.0.8.5
2. 6672979 - CORE: Patch DST CHANGES FOR SOME AUSTRALIAN REGIONS IN 2008 - NEED DATABASE FIX (this is TZ DST version 7)
3. 9345921 - ENTERPRISE MANAGER AGENT 11.1.0.1.5 PSU
4. 12424139 - PATCH BUNDLE REQUEST FOR MW MANAGEMENT CUMULATIVE MLR-APRIL 2011 - AGENT