Monday, June 13, 2016

How to find Oracle EBS Weblogic Server Admin Port and URL

Weblogic admin port

Method 1

Open the Application tier context file
vi $CONTEXTFILE

Check the value of 'WLS Admin Server Port' from "s_wls_adminport" parameter


Method 2

Open the EBS domain config file
vi $EBS_DOMAIN_HOME/config/config.xml

Check the 'listen-port' value of the 'AdminServer' 


Weblogic console URL

http://<server name>. <domain name> : <weblogic Admin Port>/console 

Ex: http://oracle.test.com:7002/console

Tuesday, June 7, 2016

Gather Schema Statistics Completed with ORA-20001 Error in R12

Problem

Gather Schema statistics concurrent program completed with following error
+-----------------------------------------------------------+
Start of log messages from FND_FILE
+-----------------------------------------------------------+
In GATHER_SCHEMA_STATS , schema_name= ALL percent= 10 degree = 8 internal_flag= NOBACKUP
stats on table AQ$_WF_CONTROL_P is locked 
stats on table WF_CONTROL is locked 
Error #1: ERROR: While GATHER_TABLE_STATS:
object_name=GL.JE_BE_LINE_TYPE_MAP***ORA-20001: invalid column name or duplicate columns/column groups/expressions in method_opt***
Error #2: ERROR: While GATHER_TABLE_STATS:
object_name=GL.JE_BE_LOGS***ORA-20001: invalid column name or duplicate columns/column groups/expressions in method_opt***
Error #3: ERROR: While GATHER_TABLE_STATS:
object_name=GL.JE_BE_VAT_REP_RULES***ORA-20001: invalid column name or duplicate columns/column groups/expressions in method_opt***
+-----------------------------------------------------------+
End of log messages from FND_FILE
+-----------------------------------------------------------+

Solution

There are duplicate rows on FND_HISTOGRAM_COLS. Find out all duplicates and/or obsolete rows in FND_HISTOGRAM_COLS and delete one of them logged in as the applsys user.

1. Identify Duplicate Rows
select table_name, column_name, count(*)
from FND_HISTOGRAM_COLS
group by table_name, column_name
having count(*) > 1;
2. Use above results on the following SQL to delete duplicates
delete from FND_HISTOGRAM_COLS
where table_name = '&TABLE_NAME'
and  column_name = '&COLUMN_NAME'
and rownum=1;
You can get the updated query by running following.
select 'delete from FND_HISTOGRAM_COLS where table_name = '''||table_name||''' and column_name = '''||column_name||''' and rownum=1;' from FND_HISTOGRAM_COLS group by table_name, column_name having count(*) > 1;
3. Use following SQL to delete obsoleted rows
delete from FND_HISTOGRAM_COLS
where (table_name, column_name) in 
  (
   select hc.table_name, hc.column_name
   from FND_HISTOGRAM_COLS hc , dba_tab_columns tc
   where hc.table_name  ='&TABLE_NAME'
   and hc.table_name= tc.table_name (+)
   and hc.column_name = tc.column_name (+)
   and tc.column_name is null
  );

commit;

Reference:

11i - 12 Gather Schema Statistics fails with Ora-20001 errors after 11G database Upgrade (Doc ID 781813.1)

Wednesday, May 25, 2016

Oracle Pre-Upgrade Check Failed – DMSYS schema exists in the Database

Problem

Pre-upgrade check failed with following error when upgrade database 
The DMSYS schema exists in the database. Prior to performing an upgrade Oracle recommends that the DMSYS schema, and its associated objects be removed from the database.

Solution

Make sure the schema is not being used, then do the following 
SQL> CONNECT / AS SYSDBA;
SQL> DROP USER DMSYS CASCADE;
SQL> DELETE FROM SYS.EXPPKGACT$ WHERE SCHEMA = 'DMSYS'; 
SQL> SELECT COUNT(*) FROM DBA_SYNONYMS WHERE TABLE_OWNER = 'DMSYS';
If the above query return non-zero values then do the following to remove public synonyms referring DMSYS objects 
SQL> SET HEAD OFF
SQL> SPOOL drop_dmsys.sql
SQL> SELECT 'Drop public synonym ' ||'"'||SYNONYM_NAME||'";' FROM DBA_SYNONYMS WHERE TABLE_OWNER = 'DMSYS';
SQL> SPOOL OFF
SQL> @drop_dmsys.sql
SQL> EXIT;

Wednesday, May 18, 2016

Output post processor error - java.io.FileNotFoundException

Problem

Concurrent request completed with following error
One or more post-processing actions failed. Consult the OPP service log for details.
When we check Output post processor log below error appear
java.io.FileNotFoundException: <path> (No such file or directory)

Solution

Set the xml/BI publisher with valid temp directory
 Go to XML Publisher Administration responsibility -> Home -> Administration -> Configuration -> Properties -> General
And Enter with valid path or clear the value of Temporary directory


Reference

Output Post Processor Log File Contains java.io.FileNotFoundException (No such file or directory) Error (Doc ID 463388.1)

Wednesday, March 23, 2016

ASM Error - CRS-4124: Oracle High Availability Services startup failed on Linux 6

Problem

Once Installed the ASM Instance, Failed to start OHASD services
CRS-4124: Oracle High Availability Services startup failed.
CRS-4000: Command Start failed, or completed with errors.
ohasd failed to start: Inappropriate ioctl for device
ohasd failed to start at /grid/app/11.2.0/grid/crs/install/rootcrs.pl line 443.
Above error because of 11gR2 Database not support with Linux 6


Solution

1. Login to racnode1
2. Open the file $GRID_HOME/crs/install/s_crsconfig_lib.pm
3. Add the following lines before the # Start OHASD
## Added by Mohamed ##

my $UPSTART_OHASD_SERVICE = "oracle-ohasd";
my $INITCTL = "/sbin/initctl";

($status, @output) = system_cmd_capture ("$INITCTL start $UPSTART_OHASD_SERVICE");
if (0 != $status)
{
error ("Failed to start $UPSTART_OHASD_SERVICE, error: $!");
return $FAILED;
}

        # Start OHASD

4. Create a file /etc/init/oracle-ohasd.conf with below content
# Oracle OHASD startup
start on runlevel [35]
stop on runlevel [!35]
respawn
exec /etc/init.d/init.ohasd run >/dev/null 2>&1

5. De-config root.sh on racnode1
[root@astrac1 ~]# cd /u01/app/11.2.0/grid/crs/install/
[root@astrac1 install]# ./roothas.pl -deconfig -force -verbose
2016-03-16 15:20:48: Checking for super user privileges
2016-03-16 15:20:48: User has super user privileges
2016-03-16 15:20:48: Parsing the host name
Using configuration parameter file: ./crsconfig_params
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Delete failed, or completed with errors.
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'astrac1'
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'astrac1'
CRS-2673: Attempting to stop 'ora.evmd' on 'astrac1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'astrac1'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'astrac1'
CRS-2677: Stop of 'ora.cssdmonitor' on 'astrac1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'astrac1' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'astrac1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'astrac1'
CRS-2677: Stop of 'ora.mdnsd' on 'astrac1' succeeded
CRS-2677: Stop of 'ora.gipcd' on 'astrac1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'astrac1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
ADVM/ACFS is not supported on oraclelinux-release-6Server-7.0.5.x86_64

ACFS-9201: Not Supported
Successfully deconfigured Oracle Restart stack
[root@astrac1 install]#

5. Re-run root.sh on racnode1
[root@astrac1 ~]# cd /u01/app/11.2.0/grid/
[root@astrac1 grid]# ./root.sh
Running Oracle 11g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...
Now racnode1 is configured successfully and OHASD service started. Do the same steps to start the OHASD services on rest of the nodes.

Wednesday, March 2, 2016

To find forgotten Apps and Sysadmin password in R12

To find forgotten Apps Password

1. Connect sqlplus via sysdba
sqlplus / as sysdba
2. Create a function as follows
create or replace FUNCTION apps.decrypt_pin_func(in_chr_key IN VARCHAR2,in_chr_encrypt_pin IN VARCHAR2) RETURN VARCHAR2
AS
LANGUAGE JAVA NAME 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String';
/
3. Get the Encrypted password for GUEST user
select ENCRYPTED_FOUNDATION_PASSWORD from apps.fnd_user where USER_NAME='GUEST';
4. Get the apps password using encrypted password return in step 3
SELECT apps.decrypt_pin_func('GUEST/ORACLE','<ENCRYPTED_FOUNDATION_PASSWORD>') from dual;


To find forgotten Sysadmin Password

1. Connect sqlplus via sysdba
sqlplus / as sysdba
2. Create a package an package body as follows
CREATE OR REPLACE PACKAGE XXARTO_GET_PWD AS
FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
RETURN VARCHAR2;
END XXARTO_GET_PWD;
CREATE OR REPLACE PACKAGE BODY XXARTO_GET_PWD AS
FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
RETURN VARCHAR2 AS
LANGUAGE JAVA NAME 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt
(java.lang.String,java.lang.String) return java.lang.String';
END XXARTO_GET_PWD;
4. Get the password for sysadmin using below script
SELECT Usr.User_Name,
Usr.Description,
XXARTO_GET_PWD.Decrypt (
(SELECT (SELECT XXARTO_GET_PWD.Decrypt (
Fnd_Web_Sec.Get_Guest_Username_Pwd,
Usertable.Encrypted_Foundation_Password)
FROM DUAL)
AS Apps_Password
FROM applsys.Fnd_User Usertable
WHERE Usertable.User_Name =
(SELECT SUBSTR (
Fnd_Web_Sec.Get_Guest_Username_Pwd,
1,
INSTR (Fnd_Web_Sec.Get_Guest_Username_Pwd,
'/')
- 1)
FROM DUAL)),
Usr.Encrypted_User_Password)
Password
FROM applsys.Fnd_User Usr
WHERE Usr.User_Name = 'SYSADMIN';

Monday, January 25, 2016

Tape Backup / Restoration commands


Display the content of the tape
tar tvf /dev/st0 

To backup directory to tape with compression
tar cvzf /dev/st0 /u01/finsys

To restore entire data from the tape
tar -xvf /dev/st0 -C /u01/TEST

To restore specific file from the tape
tar -xvf /dev/st0 u01/PROD/finsys.tar -C /u01/TEST

Reference
http://www.cyberciti.biz/faq/linux-tape-backup-with-mt-and-tar-command-howto/