Saturday, August 13, 2016

Oracle Apps R12 Custom Top Creation

login as: root
Access denied
root@172.19.0.26's password:
Last login: Wed Jul 24 11:23:17 2013 from 172.19.0.77


1) Make the directory structure for your custom application files.

[root@server2 ~]# su - applvr12
[applvr12@server2 ~]$ mkdir XXUL
[applvr12@server2 ~]$ cd $APPL_TOP
[applvr12@server2 appl]$ mkdir xxul
[applvr12@server2 appl]$ mkdir xxul/12.0.0
[applvr12@server2 appl]$ mkdir xxul/12.0.0/admin
[applvr12@server2 appl]$ mkdir xxul/12.0.0/admin/sql
[applvr12@server2 appl]$ mkdir xxul/12.0.0/admin/odf
[applvr12@server2 appl]$ mkdir xxul/12.0.0/sql
[applvr12@server2 appl]$ mkdir xxul/12.0.0/bin
[applvr12@server2 appl]$ mkdir xxul/12.0.0/reports
[applvr12@server2 appl]$ mkdir xxul/12.0.0/reports/US
[applvr12@server2 appl]$ mkdir xxul/12.0.0/forms
[applvr12@server2 appl]$ mkdir xxul/12.0.0/forms/US
[applvr12@server2 appl]$ mkdir xxul/12.0.0/lib
[applvr12@server2 appl]$ mkdir xxul/12.0.0/out
[applvr12@server2 appl]$ mkdir xxul/12.0.0/log


2) Add the custom module into the environment

[applvr12@server2 ~]$ cd $APPL_TOP
[applvr12@server2 appl]$ echo "XXUL_TOP=/vr12/d01/oracle/vr12/apps/apps_st/appl/xxul/12.0.0" > customvr12_server2.env
[applvr12@server2 ~]$ echo "export XXUL_TOP" >> customvr12_server2.env
[applvr12@server2 ~]$ vi $CONTEXT_FILE
<AU_TOP oa_var="s_autop" oa_type="PROD_TOP" oa_enabled="FALSE">/vr12/d01/oracle/vr12/apps/apps_st/appl/au/12.0.0</AU_TOP>

Copy the above shown line and change it according to your custom_top. Below is an example

 <XXUL_TOP oa_var="s_xxultop" oa_type="PROD_TOP" oa_enabled="FALSE">/vr12/d01/oracle/vr12/apps/apps_st/appl/xxul/12.0.0</XXUL_TOP>
[applvr12@server2 appl]$ cd $APPL_TOP
[applvr12@server2 appl]$ vi admin/topfile.txt
Enter the following line at the end of the file
xxul    /vr12/d01/oracle/vr12/apps/apps_st/appl
[applvr12@server2 ~]$ echo $XXUL_TOP
/vr12/d01/oracle/vr12/apps/apps_st/appl/xxul/12.0.0
[applvr12@server2 appl]$ exit
Logout


3) Create a Tablespace

[root@server2 ~]# su - oravr12
[oravr12@server2 ~]$ sqlplus '/as sysdba'
SQL> create tablespace XXUL datafile '/vr12/d02/oracle/vr12/db/apps_st/data/XXUL01.dbf' size 1g;

Tablespace created.

SQL> create user XXUL identified by XXUL
2  temporary tablespace temp
3  quota unlimited on XXUL;

User altered.

SQL> grant connect, resource to XXUL;


Grant succeeded.


4) Register your Oracle Schema.

Login to Applications with System Administrator responsibility

Navigate to Application-->Register

Application = XXUL Custom Application

Short Name = XXUL

Basepath = XXUL_TOP

Description = XXUL Custom Application


5) Register Oracle User

Naviate to Security-->Oracle-->Register

Database User Name = XXUL

Password = XXUL

Privilege = Enabled

Install Group = 0

Description = XXUL Custom Application User


6) Add Application to a Data Group

Navigate to Security-->Oracle-->DataGroup


7) Create custom request group

This will act as a placeholder for any custom reports we wish to make available for the

Custom Responsibility (which is defined at a later stage)

Navigate to Security-->responsibility-->Request

Group = XXUL Request Group

Application = XXUL Custom

Code = XXUL

Description = XXUL Custom Requests

We will not define any requests to add to the group at this stage, but you can add some

now if required.


8) Create custom menu

This will act as a placeholder for any menu items we wish to make available for the

Custom Responsibility (which is defined at a later stage). We will create two menus, one

for Core Applications and one for Self Service.

Navigate to Application-->Menu

Menu = XXUL_CUSTOM_MENU

User Menu Name = XXUL Custom Application

Menu Type =

Description = XXUL Custom Application Menu

Seq = 100

Prompt = View Requests

Submenu =

Function = View All Concurrent Requests

Description = View Requests

Seq = 110

Prompt = Run Requests

Submenu =

Function = Requests: Submit

Description = Submit Requests


9) Create new responsibility. Navigate to Security-->Responsibility-->Define

Responsibility Name = XXUL Custom

Application = XXUL Custom

Responsibility Key = XXULCUSTOM

Description = XXUL Custom Responsibility

Available From = Oracle Applications

Data Group Name = XXULGroup

Data Group Application = XXUL Custom

Menu = XXUL Custom Application

Request Group Name = XXUL Request Group


10) Add responsibility to user

Navigate to Security-->User-->Define

Add XXUL Custom responsibility to users as required.



Tuesday, August 9, 2016

ORA-01157

ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 1: '/PRIM/u02/oradata/orcl/users01.dbf'

SQL> startup
ORACLE instance started.
Total System Global Area 1286066176 bytes
Fixed Size                                2287960 bytes
Variable Size                        452986536 bytes
Database Buffers               822083584 bytes
Redo Buffers                         8708096 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 1: '/PRIM/u02/oradata/orcl/users01.dbf'

SQL> col error format a15
SQL> select * from v$recover_file;

     FILE# ONLINE  ONLINE_ ERROR                   CHANGE# TIME              CON_ID
    --------- -----------  ------------------------                  -----------------------             -----------
         6      ONLINE  ONLINE  FILE NOT FOUND          0                                    0

SQL> col file_name format a40
SQL> col tablespace_name format a15
SQL> select a.file#,a.name as FILE_NAME,b.name as TABLESPACE_NAME,status from v$datafile a,v$tablespace b where a.ts#=b.ts#;

     FILE# FILE_NAME                                                            TABLESPACE_NAME STATUS
    -------- -----------------------------------------                            ----------------------------- -----------
        1      /PRIM/u02/oradata/orcl/system01.dbf                             SYSTEM                SYSTEM
        3      /PRIM/u02/oradata/orcl/sysaux01.dbf                             SYSAUX                ONLINE
        4      /PRIM/u02/oradata/orcl/undotbs01.dbf                           UNDOTBS1           ONLINE
        6      /PRIM/u02/oradata/orcl/users01.dbf                                USERS                   ONLINE
        2      /PRIM/u02/oradata/orcl/example01.dbf                           EXAMPLE            ONLINE

SQL> alter database datafile '/PRIM/u02/oradata/orcl/users01.dbf' offline;
Database altered.
SQL> alter database open;
Database altered.
SQL> col file_name format a40
SQL> col tablespace_name format a15
SQL> select a.file#,a.name as FILE_NAME,b.name as TABLESPACE_NAME,status from v$datafile a,v$tablespace b where a.ts#=b.ts#;

     FILE# FILE_NAME                                             TABLESPACE_NAME STATUS
    -------- ----------------------------------------              ----------------------------- -----------
        1      /PRIM/u02/oradata/orcl/system01.dbf              SYSTEM               SYSTEM
        2      /PRIM/u02/oradata/orcl/example01.dbf           EXAMPLE            ONLINE
        3      /PRIM/u02/oradata/orcl/sysaux01.dbf              SYSAUX               ONLINE
        4      /PRIM/u02/oradata/orcl/undotbs01.dbf            UNDOTBS1          ONLINE
        6      /PRIM/u02/oradata/orcl/users01.dbf                 USERS                  OFFLINE
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oraprim@localhost ~]$ rman target / catalog rman/rman@oracat

Recovery Manager: Release 12.1.0.1.0 - Production on Tue Mar 22 12:35:52 2016

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL (DBID=1434527233)
connected to recovery catalog database

RMAN>list backup of datafile 6;

List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
178     Full    1.26G      DISK        00:03:06     19-MAR-16     
        BP Key: 184   Status: AVAILABLE  Compressed: NO  Tag: TAG20160319T140522
        Piece Name: /RMAN_Backup/Backup_ORCL_09r0shh5_1_1_20160319_1
  List of Datafiles in backup set 178
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 1791582    19-MAR-16 /PRIM/u02/oradata/orcl/users01.dbf
RMAN> restore datafile 6 preview;

Starting restore at 22-MAR-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=48 device type=DISK


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
178     Full    1.26G      DISK        00:03:06     19-MAR-16     
        BP Key: 184   Status: AVAILABLE  Compressed: NO  Tag: TAG20160319T140522
        Piece Name: /RMAN_Backup/Backup_ORCL_09r0shh5_1_1_20160319_1
  List of Datafiles in backup set 178
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 1791582    19-MAR-16 /PRIM/u02/oradata/orcl/users01.dbf
using channel ORA_DISK_1

List of Archived Log Copies for database with db_unique_name ORCL
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
281     1    12      A 19-MAR-16
        Name: /PRIM/u02/app/oraprim/product/12.1.0/dbhome_1/database/archive/Log_55812601_12_1_906746499.arc

279     1    13      A 19-MAR-16
        Name: /PRIM/u02/app/oraprim/product/12.1.0/dbhome_1/database/archive/Log_55812601_13_1_906746499.arc

Media recovery start SCN is 1791582
Recovery must be done beyond SCN 1791582 to clear datafile fuzziness
Finished restore at 22-MAR-16

RMAN> restore datafile 6;

Starting restore at 22-MAR-16
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00006 to /PRIM/u02/oradata/orcl/users01.dbf
channel ORA_DISK_1: reading from backup piece /RMAN_Backup/Backup_ORCL_09r0shh5_1_1_20160319_1
channel ORA_DISK_1: piece handle=/RMAN_Backup/Backup_ORCL_09r0shh5_1_1_20160319_1 tag=TAG20160319T140522
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 22-MAR-16
RMAN> recover datafile 6;

Starting recover at 22-MAR-16
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 12 is already on disk as file /PRIM/u02/app/oraprim/product/12.1.0/dbhome_1/database/archive/Log_55812601_12_1_906746499.arc
archived log for thread 1 with sequence 13 is already on disk as file /PRIM/u02/app/oraprim/product/12.1.0/dbhome_1/database/archive/Log_55812601_13_1_906746499.arc
archived log file name=/PRIM/u02/app/oraprim/product/12.1.0/dbhome_1/database/archive/Log_55812601_12_1_906746499.arc thread=1 sequence=12
archived log file name=/PRIM/u02/app/oraprim/product/12.1.0/dbhome_1/database/archive/Log_55812601_13_1_906746499.arc thread=1 sequence=13
media recovery complete, elapsed time: 00:00:00
Finished recover at 22-MAR-16

RMAN> exit
Recovery Manager complete.

[oraprim@localhost ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 12.1.0.1.0 Production on Tue Mar 22 12:40:13 2016
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select name, open_mode from v$database;
NAME     OPEN_MODE
--------- --------------------
ORCL       READ WRITE
SQL> col file_name format a40
SQL> col tablespace_name format a15
SQL> select a.file#,a.name as FILE_NAME,b.name as TABLESPACE_NAME,status from v$datafile a,v$tablespace b where a.ts#=b.ts#;

     FILE# FILE_NAME                                                            TABLESPACE_NAME STATUS
    --------- -----------------------------------------                           ----------------------------- -----------
         1       /PRIM/u02/oradata/orcl/system01.dbf                            SYSTEM               SYSTEM
         2       /PRIM/u02/oradata/orcl/example01.dbf                         EXAMPLE            ONLINE
         3       /PRIM/u02/oradata/orcl/sysaux01.dbf                            SYSAUX               ONLINE
         4       /PRIM/u02/oradata/orcl/undotbs01.dbf                          UNDOTBS1          ONLINE
         6       /PRIM/u02/oradata/orcl/users01.dbf                               USERS                  OFFLINE

SQL> alter database datafile '/PRIM/u02/oradata/orcl/users01.dbf' online;
Database altered.
SQL> col file_name format a40
SQL> col tablespace_name format a15
SQL> select a.file#,a.name as FILE_NAME,b.name as TABLESPACE_NAME,status from v$datafile a,v$tablespace b where a.ts#=b.ts#;

      FILE# FILE_NAME                                                            TABLESPACE_NAME STATUS
    --------- -----------------------------------------                           ----------------------------- -----------
         1       /PRIM/u02/oradata/orcl/system01.dbf                            SYSTEM               SYSTEM
         2       /PRIM/u02/oradata/orcl/example01.dbf                         EXAMPLE            ONLINE
         3       /PRIM/u02/oradata/orcl/sysaux01.dbf                            SYSAUX               ONLINE
         4       /PRIM/u02/oradata/orcl/undotbs01.dbf                          UNDOTBS1          ONLINE
         6       /PRIM/u02/oradata/orcl/users01.dbf                               USERS                  ONLINE  

ORA-01113

ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/oradata/orcl/system01.dbf'

cause : An attempt was made to online or open a database with a file that is in need of media recovery.

Solution : First apply media recovery to the file and then open the database.

Resolution:

1) Start the DB with mount option.

SQL> startup mount
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size                                2288872 bytes
Variable Size                      1040188184 bytes
Database Buffers               553648128 bytes
Redo Buffers                         7286784 bytes
Database mounted.


2) Find the name of the redo log file which belongs to the active group.

SQL> SELECT MEMBER FROM V$LOG G, V$LOGFILE F WHERE G.GROUP# = F.GROUP# AND
  2  G.STATUS = 'CURRENT';
MEMBER
--------------------------------------------------------------------------------
/oradata/orcl/redo02.log


3)Using a backup control file, start the cancel based recovery. The system may suggest a non-existing archive log -- ignore it and specify the log file name {with full path} that you got in the above step

SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL
ORA-00279: change 21375038 generated at 09/21/2007 20:12:47 needed for thread 1
ORA-00289: suggestion : /export/pspp/oracle/dbs/arch1_4_633901491.dbf
ORA-00280: change 21375038 for thread 1 is in sequence #4

Specify log: {=suggested | filename | AUTO | CANCEL}
/oradata/orcl/redo02.log
Log applied.
Media recovery complete.


4) Finally open the database in RESETLOGS mode. It is recommended to reset the online logs after incomplete recovery or recovery with a backup control file

SQL> ALTER DATABASE OPEN RESETLOGS;
Database altered.

     Take a backup of the database as soon as the recovery is done.





Monday, August 1, 2016

bash profile and listener.ora file entries

After we've Installed a new database, we need to add entries in .bash_profile and listener.ora files as per our requirements. So here in this post I've shared the generally used entries. Add the below entries apart from already existing entries of your database.

.bash_profile entry

LD_LIBRABRY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRABRY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
BASE_PATH=/usr/sbin:$PATH:$HOME/bin; export BASE_PATH
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH
                                  
listener.ora file entry
SID_LIST_ocl =
 (SID_LIST =
  (SID_DESC =
   (ORACLE_HOME=/u01/app/oraprim/product/12.1.0/dbhome_1)
   (SID_NAME=orcl)
  )

 )

Check if the DISPLAY variable is set in Linux environment

Most of the users have been getting Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set in Linux environment while checking requirement the oracle installations on  Linux 5.2 or later versions.

Below is the screenshot of the issue















I have tried plenty of options, even ignoring the pre-requisites.

















Finally, i have fixed this issue through one Linux command

Steps to resolve this issue:

1) login into root user( su -l root)
2) execute this command xhost +SI:localuser:oracle
3) login to the oracle user
4) execute ./runInstaller










Now, it'll work fine.

IAS Cache initialization failed

 Today I faced an Issue in R12.2 instance. The solution I followed to overcome the issue is very simple, but they are more than one solution...