Share the content if you found it is useful (You can share using 300 community websites) click "share" at the end of the post.

You are encouraged to leave a comment.








Showing posts with label Oracle. Show all posts
Showing posts with label Oracle. Show all posts

Friday, January 02, 2009

Opatch - Central Inventory

The Oracle Universal Installer supports the installation of several active Oracle homes on the same host. An Oracle home is a directory into which all Oracle software is installed. This is pointed to by an environment variable. The Oracle home consists of the following:
· Directory location where the products are installed
· Corresponding system path setup
· Program groups associated with the products installed in the home (where applicable)
· Services running from the home

Installing an Oracle Product

When you install an Oracle product, an Oracle home is created.To install the product and create the Oracle home, perform the following steps:

1. Run Oracle Universal Installer.

2. In the Specify Home Details page, enter the Oracle home settings for the installation session.
3. Continue with your installation. Oracle Installation Settings for Specify Home Details page

Enter a name for the Oracle home.
This name identifies the program group associated with a particular home and the Oracle services installed on this home. The Oracle home name must be between 1 to 127 characters long, and can include only alphanumeric characters and underscores.

Path
Enter the full path to an Oracle home, or select an Oracle home from the drop-down list of existing Oracle homes. The Oracle home location is the directory where products are installed.
Data files may or may not be installed within an Oracle home. You can use the Browse button to choose a directory to install your product.


For Windows platforms, you must provide a valid path that is not in the Windows directory. Different homes cannot share the same location.

Note:

Oracle recommends that you designate an Oracle home location that is an empty or non-existing directory. If you select a directory for the Oracle home location that is not empty or already exists, you will be warned and asked if you want to proceed.

For silent installations, if a non-empty, existing directory is specified, an error is logged in the console and in the installActions.log file. Also, the Oracle Universal Installer aborts. To override this condition, use the -force flag on the command line. The effect of using the -force flag is the same as selecting Yes while installing in interactive mode. You receive a warning message, but the installation continues.

Removing Oracle Homes
To remove an existing Oracle home, invoke Oracle Universal Installer and click Deinstall Products. At the inventory dialog, select the homes you want to delete and click Remove. You can also use the REMOVE_HOMES variable in the command line or in a response file. The syntax is as follows:

$./runInstaller -deinstall -silent ORACLE_HOME= "REMOVE_HOMES={}"


Determining the Default Oracle Home
By default, when you start Oracle Universal Installer, the software searches your system to determine the default Oracle home where Oracle software should be installed.

In all cases, the ORACLE_HOME name is taken first from the command line if it is specified, or else from the response file if specified. If not, the following convention is used for the name:

Ora_

Where

is the short product marketing name as specified in the oraparam.ini file; for example, "Db11g", and is a counter derived from the Central Inventory. For example, the ORACLE_HOME name could be OraDb11g_1.

The ORACLE_HOME path is taken first from the command line if specified, or else from the response file if specified. If not, the ORACLE_HOME environment variable is used. If neither is specified, the following conventions are used for the path:

· If ORACLE_BASE has been specified in the environment:·
$ORACLE_BASE/product//_

For example: $ORACLE_BASE/product/11.1.0/Db_1.
· If ORACLE_BASE has not been specified in the environment:· $HOME/product//_

Where is the short product name; for example, "Db", and is picked up based on the existence of the files. For example, the ORACLE_HOME path could be $HOME/product/11.1.0/Db_1.

The instance-related directory location is accepted first from the response file, if specified. If not, the oradata, flash_recovery_area, admin, and doc directories are created under ORACLE_BASE. If ORACLE_BASE has not been specified, the default is the $ORACLE_HOME/oradata directory.

If the parent directory of the Oracle home is writable, these directories are created in the parent directory of the Oracle home.

Multiple Oracle Homes
Oracle Universal Installer supports the installation of several active Oracle homes on the same host as long as the products support this at run-time. Multiple versions of the same product or different products can run from different Oracle homes concurrently. Products installed in one home do not conflict or interact with products installed on another home. You can update software in any home at any time, assuming all Oracle applications, services, and processes installed on the target home are shut down. Processes from other homes may still be running.

Target Home
The Oracle home currently accessed by Oracle Universal Installer for installation or deinstallation is the target home. To upgrade or remove products from the target homes, these products must be shut down or stopped.

Oracle Universal Installer Inventory
The Oracle Universal Installer inventory stores information about all Oracle software products installed in all Oracle homes on a host, provided the product was installed using Oracle Universal Installer.

Inventory information is stored in Extensible Markup Language (XML) format. The XML format allows for easier diagnosis of problems and faster loading of data. Any secure information is not stored directly in the inventory. As a result, during removal of some products, you may be prompted to enter the required credentials for validation.

Structure of the Oracle Universal Installer Inventory
The Oracle Universal Installer inventory has the following hierarchical structure:
· Central Inventory Pointer Directory
· Central Inventory
· Oracle Home Inventory


Central Inventory Pointer File
Every Oracle software installation has an associated Central Inventory where the details of all the Oracle products installed on a host are registered.

The Central Inventory is located in the directory that the inventory pointer file specifies. Each Oracle software installation has its own Central Inventory pointer file that is unknown to another Oracle software installation.

For Oracle homes sharing the same Central Inventory, the Oracle Universal Installer components perform all read and write operations on the inventory. The operations on the Central Inventory are performed through a locking mechanism.

This implies that when an operation such as installation, upgrade, or patching occurs on an Oracle home, these operations become blocked on other Oracle homes that share the same Central Inventory.

The following list shows the location of the inventory pointer file for various platforms:

· Solaris — /var/opt/oracle/oraInst.loc
· Linux — /etc/oraInst.loc
· Windows — The pointer is located in the registry key:· \\HKEY_LOCAL_MACHINE\\Software\Oracle\inst.loc


The following string shows an example of the path for the oraInst.loc file: inventory_loc=/home/oracle_db11g/product/11.1.0/db_1inst_group=oracle

In UNIX, if you do not want to use the Central Inventory located in the directory specified by the inventory pointer file, you can use the -invPtrLoc flag to specify another inventory pointer file. The syntax is as follows:

./runInstaller -silent -invPtrLoc ORACLE_HOME="" ORACLE_HOME_NAME=""

Note:
If the contents of the oraInst.loc file is empty, Oracle Universal Installer prompts you to create a new inventory.


Central Inventory
The Central Inventory contains the information relating to all Oracle products installed on a host. It contains the following files and folders:
· Inventory File
· Logs Directory

Inventory File
This file lists all the Oracle homes installed on the node. For each Oracle home, it also lists the Oracle home name, home index, and nodes on which the home is installed. It also mentions if the home is an Oracle Clusterware home or a removed Oracle home. It can only detect removed Oracle homes created using Oracle Universal Installer version 11.1 and later. This file is present in the following location:

/ContentsXML/inventory.xml
The following code shows a sample inventory.xml file:




11.1.0.0.0 2.1.0.6.0






Note:
Oracle recommends that you do not remove or manually edit this file as it could affect installation and patching.

Logs Directory
The Central Inventory contains installation logs in the following location:

/logs

The logs directory contains the logs corresponding to all installations performed on a particular node. You can also find a copy of the installation log in the $ORACLE_HOME/cfgtoollogs directory.The installation logs for an installation are identified by the timestamp associated with the log files. These files are generally saved in the following format:.log

For example, consider an attachHome operation performed on 17th, May, 2007 at 6.45AM. The associated log file would be created as follows:AttachHome2007-05-17_06-45-00AM.log

Note:
The installation logs do not contain any errors or failures.

Oracle Home Inventory (Local Inventory)
Oracle home inventory or local inventory is present inside each Oracle home. It only contains information relevant to a particular Oracle home. This file is located in the following location:$ORACLE_HOME/inventory
It contains the following files and folders:
· Components File
· Home Properties File
· Other Folders

Components File
This file contains the details about third-party applications like Java Runtime Environment (JRE) required by different Java-based Oracle tools and components. In addition, it also contains details of all the components as well as patchsets or interim patches installed in the Oracle home. This file is located here:ORACLE_HOME/inventory/ContentsXML/comps.xml
For an example of the components file,

Home Properties File
This file contains the details about the node list, the local node name, and the CRS flag for the Oracle home. In a shared Oracle home, the local node information is not present. This file also contains the following information:
· GUID — Unique global ID for the Oracle home
· ARU ID — Unique platform ID. The patching and patchset application depends on this ID.
· ARU ID DESCRIPTION — Platform description

The information in oraclehomeproperties.xml overrides the information in inventory.xml. This file is located here:$ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml
The following example shows the Oracle home property
file:
893051798#.356758136

46 ARU_ID_DESCRIPTION>Linux x86



NAME="stacg34"/>

Below is the list of the ARU_IDs for some platforms:

ARU_IDs for Platforms Platform ARU_ID
HPUX 64-bit 59
IBM 5L 212
Linux 32-bit 46
Solaris 32-bit 453
Solaris 64-bit 23
Windows XP 912

Other Folders
list of the other folders you can find in the Oracle home inventory:
Other Folders in the Oracle Home Inventory
Folder Name Description
Scripts Contains the scripts used for the cloning operation.
ContentsXML Contains the details of the components and libraries installed.
Templates Contains the template files used for cloning.
oneoffs Contains the details of the one-off patches applied.

Creating the Central Inventory
Oracle Universal Installer enables you to set up the Central Inventory on a clean host or register an existing Oracle home with the Central Inventory when it is lost or corrupted. If the Central Inventory does not already exist, Oracle Universal Installer creates the Central Inventory in the location specified by the oraInst.loc file.
You can set up the Central Inventory by using the -attachHome flag of Oracle Universal Installer. The syntax is as follows:

./runInstaller -silent -attachHome -invPtrLoc ./oraInst.loc ORACLE_HOME="" ORACLE_HOME_NAME="""CLUSTER_NODES={}" LOCAL_NODE=""

Using the Session Variables
You can use the following session variables:
· ORACLE_HOME
· ORACLE_HOME_NAME
· CLUSTER_NODES
· REMOTE_NODES
· LOCAL_NODE

In a cluster installation:
· If you do not pass the CLUSTER_NODES session variable, Oracle Universal Installer takes it from the $ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml file.
· If you do not pass the LOCAL_NODE session variable, Oracle Universal Installer takes it from the $ORACLE_HOME/inventory /ContentsXML/oraclehomeproperties.xml file. If it does not find an entry there, it takes it from the Oracle Clusterware stack. If it is not able to find it in the stack, the first node of the CLUSTER_NODES is taken as the LOCAL_NODE.
You can pass the REMOTE_NODES variable if you want to specify the list of remote nodes. If you want to set up the Central Inventory in the local node, you need to pass the -local flag, and the REMOTE_NODES variable is empty.

The syntax is as follows:

./runInstaller -silent -attachHome -invPtrLoc ./oraInst.loc ORACLE_HOME="" ORACLE_HOME_NAME="""REMOTE_NODES={}" -local

Note:
When you use the -local flag, it performs the action on the local node irrespective of the cluster nodes specified.

For a non-Real Application Clusters setup, you do not need to pass the LOCAL_NODE variable, and the CLUSTER_NODES variable is empty.

The syntax is as follows:

./runInstaller -silent -attachHome -invPtrLoc ./oraInst.loc ORACLE_HOME="" ORACLE_HOME_NAME="""CLUSTER_NODES={}"

You can use the -local flag to attach the local Oracle home. If you are using a shared Oracle home with the -local flag, use the -cfs flag. This ensures that the local node information is not populated inside a shared Oracle home.

Verifying the Operation
After attaching the Oracle home, you can verify the success of the operation by verifying the contents of the log file present in the /logs directory. You can also view the contents of the inventory.xml file under the /ContentsXML directory to verify if the Oracle home is registered.

Note:
Oracle recommends cloning on Windows operating systems to create the Central Inventory.
Detaching Oracle Homes from the Central Inventory. You can detach an Oracle home from the Central Inventory. When you pass this flag, it updates the inventory.xml file present in the Central Inventory.

The syntax is as follows:

./runInstaller -silent -detachHome -invPtrLoc ./oraInst.loc ORACLE_HOME="" ORACLE_HOME_NAME=""

Using Optional Flags
You can use the -local flag to detach the Oracle home from the inventory of the local node. If you are using a shared Oracle home, use the -cfs flag. This ensures that the local node information is not populated inside a shared Oracle home.

./runInstaller -silent -local -cfs -detachHome -invPtrLoc ./oraInst.loc ORACLE_HOME="" ORACLE_HOME_NAME=""

./runInstaller -silent -detachHome -invPtrLoc ./oraInst.loc ORACLE_HOME="" ORACLE_HOME_NAME=""

You can completely clean the Oracle home and remove the home directory by using the -removeallfiles flag.

The syntax is as follows:

./runInstaller -silent -deinstall -removeallfiles -invPtrLoc ./oraInst.loc ORACLE_HOME="" ORACLE_HOME_NAME=""

If you want to disable the warning message that appears when you use the -removeallfiles flag, use the -nowarningonremovefiles flag.

The syntax is as follows:

./runInstaller -silent -deinstall -nowarningonremovefiles -invPtrLoc ./oraInst.loc ORACLE_HOME="" ORACLE_HOME_NAME=""

Removing the Central Inventory
Even after all the Oracle homes on a host are removed, you will find traces of the inventory with certain log files. If you do not want to maintain these files and want to remove the Central Inventory, do the following:

Removing the Central Inventory on UNIX Platforms

You can remove the Central Inventory on UNIX by performing the following steps:
1. Locate the oraInst.loc file and get the Central Inventory location (inventory_loc parameter) from this file.

For Solaris, this file is located in the /va/opt/oracle folder.
For Linux, this file is located in the /etc folder.

2. Remove the Central Inventory by executing the following command:

3. rm -rf

4. Remove the oraInst.loc file by executing the following command with root privileges:

Solaris:rm /va/opt/oracle/oraInst.loc
Linux:rm /etc/oraInst.loc

Removing the Central Inventory on Windows Platforms
You can remove the Central Inventory on Windows by performing the following steps:
1. Locate the registry key:
\\HKEY_LOCAL_MACHINE\Software\Oracle\inst_loc
2. Get the Central Inventory location from this key.
3. Delete the Central Inventory directory and all its contents.
4. Delete the registry key:
\\HKEY_LOCAL_MACHINE\Software\Oracle\inst_loc

Consolidating Multiple Central Inventories
The following procedure explains how to consolidate multiple central inventories into a single central inventory. For CRS and RAC homes, perform this procedure for each node.
1. Identify the central inventory to use and ensure that it is the same path on all nodes of the cluster.
2. Go to this central inventory directory and run orainstRoot.sh to ensure that the oraInst.loc file points to this inventory.
3. Identify the other central inventories on the system, then identify the Oracle homes for each central inventory.
4. Do the following for each Oracle home:
a. Enter cd $ORACLE_HOME/oui/bin.
b. Run ./attachhome.sh -silent -local "CLUSTER_NODES={}" LOCAL_NODE=
For single instance homes, run ./attachhome.sh -silent.
c. Verify the inventory updates by going to the ORACLE_HOME/OPatch directory and running opatch lsinventory -detail.
d. Verify that the overall inventory is being updated by running ./runInstaller and clicking on 'Installed Products...' to bring up the contents of the central inventory. Ensure that the inventory shows the new home and the nodes.


Upgrading and Patching the Oracle Home
You can apply patchsets and upgrade an existing Oracle home. You can apply patchsets using Oracle Universal Installer. For more information on upgrading or applying patchsets for an Oracle product, refer to the respective Oracle product installation guide of the product that you want to upgrade.

Cloning Oracle Homes
You can clone an Oracle home using Oracle Universal Installer.

Backing up the Inventory
You can back up the Oracle home using your preferred method.

You can use any method such as zip, tar, and cpio to compress the Oracle home.

It is highly recommended to back up the Oracle home before any upgrade or patch operation. You should also back up the Central Inventory when Oracle home is installed or deinstalled.

Example:
Consider a scenario where you have a Database Oracle home called DBHome that is registered with the default Central Inventory in the /product directory. You want to patch this database but decide to back up the database before patching.

1. Enter the following to back up the database:

2. cd /product/DBHome

3. tar cf - * gzip > /product/archive/DBHome.tar.gz

4. If you are using a Win32 system, you could use WinZip to zip up the Oracle home. Do not use the jar command to zip the Oracle home, as this causes the file permissions to become lost.

5. Suppose you apply the patch and something goes wrong. You decide to delete the Oracle home from the Central Inventory and restore the original Oracle home. To delete the Oracle home from the Central Inventory, use the following command:

./runInstaller -silent -detachHome ORACLE_HOME="/product/DBHome"7. ORACLE_HOME_NAME="DBHome"

On Win32 systems, the command would be:setup.exe -silent -detachHome ORACLE_HOME="C:\product\DBHome"ORACLE_HOME_NAME="DBHome"

7. Delete the Oracle home:

cd /product10. rm -rf /product/DBHome


Restore the original Oracle home and update the Central Inventory.

Restore the Oracle home to its original location using the following commands:

mkdir -p /product/DBHome

gunzip < /product/archive/DBHome.tar.gz tar xf -
Attach this Oracle home to the Central Inventory:

./runInstaller -silent -attachHome ORACLE_HOME="/product/DBHome"16. ORACLE_HOME_NAME="DBHome"

On Win32 systems, the command would be:
setup.exe -silent -attachHome ORACLE_HOME="C:\product\DBHome"ORACLE_HOME_NAME="DBHome"
Recovering from Inventory Corruption

The inventory (Central and the Oracle home inventory) is critically important in the Oracle software life-cycle management. The following section explains what you need to do in case of inventory corruption.

Diagnosing and Recovering from Central Inventory Corruption
When you execute opatch lsinventory -detail or when you click Installed Products, the Oracle home does not appear.

Cause: The Oracle home may be missing from the Central Inventory, or the Central Inventory could be missing or corrupted.


Action:
Do the following:
· If the Oracle home is missing from the Central Inventory, perform an attach home operation on the missing Oracle home. The Central Inventory will be restored.
· If the Central Inventory is missing or corrupted, restore the Central Inventory. If you have not backed up the Central Inventory, perform an attach home operation.

If multiple entries are in the inventory.xml file for a given Oracle home, Inventory Collection from the Grid Control perspective would have issues. In this event, you should remove these duplicate entries manually.

Here are some examples of the kind of incorrect entries that could be there:


In the above example, the first and third entries are duplicates. The Oracle home name and Oracle home location are identical. In this example, remove the third line.

Note that all duplicate inventory issues are caused by manual updates to the inventory.xml file. Use the OUI APIs to change the inventory.

Diagnosing and Recovering from Oracle Home Inventory Corruption
When you execute opatch lsinventory -detail or when you click Installed Products, the Oracle home appears, but the products and components within the Oracle home are not listed.

Cause: This may result because of a missing or corrupted Oracle home inventory.
Action:
If the Oracle home inventory is missing or corrupted, restore the Oracle home inventory. If you have not backed up the Oracle home inventory, you may have to install the software on a different node with the same platform and install the same patch levels including interim patches. After that, you can simply copy the inventory directory from the patched Oracle home to the location of the affected Oracle home.

Note:
For Oracle Universal Installer version 10.2.0.2.0 and above, you can use the following scripts in Oracle home to recover from Oracle home inventory corruption:
· detachHome.bat / detachHome.sh: Use this script if the Oracle home is corrupted or needs to be updated.
· attachHome.bat / attachHome.sh: Use this script if the Oracle home needs to be added to the inventory.

Real Application Clusters
In a Real Application Clusters environment, the inventory also contains a list of nodes associated with an Oracle home. It is important that during upgrade and patching, the inventory is correctly populated with the list of nodes.

Updating the Nodes of a Cluster
When you use the -updateNodeList flag with the Oracle Universal Installer, it retrieves the list of nodes and updates the inventory.xml file. If the CRS tag is set to TRUE, the Oraclehomeproperties.xml file is updated with the Oracle Clusterware home information. For shared Oracle homes, you need to use this with the -cfs flag. The syntax is as follows:

./runInstaller -updateNodeList "CLUSTER_NODES={Node1,Node2}" ORACLE_HOME="" ORACLE_HOME_NAME="" LOCAL_NODE="Node_Name"

Note:
You update the nodes of a cluster only under exceptional circumstances. Oracle recommends that you perform this operation with the help of Oracle support.

Diagnosing and Recovering from RAC Oracle Home Inventory Corruption

When you execute opatch lsinventory -detail or when you click Installed Products, the Oracle home appears, but the products and components within the Oracle home are not listed.

Cause: This may result because of a missing or corrupted Oracle home inventory.
Action: Do the following:
1. Back up the Central and Local inventories of both CRS and RDBMS for all nodes.
2. Rename or remove the Central Inventory on all nodes.
3. Copy the Local Inventory from the node that is not corrupted to the node that is corrupted.
4. Recreate the Central Inventory with the attachhome option as in MetaLink note 413939.1, Steps to Recreate the Central Inventory in Real Application Clusters.
5. Verify that opatch lsinventory functions correctly in both the CRS and RDBMS homes.
Note:

Copying the Local Inventory is supported only when patch sets and one-off patches applied are the same across all nodes.

Home Selector (Available on Win32 Platforms)
The following sections describe the Home Selector, which is installed as part of Oracle Universal Installer on Windows computers.

To view the Home Selector, click the Environment tab of the Inventory dialog, which appears when you click the Installed Products button on several Oracle Universal Installer screens.
Home Selector Overview

The Home Selector is a part of the installation software. The Home Selector enables you to easily change your primary Oracle home (the one that appears first in the PATH environment variable). If you need to switch the active home or need to perform batch work which requires a "default home" to be active, you can use the Home Selector to change the Windows NT system settings.

When using the Home Selector to make a specific Oracle home the active one, the software installation in question is moved to the front of the PATH variable, making it the first directory to be scanned for executable and library files.

Use the GUI in the Environment tab of the Inventory dialog to establish the order of Oracle homes in your PATH variable.

How Home Selector Works

When you perform an installation on a system, Oracle Universal Installer runs the selectHome.bat file to register the Oracle home you selected. In silent mode, you perform this outside Oracle Universal Installer. The first Oracle home is named the "DEFAULT_HOME" and registers itself in the Windows NT registry under the key

:HKEY_LOCAL_MACHINESoftwareOracle

This is the default Windows NT registry hive which contains all the "generic" Oracle settings. Also the PATH variable is adjusted and the BIN directory of the $ORACLE_HOME is added to the environment variable.

Some additional parameters is also written to the key:

HKEY_LOCAL_MACHINESoftwareOracleKEY_

With Oracle Universal Installer, you can change the "DEFAULT_HOME" name to something else. Also, it registers all Oracle settings in the "KEY_" sub-key of the ORACLE key.

When an additional Oracle home is added to the system, the PATH variable is adjusted again to add the new BIN directory of the newly installed Oracle software. The registry variables are written to a key named "KEY_".

Oracle Home Directory Structure for Windows Platforms
A typical Oracle home on Windows platforms contains the files and directories shown

Oracle Home Directory for Windows Platforms
Oracle Home Directory Contents
\BIN Product executable and DLLs
\LIB DLL files
\JLIB All JAR files
\DBS Common message files
\PROD1 PROD1 product files
\PROD2 PROD2 product files

Optimal Flexible Architecture Directory Structure (on UNIX)

The Optimal Flexible Architecture (OFA) standard is a set of configuration guidelines for fast, reliable Oracle databases that require little maintenance.

OFA is designed to:
· Organize large amounts of complicated software and data on disk to avoid device bottlenecks and poor performance
· Facilitate routine administrative tasks such as software and data backup functions, which are often vulnerable to data corruption
· Alleviate switching among multiple Oracle databases
· Adequately manage and administer database growth
· Help eliminate fragmentation of free space in the data dictionary, isolate other fragmentation, and minimize resource contention

The OFA directory structure is described in the following sections.
ORACLE_BASE Directory
ORACLE_BASE specifies the BASE of the Oracle directory structure for OFA-compliant databases. A typical ORACLE_BASE directory structure is described below.

When installing an OFA-compliant database using Oracle Universal Installer, ORACLE_BASE is set to /pm/app/oracle by default.
Sample ORACLE_BASE Directory Structure and Content

Directory Content
admin Administrative files
doc online documentation
local Sub-tree for local Oracle software
product Oracle software

ORACLE_HOME Directory
Below table shows an example of the Oracle home directory structure and content for an Oracle Server Installation.

If you install an OFA-compliant Oracle Server, the Oracle home directory is

/mount_point/app/oracle/product/release_number.

Under UNIX, the Oracle home directory might contain the following subdirectories, as well as a subdirectory for each Oracle product selected.

Note:
The directory and content information in this table are only samples. The directories that appear in your own Oracle home depend on whether the corresponding products are installed and the version of the Oracle Database you are running.

Sample Oracle Home Directory Structure and Content

Directory Content
assistants configuration Assistants
bin binaries for all products
ctx interMedia Text cartridge
dbs initsid.ora, lksid
install install related files
lib Oracle product libraries
jlib Java classes
md Spatial cartridge
mlx Xerox Stemmer (for interMedia Text cartridge)
network Net8
nlsrtl NLS run-time loadable data
ocommon common files for all products
odg data gatherer
opsm Parallel Server Manager Components
oracore core libraries
ord data cartridges
otrace Oracle TRACE
plsql PL/SQL
precomp precompilers
rdbms server files and libraries required for the database
slax SLAX parser
sqlplus SQL*Plus

Friday, December 26, 2008

Dataguard: Physical Standby Database

In this post I described in detail the way in which we can configure a Dataguard for Oracle Databases. Here the instance is of 11g.

Oracle Database 11g RMAN introduces the FROM ACTIVE DATABASE capability to the DUPLICATE FOR STANDBY command. This alleviates the previous need for interim storage on both the Primary and Standby systems, and the limitation of single stream network traffic.

Now when taking the backup of the Primary database you can simultaneously create and restore the standby database over the network in parallel streams. Apart from some simple Oracle Net setup, and creating a couple of directories and an interim password file, the whole standby creation can be done in one RMAN script.

RMAN will automatically copy the server parameter file to the standby host, start the auxiliary instance with the server parameter file, restore a backup control file, and copy all necessary database files and archived redo logs over the network to the standby host.

Prerequisites

1.

Perform an Oracle Database 11g installation (software and db installed) for a single server environment OR Oracle Database 11g installation (software and db installed) on 1 server and Oracle Database 11g software only on 2nd server for a dual server environment.



Please Save the following script as we need to run during this process.

1. Script for RMAN:

run {
allocate channel prmy1 type disk;

allocate channel prmy2 type disk;

allocate channel prmy3 type disk;

allocate channel prmy4 type disk;

allocate auxiliary channel stby type disk;


duplicate target database for standby from active database

spfile

parameter_value_convert 'orcl','orclsby1'

set db_unique_name='orclsby1'

set db_file_name_convert='/orcl/','/orclsby1/'

set log_file_name_convert='/orcl/','/orclsby1/'

set control_files='/u01/app/oracle/oradata/orclsby1.ctl'

set log_archive_max_processes='5'

set fal_client='orclsby1'

set fal_server='orcl'

set standby_file_management='AUTO'

set log_archive_config='dg_config=(orcl,orclsby1)'

set log_archive_dest_1='service=orcl ASYNC
valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=orcl'

;

2. Create Standby logfile (cr_sby_redologs.sql)

alter database add standby logfile
('/u01/app/oracle/oradata/orcl/srl01.log',
'/u01/app/oracle/oradata/orcl/srl02.log',
'/u01/app/oracle/oradata/orcl/srl03.log',
'/u01/app/oracle/oradata/orcl/srl04.log')
size 52428800

/

3. Query for Archived Logs (query_archived_log.sql)

SELECT sequence#, first_time, next_time

FROM v$archived_log
ORDER BY sequence#
/


Preparing the Primary Database for Standby Database Creation

You verify that the primary database is configured correctly to support a physical standby database.

You only need to perform these preparatory tasks once. After you complete these steps, the database is prepared to serve as the primary database for one or more standby databases. You should perform the following steps:

1.

Determine if FORCE LOGGING is enabled. If it is not enabled, enable FORCE LOGGING mode. This statement may take some time to complete, because it waits for all unlogged direct write I/O to finish. You use the following commands:

Select FORCE_LOGGING from V$DATABASE;

ALTER DATABASE FORCE LOGGING;

2.

Configure redo transport authentication.

Data Guard uses Oracle Net sessions to transport redo data and control messages between the members of a Data Guard configuration. These redo transport sessions are authenticated using either the Secure Sockets Layer (SSL) protocol or a remote login password file.

In this blog, we will be using a remote login password file which will be created in a subsequent step.

3.

Configure the primary database to receive redo data, by adding the standby logfiles to the primary. You can use the cr_sby_redologs.sql script, after validating the directory paths reflect your environment.

It is highly recommended that you have one more standby redo log group than you have online redo log groups as the primary database. The files must be the same size or larger than the primary database’s online redo logs.

SQL> alter database add standby logfile
2 '/u01/app/oracle/oradata/orcl/srl01.log' size 52428800
3 /
Database altered.
SQL> alter database add standby logfile
2 '/u01/app/oracle/oradata/orcl/srl02.log' size 52428800
3 /
Database altered.
SQL> alter database add standby logfile
2 '/u01/app/oracle/oradata/orcl/srl03.log' size 52428800
3 /
Database altered.
SQL> alter database add standby logfile
2 '/u01/app/oracle/oradata/orcl/srl04.log' size 52428800
3 /
Database altered.
 

4.

Set primary database initialization parameters

On the primary database, you define initialization parameters that control redo transport services while the database is in the primary role. You use SQL commands similar to the following to verify these settings:

Ensure the following parameters are set to reflect the Data Guard configuration.

DB_NAME Specifies the database name. Must be orcl.
DB_UNIQUE_NAME Specify a unique name for each database. Does not change even if DG roles change. Must be orcl.
CONTROL_FILES Specifies the local path name for the control files on the primary database.
LOG_ARCHIVE_CONFIG Uses the DG_CONFIG attribute to list the DB_UNIQUE_NAME of the primary and standby databases.
LOG_ARCHIVE_DEST_1 Defaults to archive destination for the local archived redo log files.
LOG_ARCHIVE_DEST_2 Valid only for the primary role, this destination transmits redo data to the remote physical standby destination orclsby1.
REMOTE_LOGIN_PASSWORDFILE Must be EXCLUSIVE or SHARED if a remote login password file is used (default = EXCLUSIVE)
LOG_ARCHIVE_DEST_STATE_n Must be ENABLE (default)

Use the following commands to set the LOG_ARCHIVE_CONFIG and LOG_ARCHIVE_DEST_2 indicating the primary and standby databases.


5.

Issue the following statements to determine your database's archival state, and then put the primary database in ARCHIVELOG mode to enable automatic archiving.


In this practice, you configure the network environment and create a physical standby database.

NOTE: In this blog, you configure the network for a single server environment. If you are configuring an environment on two different servers, you would need to configure Net Manager on both servers accordingly.


A. Use Oracle Net Manager to create an Oracle Net service name for your physical standby database.

1.

Launch Net Manager.

2.

Expand Local. Select Service Naming and click the green plus sign

3.

Enter your (i.e. orclsby1) in the Net Service Name field and click Next

4.

Select TCP/IP (Internet Protocol) and click Next

5.

Enter your fully qualified and click Next.


6.

Enter your in the Service Name field and click Next


7.

Click Finish.

8.

Click File -> Save Network Configuration to save the information to the tnsnames.ora file.


B. Use Oracle Net Manager to configure an entry for your standby database in the listener.ora file.

1.

Expand Listeners

2.

Select LISTENER.

3.

Select Database Services in the drop-down list.

4.

Click Add Database.

5.

Enter your in the Global Database Name field. Enter your and your in the SID field.


6.

Select File -> Save Network Configuration.

7.

Select File -> Exit.


C. Creating the standby database over the network

1.

Reload the listener.



$lsnrctl reload


2.

Navigate to ORACLE_HOME/dbs folder to perform this steps.

Copy the remote login password file (orapworcl) from the primary database system to the standby database system, renaming it to orapworclsby1.

The password file must be re-copied each time the SYSDBA or SYSOPER privilege is granted or revoked and whenever the login password of a user with these privileges is changed. You may need FTP, or some other remote file transfer mechanism, if you are using differenet servers.



3.

In the ORACLE_HOME/dbs folder, for the standby system, create an initialization parameter file named initorclsby1.ora containing a single parameter: DB_NAME=




4.

For the standby system, change to the /u01/app/oracle/admin directory. Create your (i.e. orclsby1) directory. Change to your (i.e. orclsby1) directory and create the adump directory.




5.

For the standby system, create your (i.e. orclsby1) directory in $ORACLE_BASE/oradata for the data files.

NOTE: Depending on how you installed Oracle Database 11g, you may need to also add the following directory paths: $ORACLE_BASE/flash_recovery_area and $ORACLE_BASE/oradata

6.

On the standby system, set the ORACLE_SID environment variable to your (i.e. orclsby1) and start the instance in NOMOUNT mode with the text initialization parameter file.



7.

On the primary system, ensure the ORACLE_SID environment variable is set to your primary DB (i.e. orcl).




8.

On the primary system, invoke RMAN and connect as SYSDBA to the target database. Connect to the auxiliary database.



9.

Execute the script no.1 from prerequisite of this blog for RMAN on the primary system. When this script finishes you will have a new standby database that was created over the network without any interim storage.










 
10.

Perform a log switch on the primary database and redo will start being sent to the standby.


11.

On the standby system, ensure the ORACLE_SID environment variable is set to your (i.e. orclsby1) and start the MRP process.




Verify that the Physical Standby Database is Performing Correctly

Once you create the physical standby database and set up redo transport services, you may want to verify database modifications are being successfully transmitted from the primary database to the standby database. To see that redo data is being received on the standby database, you should first identify the existing archived redo log files on the standby database, force a log switch and archive a few online redo log files on the primary database, and then check the standby database again. The following steps show how to perform these tasks.

1.

On the standby database, identify the existing archived redo log files by querying the V$ARCHIVED_LOG view.

You can use the query_archived_log.sql file.


2.
On the primary database, issue the ALTER SYSTEM SWITCH LOGFILE statement to force a log switch and archive the current
online redo log file group.

3.

On the standby database, re-query the V$ARCHIVED_LOG view to verify the redo data was received and archived on the standby database:


4.

On the standby database, query the V$ARCHIVED_LOG view to verify the archived redo log files were actually applied. Please requery until you see a YES in the APPLIED column.

At the completion of this step, the physical standby database is running and provides the maximum performance level of data protection.

Monday, December 22, 2008

Transport Tablespace (Scripts) - 8 steps!!!

source:

1. select owner|| '.' ||, segment_type,tablespace_name from dba_segments where tablespace_name in ('tablespace_name')

if you want to add any user then

create user identified by password;

grant connect, resource to

2. alter tablespace read only;

3. execute dbms_tts.transport_set_check('tablespace_name',TRUE);

4. select * from transport_set_violations;

-- This should return 'NO ROWS SELECTED'

Export:

exp "'/as sysdba'" file = exp_tts.dmp log=exp_tts.log transport_tablespace=y tablespaces= tablespace_name

5. copy the .dmp file to target $ORACLE_HOME

6. Copy the datafile to target destination

Destination:

if you want to create user

then

create user identified by password;

grant connect, resource to

7. Import

imp "'/as sysdba'" file=exp_tts.dmp log=imp_tts.log fromuser = touser=newuser if created transport_tablespace=y datafiles=

source and destination

8. alter tablespace read write;

Friday, December 19, 2008

Printer and Pasta configuration on Oracle Applications

Setting up printer in Linux OS (Remote printer configuration)
- Run printtool as root
Illustration I: Printtool Command in Linux


Click new from the popup


Adding a New Print Queue
Here I gave name as HPLaser2105 and short description as HPLaserJet printer in Abdulla Machine (Just to identify)

Defining a Print Queue
You select queue type from the drop-down combo box (Networked Windows (SMB))

Select Queue Type
You click specify from the window.
Select Windows SMB

Here is the configuration window
Configuration - Printer residing Machine
It is finished with configuring. (It will be like (specified))
Configuration - Note the word (Specified)
Next Select printer model, Here I selected PCL6/PCL XL Printer
Note for PCL from Provider


Next Test Print from the printer (It should be printed!) else review the steps.
Test Page Print
After configuration the printer configuration will be like this.
Finish Printer Configuration
You should share, and make the printer as default by clicking edit.

Now the Applications Configuration:
Login as sysadmin and navigate to system administrator then Install:Printer
Then navigate to Driver. Here I created HPLASER2105 (Printer type)
Selected SRW driver as L
Driver method as command and driver method parameters as Spool File
Arguments as
: lp –c –d$PROFILES$.PRINTER –n$PROFILES$.CONC_COPIES –t"$PROFILES$.TITLE" $PROFILES$.FILENAME
To test the argument, please run this command in os command
$lp –c –d -n1 –t"Print Test"
Here I used (example)
lp –c –dHPlaser2105 –n1 –t"Print Test" sqlnet.log


Command Line : Printer command for Linux (telnet)

The printer should work. This is the command we are going to pass as argument in Oracle Apps

Define Printer Driver from SYSADMIN -> Install Print. Provide SRW Driver as L for Landscape
You next navigate to
Install printer -> style
You query for Landscape with SRW driver as L

Look for SRW Driver L for Landscape
Then move to Printer Types
Here you have to define a new type called Hplaser2105 and description as PCL

Create a new Printer TYPE
You select as HPPD, HPW, LANDSCAPE, LANDWIDE,PORTRAIT, PORTRAITLASERCHECK, RL1PAPER styles and correspondence driver files with HPLJ4.

Now. You register the printer
Install:Printer-> Register

Registering Printer
Here I have defined the printer as HPLASER2105, Selected type as HPLASER2105 and Description as Windows Remote Printer Configuration.

Set Profile option for Printer at site level – Most important.

That’s all, we completed. Now
1. Bounce the concurrent Service. It is most important. Whenever, you are doing modification with printer, you should do bouncing the concurrent service.

2. Now run a concurrent request to print a report

3. Here Selected Active users


Print Test with any report (Here I used Active Users)
Click Options.
There you select copies as 1.


Then submit with OK
Now, the concurrent manager should complete with status completed normal. Review the log file.
If any thing happened in middle, please review the steps. Thats All.. Finished Printer configuration in Oracle Applications.

Installing PASTA (FNDPSTAX)
Pasta is Oracle Application utility to convert text report files to Post Script so that these can be printed by PostScript Printers. Executable name for Pasta is FNDPSTAX. For various printing options via Pasta, you can use pasta configuration file called as pasta.cfg

The pasta.cfg is there in $FND_TOP/resource.

Copy the Pasta.cfg to Pasta_(Your printername).cfg. (Oracle recommends to copy the name to your printer name) PASTA makes it easy to customize your printing configuration very easy. So use the OS Printer name to define the Pasta.
1. Replace printer_name parameter in pasta.cfg as one with your OS printer name. Here my printer name is HPlaser2105
The command lp –c –d{printername} should print with command line.
Please check before you make changes with your pasta.cfg.
Screen Shot.
Save and exit.
Login to Oracle Apps as System admin
Navigation Path: Install -> Printer ->Driver -> create a driver, PASTA_PORTRAIT. There will be default PASTA-DRIVERS in built with Oracle Apps, We can use them.
For Portrait -> use SRW driver as P
For LANDSCAPE -> use SRW driver as L
For LANDWIDE -> use SRW driver as LW
You please check the Spool File and program name as FNDPSTAX.
Next:
Install -> Printer -> Type
Here I have created PASTA_POSTSCRIPT_HPLASER2105 with all the drivers.
Then you register.
Install -> Printer -> Register.
Save and Exit.

Restart your concurrent Manager (Important)


Check with Active Reports
You please note, the language I selected As Arabic and PASTA as the printer. Submit the request, It should completed normal. In case any problem in the middle, then review the steps.
Cheers!!!

Thursday, December 11, 2008

Enable Event level Trace in Oracle Applications

February 11, 2008

We need to generate the trace for some application user (either Apps 11i or E-business suite R12). In this case when a user connects to an application its very difficult to track the session.

For this reason we have a profile option, which can be set to generate trace file for any event we want within the application.

Follow the below steps for enabling the event level tracing within an application.

1) Login to application and go to “System Administrator” responsibility.

2) Navigate to “Profile -> System”

3) In the user field, enter the name of user you want to enable tracing for. This will be your application user.

4) On the profile search screen search for “Initialization SQL Statement - Custom” profile.

5) When the profile is shown you can set the value as

begin

fnd_ctl.fnd_sess_ctl(”,”,’TRUE’,'TRUE’,'LOG’,'ALTER SESSION SET EVENTS=”10046 TRACE NAME CONTEXT FOREVER, LEVEL 12” tracefile_identifier=”AppsTrace_10046”’); end;

All the quotes are single quote here. You can just copy and paste the profile value.

6) DO NOT SAVE THE PROFILE

7) In another browser window, login as the user you are going to trace and prepare to reproduce the problem

8 ) Once you are ready to reproduce the problem, go back to the Applications Forms and Save the profile change

9) Reproduce the problem

10) Back in the Applications form, set profile to null so it does not trace anymore and Save the change

11) The trace will be located in the user_dump_dest. The trace can be identified using the trace identifier we have set - “AppsTrace_10046″. If you have set some different identifier, then you can search using that key word.



February 11, 2008

Custom Top in Oracle Application - Creation & Registering

CUSTOM TOP (Registering Custom Application)
Balaji R S

These are all the steps to register a custom top and custom application with Oracle Apps
Create xxncm as custom top, user, schema, application name....

Steps:
Created the directory structure for your custom application files under $APPL_TOP/xxncm
cd $APPL_TOP
mkdir xxncm
mkdir xxncm/11.5.0
mkdir xxncm/11.5.0/admin
mkdir xxncm/11.5.0/admin/sql
mkdir xxncm/11.5.0/admin/odf
mkdir xxncm/11.5.0/sql
mkdir xxncm/11.5.0/bin
mkdir xxncm/11.5.0/reports
mkdir xxncm/11.5.0/reports/US
mkdir xxncm/11.5.0/forms
mkdir xxncm/11.5.0/forms/US
mkdir xxncm/11.5.0/$APPLLIB
mkdir xxncm/11.5.0/$APPLOUT
mkdir xxncm /11.5.0/$APPLLOG

Added entry XXNCM_TOP=/apps/oracle/visappl/xxncm in Enviornment file.

export XXNCM_TOP
You can source all the environment files before proceeding.

Create new tablespace for database objects

create tablespace xxncm datafile '/apps/oracle/visdata/xxncm.dbf' size 10M;

Create schema

SQL> create user xxncm identified by xxncm default tablespace xxncm
temporary tablespace temp quota unlimited on xxncm quota unlimited on temp;

SQL> grant connect, resource to xxncm;

Register your Oracle Schema

Login to Applications with System Administrator responsibility

Navigate to
Application–>Register

Application = Custom Application

Short Name = xxncm

Basepath = xxncm_TOP

Description = Custom Application

Register Oracle User

Naviate to
Security–>Oracle–>Register

Database User Name = XXNCM

Password = XXNCM

Privilege = Enabled

Install Group = 0

Description = Custom


Tuesday, December 09, 2008

Upgrade JInitiator

Upgrading Jinitiator in Oracle 11i
Balaji R S [11/09/2008]

Oracle JInitiator is basically available on two streams of JDK for Oracle Applications 11i customers. One stream is based on Jinitiator version 1.1.8.X version and another stream is based on 1.3.1.X version. As JDK 1.1.8 has long been desupported by Sun, Oracle will continue to provide critical updates to Jinitiator 1.1.8 through the desupport date for Release 11.0; Oracle strongly recommends that Oracle Applications 11i customers move to the latest certified version of JInitiator 1.3.1.x. In some cases, migration to JInitiator 1.3.1.x requires additional technology upgrades.

Many a times you might face a situation where you need to upgrade your Jinitiator version to
the latest version available. Also some times users are unable to open the forms. When they click on forms, system constantly ask for jinitiator upgrade, and even after upgrading the Jinititator system keeps on asking to install the same version again and again. This happens because of fundamental reason — Your client system is not having correct version of Jinitiator then your application is at currently. Example the situation might be that your client PC is having a Jinitiator version of 1.3.1.18 where as your application expects a Jinitiator version of 1.3.1.25. In that case when you click on the forms window it will automatically ask you for installation of required Jinitiator version. But note that installation of required Jinitiator version is only one time job. Next time click on forms should open the forms window correctly.

Reason for asking to install Jinitiator repeatedly is that if your application system is not having
a correct version of Jinitiator then it will prompt to install the highest available version with it. If this version happens to be lower version then the required then it will repeatedly as you to install the same Jinitiator version again and again.

This problem has two solutions. First solution is to download the correct version of Jinitiator
manually and install in your client PC.

Another solution is to upgrade your Jinitiator version in application system. This will put the correct Jinit exe in your application which will be downloaded and installed first time when you click on forms. With proceeding clicks it will open up the forms correctly. This post explains about upgrading Jinitiator version of your application system.

For more details, please refer to metalink note ID 124606.1.


Upgrading JInitiator for application system

For upgrading JInitiator version of your application, you need to apply 2 patches as given below depending on your Jinitiator current version.
JInitiator Version JInitiator Patch Interop Patch
1.3.1.29 6350285 6169479
1.1.8.27 6612584 6615232

In the JInitiator patch (6350285 or 6612584) , there will be jinit*.exe. You can extract this exe file by unzipping the patch.
Once the exe file is extracted, place the exe file at $COMMON_TOP/util/jinitiator/ directory.
This is the place from where the jinitiator will be downloaded in your local client PC. After placing the exe, apply the interop patch for the respective version using the following steps.
1) Apply the patch driver in the interop patch using AutoPatch.
2) Run the jinit.sh script from the
//fnd/patch/115/bin/ directory, against the web node
of your middle tie.
The usage of the script is
jinit.sh
Example: jinit.sh 13129
(If you are upgrading to 1.3.1.29 version).
The script will return the appropriate file, or prompt you for the following values:
Location of APPSORA.env file (This is located in APPL_TOP) Location of Context File (echo $CONTEXT_FILE will give the location of context file) Password for the APPS User in the database This will make the necessary changes to the application system and JInitiator version is now upgraded. You can bounce the services now and access the application. This will download the correct latest JInitiator version that you have upgraded to your local PC and it will install. You will be able to access the forms as well correctly.
You can verify the JInitiator version that you have upgraded by enabling the Jinitiator’s console as per the steps given in metalink note ID 124606.1.
References:
Metalink note ID 124606.1
Related Posts Plugin for WordPress, Blogger...

Let us be Friends...

Share |

Popular Posts

Recent Comments