Saturday 30 June 2018

RC-50208: Exception in method TimedProcessProcess.run Raised by oracle.apps.ad.util.TimedProcess$TimedProcessProcess: java.io.IOException: Cannot run program “/fs2/FMW_Home/webtier/perl/bin/perl”: error=2, No such file or directory

Attach Home Scripts
ORACLE_HOME Script/Option
———- ————-
Oracle_EBS-app1       $FMW_HOME/Oracle_EBS-app1/oui/bin/attachHome.sh
webtier                           $FMW_HOME/webtier/oui/bin/attachHome.sh
oracle_common          $FMW_HOME/oracle_common/oui/bin/attachHome.sh
10.1.2 Home                $ORACLE_HOME/oui/bin/attachHome.sh

  1. adpreclone.pl  appsTier
  2. shut down application
  3.  copy EBS apps to fs2
  4. start admin server
  5. configure FS2 file system.
FS_CLONE ERROR:- (Doc ID 1913778.1)

Wednesday 27 June 2018

Change the Apex user password using SQL and  apxchpwd.sql


If you have the APEX software available you can use the "apxchpwd.sql" script. Change to the directory with the APEX software, connect to SQL*Plus as the SYS user and run the "apxchpwd.sql" script, specifying the credentials when prompted.
SQL> CONN sys@pdb1 AS SYSDBA
SQL> @apxchpwd.sql

Using SQL

Change the current schema to the one relevant for your APEX version and find the admin user in the WWV_FLOW_FND_USER table.
ALTER SESSION SET CURRENT_SCHEMA = APEX_050100;

COLUMN user_id Format 99999999999999999
COLUMN first_name FORMAT A20
COLUMN last_name FORMAT A20
COLUMN default_schema FORMAT A30

SELECT user_id,
       first_name,
       last_name,
       default_schema
FROM   wwv_flow_fnd_user
WHERE  user_name = 'ADMIN'
ORDER BY last_update_date DESC;

           USER_ID FIRST_NAME           LAST_NAME            DEFAULT_SCHEMA
------------------ -------------------- -------------------- ------------------------------
  1830220964288167                                           APEX_050100

SQL>
Update the password in the user record you found previously.

UPDATE wwv_flow_fnd_user
SET    web_password = 'ApexPassword1'
WHERE  user_name = 'ADMIN'
AND    user_id = 1830220964288167;

COMMIT;
JUST UNLOCKING APEX ADMIN USER PASSWORD INSTEAD OF CHANGING IT

Problem description:

You have locked your APEX administrator account by mistyping the account’s password too often. As other persons are also using the account, you don’t want to use the “apxchpwd”-script.


Problem resolution:

If you just want to unlock the account instead of completely resetting the password, you can use the following PL/SQL block to establish this task:


begin

    wwv_flow_security.g_security_group_id := <APEX_WORKSPACE_ID>;

    wwv_flow_fnd_user_api.UNLOCK_ACCOUNT('<APEX_ACCOUNT_NAME>');

    commit;

end;

Example:

Query the id for the “INTERNAL” workspace:

SQL> SELECT workspace_id FROM apex_workspaces WHERE workspace = 'INTERNAL';

 

WORKSPACE_ID

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

          10
SQL>



Query the APEX schema’s name for your version:


SQL> select username from dba_users where username like 'APEX%' order by 1;

 

USERNAME

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

APEX

APEX_040200

APEX_PUBLIC_USER

 

SQL>



Switch your session to the APEX-schema:

SQL> alter session set current_schema = APEX_040200;                      

 

Session altered.

 

SQL>



Unlock your ADMIN account with the following code:


begin

    wwv_flow_security.g_security_group_id := <APEX_WORKSPACE_ID>;

    wwv_flow_fnd_user_api.UNLOCK_ACCOUNT('<APEX_ACCOUNT_NAME>');

    commit;

end;



Thursday 14 June 2018

 APEX - ORDS   Errors: 404 NOT FOUND,
             REST DATA SERVICE NOT AVAILABLE,
             REQUEST CANNOT BE MAPPED to DATABASE.
                                          

Sometimes the ORACLE REST DATA SERVICES shows some of the  below unexpected and annoying errors which prevents to launch Oracle Apex Instances:
  • 404 Not found
  • REST  data service not available
  • The request could not be mapped to any database…..
and so on
I found the below solution and you can try to get rid of from this annoying issue:
  1. login to SYS with SYSDBA privilege and execute the below command to unlock & Reset password for below users.
  2. Also if you update the wrong password , it will not be in sync with ords and causes you below errors like below. So make sure you get the correct password as i wasted one day by updating wrong password.
<Jun 13, 2018, 9:09:23,441 AM EDT> <Error> <oracle.dbtools> <BEA-000000> <The username or password for the connection pool named apex_rt, are invalid, expired, or the account is locked
oracle.dbtools.common.jdbc.ConnectionPoolConfigurationException: The username or password for the connection pool named apex_rt, are invalid, expired, or the account is locked


FIX:

alter user APEX_LISTENER identified by welcome1 account unlock;
alter user APEX_REST_PUBLIC_USER identified by welcome1 account unlock;
alter user APEX_PUBLIC_USER identified by welcome1 account unlock;
alter user ORDS_PUBLIC_USER identified by welcome1 account unlock;

    3. Restart the ORDS Services once done.


Wednesday 6 June 2018

HOW TO CHECK WHETHER PHYSICAL STANDBY IS IN SYNC WITH THE PRIMARY OR NOT AND RESOLVED GAP ?


Step by Step Process to Resolved gap on Standby database.

Summary
1. Check the name and status of database.
2. Check for GAP on standby
3. Check redo received on standby
4. Check redo applied on standby
5. Identify missing archive log files
6. Copy archive log files
7. Register archive log files with standby
8. Restart the managed recovery operations

******************************************************************************************************************

Step 1 : Check the status of database on both server.
On Primary Server.
SQL> select name, open_mode, database_role from v$database;
NAME      OPEN_MODE  DATABASE_ROLE
——— ———- —————-
MYDB   READ WRITE PRIMARY

SQL> set sqlprompt “PRIMARY’@’_connect_identifier>”
PRIMARY@MYDB>

On Standby Server.

SQL> select name, open_mode, database_role from v$database;
NAME      OPEN_MODE  DATABASE_ROLE
——— ———- —————-
MYDB   MOUNTED    PHYSICAL STANDBY

SQL> set sqlprompt “SECONDARY’@’_connect_identifier>”
STANDBY@MYDB>

Step 2 : Check for GAP on Standby
PRIMARY@MYDB>select max(sequence#) from v$log_history;

MAX(SEQUENCE#)
————–
         76921
STANDBY@MYDB>select max(sequence#) from v$log_history;
MAX(SEQUENCE#)
————–
         76921

STANDBY@MYDB>SELECT THREAD# “Thread”,SEQUENCE# “Last Sequence Generated”
 FROM V$ARCHIVED_LOG
          WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)
          ORDER BY 1;
    Thread Last Sequence Generated
———- ———————–
         1                   76921



Step 3 & 4: Check redo received and applied on standby.

STANDBY@MYDB> SELECT ARCH.THREAD# “Thread”, ARCH.SEQUENCE# “Last Sequence Received”,
APPL.SEQUENCE# “Last Sequence Applied”, (ARCH.SEQUENCE# – APPL.SEQUENCE#) “Difference”
FROM
(SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN
(SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,
(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN
(SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL
WHERE
ARCH.THREAD# = APPL.THREAD#
ORDER BY 1;
    Thread Last Sequence Received Last Sequence Applied Difference
———- ———————- ——————— ———-
         1                  76922                 20931      55991

Step 5: Identify the missing archive log file.

 STANDBY@MYDB>SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;
no rows selected

—-If found gap

Step 6: Copy missing archive log file
After identifying a gap (as shown above), the DBA will need to query the primary database to locate the archived redo logs on the primary database. The following query assumes the local archive destination on the primary database is LOG_ARCHIVE_DEST_1:
PRIMARY@MYDB>  SELECT name
 FROM v$archived_log
 WHERE thread# = 1
 AND dest_id = 1
 AND sequence# BETWEEN 20931 and 76922;
Output:
/oracle/bases/MYDB/archives/MYDB_0001_0716381751_0000076922.arc
56027 rows selected.

Step 7: Register archive logfile with standby.
Copy the above redo log files to the physical standby database and register them using the ALTER DATABASE REGISTER LOGFILE … SQL statement on the physical standby database.
For example:
STANDBY@MYDB> ALTER DATABASE REGISTER LOGFILE ‘/oracle/bases/MYDB/archives/MYDB_0001_0716381751_0000076922.arc’;

Step 8: Restart the managed recovery operations.
— After the redo logs have been registered on the physical standby database, the DBA can restart the managed recovery operations.
  For example, to put the physical standby database into automatic recovery managed mode:
STANDBY@MYDB> alter database recover managed standby database disconnect from session;

How to Check/Validate That RMAN Backups Are Good

I Want to restore and recover the database till time ‘9:00, 22-October-2012
Step 1: The below command just gives the report of backups that are used to do the  restore and recover :
RMAN> run
{
set until time "to_date('2012-22-10:9:00:00','yyyy-dd-mm:hh24:mi:ss')";
restore database preview;
}
2> 3> 4> 5>
executing command: SET until clause
using target database control file instead of recovery catalog
Starting restore at 22-OCT-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=4 devtype=DISK

List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3457 Full 3.41G DISK 00:11:40 22-OCT-12
 BP Key: 3457 Status: AVAILABLE Compressed: YES Tag: WHOLE_DATABASE_OPEN
 Piece Name: /u02/rman/db_797315408_3460_p1
 List of Datafiles in backup set 3457
 File LV Type Ckp SCN Ckp Time Name
 ---- -- ---- ---------- --------- ----
 1 Full 135540931 22-OCT-12 /u01/oracle/oradata/prod/system01.dbf
 2 Full 135540931 22-OCT-12 /u01/oracle/oradata/prod/undotbs01.dbf
 3 Full 135540931 22-OCT-12 /u01/oracle/oradata/prod/sysaux01.dbf
 4 Full 135540931 22-OCT-12 /u01/oracle/oradata/prod/users01.dbf
 5 Full 135540931 22-OCT-12 /u01/oracle/oradata/prod/prodtbs
 6 Full 135540931 22-OCT-12 /u01/oracle/oradata/prod/prod_data_space.dbf
using channel ORA_DISK_1

List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
48185 1 48301 A 22-OCT-12 /u02/arch/1_48301_738779061.dbf
48186 1 48302 A 22-OCT-12 /u02/arch/1_48302_738779061.dbf
48187 1 48303 A 22-OCT-12 /u02/arch/1_48303_738779061.dbf
48188 1 48304 A 22-OCT-12 /u02/arch/1_48304_738779061.dbf
48189 1 48305 A 22-OCT-12 /u02/arch/1_48305_738779061.dbf
48190 1 48306 A 22-OCT-12 /u02/arch/1_48306_738779061.dbf
48191 1 48307 A 22-OCT-12 /u02/arch/1_48307_738779061.dbf
48192 1 48308 A 22-OCT-12 /u02/arch/1_48308_738779061.dbf
48193 1 48309 A 22-OCT-12 /u02/arch/1_48309_738779061.dbf
48194 1 48310 A 22-OCT-12 /u02/arch/1_48310_738779061.dbf
48195 1 48311 A 22-OCT-12 /u02/arch/1_48311_738779061.dbf
48196 1 48312 A 22-OCT-12 /u02/arch/1_48312_738779061.dbf
48197 1 48313 A 22-OCT-12 /u02/arch/1_48313_738779061.dbf
48198 1 48314 A 22-OCT-12 /u02/arch/1_48314_738779061.dbf
48199 1 48315 A 22-OCT-12 /u02/arch/1_48315_738779061.dbf
48200 1 48316 A 22-OCT-12 /u02/arch/1_48316_738779061.dbf
48201 1 48317 A 22-OCT-12 /u02/arch/1_48317_738779061.dbf
Media recovery start SCN is 135540931
Recovery must be done beyond SCN 135540931 to clear data files fuzziness
Finished restore at 22-OCT-12
Step 2: Then run the below command to check the backup pieces are good :
The below command will read the backup pieces/Copies which has datafiles and if finds any error it will report at the RMAN prompt.
RMAN> run
{
allocate channel c1 type disk;
set until time "to_date('2012-22-10:9:00:00','yyyy-dd-mm:hh24:mi:ss')";
restore database validate;
} 2> 3> 4> 5> 6>
released channel: ORA_DISK_1
allocated channel: c1
channel c1: sid=4 devtype=DISK
executing command: SET until clause
Starting restore at 22-OCT-12
channel c1: starting validation of datafile backupset
channel c1: reading from backup piece /u02/rman/db_797315408_3460_p1

Step 3: Check the archivelogs needed for recovery
Replace the xxx, yyy with the start and end archivelog sequence reported by restore database preview command ran in the step 1.
RMAN> run
2> {
allocate channel c1 type disk;
restore archivelog from sequence 48301 until sequence 48317 validate;
}
3> 4> 5>
allocated channel: c1
channel c1: sid=4 devtype=DISK
Starting restore at 22-OCT-12
channel c1: scanning archive log /u02/arch/1_48301_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48302_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48303_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48304_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48305_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48306_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48307_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48308_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48309_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48310_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48311_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48312_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48313_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48314_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48315_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48316_738779061.dbf
channel c1: scanning archive log /u02/arch/1_48317_738779061.dbf
Finished restore at 22-OCT-12
released channel: c1
RMAN>