IN ORACLE MILIEU …

January 6, 2010

Unlocking the locked table

Filed under: Database 10g Performance Tuning, Oracle Database 10g — advait @ 6:27 am

Some times we get an error while running a DDL statement on a table. something like below

SQL> drop table aa;
drop table aa
*
ERROR at line 1:
ORA-14452: attempt to create, alter or drop an index on temporary table already
in use

This happens because some other session is using this table or having a lock on this table.

Following is the simple procedure to kill the session holding the lock on this table and drop the table. Note that this should be done only if you are sure that this table is no more required and all sessions holding lock on this table can be deleted

1. Get the object ID of the table to be dropped

SQL> select object_id from dba_objects where object_name = 'AA';
 OBJECT_ID
----------
   3735492
2. Get the session ID which is holding lock on this object from v$locked_object view
SQL> select OBJECT_ID, SESSION_ID, ORACLE_USERNAME, PROCESS from v$locked_object where OBJECT_ID = 3735492;
 OBJECT_ID SESSION_ID ORACLE_USERNAME                PROCESS
---------- ---------- ------------------------------ ------------------------
   3735492       1124 MSC                            4092@AKPRADH-LAP
3. Get the serial# of the SID using v$session
SQL> select sid, serial# from v$session where sid = 1124;
       SID    SERIAL#
---------- ----------
      1124      51189
4. Kill the session by connecting as sysdba and try dropping the table
SQL> alter system kill session '1124, 51189';
System altered.
SQL> drop table aa;
Table dropped.
Once the locks are removed, you should be able to drop the table.
Hope this helps !!

December 22, 2009

Using Transportable Tablespace in Oracle Database 10g

Introduction:

Oracle’s transportable tablespace feature allows users to quickly move a user tablespace across Oracle databases.  It is the most efficient way to move bulk data between databases.

Moving data using transportable tablespaces can be much faster than performing either an export/import or unload/load of the same data. This is because transporting a tablespace only requires the copying of datafiles and integrating the tablespace structural information. You can also use transportable tablespaces to move both table and index data, thereby avoiding the index rebuilds you would have to perform when importing or loading table data

Prior to Oracle Database 10g, if you want to transport a tablespace, both source and target databases need to be on the same platform

Oracle Database 10g adds the cross platform support for transportable tablespaces. With the cross platform transportable tablespace, you can transport tablespaces across platforms.

Endian Formats:

Even if your source and target platforms are compatible or same, you wont be able to transport the tablespace from source platform to target platform directly. Before you start transporting or copying the datafile, you need to check the endian format of the data files in the source and target platform. Endian format refers to the byte ordering in the datafile. It is just the way bytes are stored in the datafile. There are 2 types of endian formats – Big and Small.

If your target platform is not compatible with your source platform in terms of endian format, then you have to make the endian format of all the datafiles belonging to the tablespace you want to transport same. You can accomplish this using RMAN. I will let you know later how to convert the endian format. For now, we will see the platform compatibility and other details.

Determining the supported platform

First step before transporting the tablespace from source platform to target platform, you need to first check if tablespace transport is compatible. You can check the list of supported platform using following query in the database.

SQL> select * from v$transportable_platform;

 

PLATFORM_ID PLATFORM_NAME                        ENDIAN_FORMAT

----------- ------------------------------------ --------------

          1 Solaris[tm] OE (32-bit)              Big

          2 Solaris[tm] OE (64-bit)              Big

          7 Microsoft Windows IA (32-bit)        Little

         10 Linux IA (32-bit)                    Little

          6 AIX-Based Systems (64-bit)           Big

          3 HP-UX (64-bit)                       Big

          5 HP Tru64 UNIX                        Little

          4 HP-UX IA (64-bit)                    Big

         11 Linux IA (64-bit)                    Little

         15 HP Open VMS                          Little

          8 Microsoft Windows IA (64-bit)        Little

 

PLATFORM_ID PLATFORM_NAME                        ENDIAN_FORMAT

----------- ------------------------------------ --------------

          9 IBM zSeries Based Linux              Big

         13 Linux 64-bit for AMD                 Little

         16 Apple Mac OS                         Big

         12 Microsoft Windows 64-bit for AMD     Little

         17 Solaris Operating System (x86)       Little

 

16 rows selected.

In our case we are going to transport a tablespace from HP Itanium 64 bit platform to Linux 32 bit platform. These platforms are made bold in the above query output. As you can see the endian format of these platforms are different (HP IA 64 has big endian format and Linux IA 32 has little endian format).

You can check your database server platform using following query.

SQL> select platform_name from v$database;
PLATFORM_NAME
-----------------------------------------------
HP-UX IA (64-bit)

General requirements for transporting tablespaces between 2 databases

  • Both platform should have same character set.

you can check the character set of both platform using following query

SQL> select * from nls_database_parameters where parameter like '%SET%';

PARAMETER                      VALUE

------------------------------ ----------------------------------------

NLS_CHARACTERSET               WE8ISO8859P1

NLS_NCHAR_CHARACTERSET         AL16UTF16

 
  • Both database must be using Oracle 8i or higher version, but database version need not be identical
  • You cannot transport SYSTEM tablespace or any object owned by SYS
  • If you want to transport partitioned table, all the partitions must be included in transportable table set. If you are transporting index, all the tablespace containing respective tables also needs to be transported
  • You can transport the tablespace to a target database only if it has same or higher compatibility settting

Following are the brief steps for transporting the tablespace.

1. Ensure that the tablespace is self-contained

You can check if the tablespace you are transporting is self-contained or not using TRANSPORT_SET_PROCEDURE in DBMS_TTS package. This is shown below

DBMS_TTS.TRANSPORT_SET_CHECK (

   ts_list          IN CLOB, 

   incl_constraints IN BOOLEAN DEFAULT FALSE,

   full_check       IN BOOLEAN DEFAULT FALSE);

SQL> EXECUTE DBMS_TTS.TRANSPORT_SET_CHECK('IAS_META',TRUE);

PL/SQL procedure successfully completed.

SQL> SELECT * FROM TRANSPORT_SET_VIOLATIONS;

no rows selected
If you see no rows selected, that mean the tablespace is self-contained.
2. Make the tablespace read-only
Alter the tablepace to make it read-only as shown below.
SQL> alter tablespace IAS_META read only; 
Tablespace altered.
You can make the tablespace read write once you export the metadata about this tablespace and convert the endian format of the tablespace (if needed).
3. Export metadata using TRANSPORTABLE_TABLESPACE data pump option
Once you make tablespace as readonly, export the metadata information about the tablespace using data pump export as shown below.

-bash-3.00$ expdp system/welcome1 TRANSPORT_TABLESPACES=IAS_META DUMPFILE=test_dir:test_exp.dmp LOGFILE=test_dir:exp_01.log
Export: Release 10.1.0.5.0 - 64bit Production on Tuesday, 22 December, 2009 17:5
Copyright (c) 2003, Oracle.  All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - 64bit
With the Partitioning, OLAP and Data Mining options
Starting "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01":  system/******** TRANSPORT_TABL
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/CLUSTER
Processing object type TRANSPORTABLE_EXPORT/TTE_CLU_INDEX/INDEX
Processing object type TRANSPORTABLE_EXPORT/TYPE/TYPE_SPEC
Processing object type TRANSPORTABLE_EXPORT/TYPE/GRANT/OBJECT_GRANT
Processing object type TRANSPORTABLE_EXPORT/TYPE/TYPE_BODY
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/GRANT/TTE_TABLE_OWNER_OBJGRANT/OBJECT_GRANT
Processing object type TRANSPORTABLE_EXPORT/INDEX
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/COMMENT
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/TRIGGER
Processing object type TRANSPORTABLE_EXPORT/TTE_FUNC_BITMAP_INDEX/TTE_FBM_INDEX_INDEX/INDEX
Processing object type TRANSPORTABLE_EXPORT/TTE_FUNC_BITMAP_INDEX/STATISTICS/TTE_FBM_IND_STATS/INDEX_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/DOMAIN_INDEX/TABLE
Processing object type TRANSPORTABLE_EXPORT/DOMAIN_INDEX/INDEX
Processing object type TRANSPORTABLE_EXPORT/RLS_POLICY
Processing object type TRANSPORTABLE_EXPORT/TTE_POSTINST/PROCACT_INSTANCE
Processing object type TRANSPORTABLE_EXPORT/TTE_POSTINST/PROCDEPOBJ
Processing object type TRANSPORTABLE_EXPORT/TTE_POSTINST/PLUGTS_BLK
Master table "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TRANSPORTABLE_01 is:
  /slot/ems6024/oracle/test_exp.dmp
Job "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 17:56
4. Convert the datafile to match endian format
You can use RMAN to convert the data file to the endian format of the target. Following is the command for the same
-bash-3.00$ rman TARGET SYS/welcome1
Recovery Manager: Release 10.1.0.5.0 - 64bit Production
Copyright (c) 1995, 2004, Oracle.  All rights reserved.
connected to target database: HPTSTPW1 (DBID=2764844932)
RMAN> convert tablespace IAS_META to platform 'Linux IA (32-bit)' format '/slot/ems6024/oracle/%U';
Starting backup at 22-DEC-09
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=378 devtype=DISK
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00009 name=/slot/ems6024/oracle/AS10g/oradata/hptstpw1/ias_meta01.dbf
converted datafile=/slot/ems6024/oracle/data_D-HPTSTPW1_I-2764844932_TS-IAS_META_FNO-9_01l1igm6
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:02:10
Finished backup at 22-DEC-09
It generated the file with name "data_D-HPTSTPW1_I-2764844932_TS-IAS_META_FNO-9_01l1igm6". If you want to preserve the name or give custom name to the datafile, you can use db_file_name_convert parameter while converting the endian format.
5. Copy the file to target database
Here you need to copy both the converted file from step 4. (tablespace datafile) as well as export dump file from step 3.
6. Run import command to import the transportable tablespace
impdp system/welcome1 TRANSPORT_DATAFILES='/slot/ems5918/oracle/data_D-HPTSTPW1_I-2764844932_TS-IAS_META_FNO-9_01l1igm6' DUMPFILE=test_dir:test_exp.dmp LOGFILE=test_dir:imp_01.log
You might hit the error "UDI-00011: parameter dumpfile is incompatible with parameter transport_tablespaces" in case you are using TRANSPORT_TABLESPACES parameter in above impdp command. Please DO NOT use TRANSPORT_TABLESPACES parameter in impdp. Refer to official release metalink note ID 444756.1
Hope this helps !!

December 19, 2009

Oracle Data Pump Technology – Oracle Database 10g

Filed under: Oracle Database 10g — advait @ 8:38 pm
Tags: , , , , ,

Introduction:

Oracle datapump technology refers to the new import and export functionality introduced in Oracle database 10g. New import/export technology is far superior then the traditional import/export tools available until Oracle database 9i. Data pump manages multiple, parallel stream of data to achieve maximum throughput.

Oracle claims that Data Pump allows you to decrease the total export time by two orders of magnitude in most data intensive export jobs. Imports are supposed to run 15-20 times faster then traditional method.

While Oracle continues to support the traditional import utility forever, the traditional export utility will get deprecated eventually.

Benefits of using Data Pump:

Following are some of the benefits of using Data Pump

  • Server based: Data Pump jobs are server based. Mean if you submit the job from the client and you close the client connection the job will continue to run on server.
  • Ability to restart data pump job: We can attach to existing job which is stalled or failed because of lack of space and start the job.
  • Parallel Execution capabilities: Data Pump provide PARALLEL parameter which enables you to provide number of parallel workers
  • Ability to attach to running job: Data Pump provide you capability to attach to running job and change parameter as required
  • Network mode of operation: Ability to import the database from some other database without having to create a dump file
  • Fine-grained data import capability: Provides finer control on which objects to import
  • Remapping Capabilities: Enhancement to traditional TOUSER parameter. You have the capability to remap tablespace, schemas and datafiles
  • Ability to estimate space requirement: You can estimate the space without even running the export job.

Data Pump Components

We have following data pump API available for use in the program

  • DBMS_DATAPUMP
  • DBMS_METADATA

DBMS_DATAPUMP is a package which has the actual data pump engine to export and import data from the database. DBMS_METADATA is used to extract and upload the metadata about data. These are the API packages and can be used directly in a program. Other then this the client binaries like expdp and impdp are also available.

DIRECTORY Object:

One of the benefit of using data pump is that the job runs on the server side unlike the traditional import/export programs. In the traditional import/export programs, Oracle used to make simple client connection to the database and extract the data. The process for import/export in the traditional method used to run on client machine. Meaning that if a job is started using the traditional export and import method, the dump file will get created at a place or machine on which you started the job.

Data pump is different. In that the job always runs on the server where the database resides and job does not make a simple client connection and use SQL to extract the data. The mechanism for data pump is different then traditional technology. The mechanism is explained in the next section of this post. For now the important thing to understand here is that the job runs on the sever side and the dump files also gets created on the server side. So how do we know the location for this dump file. Where exactly will it get created on the server?

To answer this we have a parameter called DIRECTORY. This is a new object introduced in Oracle database 10g. Using DIRECTORY parameter we can specify the location of dump file.

Before using DIRECTORY parameter in expdp or impdp, we need to first create this object in the database. Following is the way to create directory object in database.

SQL> Create directory test_dir as ‘/u01/app/oracle/exp_dump’ ;

Here the location /u01/app/oracle/exp_dump is the location on server and must exists. test_dir is the directory object that we created in the database.

In order for the user to use a directory object, you need to grant privilege to the user on that directory.

SQL> grant read, write on directory test_dir to avdeo;

While doing the export or import there are 3 ways to provide this directory object.

1) Using DIRECTORY parameter

You can specify the DIRECTORY parameters and all the files will get created or read from the that directory. Example

$ expdp hr/hr DIRECTORY=test_dir DUMPFILE=…

2) Using DIRECTORY:FILE notation

You use DIRECTORY:FILE notation if you want to specify different direct for dump file, log file etc. Example

$ expdp hr/hr DUMPFILE=test_dir:exp_file01.dmp LOGFILE=test_dir1:logfile01.log

3) Using DATA_DUMP_DIR environment variable

You can also set DATA_DUMP_DIR env variable to a directory object name and same will be used by the expdp and impdp tool. Example

$ export DATA_DUMP_DIR=test_dir

$ expdp hr/hr DUMPFILE=test.dmp …

Order of precedence for the above notation goes as follows. Oracle will first give the precedence to DIRECTORY:FILE notation (point #2). If you have submitted job giving DIRECTORY:FILE notation then oracle will ignore other notation. Second precedence is giving to DIRECTORY parameter. Oracle will look for DATA_DUMP_DIR environment variable only of you have not used DIRECTORY parameter or DIRECTORY:FILE notation.

Mechanics of Data Pump technology

Data Pump uses several processes to perform the job. This include the master process, the worker process, shadow process and the client process. Lets check out each of these processes

The master process

The master process or more accurately the Master Control Process (MCP) is the primary process for managing data pump job. MCP is a background process with a full name as <instance>_DMnn_<pid> and this process can be seen when a import or export job starts. There is 1 MCP process per job. If you are running 3 import or export job, you will see 3 such master process in that instance. The master process performs following tasks:

  • Create jobs and control them
  • Creates and manages worker process
  • Monitors the job and logs the progress
  • Maintains the job state and restart information
  • Manages necessary files, including the dump file set

When a job is submitted master process creates a table called mater table to log the location of various database objects in export dump file. Master table is the heart of every data pump export and import job. Master process maintains the job state and restart information in master table. Oracle creates master table in the schema of use who is running the data pump job at the beginning of export. Master table contains various set of information regarding the state of the running job, the location of various objects in export dump file, parameters of the job and status of all worker process. Master table has the same name as the name of the job. You can provide the name to the job you are submitting or by default the name of the job will be <schema>_<operation>_<mode>_<unique count>. Example SYS_EXPORT_SCHEMA_01

At the end of export, data pump export job will export the master table and drop it from the schema of the job is successful. If the job fails the master table will remain with all the information about the point of failure. Later on one can just attach to the job and restart the failed job after fixing the issue. Also master table will get deleted if you kill the job using KILL_JOB command.

Master process will also recreate the master table that gets saved at the end of export as the first thing while starting the import. The import process gets complete information about the dumps and objects its going to import using the master table. If the import is successful or forcefully killed by the user, the master table is dropped. If the import job fails or stopped by the user using STOP_JOB command, the master table remains in the database schema.

The worker process

Work process is the one who does the heavy duty work of actual loading and unloading operations. Worker process has the name of the process as <instance>_DWnn_<pid>. Number of worker process depends on the degree of parallelism as defined by the parameter PARALLEL. As the worker process exports and imports the objects they update the status of the same in master table. They update the master table with information about the status of various jobs: completed, pending or failed.

The Shadow process

When a client logs into the database server, the database creates an Oracle background foreground process to service data pump API request. The shadow process creates the job consisting of master table as well as master process. Once client detaches shadow process automatically disappears.

The Client Process

Client process is the one which calls data pump API. You have 2 client- expdp and impdp.

Interactive Data Pump

Running the export and import job in interactive mode is totally different concept in case of traditional import and export and data pump. In case of traditional import and export job when we give the export or import command without giving any parameters, the API will ask for some required mandatory parameters which we used to input and job used to start. But in case of data pump the meaning of interactive job is different. In case of data pump the API never ask you for any inputs of the parameters one by one. Only way you have to submit the job is to give all the parameters, either inline with job or in a parameter file.

Then what is interactive method in case of data pump?

Well the interactive method is used in data pump only when you decide to make some changes to the parameters of the already running job.

The way to get into the interactive mode is either by doing ctrl+c or using ATTACH parameter. Example

expdp hr/hr ATTACH=test_job_01

Data Pump Export Parameters

Following is the brief list of parameters that can be passed with data pump export job. For complete list you can do expdp help=y

DIRECTORY – Used to specify the location for dump file or logfile or SQL file.

DUMPFILE – Used to specify the name of dump file. And yes it replaces the FILE parameter in traditional export

FILESIZE – Used to specify the size of the dump file that it should create. If the size exceeds, then it will write the dump in another file if you have given multiple filenames in DUMPFILE parameter or used %U while giving the name of dump file.

PARFILE – Used to provide the name and location of parameter file which has all the required parameter for the export job to run

LOGFILE and NOLOGFILE – You can specify LOGFILE parameter to to create log file for export job. If you dont specify LOGFILE parameter, Oracle will still create the log file named export.log. Subsequent export jobs will overwrite it as this is the default name. You can specify NOLOGFILE parameter if you want to totally avoid creation of log file for your export job.

CONTENT – Using content parameter, you can filter what goes into the dump file. CONTENT parameter can take 3 values: ALL, DATA_ONLY, METADATA_ONLY

EXCLUDE and INCLUDE – Used for fine grained filtering of the objects that can go in export dump file

QUERY – Used to control the rows of the table that can go into the export dump file

ESTIMATE – Used to estimate the time and space required for export dump file in addition to doing export

ESTIMATE_ONLY – Used to only estimate the time and space requirement for the export job. This parameter will not export and data into the dump file.

NETWORK_LINK – Used to get the export dump from some other database into the current database server. This parameter expects a database network link. Example

expdp hr/hr DIRECTORY=test_dir NETWORK_LINK=finance@prod1 …

Here finance is the remote database on prod1 server from which you are exporting the data.

ATTACH – Used to connect to the currently running job.

JOBNAME – Used to provide custom name to the export jobs.

STATUS – Used to display the status of the job. This parameter takes the numeric values in seconds.

PARALLEL – Used to provide number of parallel workers who will perform the actual job

Data Pump Import Parameters

Some of the parameters in import job are same in export like PARFILE, DIRECTORY, DUMPFILE, LOGFILE, NOLOGFILE etc

Some of the other parameters in import are

SQLFILE – Used to extract DDL from the export dump file. If you specify the SQLFILE parameters it extracts the DDLs, no import takes place.

REUSE_DATAFILES – This parameter tells data pump whether it should existing datafile for creating tablespace during import. If REUSE_DATAFILES is set to Y then import utility will write over your existing datafiles.

CONTENT – Using content parameter, you can filter what goes into the dump file. CONTENT parameter can take 3 values: ALL, DATA_ONLY, METADATA_ONLY

TABLE_EXISTS_ACTION – In case the table already exist in the database which a import job is trying to import from the export dump file, you can use this parameter to tell import job what to do. The valid values are SKIP, APPEND, TRUNCATE, REPLACE

TRANSPORTABLE_TABLESPACE – used when you want to transport the tablespace from one database to another

REMAP_SCHEMA – Used to move objects from one user to another. Replacement of old TOUSER parameter.

REMAP_DATAFILE – Used to remap the data file names specially when transferring the data from one platform to another. Example from windows to UNIX

REMAP_TABLESPACE – Sometimes you want the tablespace in which you are importing the data to be different from the source database tablespace. This parameter comes handy for doing that.

NETWORK_LINK – This parameters is used to import the data directory into the database from some other database without having to create a dump file.

TRANSFORM – In case you don’t want to import the objects storage attributes but just the content, you can use this parameter. TRANSFORM parameter instruct the data pump import job to modify the DDL that creates the object during import. You can modify 2 basic attributes SEGMENT_ATTRIBUTE and STORAGE.

FLASHBACK_TIME – Enables you to import data consistent as of flashback time you specify in the import job. Replacement of old CONSISTENT parameter in traditional import utility.

Monitoring Data Pump Job

You can monitor data pump job using following views

DBA_DATAPUMP_JOBS
OWNER_NAME       VARCHAR2(30) User that initiated the job
JOB_NAME       VARCHAR2(30) Name of the job
OPERATION       VARCHAR2(30) Type of operation being performed
JOB_MODE       VARCHAR2(30) Mode of operation being performed
STATE             VARCHAR2(30) Current job state
DEGREE           NUMBER       Number of worker processes performing the operation
ATTACHED_SESSIONS NUMBER       Number of sessions attached to the job
DBA_DATAPUMP_SESSIONS OWNER_NAME VARCHAR2(30) User that initiated the job JOB_NAME VARCHAR2(30) Name of the job SADDR RAW(4) Address of the session attached to the job You can also use V$SESSION_LONGOPS to monitor long running export or import jobs. Hope this helps !!

December 17, 2009

Manual Cleanup of CRS installation – Oracle CRS 10g R2 (10.2.0.1)

Filed under: Oracle Database 10g — advait @ 2:53 pm
Tags: , ,

Some times we have to do a maual cleanup of failed CRS installation or some old CRS installation that was done. We have a automated way of cleaning up CRS as show below

1) Run rootdelete.sh script present in $ORA_CRS_HOME/install directory

2) Run rootdeinstall.sh script present in $ORA_CRS_HOME/install directory

If you have unknowingly deleted the CRS HOME before running the above scripts then you can follow below procedure to manually clean up the CRS.

Manual Cleanup of CRS on Linux

1. Remove following files as root user on ALL NODES IN CLUSTER

rm /etc/oracle/*
rm -f /etc/init.d/init.cssd
rm -f /etc/init.d/init.crs
rm -f /etc/init.d/init.crsd
rm -f /etc/init.d/init.evmd
rm -f /etc/rc2.d/K96init.crs
rm -f /etc/rc2.d/S96init.crs
rm -f /etc/rc3.d/K96init.crs
rm -f /etc/rc3.d/S96init.crs
rm -f /etc/rc5.d/K96init.crs
rm -f /etc/rc5.d/S96init.crs
rm -Rf /etc/oracle/scls_scr
rm -f /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab

2. If they are not already down then kill off EVM, CRS and CSS process as root user on ALL NODES

ps -ef | grep crs    
kill <crs pid>
ps -ef | grep evm
kill <evm pid>
ps -ef | grep css    
kill <css pid>

3. Remove the files in /var/tmp/.oracle or /tmp/.oracle on ALL NODES

rm -f /var/tmp/.oracle/*
or
rm -f /tmp/.oracle/*

4. Remove the ocr.loc at /etc/oracle on ALL NODES

5. De-install the CRS home in the Oracle Universal Installer
This is to remove the CRS home from inventory. Installer may not be able to remove the files in the slot as CRS home is already deleted, but it will clean up the inventory.

6. Remove the CRS install location on ALL NODES
In case you have not removed the CRS install directory, please do so.

7. Remove OCR and Voting disk from shared location from any 1 node

Once above manual steps are done, the hosts are cleaned up and ready for next CRS installation.

Hope this helps !!

References:

Metalink Note ID : 239998.1

September 30, 2009

WLST (Weblogic Scripting Tool)

Introduction

With Fusion Middleware 11g, Oracle has moved from the traditional Apache and OC4J to Oracle weblogic. There are many new things that has come up with weblogic. There is a change in architecture. Changes related to managing the services, deployment procedure, changing of port and many other things.

Well, should we say that it has got better or it got worst ? I am not sure about good or bad, but I know its new. Per my opinion and experience, weblogic provides more flexibility in terms of changing the parameters or making any changes in the existing deployment. Or may be I havent worked much on OC4J or weblogic.

Anyways, this is a short post which explains about a tool called WLST (Weblogic Scripting Tool). WLST framework comes along with weblogic installation and provides a platform to carry out all the task at command line. This is a very useful tool for the people working on weblogic.

WLST Commands

For this post, I have following home

Middleware Home – /slot/ems3398/oracle/mwhome

Weblogic Home – /slot/ems3398/oracle/mwhome/wlserver_10.3

In weblogic we have a concept called domain. Domain is nothing but a project created inside weblogic which will have applications deployed within it. Every domain will have one AdminServer and multiple managed servers. Applications are deployed either on a AdminServer (less recommended) or on managed servers (more recommended).

Domains are created from a template. To begin with weblogic provides some default templates which can be used to create a domain. These templates are nothing but the jar files which has complete file system and services in side it. When a domain is created the jar file is extracted to create the required domain file system and AdminServer for that domain.

The purpose of AdminServer is for administering the services. In case you have managed server for the domain, then you can start and stop manage server only using AdminServer. If your AdminServer is down, then you cannot start or stop Managed servers. However manage servers can remain up and accessible even if AdminServer is down. Each of these servers have there own separate ports.

Default installation of weblogic does not create any domain. We need to create domain manually using the default templates provided by weblogic.

Default template for weblogic will be available at /slot/ems4179/oracle/mwhome/wlserver_10.3/common/templates/domains location

-bash-3.00$ pwd
/slot/ems4179/oracle/mwhome/wlserver_10.3/common/templates/domains
-bash-3.00$ ls -rlt
total 164
-rw-r—–  1 ora4179 ems4179  32510 Jul 28 11:27 wls.jar
-rw-r—–  1 ora4179 ems4179 130456 Jul 28 11:27 wls_starter.jar

You can create domain using this default template (.jar file) using config.sh script present in /slot/ems4179/oracle/mwhome/wlserver_10.3/common/bin location. This script will launch a GUI where all the details can be provided and it will create the required domain.

You can also create the same domain using WLST (Weblogic Scripting Tool). WLST has many commands that helps to get the required configuration. Also the complete domain is visible in WLST as directory and file listing. To connect to WLST framework just run wlst.sh script present in /slot/ems4179/oracle/mwhome/wlserver_10.3/common/bin location

Once you run wlst.sh, you will get the WLS prompt.

wls:/offline>

Creating Default Domain

For creating any domain, you need to first read the required template at WLS prompt and then create domain out of it. The command is readDomain and it takes 1 argument as complete name and location of template.

wls:/offline> readTemplate('/slot/ems4179/oracle/mwhome/wlserver_10.3/common/templates/domains/wls.jar');
wls:/offline/base_domain>ls()
drw-   Security
drw-   Server
-rw-   Active                                        false
-rw-   AdminServerName                               AdminServer
-rw-   AdministrationMBeanAuditingEnabled            false
-rw-   AdministrationPort                            9002
-rw-   AdministrationPortEnabled                     false
-rw-   AdministrationProtocol                        null
-rw-   AutoDeployForSubmodulesEnabled                true
-rw-   ClusterConstraintsEnabled                     false
-rw-   ConfigBackupEnabled                           false
-rw-   ConfigurationAuditType                        null
-rw-   ConfigurationVersion                          10.3.1.0
-rw-   ConsoleContextPath                            console
-rw-   ConsoleEnabled                                true
-rw-   ConsoleExtensionDirectory                     console-ext
-rw-   DomainVersion                                 10.3.1.0
-rw-   GuardianEnabled                               false
-rw-   InternalAppsDeployOnDemandEnabled             true
-rw-   LastModificationTime                          0
-rw-   Name                                          base_domain
-rw-   Notes                                         null
-rw-   OcmEnabled                                    true
-rw-   ProductionModeEnabled                         false
-rw-   RootDirectory                                 null

If you want to list the attributes and services of the template you can use ls() command. The command is same as that of OS command but we need to supply () along with the command. Similarly you can change directory in WLS prompt and go inside the template. Example, I want to set the password for weblogic inside the template, So I can use following command

wls:/offline/base_domain>cd('/Security/base_domain/User/weblogic');
wls:/offline/base_domain/Security/base_domain/User/weblogic>cmo.setPassword('welcome1');

Complete list of all the commands available in WLS is giving in reference section of this post.

Next, after setting the password, you can close the template using closeTemplate(); before creating the domain

wls:/offline/base_domain/Security/base_domain/User/weblogic>closeTemplate();

Next is creating the domain. The command for that is createDomain. It takes 4 argument as shown below

createDomain('/slot/ems4179/oracle/mwhome/wlserver_10.3/common/templates/domains/wls.jar','/slot/ems4179/oracle/mwhome/user_projects/domain/soa_domain1','weblogic','welcome1');

1st Argument is the template name

2nd arguement is the location where the domain is to be created

3rd argument is the weblogic username (which will be weblogic)

4th argument will be the weblogic password

This command is going to extract /slot/ems4179/oracle/mwhome/wlserver_10.3/common/templates/domains/wls.jar file completly and create a directory strucrure under /slot/ems4179/oracle/mwhome/user_projects/domain/soa_domain1

Once the domain is created you can exit the WLST command promt and start the AdminServer using the script shown below

wls:/offline>exit()

Exiting WebLogic Scripting Tool.

-bash-3.00$ cd /slot/ems4179/oracle/mwhome/user_projects/domain/soa_domain1/bin/
-bash-3.00$ ./startWebLogic.sh  &

Start of weblogic server will take some time. Wait until you see the message

<Sep 30, 2009 10:20:09 AM PDT> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>

Once AdminServer is started you can access the weblogic console using http://<hostname>:<port>/console

The default port number will be 7001 unless you change the port number in WLST as shown below

Changing the Default port number

Connect to WLST again and read the domain that you have created just now

wls:/offline> readDomain('/slot/ems4179/oracle/mwhome/user_projects/domain/soa_domain1');
wls:/offline/soa_domain1>cd ('/Server/AdminServer');
wls:/offline/soa_domain1/Server/AdminServer>set('ListenPort',8050);
wls:/offline/soa_domain1/Server/AdminServer>updateDomain()

Once you update the domain with new port 8050, exit the WLST and bounce AdminServer. You can now access the console using new port.

Adding SOA templates to default domain

In the previous post for installing SOA, I showed you the installation procedure for SOA. In those steps we used the GUI for installing the SOA. Here I will show you the steps for installing the SOA using WLST. Basically we can convert our existing default domain into SOA domain by adding SOA template to this domain and changing few attributes of the domains.

The database required for the SOA needs to be installed separately. I have a script for installing SOA using WLST and I will walk you through that script now.

The script looks as shown below


readTemplate('/slot/ems4179/oracle/mwhome/wlserver_10.3/common/templates/domains/wls.jar');
cd('/Security/base_domain/User/weblogic');
cmo.setPassword('welcome1');
closeTemplate();
createDomain('/slot/ems4179/oracle/mwhome/wlserver_10.3/common/templates/domains/wls.jar','/slot/ems4179/oracle/mwhome/user_projects/domain/fmw_domain','weblogic','welcome1');
readDomain('/slot/ems4179/oracle/mwhome/user_projects/domain/fmw_domain');
addTemplate('/slot/ems4179/oracle/mwhome/Oracle_SOA1/common/templates/applications/oracle.soa_template_11.1.1.jar');

addTemplate('/slot/ems4179/oracle/mwhome/Oracle_SOA1/common/templates/applications/oracle.bam_template_11.1.1.jar');

cd('/Servers/AdminServer');
set('ListenPort', 15079);
cd('/Servers/soa_server1');
set('ListenPort', 16079);
cd('/Servers/bam_server1');
set('ListenPort', 17079);
cd('/JDBCSystemResources/BAMDataSource/JdbcResource/BAMDataSource/JDBCDriverParams/NO_NAME_0');
set('URL','jdbc:oracle:thin:@stasa38.us.oracle.com:1600:soaemqa');
cmo.setPasswordEncrypted('welcome1');
cd('/JDBCSystemResources/EDNDataSource/JdbcResource/EDNDataSource/JDBCDriverParams/NO_NAME_0');
set('URL','jdbc:oracle:thin:@stasa38.us.oracle.com:1600:soaemqa');
cmo.setPasswordEncrypted('welcome1');
cd('/JDBCSystemResources/EDNLocalTxDataSource/JdbcResource/EDNLocalTxDataSource/JDBCDriverParams/NO_NAME_0');
set('URL','jdbc:oracle:thin:@stasa38.us.oracle.com:1600:soaemqa');
cmo.setPasswordEncrypted('welcome1');
cd('/JDBCSystemResources/OraSDPMDataSource/JdbcResource/OraSDPMDataSource/JDBCDriverParams/NO_NAME_0');
set('URL','jdbc:oracle:thin:@stasa38.us.oracle.com:1600:soaemqa');
cmo.setPasswordEncrypted('welcome1');
cd('/JDBCSystemResources/SOADataSource/JdbcResource/SOADataSource/JDBCDriverParams/NO_NAME_0');
set('URL','jdbc:oracle:thin:@stasa38.us.oracle.com:1600:soaemqa');
cmo.setPasswordEncrypted('welcome1');
cd('/JDBCSystemResources/SOALocalTxDataSource/JdbcResource/SOALocalTxDataSource/JDBCDriverParams/NO_NAME_0');
set('URL','jdbc:oracle:thin:@stasa38.us.oracle.com:1600:soaemqa');
cmo.setPasswordEncrypted('welcome1');
cd('/JDBCSystemResources/mds-owsm/JdbcResource/mds-owsm/JDBCDriverParams/NO_NAME_0');
set('URL','jdbc:oracle:thin:@stasa38.us.oracle.com:1600:soaemqa');
cmo.setPasswordEncrypted('welcome1');
cd('/JDBCSystemResources/mds-soa/JdbcResource/mds-soa/JDBCDriverParams/NO_NAME_0');
set('URL','jdbc:oracle:thin:@stasa38.us.oracle.com:1600:soaemqa');
cmo.setPasswordEncrypted('welcome1');
updateDomain();
exit();

The first 5 steps are same as we saw above. Next step is to read the domain and add SOA & BAM template to it. SOA template will come along with SOA installation.

After adding these templates, it will automatically create ManagedServers in the domain.

Next we are just navigating to the folders and changing the ports for AdminServer and each of the ManagedSever

SOA and BAM uses datasources for connecting to database, so we have to navigate to the corresponding datasource folders and update the JDBC connection, userID and passwords.

Once all this is done, update the domain and your SOA installation is ready. You can bounce the AdminServer and start ManagedServers.

References

WLST Command Reference : http://download.oracle.com/docs/cd/E12840_01/wls/docs103/config_scripting/reference.html

Hope this helps !!

September 7, 2009

Installing Oracle Identity Management 11g R1 (11.1.1.1)

Introduction:

Oracle Identity Management enables enterprises to manage the end-to-end lifecycle of user identities across all enterprise resources—both within and beyond the firewall. With Oracle Identity Management, you can deploy applications faster, apply the most granular protection to enterprise resources, automatically eliminate latent access privileges, and much more.

Oracle Identity Management 11g Release 1 (11.1.1) includes the following components:

  • Oracle Internet Directory
  • Oracle Directory Integration Platform
  • Oracle Virtual Directory
  • Oracle Directory Services Manager
  • Oracle Identity Federation

In this post we will see the installation of Oracle Identity Management 11g R1 (11.1.1.1). As mentioned before the approach for installing Oracle 11g FMW components is different then those of 10g components, I will mention the approach for installing Oracle Identity Management 11g.

Brief Installation Steps:

Following are the brief steps for installing Oracle Identity Management 11g

1) Install database 11g (11.1.0.6 / 11.1.0.7) including configuring TNS and listener

2) Create repository using Oracle RCU (Repository Creation Utility)

3) Install WLS (weblogic Server) and create a middleware home

4) Install Oracle Identity Management 11g inside middleware home

The installation will install and configure the complete Identity Management and provide the access URLs.

Download Locations:

You can download all the required software from following location

Oracle Database 11g (11.1.0.6/11.1.0.7) – http://www.oracle.com/technology/software/products/database/index.html

Oracle IDM 11g – http://www.oracle.com/technology/software/products/middleware/htdocs/111110_fmw.html (Download the product Identity Management)

Oracle RCU – http://www.oracle.com/technology/software/products/middleware/htdocs/111110_fmw.html

Oracle WLS 10.3.1 – http://www.oracle.com/technology/software/products/ias/htdocs/wls_main.html

Step 1) Install database 11g including configuring TNS and listener

For this you can refer previous post for database installation and create a 11g database. Also create a listener on any available port and configure TNS for the database.

Step 2) Create repository using Oracle RCU (Repository Creation Utility)

Using RCU, you can create repository for IDM. You dont have to install RCU for using it. RCU comes as a zip file along with the identity management software download. Once you unzip you run <RCU_UNZIP>/bin/rcu binary

This will invoke a GUI. On the first page you can select “Create Repository” and click on next.

On the next page RCU will ask for database details in which you want to create the repository. The page will look as shown below

1

Once you connect to database, on the next page you need to select the repository that you want to create. Here you can select “Identity Management” as shown below. Also you can use any prefix for these schema. All these schema created will have the prefix string prefixed to it. In this case it will prepend DEV before each schema name. Note that it wont prefix anything before ODS schema. This schema is used for OID and SSO configuration.

2

Once you click on next, it will show the summary and will create tablespace if they dont exists. After tablespace creation, click on create and it will create the required repository schemas.

Step 3) Install WLS (weblogic Server) and create a middleware home

Next step is to install WLS server. Carry out the basic installation of WLS. You need to provide a new location for middleware home when asked for as shown below.

wls1

Next it will ask for the location of weblogic. Here you can accept the default value as it will be created inside middleware home.

wls2

Select all other values as default and install WLS.

Step 4) Installing IDM 11g.

IDM installation involves many steps and screens. Please follow the below screen shots for installing IDM

When you start the IDM installer, you will see a welcome screen. Click on next.

Next you will see “Install option” screen. In this screen select “Install and Configure”. Click on next.

The installer will perform the pre-requisite checks. Click on next.

In the next screen “Select Domain”, click on “Create new domain” as shown below

3

On the next screen, specify the install location inside middleware home.Click Next.

Select default values for next screen – Security Updates. Click Next.

On configure components screen, keep the default values. Click Next

On configure port  screen, you can choose Automatic port assignment. Click Next.

On “Specify Oracle Virtual Directory Information” page, provide the inputs as shown in the screen below

4

Here you need to specify the password for orcladmin. Remember the password you are setting here as you will need that at many places later. Click on Next.

On “Specify Schema Database” page, you can specify the ODS schema details that we created using repository creation utility (Step 2)). Also you need to provide ODS schema password you set while running RCU in step 2) as shown below

5

On “Create Oracle Internet Directory” screen, specify the Realm and orcladmin password. Note here that this orcladmin user is different then we say couple of screens back. This orcladmin user is for OID, where as the previous orcladmin user was for OVD.

6

Next, On “Specify OIF Details” page, specify the PKCS12 password and the domain name for OIF as shown below

7

On rest of the screen, you can specify the default value and submit the installation. The installation will complete in approximately 45 mins. Once the installation and all configuration assistants completes successfully, you can login to weblogic console.

The default port for weblogic console is 7001. So the console URL becomes

http://<hostname>:7001/console

user name : Weblogic

password : As specified while installing WLS in step 3)

8

Once you login, you will see the managed servers created for OID and OIF.

Hope this helps !!

August 25, 2009

Installing Oracle SOA 11g

Introduction:

In this post we will see detailed steps to install SOA 11g. The approach used in all 11g FMW components (Including SOA) is very different then 10g. The basic limitation of any 10g component involving infrastructure was that the product itself used to create database and configure the entire infrastructure. This used to put limitation on database port which always used to be 1521.

Here in 11g version, a user has a flexibility to use any port. 11g expects installed database as a pre-reqs and uses that database to create corresponding repository. This way we can have database and listener at any port and provide that information while creating repository.

Also another important feature with all 11g components is that web server used is weblogic and it is kept as another separate component in the form of pre-reqs. So any 11g components requiring web server expects weblogic as pre-reqs. With this brief introduction about 11g FMW components characteristics we will see the installation procedure for SOA 11g.

Installing SOA 11g:

Following are the brief steps for installing SOA 11g

1) Install database 11g (11.1.0.6 / 11.1.0.7) including configuring TNS and listener

2) Create repository using Oracle RCU (Repository Creation Utility)

3) Install WLS (weblogic Server) and create a middleware home

4) Install SOA 11g inside middleware home

5) Use config.sh or WLST to create and configure SOA domain and managed servers

In case of SOA 11g, BAM also gets install and configured if selected. Here we will install both SOA and BAM

Download Locations:

You can download all the required software from following location

Oracle Database 11g (11.1.0.6/11.1.0.7) – http://www.oracle.com/technology/software/products/database/index.html

Oracle SOA suite 11g – http://www.oracle.com/technology/software/products/middleware/htdocs/111110_fmw.html

Oracle RCU – http://www.oracle.com/technology/software/products/middleware/htdocs/111110_fmw.html

Oracle WLS 10.3.1 – http://www.oracle.com/technology/software/products/ias/htdocs/wls_main.html

Step 1) Install database 11g including configuring TNS and listener

For this you can refer previous post for database installation and create a 11g database. Also create a listener on any available port and configure TNS for the database.

Step 2) Create repository using Oracle RCU (Repository Creation Utility)

Using RCU, you can create repository for SOA. You dont have to install RCU for using it. RCU comes as a zip file which you need to unzip. Once you unzip you run <RCU_UNZIP>/bin/rcu binary

This will invoke a GUI. On the first page you can select “Create Repository” and click on next.

On the next page RCU will ask for database details in which you want to create the repository. The page will look as shown below

1

Once you connect to database, on the next page you need to select the repository that you want to create. Here you can select SOA as shown below. Metadata services will get selected automatically. Also you can use any prefix for these schema. All these schema created will have the prefix string prefixed to it. In this case it will prepend DEV before each schema name. Example DEV_MDS, DEV_SOAINFRA etc.

2

Once you click on next, it will show the summary and will create tablespace if they dont exists. After tablespace creation, click on create and it will create the required repository schemas.

Step 3) Install WLS (weblogic Server) and create a middleware home

Next step is to install WLS server. Carry out the basic installation of WLS. You need to provide a new location for middleware home when asked for as shown below.

wls1

Next it will ask for the location of weblogic. Here you can accept the default value as it will be created inside middleware home.

wls2

Select all other values as default and install WLS.

Step 4) Install SOA 11g inside middleware home

Installation of SOA home is again very straight. Installation of SOA will just lay down the file system, it wont configure anything. Important input while installing SOA is the middleware home location and location for SOA home

soa1

Here Oracle_SOA1 directory will get created inside mwhome directory. Rest of the inputs for SOA installation can be default.

Step 5) Use config.sh or WLST to create and configure SOA domain and managed servers

Once SOA installation is done, the last and the most important step is configuring SOA domain.

You need to navigate to <middleware_home>/Oracle_SOA1/common/bin location and run config.sh script. This script will open a new GUI window. Follow the below screen shots for configuring SOA.

soa2

Select all the required template from this screen. If you don’t need BAM installation, you can uncheck the Business Activity Monitoring template. Click on Next.

soa3

On the next screen give any domain name (soa_domain) in this case. You can keep the Domain location and Application location as default. These directories will get automatically created when this domain gets created at the end of installation. Click on Next.

soa4

On this screen, provide the weblogic password and click on Next.

soa5

On this screen you need to provide the database connection details like database name, hostname and database port. You also need to provide all the schema names and password you created using RCU. RCU will create exact 5 schemas required for SOA configuration. You need to provide details of those schemas on this screen. Once you click in next, the configurator will test the connection for all 5 schemas.

Once the connection test goes successful, you can keep rest of the values as default and create the required domain.

After domain creation start the weblogic server using <middleware_home>/user_projects/domain/<domain_name>/bin/startWeblogic.sh script

Also start the managed servers using <middleware_home>/user_projects/domain/<domain_name>/bin/startManagedWeblogic.sh script

You can then login to console using http://<SOA hostname>:<AdminServer port>/console

soa6

In the next post, I will provide the WLST details instead of config.sh for performing tasks in step 5) above.

Hope this helps !!

http://advait.wordpress.com/installing-oracle-database-10g-r2-on-solaris-59/

August 14, 2009

Spawn, Expect, Send and Interact

Filed under: General — advait @ 6:13 pm
Tags: , , , ,

Imagine a kind of automation you want to do where you want to telnet to a server within your shell script and carry out the activity on the remote server. There no RSH setup done on the remote server and you have to enter the password non-interactively. Under these kind of circumstances we have a tool called EXPECT.

expect is a unix command present under /usr/local/bin. In one of the scenario, I wanted to automate the installation Oracle Identity manager 9.1.0.1 (The install process will come in another post shortly). But Oracle Identity manager 9.1.0.1 is nither clonable nor it can be silently installed. Trust me, only way to install Oracle identity Manager is to do interactive installation using console mode of GUI mode.

But using expect commad we can simulate the complete installation non-interactively. Here we will see a small example of expect command.

As I said before expect is a binary present in /usr/local/bin directory and expect understand the command like spawn, expect, send and interact. These are the once that I used. Lets take a example where we want to telnet to a server and get the hostname and date (Just to verify that we connected to right server). I will provide the code and will explain the significance later.

#! /usr/bin/expect
spawn telnet mfgops;
expect "login:*";
send "cmsops\r";
expect "Password:*";
send "welcome\r";
expect "(cmsops) cmsops- ";
send "date;hostname;\r";
expect "(cmsops) cmsops- ";
send "exit\r";
expect eof;

Here is how you run this script and the expected output of the same.

-bash-3.00$ expect test.sh
spawn telnet mfgops
Trying 130.35.5.43...
Connected to mfgops.us.oracle.com (130.35.5.43).
Escape character is '^]'.

SunOS 5.6

login: cmsops
Password:
Last login: Fri Aug 14 11:05:42 from adc60020sems.us.
Sun Microsystems Inc.   SunOS 5.6       Generic August 1997
Built on Mon Sep 11 18:02:19 PDT 2000
You have new mail.
*********************************************************************
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*********************************************************************
The cmsops user should no longer be used for osn development. Please
use the pomops user instead.
*********************************************************************
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*********************************************************************
(cmsops) cmsops- date;hostname;
Fri Aug 14 11:06:56 PDT 2009
ap075sun
(cmsops) cmsops- exit
logout
Connection closed by foreign host.
-bash-3.00$

So we run the script using expect (expect test.sh) instead of using sh. You can even remove the expect and use ./ to run the script, but do not use sh, the script wont work.

spawn is used to spawn a command. A command which will expect some prompts.

expect us used to tell which prompts are expected. Here * is used as wild character, in case you are not sure about complete prompt.

send is used to send the inputs to those prompts. Example for login and password we send the appropriate inputs

interact is not used in this program, but in case you want the control back to the user, you can use interact.

We also have a expect module in perl which does almost similar kind of activities, but its more advanced than expect unix command. Expect.pm (perl module) is not installed by default, but you have to install it yourself.

I found this utility wonderful in case of automating something like telnet or any interactive console based installation. A very handy tool.

Hope this helps !!

Reference:

expect man pages.


June 22, 2009

Cleaning up the system – 11i and R12

Here is the small post which describes the potential placed where log files and trace files are present and can be cleaned up. This is requied when you want to free up space on the system.

Cleaning up R12 instance:

Following are the locations in applmgr side which you can check and clean up. Be careful while cleaning up the log files, because some might be needed for analysis or might contan errors for some reproducible test case. So if you delete some log file which is needed, you might have to redo that work. Usually its a good idea to leave the logs which are 1-2 days old and delete the other older logs

Main location for logs and other not useful files on applmgr side:

Forms dump files : $INST_TOP/logs/ora/10.1.2/forms

Reports Cache : $INST_TOP/logs/ora/10.1.2/reports/cache

Apache logs : $INST_TOP/logs/ora/10.1.3/Apache

OPMN Logs : $INST_TOP/logs/ora/10.1.3/opmn

Its advisable not to remove any logs under $INST_TOP/logs/ora/10.1.3/j2ee directory since these are very important logs and are required frequently for debugging.

Logs for service management : $INST_TOP/logs/appl/admin/log

Concurrent Manager logs : $INST_TOP/logs/appl/conc/log

Concurrent Manager out files : $INST_TOP/logs/appl/conc/out

Other then these directories if you have some patch downloaded at some location, it is advisable to remove those patches once applied.

Main location for logs and other not useful files on oracle side:

Cleanup background_dump_dest, user_dump_dest and core_dump_dest directories on database side. These locations usually have huge trace files.

Check the location of ORACLE_HOME using du -sh command. Usually the size of ORACLE_HOME should be aounr 3-4G. If size of ORACLE_HOME (other then datafiles) is abnormally large like 7-8G or more then you need to investigate which directory is consuming more space and accordingly clean up that directory if appropriate.

In some situation if it becomes impossible to clean up the space (because there are no trace files to cleanup) and you desperately want the space to be available on the file system, then you can connect to database as sysdba and try to reduce the size of temp files using “alter database tempfile .. resize” comamnd. This will release some space and prevent database from crashing in case file system is reaching 100% full.

Again if some patches are downloaded for application, make sure to remove the patches zip files once they are applied.

Some times we upgrade the database to a major release, like from 9i to 10g or from 10g to 11g. In that case its advicable to remove the old ORACLE_HOME. This will not only save space but also will avoid confusion.

Cleaning up 11i instance:

Main location for logs and other not useful files on applmgr side:

Logs for Concurrent manager, forms and reports: $COMMON_TOP/admin/log/$CONTEXT_NAME

Out files for Concurrent managers: $COMMON_TOP/admin/out/$CONTEXT_NAME

Apache Log files: $IAS_ORACLE_HOME/Apache/Apache/logs

Jserv Log files: $IAS_ORACLE_HOME/Apache/Jserv/logs

There are some log files in $APPL_TOP/admin/$TWO_TASK/log and $AD_TOP/log, but its advisable not to delete these logs as they are very important for debugging.

Main location for logs and other not useful files on oracle side:

Cleanup background_dump_dest, user_dump_dest and core_dump_dest directories on database side. These locations usually have huge trace files.

Hope this helps !!

June 17, 2009

AutoConfig Search Utility

Sometime if we want to find out a variable to be changed in context file, but we dont know the exact name and the meaning of the variable then we can use autoconfig search utility. Search utility will ask for the keyword to be searched for and will generate the report based on the available variables contaning that search keyword. It will also give the description about the autoconfig variables, which is very useful.

Following is the way to use search utility

-bash-3.00$ perl $FND_TOP/bin/txkrun.pl -script=GenCtxInfRep -keyword=mwa -outfile=$OA_HTML/txkContext_Apps.html
*** ALL THE FOLLOWING FILES ARE REQUIRED FOR RESOLVING RUNTIME ERRORS
*** Log File = /slot/ems2815/appmgr/inst/apps/az1mq206_rws60043rems/logs/appl/rgf/TXK/txkGenCtxInfRep_Wed_Jun_17_00_04_30_2009.log
Program : /slot/ems2815/appmgr/apps/apps_st/appl/fnd/12.0.0/patch/115/bin/txkGenCtxInfRep.pl started @ Wed Jun 17 00:04:30 2009

*** Log File = /slot/ems2815/appmgr/inst/apps/az1mq206_rws60043rems/logs/appl/rgf/TXK/txkGenCtxInfRep_Wed_Jun_17_00_04_30_2009.log 

The HTML report is generated in /slot/ems2815/appmgr/apps/apps_st/comn/webapps/oacore/html/txkContext_Apps.html

Program : /slot/ems2815/appmgr/apps/apps_st/appl/fnd/12.0.0/patch/115/bin/txkGenCtxInfRep.pl completed @ Wed Jun 17 00:04:59 2009

End of /slot/ems2815/appmgr/apps/apps_st/appl/fnd/12.0.0/patch/115/bin/txkGenCtxInfRep.pl : No Errors encountered
-bash-3.00$

Here I used the keyword as mwa and the report will give all variables having mwa as sub-string. The report will look as shown in this link.

Hope this helps !!

The report will look as shown in this link
Next Page »

Blog at WordPress.com.