Saturday, November 28, 2015

Change Display Resolution of Oracle Linux 6.5



Check the all possible resolution supported using the following command:
xrandr

Change or set the resolution using the available resolution

#xrandr -s 1024x768


Dead Locks occured while applying patch# 21314548 R12.AD.B.DELTA.7 PATCH


Dead Locks occured while applying patch# 21314548 

sqlplus -s APPS/***** @/u02/app/oracle/PROD/apps/apps_st/appl/ad/12.0.0/patch/115/sql/ADFIXUSER.sql
Connected.
begin
*
ERROR at line 1:
ORA-00060: deadlock detected while waiting for resource
ORA-06512: at "SYS.AD_ZD_SYS", line 39
ORA-06512: at line 2


The error is a lock on object.

1. stop you patch application

2.  Stop and start your database

3. re-apply the patch .

Tuesday, November 24, 2015

Oracle BI Administration Tool: Connection has failed

Oracle BI Administration Tool: Connection has failed

Import metadata error message:

The connection has failed.
[nQSError: 17014] Could not connect to Oracle Database.
[nQSError: 17001] Oracle Error code: 12154, message: ORA-12154:
TNS:could not resolve the connect identifier specified at OCI call OCIServerAttach.

Solution:

Oracle Instant Client must be installed in your machine and set environment variable TNS_ADMIN pointing to network admin folder of oracle instant client.








Click ok to close window

Start the OBIEE Administration Tool and import metadata again.




Tuesday, November 17, 2015

Employee Payroll Costing Creation Using API


Employee Payroll Creation Using API

Declare
  Cursor c_cost_emp_cur Is
         Select paaf.assignment_id
         From per_all_assignments_f paaf
             ,per_all_people_f papf
         Where papf.person_id = paaf.person_id
         And sysdate between papf.effective_start_date And papf.effective_end_date
         And sysdate between paaf.effective_start_date and paaf.effective_end_date

         And Not exists (Select 'x'
                                    From pay_cost_Allocations_F pcaf
                                   Where pcaf.assignment_id =  paaf.assignment_id
                                   And sysdate Between pcaf.effective_Start_date and pcaf.effective_end_date);
Type l_emp_rec Is Table of c_cost_emp_cur%rowtype Index By Pls_Integer;
l_emp_table l_emp_rec;
l_flag Boolean;
l_combination_name          varchar2(150);
l_cost_allocation_id        number;
l_cost_effective_start_date date;
l_cost_effective_end_date   date;
l_cost_allocation_keyflex_id pay_cost_allocation_keyflex.cost_allocation_keyflex_id%type;
l_cost_obj_version_number   number;

Begin
l_emp_table.delete;
Open c_cost_emp_cur;
Fetch c_cost_emp_cur Bulk Collect Into l_emp_table;
Close c_cost_emp_cur;

For i In 1..l_emp_table.Count
Loop
 -- We enabled only cost center in cost allocation.
  pay_cost_allocation_api.create_cost_allocation (p_validate => false
                        ,p_effective_date       => '01-nov-2015'
                        ,p_assignment_id        => l_emp_table(i).assignment_id
                        ,p_proportion           => 1 -- the parameter value should be 1 , This is equal to 100% entered via applcation screen
                        ,p_business_group_id    => 101
                       -- ,p_segment1             => l_company
                        ,p_segment2             => '254'
                        --,p_segment3             => l_cost_code
                        --,p_segment4             => l_budget_code
                        --,p_segment5             => l_account
                        -- Out
                        ,p_combination_name     => l_combination_name
                        ,p_cost_allocation_id   => l_cost_allocation_id
                        ,p_effective_start_date => l_cost_effective_start_date
                        ,p_effective_end_date   => l_cost_effective_end_date
                        ,p_object_version_number => l_cost_obj_version_number
                        -- In / Out
                        ,p_cost_allocation_keyflex_id => l_cost_allocation_keyflex_id
                        );
End Loop;
commit;
End;

Saturday, November 7, 2015

Linux: Delete Files Older than x number of days



Delete files older than x number of days

$find . -mtime +5 -print 0 |xargs -0 rm -f

Tuesday, November 3, 2015

Adobe Acrobat: JavaScript Enabled warning Message while opening some documents

Enable JavaScript in Adobe Reader , follow the following steps


1. Launch Acrobat or Adobe Reader.
2. Select Edit>Preferences
3. Select the JavaScript Category
4. Uncheck the ‘Enable Acrobat JavaScript’ option
5. Click OK

Remove Special Characters from String


Remove Special Characters from a String

REGEXP_REPLACE('String for replace','[^[:alnum:]'' '']', NULL)

E.g

SELECT REGEXP_REPLACE('##787__!!','[^[:alnum:]'' '']', NULL) FROM dual;

787