Thursday, 27 November 2014

Data Pump 10g / 11g Flashback_Scn and flashback_Time parameter

Flashback Exports 10g

The exp utility used the CONSISTENT=Y parameter to indicate the export should be consistent to a point in time. By default the expdp utility exports are only consistent on a per table basis. If you want all tables in the export to be consistent to the same point in time, you need to use the FLASHBACK_SCN or FLASHBACK_TIME parameter.
The FLASHBACK_TIME parameter value is converted to the approximate SCN for the specified time.


expdp ..... flashback_time=systimestamp
 
# In parameter file.
flashback_time="to_timestamp('09-05-2011 09:00:00', 'DD-MM-YYYY HH24:MI:SS')"
 
# Escaped on command line.
expdp ..... flashback_time=\"to_timestamp\(\'09-05-2011 09:00:00\', \'DD-MM-YYYY HH24:MI:SS\'\)\"

Not surprisingly, you can make exports consistent to an earlier point in time by specifying an earlier time or SCN, provided you have enough UNDO space to keep a read consistent view of the data during the export operation.
If you prefer to use the SCN, you can retrieve the current SCN using one of the following queries.


SELECT current_scn FROM v$database;
SELECT DBMS_FLASHBACK.get_system_change_number FROM dual;
SELECT TIMESTAMP_TO_SCN(SYSTIMESTAMP) FROM dual;

That SCN is then used with the FLASHBACK_SCN parameter.


expdp ..... flashback_scn=5474280

The following queries may prove useful for converting between timestamps and SCNs.


 
SELECT TIMESTAMP_TO_SCN(SYSTIMESTAMP) FROM dual;
SELECT SCN_TO_TIMESTAMP(5474751) FROM dual;

In 11.2, the introduction of legacy mode means that you can use the CONSISTENT=Y parameter with the expdp utility if you wish.

If you want to use a parameter file, you should make a file with for example this content and give it for example the name scott.par:

schemas=scott
dumpfile=exp_scott.dmp
logfile=exp_scott.log
directory=DATA_PUMP_DIR
flashback_time=systimestamp
..

You then can execute the export using:


expdp system/password parfile=scott.par

If you want a time consistent export on another timestamp, let say september 3rd 2014 on 14:41:00 then you should set the flashback_time parameter as follows:


flashback_time=”to_timestamp(’03-09-2014 14:41:00′, ‘DD-MM-YYYY HH24:MI:SS’)”


11g  ver: - 11.1
Flashback_Scn  and  flashback_Time  are  two  important  feature  of  the  datapump 11g . If  we  want  to  run  a  large  export  whilst  the  database  is  in  use  then  ideally  we  should  always use  one  of  the  two  flashback  parameters. The export  operation  is  performed  with  data  that is  consistent  as  of  the  specified  SCN .  FLASHBACK_SCN and FLASHBACK_TIME are mutually exclusive .

FLASHBACK_TIME : The SCN that most closely matches the specified time is found, and this SCN is used to enable the Flashback utility. The export operation is performed with data that is consistent as of this SCN. TheFLASHBACK_SCN parameter pertains only to the Flashback Query capability of Oracle Database. It is not applicable to Flashback Database, Flashback Drop, or Flashback Data Archive. We can get the scn number from the following query :

SQL> select current_scn from v$database ;       or

SQL>select dbms_flashback.get_system_change_number from dual ; 

Let's have a Demo of the flashback_scn

SQL> select current_scn from v$database;

CURRENT_SCN
------------------------
    1140271

SQL> create table hr.test as select * from test;
Table created.

SQL> select current_scn from v$database;

CURRENT_SCN
-------------------------
    1140487

Let's take a export using flashback_scn  parameter
oracle$ expdp system/ramtech@terminal directory=dpump schemas=hr dumpfile=flashback_hr.dmp logfile=flashlog.log       flashback_scn=1140271

Export: Release 11.1.0.6.0 - Production on Saturday, 16 MAY, 2014 11:35:45
Copyright (c) 2003, 2007, Oracle.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/********@terminal directory=dpump schemas=hr dumpfile=flashback_hr.dmp logfile=flashlog.log    flashback_scn=1140271
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 512 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCACT_SCHEMA
. . exported "HR"."COUNTRIES"                            6.375 KB      25 rows
. . exported "HR"."DEPARTMENTS"                          7.015 KB      27 rows
. . exported "HR"."EMPLOYEES"                            16.80 KB     107 rows
. . exported "HR"."JOBS"                                 6.984 KB      19 rows
. . exported "HR"."JOB_HISTORY"                          7.054 KB      10 rows
. . exported "HR"."LOCATIONS"                            8.273 KB      23 rows
. . exported "HR"."REGIONS"                              5.484 KB       4 rows
ORA-31693: Table data object "HR"."TEST" failed to load/unload and is being skipped due to error:
ORA-02354: error in exporting/importing data
ORA-01466: unable to read data - table definition has changed
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  D:\DPUMP\FLASHBACK_HR.DMP
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" completed with 1 error(s) at 11:37:50

The above error show that the table "test"  is not include in the  export operation because the SCN mention  is of before the table "test" creation. The below export will show the export upto current SCN when database is in use.
Oracle$ expdp system/ramtech@terminal directory=dpump schemas=hr dumpfile=flashback_hr1.dmp  logfile=flashback_log.log  flashback_scn=1140487

Export: Release 11.1.0.6.0 - Production on Saturday, 16 MAY, 2014 11:44:50
Copyright (c) 2003, 2007, Oracle.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/********@terminal directory=dpump schemas=hr dumpfile=flashback_hr1.dmp logfile=flashback_log.log
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 512 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCACT_SCHEMA
. . exported "HR"."COUNTRIES"                                6.375 KB      25 rows
. . exported "HR"."DEPARTMENTS"                          7.015 KB      27 rows
. . exported "HR"."EMPLOYEES"                             16.80 KB     107 rows
. . exported "HR"."JOBS"                                             6.984 KB      19 rows
. . exported "HR"."JOB_HISTORY"                             7.054 KB      10 rows
. . exported "HR"."LOCATIONS"                                8.273 KB      23 rows
. . exported "HR"."REGIONS"                                      5.484 KB       4 rows
. . exported "HR"."TEST"                                              5.054 KB       8 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  D:\DPUMP\FLASHBACK_HR1.DMP
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 11:46:41





Oracle$ impdp system/ramtech@terminal directory=dpump schemas=hr dumpfile=flashback_hr1.dmp  logfile=impflashback_log.log  flashback_scn=1140487





From version 11.2 and higher it is also possible to use the so called legacy mode: you can use the parameters from the old exp utilities! You can use the consistent=y parameter again to make a time consistent export:


$ expdp schemas=scott consistent=y dumpfile=exp_scott.dmp logfile=exp_scott.log directory=DATA_PUMP_DIR

This is the output you will get:
Export: Release 11.2.0.4.0 – Production on Wed Sep 3 15:32:03 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

Username: system
Password:

Connected to: Oracle Database 11g Release 11.2.0.4.0 – 64bit Production
Legacy Mode Active due to the following parameters:
Legacy Mode Parameter: “consistent=TRUE” Location: Command Line, Replaced with: “flashback_time=TO_TIMESTAMP(‘2014-09-03 15:32:03′, ‘YYYY-MM-DD HH24:MI:SS’)”
Legacy Mode has set reuse_dumpfiles=true parameter.
Starting “SYSTEM”.”SYS_EXPORT_SCHEMA_01″: system/******** schemas=RPCR_DEV flashback_time=TO_TIMESTAMP(‘2014-09-03 15:32:03′, ‘YYYY-MM-DD HH24:MI:SS’) dumpfile=rpcr_dev2.dmp logfile=rpcr_dev.log directory=EXP_DIR reuse_dumpfiles=true
Estimate in progress using BLOCKS method…
….

So you see that expdp is translating consistent=y to a flashback_time parameter.

As I said this works only in version 11.2 and higher.

Tuesday, 18 November 2014

Oracle Installation On RHEL 5.x / 6.x

====================
Oracle 10g On RHEL 5.x
====================

#Unpack Files
Unzip cmd
Unzip the files: unzip 10201_database_linux32.zip

#Hosts File
# hostname
# hostname linux

 The /etc/hosts file must contain a fully qualified name for the server:
<IP-address>  <fully-qualified-machine-name>  <machine-name>
linux.com linux

#Set Oralce Kernel Parameters
 Add the following lines to the /etc/sysctl.conf file:

#shmax set of 50% of ram in byte when 1 GB of ram then 512*1024*1024
kernel.shmmax = 2147483648

#shmall is shmmax/PAGE_SIZE default pagesize is 4096 (4 KB)--- # getconf PAGE_SIZE
kernel.shmall = 2097152

#shmmni minimum size of shared segment is 4 KB (4096 in bytes)
kernel.shmmni = 4096

# Increase the size of shmall without reboot linux reboot system
# cat /etc/proc/sys/kernel/shmall
2097152

# echo 2097152> /etc/proc/sys/kernel/shmall

 Alternative command 
# sysctl -w kernel.shmall=2097152
# echo "kernel.shmall=2097152">> /etc/sysctl.conf

 Removing shared memory when show status 'dest' destroy then crash the shared memory segments.
# $ ipcs -m  //see the shmid column where status is dest then following next command
# $ ipcs -m -i 32768
# $ ipcrm shm 32768  //remove shmid


# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144

# Run the following command to change the current kernel parameters:
/sbin/sysctl -p   (# sysctl -p)

# Add the following lines to the /etc/security/limits.conf file:
oracle           soft     nproc            2047
oracle           hard    nproc           16384
oracle           soft     nofile            1024
oracle           hard    nofile           65536

# Add the following line to the /etc/pam.d/login file, if it does not already exist:
session    required     pam_limits.so


# Disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows:

SELINUX=disabled
Alternatively, this alteration can be done using the GUI tool (System > Administration > Security Level and Firewall). Click on the SELinux tab and disable the feature.




Setup
 Install the following packages:
 rpm -ivh binutils*
 rpm -ivh elfutils*
 rpm -ivh setarch-2*
 rpm -ivh make-3*
 rpm -ivh glibc-2.5-12.i386.rpm
 rpm -ivh glibc-2.5-12.i686.rpm
 rpm -ivh libaio-0*
 rpm -ivh compat-libstdc++-*
 rpm -ivh compat-libstdc++-33-3.2.3-61.i386.rpm
 rpm -ivh compat-libf2c*
 rpm -ivh glibc-headers-2.5-12.i386.rpm
 rpm -ivh glibc-devel-2.5-12.i386.rpm
 rpm -ivh compat-gcc-34-3.4.6-4.i386.rpm
 rpm -ivh compat-gcc-34-3*
 rpm -ivh compat-gcc-34-c++-3*
 rpm -ivh libgomp-4.1.1-52.el5.i386.rpm
 rpm -ivh gcc-4*
 rpm -ivh libXp-1*
 rpm -ivh openmotif-2*
 rpm -ivh compat-db-4*
 rpm -ivh glibc-common*
 rpm -ivh libstdc*
 rpm -ivh libgcc*
 rpm -ivh unixODBC*
 rpm -ivh sysstat*



# COMMAND
# cat /etc/passwd
# cat /etc/group
# userdel oracle
# groupdel oracle

# Create the new groups and users:
groupadd oinstall
groupadd dba
groupadd oper

useradd -g oinstall -G dba oracle
passwd oracle

# Create the directories in which the Oracle software will be installed:
mkdir -p /u01/app/oracle/product/10.2.0/db_1
chown -R oracle.oinstall /u01
chown -R oracle.oinstall /u02
chmod -R 775 /u01
chmod -R 775 /u02

# Login as root and issue the following command:
xhost +<machine-name>

# Edit the /etc/redhat-release file replacing the current release information
(Red Hat Enterprise Linux Server release 5 (Tikanga)) with the following:
vim /etc/redhat-release

redhat-4



# Login as the ORACLE user and ADD the following lines at the end of the .bash_profile file:

# su - oracle
$ vi .bash_profile


# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=TSH1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fi
:wq!

$. .bash_profile  //ROOT COMMANDS:

[root@beam oracle]# chown oracle:oinstall database/
# ls -lrt
# ls -li
# cd database
[root@beam database]# ls -lrt
[root@beam database]# chown -R oracle:oinstall *
[root@beam database]# ls -lrt
[root@beam database]# cd response
[root@beam response]# ls -lrt


# Installation
LOGIN oracle user LOGOUT root user



Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable:
DISPLAY=<machine-name>:0.0; export DISPLAY

 Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory:
./runInstaller

 During the installation enter the appropriate ORACLE_HOME and name then continue installation. For a more detailed look at the installation process, click on the links below to see screen shots of each stage.

[root@beam oraInventory]# ./orainstRoot.sh

Run the following scripts as root:
   /u01/app/oracle/oraInventory/orainstRoot.sh
   /u01/app/oracle/product/10.2.0/db_1/root.sh




================
11g On RHEL 5.x
================
umount tmpfs
mount -t tmpfs shmfs -o size=2000m /dev/shm

/etc/fstab
shmfs /dev/shm tmpfs size=2000m 0 0

physical recomment 1024Mb > 1100
swap double


 The /etc/hosts file must contain a fully qualified name for the server:
<IP-address>  <fully-qualified-machine-name>  <machine-name>
linux.com linux

#Set Oralce Kernel Parameters
 Add the following lines to the /etc/sysctl.conf file:
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048576

# Run the following command to change the current kernel parameters:
/sbin/sysctl -p   (# sysctl -p)

# Add the following lines to the /etc/security/limits.conf file:
oracle           soft     nproc         2047
oracle           hard    nproc         16384
oracle           soft     nofile          1024
oracle           hard    nofile          65536
oracle           soft     stack          10240

# Add the following line to the /etc/pam.d/login file, if it does not already exist:
session    required     pam_limits.so


# Disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows:

SELINUX=disabled
Alternatively, this alteration can be done using the GUI tool (System > Administration > Security Level and Firewall). Click on the SELinux tab and disable the feature.




Setup
 Install the following packages:
 rpm -ivh binutils*
 rpm -ivh elfutils*
 rpm -ivh setarch-2*
 rpm -ivh make-3*
 rpm -ivh glibc-*
 rpm -ivh libaio-0*
 rpm -ivh compat-libstdc++-*
 rpm -ivh compat-libstdc++-33*
 rpm -ivh compat-libf2c*
 rpm -ivh glibc-headers-*
 rpm -ivh glibc-devel-*
 rpm -ivh compat-gcc-*
 rpm -ivh compat-gcc-34-3*
 rpm -ivh compat-gcc-34-c++-3*
 rpm -ivh libgomp-*
 rpm -ivh gcc-4*
 rpm -ivh libXp-1*
 rpm -ivh openmotif-2*
 rpm -ivh compat-db-4*
 rpm -ivh glibc-common*
 rpm -ivh libstdc*
 rpm -ivh libgcc*
 rpm -ivh unixODBC*
 rpm -ivh sysstat*



# COMMAND
# cat /etc/passwd
# cat /etc/group
# userdel oracle
# groupdel oracle

# Create the new groups and users:
groupadd oinstall
groupadd dba
groupadd oper

useradd -g oinstall -G dba oracle
passwd oracle

# Create the directories in which the Oracle software will be installed:
mkdir -p /u01/oracle/product/10.2.0/db_1
chown -R oracle.oinstall /u01
chown -R oracle.oinstall /u02
chmod -R 775 /u01
chmod -R 775 /u02

# Login as root and issue the following command:
xhost +<machine-name>

# Edit the /etc/redhat-release file replacing the current release information
(Red Hat Enterprise Linux Server release 5 (Tikanga)) with the following:
vim /etc/redhat-release

redhat-4



# Login as the ORACLE user and ADD the following lines at the end of the .bash_profile file:

# su - oracle
$ vi .bash_profile


# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/u01/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=TSH1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fi
:wq!

$. .bash_profile  //ROOT COMMANDS:

[root@beam oracle]# chown oracle:oinstall database/
# ls -lrt
# ls -li
# cd database
[root@beam database]# ls -lrt
[root@beam database]# chown -R oracle:oinstall *
[root@beam database]# ls -lrt
[root@beam database]# cd response
[root@beam response]# ls -lrt


# Installation
LOGIN oracle user LOGOUT root user


Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable:
DISPLAY=<machine-name>:0.0; export DISPLAY

 Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory:
./runInstaller




===================
Oracle  11g On RHEL 6
===================

linux 6.1 on Oracle

---tmp approx 5 gb

#Unpack Files
Unzip cmd
Unzip the files: unzip 10201_database_linux32.zip

#Hosts File
# hostname
# hostname linux

 The /etc/hosts file must contain a fully qualified name for the server:
<IP-address>  <fully-qualified-machine-name>  <machine-name>
linux.com linux

#Set Oralce Kernel Parameters
 Add the following lines to the /etc/sysctl.conf file:

kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536
fs.aio-max-nr = 1048576
fs.suid_dumpable= 1
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

# Run the following command to change the current kernel parameters:
/sbin/sysctl -p   (# sysctl -p)

# Add the following lines to the /etc/security/limits.conf file:
oracle           soft     nproc            2047
oracle           hard    nproc           16384
oracle           soft     nofile          4096
oracle           hard    nofile           65536
oracle soft stack 10240


# Add the following lines to the /etc/security/limits.d/90- file:



# Add the following line to the /etc/pam.d/login file, if it does not already exist:
session    required     pam_limits.so


# Disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows:

SELINUX=permissive
Alternatively, this alteration can be done using the GUI tool (System > Administration > Security Level and Firewall). Click on the SELinux tab and disable the feature.






-----Setup
 Install the following packages:



rpm -ivh libstdc++-devel-4.4.5*
rpm -ivh kernel-header-2.6.32-131*
rpm -ivh glibc-headers-2.12*
rpm -ivh glibc-devel-2.12*

rpm -ivh gnome-icon-theme-2*
rpm -ivh dmz-cursor-themes-0.4.4*
rpm -ivh sgml-common-0.6*
rpm -ivh libaio-devel-0.3.107*
rpm -ivh ncurses-devel-5.7-3*
rpm -ivh elfutils-libelf-devel-0.152*

rpm -ivh compat-gcc-34-3*
rpm -ivh libXxf86misc-1.0.2*
rpm -ivh libXmu-1.0.5*
rpm -ivh mpfr-2.4*
rpm -ivh cpp-4.4.5*

rpm -ivh xorg-x11-xauth-1.0*
rpm -ivh compat-gcc-34*
rpm -ivh libdaemon-0.14-1*
rpm -ivh avahi-0.6.25*


rpm -ivh avahi-glib-0.6.25*
rpm -ivh shared-mime-info-0.70*
rpm -ivh liblDL-0.8*
rpm -ivh ORBit2-2.14*

rpm -ivh GConf2-2.28*
rpm -ivh gnome-vfs2-2*
rpm -ivh libbonobo-ltdl-2.24*
rpm -ivh libtool-ltddl-2.2*

rpm -ivh unixODBC-2.2.14*
rpm -ivh gtk2-engines-2.18.4*
rpm -ivh libmcpp-2.7*
rpm -ivh mcpp-2.7.2*
rpm -ivh xorg-x11-server-utils-7.4*
rpm -ivh ConsoleKit-x11-xinit-1.0*
rpm -ivh libXp-1.0.0*
rpm -ivh libXxf86dga-1.1.1-1*
rpm -ivh libdmx-1.1.0*
rpm -ivh xorg-x11-utils-7.4-8*
rpm -ivh compat-db43-4.3.29*
rpm -ivh compat-db42-4.2.52*
rpm -ivh ppl-0.10.2-11*
rpm -ivh cloog-ppl-0.15.7*
rpm -ivh gcc-4.4.5-6*
rpm -ivh gcc-c++-4.4.5-6*
rpm -ivh compat-libstdc++-33-3*
rpm -ivh compat-db-4.6.21*
rpm -ivh gnome-themes-2.28.1-6*
rpm -ivh system-icon-themes-6*
rpm -ivh system-gnome-themes-6*
rpm -ivh unixODBC-devel-2.2*
rpm -ivh readline-devel-6.0*
rpm -ivh libgnome-2.28.0*




# COMMAND
# cat /etc/passwd
# cat /etc/group
# userdel oracle
# groupdel oracle

# Create the new groups and users:
groupadd oinstall
groupadd dba
groupadd oper

useradd -g oinstall -G dba oracle
passwd oracle

# Create the directories in which the Oracle software will be installed:
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle.oinstall /u01
chown -R oracle.oinstall /u02
chmod -R 775 /u01
chmod -R 775 /u02

# Login as root and issue the following command:
xhost +<machine-name>


# Edit the /etc/redhat-release file replacing the current release information
(Red Hat Enterprise Linux Server release 6 (Tikanga)) with the following:
vim /etc/redhat-release

redhat-4







# Login as the ORACLE user and ADD the following lines at the end of the .bash_profile file:
# su - oracle
$ vi .bash_profile

# Oracle Settings
#TMP=/tmp; export TMP
#TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=TSH1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fi
:wq!

$. .bash_profile  //ROOT COMMANDS:



# Installation
LOGIN oracle user LOGOUT root user



Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable:
DISPLAY=<machine-name>:0.0; export DISPLAY

 Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory:
./runInstaller

 During the installation enter the appropriate ORACLE_HOME and name then continue installation. For a more detailed look at the installation process, click on the links below to see screen shots of each stage.


[root@beam oraInventory]# ./orainstRoot.sh



Run the following scripts as root:
   /u01/app/oracle/oraInventory/orainstRoot.sh
   /u01/app/oracle/product/10.2.0/db_1/root.sh





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

What is oraInventory

The Orainventory is the location for the OUI's Book keeping
The inventory stores information about.
  • All the Oracle software products installed on all ORACLE_HOMES on a machine
  • Other non-oracle products such as Java Runtime env's (JRE)

  1. Global Inventory
Global Inventory holds information about Oracle Products on a Machine, The inventory contains the high level list of all oracle products installed on a machine such as ORACLE_HOMES or JRE.
It doesn't have any information about the details of patches applied on each ORACLE_HOMES.
There should be only one per machine. Its locations is defined in the oraInst.loc in /etc (on Linux) or /var/opt/oracle (solaris).
  1. Local Inventory
There is one Local inventory per ORACLE_HOME.
Inventory inside each Oracle Home is called as local Inventory or ORACLE_HOME Inventory. This Inventory holds information to that ORACLE_HOME only.

Can I have multiple Global Inventories on a machine?
Can you have multiple global Inventory and answer is YES you can have multiple global Inventory but if your upgrading or applying patch then change Inventory Pointer oraInst.loc to respective location.
If you are following single global Inventory and if you wish to uninstall any software then remove it from Global Inventory as well.

What to do if my Global Inventory is corrupted?
Follow Link else below : RE-CREATE ORAINVENTORY
If your global Inventory is corrupted, you can recreate global Inventory on machine using Universal Installer and attach already Installed oracle home by option
-attachHome
./runInstaller -silent -attachHome -invPtrLoc $location_to_oraInst.loc ORACLE_HOME=Oracle_Home_Location ORACLE_HOME_NAME=Oracle_Home_Name CLUSTER_NODES={}

Do I need to worry about oraInventory during oracle Apps 11i cloning ?
No, Rapid Clone will update both Global & Local Inventory with required information, you don't have to worry about Inventory during Oracle Apps 11i cloning.

How to Move oraInventory from one location to other?Find the current location of the central inventory (Normally $ORACLE_BASE/oraInventory):
Open the oraInst.loc file in /etc and check the value of inventory_loc
cat /etc/oraInst.loc
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall 

Remark: The oraInst.loc file is simply a pointer to the location of the central inventory (oraInventory)
Copy the oraInventory directory to the destination directory
cp -Rp /u01/app/oracle/oraInventory /u02/app/oracle/oraInventory
Edit the oraInst.loc file to point to the new location
vi /etc/oraInst.loc
inventory_loc=/u02/app/oracle/oraInventory
inst_group=dba




How To Install oracle in silent mode

Wednesday, 12 November 2014

ORA-00354 ORA-00353 ORA-00312 Corrupt redo block header


Error Description:
----------------------------

I ran DML operation on database and it failed with exception. I looked for alert log and the entry is ,
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 11037 change 118820174 time 04/22/2008 11:15:12
ORA-00312: online log 2 thread 1: '/oradata1/system/ARJU/redo02.log'

Cause of The Problem:
----------------------------

The redo log file has been corrupted. It may be corrupted through various reasons. Suppose there is disk full or hardware failure.

Solution of The Problem:
------------------------------
.
Solution 1 or 2 is the option while database is open and solution 3 is the option if database is closed.
Solution 1: Look at the disk space usage containing redo log. If disk is full then free it by removing unwanted files. If disk is ok then try to clear the log file. Here from error we see log 2 is corrupted. So , clear group 2 Like,

SQL>ALTER DATABASE CLEAR LOGFILE GROUP 2;

Clear logfile does the thing of dropping logfile and then create. The advantage of this procedure is it can be used if you have only two redo log group.

Solution 2: If redo log was not archived (query from V$LOG) then you must specify UNARCHIVED LOGFILE. Otherwise error will come.
Try, SQL>ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 2;
After issuing this you have lost archived data, so take backup immediately.

In both 1 and 2 if it was the logfile member of online redo log group then you must issue,
SQL> alter system checkpoint;after clearing it.
Solution 3: If both does not work then do a point in time recovery.
SQL>SHUTDOWN ABORT;
SQL>STARTUP MOUNT;
RMAN>RESTORE DATABASE;
SQL>RECOVER DATABASE UNTIL CANCEL; CANCEL
SQL>ALTER DATABASE OPEN RESETLOGS;


Point in time recovery is described in DBPITR
If database can't be opened that solution 3 is the only option

How to perform Database Point in time Recovery DBPITR


About Database Point in time recovery
----------------------------------------------

Database point-in-time recovery is helpful whenever we want to back the whole database to an earlier time. With RMAN you can give a specified target time and RMAN restores the database from backups prior to that time, and then applies archived redo log or incremental backups to perform media recovery to recreate all changes between the time of the datafile backups and the target time.

Disadvantages of Database Point in time Recovery
------------------------------------------------------

1)Unlike TSPITR you can't get back a set of objects to their past state instead you have to back to an earlier with of the entire database.

2)The entire database will be unavailable during the operation.

3)It is time-consuming, because all datafiles must be restored, and redo logs and incremental backups must be restored from backup and used to recover the datafiles.

Requirements of Database Point in time Recovery
--------------------------------------------------------------

1)Your database must be in archivelog mode.
2)You must have backups of all datafiles from before the target SCN for DBPITR and archived redo logs or incremental backups for the period between the SCN of the backups and the target SCN.

Database Point-in-Time Recovery Within the Current Incarnation
----------------------------------------------------------------------

If you want to perform database point in time recovery within current incarnation then you don't have to perform extra work as RMAN by default search for backups within current incarnation. Only you need SET UNTIL clause and then RESTORE and RECOVER. However you can get back your database to an ancestor incarnation .In that case before performing operation set incarnation. Like RESET DATABASE INCARNATION TO 1. In order to do so as well as to know about incarnation please have a look About Database Incarnations

In the following steps I demonstrate an example of how we can perform DBPITR.

1)Create a Table. Just an an extra work. I just created it and want to perform DBPITR before the time of table creation in order to show that this table would not found after DBPITR.

SQL> CONN A/A
Connected.

SQL> CREATE TABLE BEFORE_PITR TABLESPACE USERS AS SELECT LEVEL A FROM DUAL CONNECT BY LEVEL <100;

Table created.

2)Shutdown the database.
SQL> CONN / AS SYSDBA
Connected.

SQL> SHUTDOWN ABORT

ORACLE instance shut down.

3)Connect to rman and Perform DBPITR. Here I wanted to get back of database to 30 minutes ago from current date. So I used SYSDATE-1/24/60*30.

SQL> !rman TARGET /

Recovery Manager: Release 10.2.0.1.0 - Production on Wed May 14 22:31:25 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database (not started)
RMAN> RUN{
2> RESTORE DATABASE UNTIL TIME 'SYSDATE-1/24/60*30';
3> RECOVER DATABASE UNTIL TIME 'SYSDATE-1/24/60*30';
4> } 

Starting restore at 14-MAY-08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
.
.
media recovery complete, elapsed time: 00:00:27
Finished recover at 14-MAY-08

4)Open the database with RESETLOGS option.
RMAN> SQL'ALTER DATABASE OPEN RESETLOGS';

using target database control file instead of recovery catalog
sql statement: ALTER DATABASE OPEN RESETLOGS

5)Check the objects under Arju Schema.

SQL> conn a/a
Connected.
SQL> select table_name from tabs;

TABLE_NAME
------------------------------
TesT
MY_TABLE

And see that BEFORE_PITR is lost.

In stead of giving 'SYSDATE-1/24/60*30' you can also use time expressions,SCN restore points,SCN or log sequence numbers with SET UNTIL clause.

Like,
RMAN>RUN{
#SET UNTIL TIME 'Nov 12 2007 06:00:00'; --Set NLS_DATE_FORMAT setting.
#SET UNTIL SEQUENCE 9923;
#SET UNTIL RESTORE POINT before_update; --The restore point you created early.
SET UNTIL SCN 123456;
RESTORE DATABASE;
RECOVER DATABASE;

Delete Archivelog Using RMAN in Oracle

If your storage is about full, you must either delete old backup and archivelog or move to tape.
If you want to delete archivelog from FRA(ASM Storage-Flash Revovery Area) or filesystem for win space, you can use below commands. You can delete archivelog safely, because archivelog deleting does not harm to database.

Archivelog List Commands

RMAN>list archivelog all;
RMAN>list copy of archivelog until time 'SYSDATE-10';
RMAN>list copy of archivelog from time 'SYSDATE-10';
RMAN>list copy of archivelog from time 'SYSDATE-10' until time 'SYSDATE-2';
RMAN>list copy of archivelog from sequence 1000;
RMAN>list copy of archivelog until sequence 1500;
RMAN>list copy of archivelog from sequence 1000 until sequence 1500;
RMAN> crosscheck archivelog until time 'SYSDATE-10';

Archivelog Delete Commands

RMAN>delete archivelog all;
RMAN>delete archivelog until time 'SYSDATE-10';
RMAN>delete archivelog from time 'SYSDATE-10'
RMAN>delete archivelog from time 'SYSDATE-10' until time 'SYSDATE-2';
RMAN>delete archivelog from sequence 1000;
RMAN>delete archivelog until sequence 1500;
RMAN>delete archivelog from sequence 1000 until sequence 1500;
RMAN> delete expired archivelog until time 'SYSDATE-10';

Note : Also, you can use noprompt statement for do not yes-no question.
RMAN>delete noprompt archivelog until time 'SYSDATE-10';

Monday, 13 October 2014

How to Purge the RECYCLEBIN in Oracle 10g

THE RECYCLE BIN
*****************

The Recycle Bin is a virtual container where all dropped objects reside. Underneath the covers, the objects are occupying the same space as when they were created. If table EMP was created in the USERS tablespace, the dropped table EMP remains in the USERS tablespace. Dropped tables and any associated objects such as indexes, constraints, nested tables, and other dependant objects are not moved, they are simply renamed with a prefix of BIN$$. You can continue to access the data in a
dropped table or even use Flashback Query against it. Each user has the same rights and privileges on Recycle Bin objects before it was dropped. You can view your dropped tables by querying the new RECYCLEBIN view. Objects in the Recycle Bin will remain in the database until the owner of the dropped objects decides to permanently remove them using the new PURGE command. The Recycle Bin objects are counted against a user's quota. But Flashback Drop is a non-intrusive feature. Objects in the Recycle Bin will be automatically purged by the space reclamation process if

o A user creates a new table or adds data that causes their quota to be exceeded.
o The tablespace needs to extend its file size to accommodate create/insert operations.


There is no issues with DROPping the table, behaviour wise. It is the same as in 8i / 9i. The space is not released immediately and is accounted for within the same tablespace / schema after the drop.

When we drop a tablespace or a user there is NO recycling of the objects.

o Recyclebin does not work for SYS objects

Checking the RECYCLEBIN Objects
*******************************

SELECT object_name,original_name,operation,type,dropscn,droptime FROM user_recyclebin;

SELECT owner,original_name,operation,type FROM dba_recyclebin;


Purging the Recyclebin
**************************
Subject: 10g Recyclebin Features And How To Disable it( _recyclebin )
Doc ID: Note:265253.1 Type: BULLETIN

Applies to: Oracle Server - Enterprise Edition - Version: 10.1.0.2 to 10.2.0.0
Information in this document applies to any platform.
Purpose:- This bulletin illustrates the new recyclebin functionality provided with the 10g database

Scope and ApplicationCan be used by Oracle Support Analyst and DBA

10g Recyclebin Features And How To Disable it( _recyclebin )ABOUT 10g RECYCLEBIN
In order to have FLASHBACK DROP functionality a recyclebin is provided to every oracle user.

SQL> desc recyclebin
Name Null? Type
----------------------------------------- -------- ------------
OBJECT_NAME NOT NULL VARCHAR2(30)
ORIGINAL_NAME VARCHAR2(32)
OPERATION VARCHAR2(9)
TYPE VARCHAR2(25)
TS_NAME VARCHAR2(30)
CREATETIME VARCHAR2(19)
DROPTIME VARCHAR2(19)
DROPSCN NUMBER
PARTITION_NAME VARCHAR2(32)
CAN_UNDROP VARCHAR2(3)
CAN_PURGE VARCHAR2(3)
RELATED NOT NULL NUMBER
BASE_OBJECT NOT NULL NUMBER
PURGE_OBJECT NOT NULL NUMBER
SPACE NUMBER

The recyclebin is a public synonym and it is based on the view user_recyclebin which in turn is based on sys.recyclebin$ table.

Related recyclebin objects:

SQL> SELECT SUBSTR(object_name,1,50),object_type,owner
FROM dba_objects
WHERE object_name LIKE '%RECYCLEBIN%';
/
SUBSTR(OBJECT_NAME,1,50) OBJECT_TYPE OWNER
--------------------------- ------------------- ----------
RECYCLEBIN$ TABLE SYS
RECYCLEBIN$_OBJ INDEX SYS
RECYCLEBIN$_TS INDEX SYS
RECYCLEBIN$_OWNER INDEX SYS
USER_RECYCLEBIN VIEW SYS
USER_RECYCLEBIN SYNONYM PUBLIC
RECYCLEBIN SYNONYM PUBLIC
DBA_RECYCLEBIN VIEW SYS
DBA_RECYCLEBIN SYNONYM PUBLIC

9 rows selected.

EXAMPLE
SQL> SELECT * FROM v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bi
PL/SQL Release 10.1.0.2.0 - Production
CORE 10.1.0.2.0 Production
TNS for Solaris: Version 10.1.0.2.0 - Production
NLSRTL Version 10.1.0.2.0 - Production

SQL> sho user
USER is "BH"

SQL> SELECT object_name,original_name,operation,type,dropscn,droptime
2 FROM user_recyclebin
3 /
no rows selected

SQL> CREATE TABLE t1(a NUMBER);
Table created.

SQL> DROP TABLE t1;
Table dropped.

SQL> SELECT object_name,original_name,operation,type,dropscn,droptime
2 FROM user_recyclebin
3 /
OBJECT_NAME ORIGINAL_NAME OPERATION TYPE DROPSCN DROPTIME
------------------------------ -------------------------------- --------- ------------------------- ---------- -------------------
BIN$1Unhj5+DSHDgNAgAIKds8A==$0 T1 DROP TABLE 8.1832E+12 2004-03-10:11:03:49

SQL> sho user
USER is "SYS"

SQL> SELECT owner,original_name,operation,type
2 FROM dba_recyclebin
3 /

OWNER ORIGINAL_NAME OPERATION TYPE
------------------------------ -------------------------------- --------- ------
BH T1 DROP TABLE

We can also create a new table with the same name at this point.

@NOTE:
@Pre-10.1.0.3, the recycled objects can also be viewed in user_tables and dba_tables
@Fix for Bug 3255906 changed this behaviour to maintain compatibility with 9i



PURGING
********

In order to completely remove the table from the DB and to release the space the new PURGE command is used.

From BH user:
SQL> PURGE TABLE t1;
Table purged.

OR

SQL> PURGE TABLE "BIN$1UtrT/b1ScbgNAgAIKds8A==$0";
Table purged.

From SYSDBA user:
SQL> SELECT owner,original_name,operation,type
2 FROM dba_recyclebin
3 /
no rows selected

From BH user:
SQL> SHOW recyclebin
SQL>

There are various ways to PURGE objects:

PURGE TABLE t1;
PURGE INDEX ind1;
PURGE recyclebin; (Purge all objects in Recyclebin)
PURGE dba_recyclebin; (Purge all objects / only SYSDBA can)
PURGE TABLESPACE users; (Purge all objects of the tablespace)
PURGE TABLESPACE users USER bh; (Purge all objects of the tablspace belonging to BH)

For an object, the owner or a user with SYSDBA privilege or a user with DROP ANY... system privilege for the type of object to be purged can PURGE it.


DISABLING RECYCLEBIN
**********************

We can DROP and PURGE a table with a single command

From BH user:
SQL> DROP TABLE t1 PURGE;
Table dropped.

SQL> SELECT *
2 FROM recyclebin
3 /
no rows selected

There is no need to PURGE.

On 10gR1, in case we want to disable the behavior of recycling, there is an underscore parameter
"_recyclebin" which defaults to TRUE. We can disable recyclebin by setting it to FALSE.

From SYSDBA user:
SQL> SELECT a.ksppinm, b.ksppstvl, b.ksppstdf
FROM x$ksppi a, x$ksppcv b
WHERE a.indx = b.indx
AND a.ksppinm like '%recycle%'
ORDER BY a.ksppinm
/
Parameter Value Default?
---------------------------- ---------------------------------------- --------
_recyclebin TRUE TRUE

From BH user:
SQL> CREATE TABLE t1(a NUMBER);
Table created.

SQL> DROP TABLE t1;
Table dropped.

SQL> SELECT original_name
FROM user_recyclebin;
ORIGINAL_NAME
--------------
T1

From SYSDBA user:
SQL> ALTER SYSTEM SET "_recyclebin"=FALSE SCOPE = BOTH;
System altered.

SQL> SELECT a.ksppinm, b.ksppstvl, b.ksppstdf
FROM x$ksppi a, x$ksppcv b
WHERE a.indx = b.indx
AND a.ksppinm like '%recycle%'
ORDER BY a.ksppinm
/
Parameter Value Default?
---------------------------- ---------------------------------------- --------
_recyclebin FALSE TRUE

From BH user:
SQL> CREATE TABLE t1(a NUMBER);
Table created.

SQL> DROP TABLE t1;
Table dropped.

SQL> SELECT original_name
FROM user_recyclebin;
no rows selected

There is no need to PURGE.

As with anyother underscore parameter, setting this parameter is not recommended unless
advised by oracle support services.

On 10gR2 recyclebin is a initialization parameter and bydefault its ON.
We can disable recyclebin by using the following commands:

SQL> ALTER SESSION SET recyclebin = OFF;
SQL> ALTER SYSTEM SET recyclebin = OFF;

The dropped objects, when recyclebin was ON will remain in the recyclebin even if we set the recyclebin parameter to OFF.

Friday, 26 September 2014

oracleasm >= 1.0.4

oracleasm >= 1.0.4 is needed by oracleasmlib-2.0.4-1.el4.x86_64

[root@localhost Downloads]# rpm -ivh oracleasmlib-2.0.4-1.el4.x86_64.rpm
warning: oracleasmlib-2.0.4-1.el4.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID b38a8516: NOKEY
error: Failed dependencies:
    oracleasm >= 1.0.4 is needed by oracleasmlib-2.0.4-1.el4.x86_64


Action Taken

[root@localhost Downloads]# rpm -ivh --nodeps --force oracleasmlib-2.0.4-1.el4.x86_64.rpm
warning: oracleasmlib-2.0.4-1.el4.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID b38a8516: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:oracleasmlib-2.0.4-1.el4         ################################# [100%]
[root@localhost Downloads]# 

Saturday, 20 September 2014

OC4J Configuration issue. /u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_localhost.localdomain

[oracle@localhost ~]$ emctl start dbconsole
TZ set to Asia/Calcutta
OC4J Configuration issue. /u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_localhost.localdomain_xxxxx not found.

emca -repos drop

emca -repos create

 emca -config dbcontrol db

emctl start dbconsole

Saturday, 6 September 2014

SSH LOGIN TAKE TIME

vim /etc/ssh/sshd_config

#GSSAPIAuthentication yes     --- this setting if putty prompt a password after long time
GSSAPIAuthentication no

#UseDNS yes --- this setting after put the password long time
UseDNS no


service sshd restart

Saturday, 23 August 2014

Direct Login to forms in eBusiness Suite


The usual url for loggin in to Oracle Application is 

http://<server name>:<port>/

which most of the times gets directed to 
http://<server name>:<port>/OA_HTML/AppsLocalLogin.jsp

But for some reason or for troubleshooting purpose we may need to login directly to forms.
Below are the urls for directly connecting forms.

For 11i :-  
Socket mode:- http://<server name>:<port>/dev60cgi/f60cgi
Servlet mode:- http://<server name>:<port>/servlet/f60

For R12 :- 
Servlet mode:- http://<server name>:<port>/forms/frmservlet
Socket mode:- http://<server name>:<port>/OA_HTML/frmservlet

You can see the forms opening but after entering login details you may not be able to login and find the error as "APP-FND-01542: This application server is not authorized to access this database"

The reason for this is, direct forms login is disabled. To check and change that check the value for context variable "s_appserverid_authentication". You can make it ON or OFF to change the security level. SECURE doesn't allow you to login directly and gives the message as above.

Below are possible modes.
ON     :- Partial
SECURE :- activates full server security (SECURE mode)
OFF    :- deactivates server security



à COMMAND LINE OFF AUTHENTICATION EXECUTE

1.      java oracle.apps.fnd.security.AdminAppServer apps/apps AUTHENTICATION OFF DBC=PROD.dbc


3.     ./adautocfg.sh

4.     Enter Form User and Password in My Case :- SYSADMIN.    NOTE:- Not getting error as "APP-FND-01542: This application server is not authorized to access this database" And Open the form

5.     java oracle.apps.fnd.security.AdminAppServer apps/apps AUTHENTICATION ON DBC=PROD.dbc



For more details and alternative options refer metalink doc:- 293609.1