17 September, 2015

How to find out which users are having a particular responsibility

There is a concurrent program called "Users of a responsibility"

When we submit this request, it Prompt for

                      1.Application name
                      2. Responsibility name.

To find Application  name, Goto Responsibility =>Define

search for Responsibility, you will get the Application name.


Now provide Application name and Responsibility name. it will give out put.


16 September, 2015

RMAN Backup Monitoring

Here is a simple query to monitor the RMAN progress.

select
 SID||'-'||OPNAME SID_OPNAME,
 100-round((sofar/totalwork) * 100,2) pct_left
from 
   v$session_longops
where 
   totalwork > sofar
AND 
   opname NOT LIKE '%aggregate%'
AND 
   opname like 'RMAN%';

SID_OPNAME                             PCT_LEFT               
-------------------------------------- --------
3119-RMAN: incremental datafile backup 79.77                  
3135-RMAN: incremental datafile backup 79.87                  
3123-RMAN: incremental datafile backup 79.79                  
3143-RMAN: incremental datafile backup 79.92                  
3127-RMAN: incremental datafile backup 79.82                  
3159-RMAN: incremental datafile backup 78.28                  
3120-RMAN: incremental datafile backup 79.91                  
3136-RMAN: incremental datafile backup 78.16                  
3146-RMAN: incremental datafile backup 79.86                  
3183-RMAN: incremental datafile backup 85.29                  
3152-RMAN: incremental datafile backup 78.10
3151-RMAN: incremental datafile backup 79.74                  
3111-RMAN: incremental datafile backup 80.00                     
3124-RMAN: incremental datafile backup 79.74                  
3139-RMAN: incremental datafile backup 79.68                  

15 rows selected

Database Instance failed to turn on Flashback Database

ORA-38760:This database instance failed to turn on flashback database

Recently starting up a database reported ORA-38760. On this database I had flashback on. The error message indicates that the database flashback is on but the database failed to start generating flashback data. Checking the alert log found that there was no space in the disk group.

ORA-38701: Flashback database log 1442 seq 1519 thread 1: "+FB1"
ORA-17502: ksfdcre:4 Failed to create file +FB1
ORA-15041: diskgroup space exhausted
Can not open flashback thread because there is no more space in flash recovery area

Measures would be to add more disk space or free some space in the Disk Group so that the database can start.

I decided not to use the flashback any more and so determined to stop the flashback.

SQL>aler database flashback off;
SQL>shutdown immediate
SQL>startup

Again it resulted with the same message "ORA-38760:This database instance failed to turn on flashback database" which means the flashback is still not switched off.

Reason was flashback was not opened to close it. It still reported "Can not open flashback thread because there is no more space in flash recovery area" in the alert.log.

So it would be to review v$restore_point to see if there are options and I found that there was a restore point created with option guarantee which means the flashback is maintaining logs that are relevant for the guaranteed restore point. I do not need this restore point and so removed it. Database was then able to release a huge amount of space and my system was back again.

Replace 'no rows selected'

I wanted to replace the message 'no rows selected' with an alternate message.

SQL> select * from dual where 1=0;

no rows selected

SQL>

I found a good one by using NOT EXISTS clause

SQL> select * from dual where 1=0
           UNION
           select 'no data found' from dual where not exists (select * from dual where 1=0); 

DUMMY
no data found

1 row selected.

SQL>

08 September, 2015

What You need to Learn


Exploring the Oracle Database Architecture

  • Oracle Database Architecture Overview
  • Oracle ASM Architecture Overview
  • Process Architecture
  • Memory structrues
  • Logical and physical storage structures
  • ASM storage components

Installing your Oracle Software

  • Tasks of an Oracle Database Administrator
  • Tools Used to Administer an Oracle Database
  • Installation: System Requirements
  • Oracle Universal Installer (OUI)
  • Installing Oracle Grid Infrastructure
  • Installing Oracle Database Software
  • Silent Install

Creating an Oracle Database

  • Planning the Database
  • Using the DBCA to Create a Database
  • Password Management
  • Creating a Database Design Template
  • Using the DBCA to Delete a Database

Managing the Oracle Database Instance

  • Start and stop the Oracle database and components
  • Use Oracle Enterprise Manager
  • Access a database with SQLPlus
  • Modify database installation parameters
  • Describe the stages of database startup
  • Describe database shutdown options
  • View the alert log
  • Access dynamic performance views

Manage the ASM Instance

  • Set up initialization parameter files for ASM instance
  • Start up and shut down ASM instances
  • Administer ASM disk groups

Configuring the Oracle Network Environment

  • Use Enterprise Manager to create and configure the Listener
  • Enable Oracle Restart to monitor the listener
  • Use tnsping to test Oracle Net connectivity
  • Identify when to use shared servers and when to use dedicated servers

Managing Database Storage Structures

  • Storage Structures
  • How Table Data Is Stored
  • Anatomy of a Database Block
  • Space Management in Tablespaces
  • Tablespaces in the Preconfigured Database
  • Actions with Tablespaces
  • Oracle Managed Files (OMF)

Administering User Security

  • Database User Accounts
  • Predefined Administrative Accounts
  • Benefits of Roles
  • Predefined Roles
  • Implementing Profiles

Managing Data Concurrency

  • Data Concurrency
  • Enqueue Mechanism
  • Resolving Lock Conflicts
  • Deadlocks

Managing Undo Data

  • Data Manipulation
  • Transactions and Undo Data
  • Undo Data Versus Redo Data
  • Configuring Undo Retention

Implementing Oracle Database Auditing

  • Describe DBA responsibilities for security
  • Enable standard database auditing
  • Specify audit options
  • Review audit information
  • Maintain the audit trail

Database Maintenance

  • Manage optimizer statistics
  • Manage the Automatic Workload Repository (AWR)
  • Use the Automatic Database Diagnostic Monitor (ADDM)
  • Describe and use the advisory framework
  • Set alert thresholds
  • Use server-generated alerts
  • Use automated tasks

Performance Management

  • Performance Monitoring
  • Managing Memory Components
  • Enabling Automatic Memory Management (AMM)
  • Automatic Shared Memory Advisor
  • Using Memory Advisors
  • Dynamic Performance Statistics
  • Troubleshooting and Tuning Views
  • Invalid and Unusable Objects

Backup and Recovery Concepts

  • Part of Your Job
  • Statement Failure
  • User Error
  • Understanding Instance Recovery
  • Phases of Instance Recovery
  • Using the MTTR Advisor
  • Media Failure
  • Archive Log Files

Performing Database Backups

  • Backup Solutions: Overview
  • Oracle Secure Backup
  • User-Managed Backup
  • Terminology
  • Recovery Manager (RMAN)
  • Configuring Backup Settings
  • Backing Up the Control File to a Trace File
  • Monitoring the Flash Recovery Area

Performing Database Recovery

  • Opening a Database
  • Data Recovery Advisor
  • Loss of a Control File
  • Loss of a Redo Log File
  • Data Recovery Advisor
  • Data Failures
  • Listing Data Failures
  • Data Recovery Advisor Views

Moving Data

  • Describe ways to move data
  • Create and use directory objects
  • Use SQL*Loader to move data
  • Use external tables to move data
  • General architecture of Oracle Data Pump
  • Use Data Pump export and import to move data

Working with Support

  • Use the Enterprise Manager Support Workbench
  • Work with Oracle Support
  • Log service requests (SR)
  • Manage patches

05 August, 2015

Health check script for Oracle EBS Database and Application 11i/R12

SQL>conn apps/***
SQL>spool health_check_apps_db.out 

set pages 1000
set linesize 135
col PROPERTY_NAME for a25
col PROPERTY_VALUE for a15
col DESCRIPTION for a35
col DIRECTORY_PATH for a70
col directory_name for a25
col OWNER for a10
col DB_LINK for a40
col HOST for a20
col "User_Concurrent_Queue_Name" format a50 heading 'Manager'
col "Running_Processes" for 9999 heading 'Running'
set head off
set feedback off
set echo off

break on utl_file_dir

select '--------------------------------------------------------------------------------' from dual;
select '-----------------------     Database Checks    ---------------------------------' from dual;
select '--------------------------------------------------------------------------------' from dual;
Prompt
select '************************ Getting Database Information  *************' from dual ;
select 'Database Name..................... : '||name from v$database;
select 'Database Status................... : '||open_mode from v$database;
select 'Archiving Status.................. : '||log_mode  from v$database;
select 'Global Name....................... : '||global_name from global_name;
select 'Creation Date..................... : '||to_char(created,'DD-MON-YYYY HH24:MI:SS') from v$database;
select 'Checking For Missing File......... : '||count(*) from v$recover_file;
select 'Checking Missing File Name ....... : '||count(*) from v$datafile where name like '%MISS%';
select 'Total SGA ........................ : '||round(sum(value)/(1024*1024))||' MB' from v$sga ;
select 'Database Version.................. : '||version from v$instance;
select 'Temporary Tablespace.............. : '||property_value from database_properties where property_name like 'default_temp_tablespace';
select 'Apps Temp Tablespace.............. : '||temporary_tablespace from dba_users where username like '%APPS%';
select 'Temp Tablespace size.............. : '||sum(maxbytes/1024/1024/1024)||' GB' from dba_temp_files group by tablespace_name;
select 'No of Invalid Object ............. : '||count(*) from dba_objects where status = 'INVALID' ;
select 'service Name...................... : '||value from v$parameter2 where name='service_names';
select 'plsql code type................... : '||value from v$parameter2 where name='plsql_code_type';
select 'plsql subdir count................ : '||value from v$parameter2 where name='plsql_native_library_subdir_count';
select 'plsql native library dir.......... : '||value from v$parameter2 where name='plsql_native_library_dir';
select 'Shared Pool Size.........,........ : '||(value/1024/1024) ||' MB' from v$parameter where name='shared_pool_size';
select 'Log Buffer........................ : '||(value/1024/1024) ||' MB' from v$parameter where name='log_buffer';
select 'Buffer Cache...................... : '||(value/1024/1024) ||' MB' from v$parameter where name='db_cache_size';
select 'Large Pool Size................... : '||(value/1024/1024) ||' MB' from v$parameter where name='large_pool_size';
select 'Java Pool Size.................... : '||(value/1024/1024) ||' MB' from v$parameter where name='java_pool_size';
select 'utl_file_dir...................... : '||value from v$parameter2 where name='utl_file_dir';
select directory_name||'.................... : '||directory_path from all_directories where rownum<15;
select '************************ Getting Apps Information *****************' from dual ;
select 'Home URL.......................... : '||home_url from apps.icx_parameters ;
select 'Session Cookie.................... : '||session_cookie from apps.icx_parameters ;
select 'Applicaiton Database ID........... : '||fnd_profile.value('apps_database_id') from dual;
select 'GSM Enabled....................... : '||fnd_profile.value('conc_gsm_enabled') from dual;
select 'Maintainance Mode................. : '||fnd_profile.value('apps_maintenance_mode') from dual;
select 'Site Name......................... : '||fnd_profile.value('Sitename')from dual;
select 'Bug Number........................ : '||bug_number from ad_bugs where bug_number='2728236';
select '************************ Doing Workflow Checks ********************' from dual ;
select 'No Open Notifications............. : '||count(*) from wf_notifications where mail_status in('MAIL','INVALID','OPEN');
select 'Name(wf_systems).................. : '||name from wf_systems;
select 'Display Name(wf_systems).......... : '||display_name from wf_systems;
select 'Address........................... : '||address from wf_agents;
select 'Workflow Mailer Status............ : '||component_status from applsys.fnd_svc_components where component_name like 'Workflow Notification Mailer';
select 'Test Address...................... : '||b.parameter_value from fnd_svc_comp_param_vals_v a, fnd_svc_comp_param_vals b
where a.parameter_id=b.parameter_id and a.parameter_name in ('TEST_ADDRESS');
select 'From Address...................... : '||b.parameter_value from fnd_svc_comp_param_vals_v a, fnd_svc_comp_param_vals b
where a.parameter_id=b.parameter_id and a.parameter_name in ('FROM');
select 'WF Admin Role..................... : '||text from wf_resources where name = 'WF_ADMIN_ROLE' and  rownum =1;
Prompt
Prompt Getting Apps Node Info
Prompt ************************
select Node_Name,'........................ : '||server_id from fnd_nodes;
select server_type||'......................: '||name from fnd_app_servers, fnd_nodes where fnd_app_servers.node_id =fnd_nodes.node_id;
select '************************ Doing Conc Mgr Checks  ********************' from dual ;
Prompt Getting Con Mgr Status
Prompt ************************
Prompt
Prompt Manager Name                                                 Hostname          No of Proc Running
Prompt ~~~~~~~~~~~~                                                 ~~~~~~~~          ~~~~~~~~~~~~~~~~~~
set lines 145
Column Target_Node   Format A12
select User_Concurrent_Queue_Name,'....... : '||Target_Node||' ...... : '||Running_Processes from fnd_concurrent_queues_vl
where Running_Processes = Max_Processes and Running_Processes > 0;
Prompt
Prompt Getting Pending Request
Prompt ***********************
--select user_concurrent_program_name||'........ : '||request_id
--                                                  from fnd_concurrent_requests r, fnd_concurrent_programs_vl p, fnd_lookups s, fnd_lookups ph
--                                                  where r.concurrent_program_id = p.concurrent_program_id
--                                                 and r.phase_code = ph.lookup_code
--                                                and ph.lookup_type = 'CP_PHASE_CODE'
--                                               and r.status_code = s.lookup_code
--                                                  and s.lookup_type = 'CP_STATUS_CODE'
--                                                  and ph.meaning ='Pending'
--                                                  and rownum < 10
--                                                  order by to_date(actual_start_date, 'dd-MON-yy hh24:mi');
--
Prompt
Prompt Getting Workflow Components Status
Prompt **********************************
set pagesize 1000
set linesize 125
col COMPONENT_STATUS for a20
col COMPONENT_NAME for a45
col STARTUP_MODE for a12
select fsc.COMPONENT_NAME,
fsc.STARTUP_MODE,
fsc.COMPONENT_STATUS,
fcq.MAX_PROCESSES TARGET,
fcq.RUNNING_PROCESSES ACTUAL
from APPS.FND_CONCURRENT_QUEUES_VL fcq, APPS.FND_CP_SERVICES fcs,
APPS.FND_CONCURRENT_PROCESSES fcp, fnd_svc_components fsc
where fcq.MANAGER_TYPE = fcs.SERVICE_ID
and fcs.SERVICE_HANDLE = 'FNDCPGSC'
and fsc.concurrent_queue_id = fcq.concurrent_queue_id(+)
and fcq.concurrent_queue_id = fcp.concurrent_queue_id(+)
and fcq.application_id = fcp.queue_application_id(+)
and fcp.process_status_code(+) = 'A'
order by fcp.OS_PROCESS_ID, fsc.STARTUP_MODE;
select '--------------------------------------------------------------------------------' from dual;
select '-----------------------     End Of Database Checks  ----------------------------' from dual;

select '--------------------------------------------------------------------------------' from dual;

03 August, 2015

FNDLOAD

The Generic Loader (FNDLOAD) is a concurrent program that can transfer Oracle Application entity data between database and text file. The loader reads a configuration file to determine which entity to access. In simple words FNDLOAD is used to transfer entity data from one instance/database to other. For example if you want to move a concurrent program/menu/value sets developed in DEVELOPMENT instance to PRODUCTION instance you can use this command.

Steps to Move a Concurrent program from one instance(Database) to other

  • Define your concurrent program and save it in first instance.
  • Connect to your UNIX box on first instance and run the following command to download the .ldt file
    FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct file_name.ldt PROGRAMAPPLICATION_SHORT_NAME=”Concurrent program application short name”CONCURRENT_PROGRAM_NAME=”concurrent program short name”
  • Move the downloaded .ldf file to new instance(Use FTP)
  • Connect to your UNIX box on second instance and run the following command to upload the .ldt file
    FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct file_name.ldt
Note: Make sure you are giving proper .lct file in the commands and don’t confuse with .lct and .ldt files

These following are the other entity data types that we can move with FNDLOAD

1 – Printer Styles

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcppstl.lct file_name.ldt STYLE PRINTER_STYLE_NAME=”printer style name”


2 – Lookups

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct file_name.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME=”FND”
LOOKUP_TYPE=”lookup name”


3 – Descriptive Flexfield with all of specific Contexts

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt DESC_FLEX P_LEVEL=COL_ALL:REF_ALL:CTX_ONE:SEG_ALL APPLICATION_SHORT_NAME=”FND” DESCRIPTIVE_FLEXFIELD_NAME=”desc flex name” P_CONTEXT_CODE=”context name”


4 – Key Flexfield Structures

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt KEY_FLEX P_LEVEL=COL_ALL:FQL_ALL:SQL_ALL:STR_ONE:WFP_ALL:SHA_ALL:CVR_ALL:SEG_ALL APPLICATION_SHORT_NAME=”FND” ID_FLEX_CODE=”key flex code” P_STRUCTURE_CODE=”structure name”


5 – Concurrent Programs

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct file_name.ldt PROGRAM APPLICATION_SHORT_NAME=”FND” CONCURRENT_PROGRAM_NAME=”concurrent name”


6 – Value Sets

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt VALUE_SET_VALUE FLEX_VALUE_SET_NAME=”value set name”


7 – Value Sets with values

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt VALUE_SET FLEX_VALUE_SET_NAME=”value set name”


8 – Profile Options

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct file_name.ldt PROFILE PROFILE_NAME=”profile option” APPLICATION_SHORT_NAME=”FND”


9 – Request Groups

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpreqg.lct file_name.ldt REQUEST_GROUP REQUEST_GROUP_NAME=”request group” APPLICATION_SHORT_NAME=”FND”


10 – Request Sets

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct file_name.ldt REQ_SET
APPLICATION_SHORT_NAME=”FND” REQUEST_SET_NAME=”request set”


11 – Responsibilities

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct file_name.ldt FND_RESPONSIBILITY RESP_KEY=”responsibility”


12 – Menus

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct file_name.ldt MENU MENU_NAME=”menu_name”


13 – Forms Personalization

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct file_name.ldt FND_FORM_CUSTOM_RULES function_name=FUNCTION_NAME


Note: UPLOAD command is same for all except replacing the .lct and passing any extra parameters if you want to pass

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/corresponding.lct upload_file.ldt

Finding OPP Manager log for a concurrent request

=> Use below query to find the OPP manager log for a concurrent request.  SELECT fcpp.concurrent_request_id req_id, fcp.node_name, fcp.lo...