Sunday 25 February 2018

FRM-92101: There was a failure in form server during startup

R12 after clone/patch/upgrade Error -FRM-92101

Error:-

After cloning R12 instance on TEST instance and when I started services normally, an error apprears when access the forms, getting the following error

FRM-92101: There was a failure in the Forms Server during startup. This could happen due to invalid configuration. Please look into the web-server log file for details

Java Exception
oracle.forms.net.ConnectionException:Forms sessionfailed during startup:no response from runtime process
at oracle.forms.net.ConnectionException.createConnectionException(Unknown Source)
at oracle.forms.net.HTTPNStream.getResponse(Unknown source)
at oracle.forms.net.HTTPNStream.doFlush(Unknown Source)
at oracle.forms.net.HTTPNStream.flush(Unknown Source)
at java.io.DataOutputStream.flush(Unknown source)
…………………………………………………………..
I have looked into the forms server log file which is given below
$LOG_HOME/ora/10.1.3/opmn/forms_default_group_1/formsstd.out
and found the following error
FormsServlet init():
configFileName: /u01/DEV/inst/apps/DEV_mkhots06/ora/10.1.2/forms/server/appsweb.cfg
testMode: false
Oracle Containers for J2EE 10g (10.1.3.4.0) initialized
ListenerServlet init()

Cause:-

Implementation Restriction: Cannot directly access remote package variable or cursor.

Solution:-

$cd $ADMIN_SCRIPTS_HOME
$adstpall.sh apps/
Then
$cd $ORACLE_HOME/forms/lib
$make -f ins_forms.mk install
Then restarted the services using adstrtal.sh apps/

Now there is no issue of form errors and was able to access the forms from my TEST instance.



Monday 19 February 2018

Script to check tablespace used and free space in oracle database

set lines 132
set pages 105
set pause off
set echo off
set feedb on

column "TOTAL ALLOC (GB)"      format 9,999,990.00
column "TOTAL PHYS ALLOC (GB)" format 9,999,990.00
column "USED (GB)"             format 9,999,990.00
column "FREE (GB)"             format 9,999,990.00
column "% USED"                format 990.00

select
   a.tablespace_name,
   a.bytes_alloc/(1024*1024*1024) "TOTAL ALLOC (GB)",
   a.physical_bytes/(1024*1024*1024) "TOTAL PHYS ALLOC (GB)",
   nvl(b.tot_used,0)/(1024*1024*1024) "USED (GB)",
   (nvl(b.tot_used,0)/a.bytes_alloc)*100 "% USED"
from
   (select
      tablespace_name,
      sum(bytes) physical_bytes,
      sum(decode(autoextensible,'NO',bytes,'YES',maxbytes)) bytes_alloc
    from
      dba_data_files
    group by
      tablespace_name ) a,
   (select
      tablespace_name,
      sum(bytes) tot_used
    from
      dba_segments
    group by
      tablespace_name ) b
where
   a.tablespace_name = b.tablespace_name (+)
and
   a.tablespace_name not in
   (select distinct
       tablespace_name
    from
       dba_temp_files)
and
   a.tablespace_name not like 'UNDO%'
order by 1;

Friday 16 February 2018

ORA-01940 cannot drop a user that is currently connected

When I am trying to drop a user and I get the error "ORA-01940: cannot DROP a user that is currently logged in".

Cause: An attempt was made to drop a user that was currently logged in.

Action: Make sure the user is logged out, then re-execute the command.

Solution:-
select s.sid, s.serial#, s.status, p.spid
from v$session s, v$process p
where s.username = 'myuser'
and p.addr (+) = s.paddr;

-- alter system kill session '<sid>,<serial#>';

Also, check that the user is not associated with any active jobs:

select job from dba_jobs where log_user='myuser';

Hope it works ! 

Thursday 8 February 2018

Update Oracle db users password with same password

To update Oracle DB users password with same password when it is going to expire.

select name,password from sys.user$ where name in('ATLAS_RO');

select username,account_status,expiry_date from dba_users where username in('ATLAS_RO');

spool user_password.sql
select 'ALTER USER '||name||' IDENTIFIED BY VALUES '||''''||password||''''||';' from sys.user$ where name in('ATLAS_RO');
spool off
@user_password.sql

select username,account_status,expiry_date from dba_users where username in('ATLAS_RO');

To get archive log updates in hourly basis.


Oracle v$log_history scripts - to get archive log updates in hourly basis.


set lines 200;
set pages 200;
SELECT
to_char(first_time,'YYYY-MON-DD') day,
to_char(sum(decode(to_char(first_time,'HH24'),'00',1,0)),'9999') "00",
to_char(sum(decode(to_char(first_time,'HH24'),'01',1,0)),'9999') "01",
to_char(sum(decode(to_char(first_time,'HH24'),'02',1,0)),'99') "02",
to_char(sum(decode(to_char(first_time,'HH24'),'03',1,0)),'99') "03",
to_char(sum(decode(to_char(first_time,'HH24'),'04',1,0)),'99') "04",
to_char(sum(decode(to_char(first_time,'HH24'),'05',1,0)),'99') "05",
to_char(sum(decode(to_char(first_time,'HH24'),'06',1,0)),'99') "06",
to_char(sum(decode(to_char(first_time,'HH24'),'07',1,0)),'99') "07",
to_char(sum(decode(to_char(first_time,'HH24'),'08',1,0)),'99') "0",
to_char(sum(decode(to_char(first_time,'HH24'),'09',1,0)),'99') "09",
to_char(sum(decode(to_char(first_time,'HH24'),'10',1,0)),'99') "10",
to_char(sum(decode(to_char(first_time,'HH24'),'11',1,0)),'99') "11",
to_char(sum(decode(to_char(first_time,'HH24'),'12',1,0)),'99') "12",
to_char(sum(decode(to_char(first_time,'HH24'),'13',1,0)),'99') "13",
to_char(sum(decode(to_char(first_time,'HH24'),'14',1,0)),'99') "14",
to_char(sum(decode(to_char(first_time,'HH24'),'15',1,0)),'99') "15",
to_char(sum(decode(to_char(first_time,'HH24'),'16',1,0)),'99') "16",
to_char(sum(decode(to_char(first_time,'HH24'),'17',1,0)),'99') "17",
to_char(sum(decode(to_char(first_time,'HH24'),'18',1,0)),'99') "18",
to_char(sum(decode(to_char(first_time,'HH24'),'19',1,0)),'99') "19",
to_char(sum(decode(to_char(first_time,'HH24'),'20',1,0)),'99') "20",
to_char(sum(decode(to_char(first_time,'HH24'),'21',1,0)),'99') "21",
to_char(sum(decode(to_char(first_time,'HH24'),'22',1,0)),'9999') "22",
to_char(sum(decode(to_char(first_time,'HH24'),'23',1,0)),'9999') "23",
COUNT(*) TOT
from
   v$log_history
GROUP by
   to_char(first_time,'YYYY-MON-DD')
   order by day ;

Wednesday 7 February 2018

Error while patching patch in ESB R12 | fndcct.jar on worker 1

Error:-

1. Getting Error while patching patch 22284589

ATTENTION: All workers either have failed or are waiting:

FAILED: file fndcct.jar on worker 1.

ATTENTION: Please fix the above failed worker(s) so the manager can continue.

Worker log :-

WARNING: Unable to load metadata entry from zip file jtfaoljdepen.zip
Cause: Error while trying to read metadata from file jtfaoljdepen.zip: No metadata entry META-INF/JRIMETA.DAT found


Calling /ur124app/r12cms8/apps/tech_st/10.1.3/appsutil/jdk/jre/bin/java ...
Error while creating class oracle/apps/jtf/cache/appsimpl/AppsCacheContext

2. If you skip patches and start application you will find Homepage with service not found.

Cause:-

Found in database JServer JAVA Virtual Machine 11.2.0.4.0 seems to be "INVALID"

Query used to find:- SELECT comp_name, version, status FROM dba_registry ORDER BY comp_name;

Solution:-

Safe repair/reinstall of the JVM Component in 11.2 and up (Doc ID 2314363.1)

We have performed OPTION #2: JVM Removal and Reinstall

The steps should be executed one by one rather than in a single script.

1. Connect as SYSDBA and startup the database in restricted mode.

connect / as sysdba
startup mount
alter database open;
alter system enable restricted session;
alter system set "_system_trig_enabled" = false scope=memory;

-- just in case the JVM Mitigation patch has been applied. ignore pls-201 or any other error otherwise
exec dbms_java_dev.enable;

-- to avoid any problems trying to run catnojava.sql, lets force the registry to reflect VALID components
execute sys.dbms_registry.loaded('JAVAVM');
execute sys.dbms_registry.loaded('CATJAVA');
execute sys.dbms_registry.valid('JAVAVM');
execute sys.dbms_registry.valid('CATJAVA');

2. Start a log of the session so that any problems encountered can be investigated later.

spool jvm_removal.log
set echo on

3. Now execute version specific removal scripts one at a time.
    Most errors, except for ora-3113/ora-3114, in these scripts can be ignored.

@?/rdbms/admin/catnoexf.sql
@?/rdbms/admin/catnojav.sql
@?/xdk/admin/rmxml.sql

4. Next is the part which actually removes the JVM related objects from the database.

execute rmjvm.run(false);

5. Now just cleanup any loose ends

truncate table java$jvm$status;
delete from obj$ where obj#=0 and type#=0;
commit;

6. execute the following query to check for any java objects existing in SYS schema

select count(*) from obj$ where type#=29 and owner#=0;

If the removal process was successful then this query should return a count=0 and you should have no issues with the reinstall. However, if this query returns a count, it is likely that these are java objects that were not part of the original JVM installation and were the source of a INVALID JVM. You might need to address these at the end.

7. Now shutdown and turn off spooling and exit the session otherwise you will receive ORA-28 and have to start a new session for the install anyway.

shutdown immediate
set echo off
spool off
exit

8. *** CRITICAL STEP ***: The initjvm.sql was only intended to install the JVM component one time.

a) navigate to the location of initjvm.sql
         cd $ORACLE_HOME/javavm/install
b) make a copy of initjvm.sql called reinitjvm.sql
         cp initjvm.sql reinitjvm.sql
c) in an editor, modify the reinitjvm.sql script by locating the code identified in the <original snip> and replace it with the code between the <new snip>.


<original snip>
-- Now check whether create java system worked correctly, and if not, back
-- out of everything done in this script
variable jvmrmaction varchar2(30)

declare
ok int;
bad int;
begin
:jvmrmaction := 'NONE';
select count(*) into ok from obj$ where status=1 and type#=29;
select count(*) into bad from obj$ where status!=1 and type#=29 and owner#=0;
if bad > 0 or ok < 100 then
initjvmaux.abort_message(
'CREATE JAVA SYSTEM did not complete successfully:',
'number of java classes with status 1: '|| ok ||', with status != 1: '|| bad);
initjvmaux.abort_message('Backing out of java installation...');
:jvmrmaction := 'FULL_REMOVAL';
initjvmaux.endaction;
end if;
end;
/
</original snip>

<new snip>
-- Now check whether create java system worked correctly, and if not, log
-- it for future reference in case there are invalid java objects in SYS.
variable jvmrmaction varchar2(30)

declare
ok int;
bad int;
begin
:jvmrmaction := 'NONE';
select count(*) into ok from obj$ where status=1 and type#=29;
select count(*) into bad from obj$ where status!=1 and type#=29 and owner#=0;
if bad > 0 or ok < 100 then
initjvmaux.abort_message(
'CREATE JAVA SYSTEM may not have completed successfully:',
'number of VALID java classes: '|| ok ||', and INVALID java classes: '|| bad);
-- initjvmaux.abort_message('Backing out of java installation...');
-- :jvmrmaction := 'FULL_REMOVAL';
initjvmaux.endaction;
end if;
end;
/
</new snip>

9. Now startup the database and prepare to reload the JVM and its SYS owned dependents

connect / as sysdba
startup mount
alter database open;
alter system enable restricted session;
alter system set "_system_trig_enabled" = false scope=memory;

-- start a log file
spool full_jvminst.log;
set echo on

10) Run the individual scripts to reinstall the JVM and its SYS owned dependents (XDK for Java, Java packages, and Expression Filter(11g))

@?/javavm/install/reinitjvm.sql
@?/xdk/admin/initxml.sql
@?/rdbms/admin/catjava.sql
The next script is a 11g reinstall specific step to reinstall the Expression Filter Component that is no longer installed in 12c and up. Proceed to step 11 if reinstalling in 12c or up
@?/rdbms/admin/catexf.sql

11. Now shutdown and exit sqlplus so that the cache is cleaned for the restart

shutdown immediate
set echo off
spool off
exit

12. Review the log file FULL_JVMINST.LOG for any unexpected errors were raised.

13. Once you are confident the INSTALL scripts in step 10 above completed successfully, restart the database normal and resolve any invalid objects by running utlrp.sql

connect / as sysdba
startup
@?/rdbms/admin/utlrp.sql

14. The JVM should now be fully installed. Please confirm it by running:

SELECT comp_name, version, status FROM dba_registry ORDER BY comp_name;

*** All queries should return the expected results ***

Note: If you encountered a count in step 6, check to see if there are still java objects in SYS that do not show as VALID:

        select count(*) from obj$ where status!=1 and type#=29 and owner#=0;

 If you receive a count > 0, yet the JVM shows VALID according to the script in 14, then check the names of these objects. If they are not part of the JVM, then drop them manually as they should never have been installed in the SYS schema.

15. If you have the JVM Mitigation patch installed and you wish to prevent new Java Development without prior DBA approval, then:

exec dbms_java_dev.disable;


Hope your issue is resolved !!

R12 – Responsibilities not visible to user

We recently encountered this issue on a R12 instance fully functional instance.

1) Login as sysadmin or any user who as privileges to create user/add responsibilities
2) Create a new user and add responsibilities or add additional seeded/custom responsibilities to existing user

Then,
3) New/existing user logs in but he/she cant see the new responsibility.

To tackle this situation, we ran the concurrent program “Workflow Directory Services User/Role Validation” with below parameters:

p_BatchSize – 10000 (Default Value 10000)
p_Check_Dangling – Yes (Default value No)
Add missing user/role assignments – Yes (Default Value No)
Update WHO columns in WF tables – No (Default Value No)

So what does this concurrent program do. It syncs all the user and role related WF tables with latest information viz., WF_LOCAL_ROLES, WF_LOCAL_USER_ROLES, WF_USER_ROLE_ASSIGNMENTS etc.,

The time taken to complete this program depends on the number of users/roles to be synched. After completion of this request the affected user can log back in to see the missing responsibilities.

You can also schedule this request to run every 15 minutes or so, but it depends how frequently you create/assign new users/roles/responsibilities.