วันจันทร์ที่ 20 พฤษภาคม พ.ศ. 2556
Script for checking database session and script for terminating the session.
select
c.owner,
c.object_name,
c.object_type,
b.sid,
b.serial#,
b.status,
b.osuser,
b.machine
from
v$locked_object a ,
v$session b,
dba_objects c
where
b.sid = a.session_id
and
a.object_id = c.object_id;
alter system kill session 'b.sid,b.serial#';
วันอังคารที่ 14 พฤษภาคม พ.ศ. 2556
Script for checking user privileges in Oracle
Ref:
http://stackoverflow.com/questions/1298473/how-can-i-list-all-grants-a-user-received
System privileges for a user:
SELECT PRIVILEGE
FROM sys.dba_sys_privs
WHERE grantee = <theUser>
UNION
SELECT PRIVILEGE
FROM dba_role_privs rp JOIN role_sys_privs rsp ON (rp.granted_role = rsp.role)
WHERE rp.grantee = <theUser>
ORDER BY 1;
Direct grants to tables/views:
SELECT owner, table_name, select_priv, insert_priv, delete_priv, update_priv, references_priv, alter_priv, index_priv
FROM table_privileges
WHERE grantee = <theUser>
ORDER BY owner, table_name;
Indirect grants to tables/views:
SELECT DISTINCT owner, table_name, PRIVILEGE
FROM dba_role_privs rp JOIN role_tab_privs rtp ON (rp.granted_role = rtp.role)
WHERE rp.grantee = <theUser>
ORDER BY owner, table_name;
DBA_ROLE_PRIVS - Roles granted to users and roles
ROLE_ROLE_PRIVS - Roles which are granted to roles
ROLE_SYS_PRIVS - System privileges granted to roles
ROLE_TAB_PRIVS - Table privileges granted to roles
dba_tab_privs
http://stackoverflow.com/questions/1298473/how-can-i-list-all-grants-a-user-received
System privileges for a user:
SELECT PRIVILEGE
FROM sys.dba_sys_privs
WHERE grantee = <theUser>
UNION
SELECT PRIVILEGE
FROM dba_role_privs rp JOIN role_sys_privs rsp ON (rp.granted_role = rsp.role)
WHERE rp.grantee = <theUser>
ORDER BY 1;
Direct grants to tables/views:
SELECT owner, table_name, select_priv, insert_priv, delete_priv, update_priv, references_priv, alter_priv, index_priv
FROM table_privileges
WHERE grantee = <theUser>
ORDER BY owner, table_name;
Indirect grants to tables/views:
SELECT DISTINCT owner, table_name, PRIVILEGE
FROM dba_role_privs rp JOIN role_tab_privs rtp ON (rp.granted_role = rtp.role)
WHERE rp.grantee = <theUser>
ORDER BY owner, table_name;
DBA_ROLE_PRIVS - Roles granted to users and roles
ROLE_ROLE_PRIVS - Roles which are granted to roles
ROLE_SYS_PRIVS - System privileges granted to roles
ROLE_TAB_PRIVS - Table privileges granted to roles
dba_tab_privs
วันศุกร์ที่ 10 พฤษภาคม พ.ศ. 2556
How to fix Query has exceeded 200 rows. Potentially more rows exists, please restrict your query.
How to fix Query has exceeded 200 rows. Potentially more rows exists, please restrict your query.
This issue occurs because your query has more than 200 rows.
You can put more filters in your query or set profile "FND: View Object Max Fetch Size".
To set profile values, follow below steps
1. Log in eBusiness Suite
2. System Administrator > Profile > System
3. At Find System Profile Values window, find "FND: View Object Max Fetch Size".
4. At System Profile Values window, change the value then save.
This issue occurs because your query has more than 200 rows.
You can put more filters in your query or set profile "FND: View Object Max Fetch Size".
To set profile values, follow below steps
1. Log in eBusiness Suite
2. System Administrator > Profile > System
3. At Find System Profile Values window, find "FND: View Object Max Fetch Size".
4. At System Profile Values window, change the value then save.
วันพุธที่ 8 พฤษภาคม พ.ศ. 2556
Script for getting User's responsibility
SELECT FURGA.USER_ID
, FU.USER_NAME
, FURGA.RESPONSIBILITY_ID
, FRTL.RESPONSIBILITY_NAME
, FURGA.RESPONSIBILITY_APPLICATION_ID
, FA.APPLICATION_SHORT_NAME
, FURGA.SECURITY_GROUP_ID
, FSG.SECURITY_GROUP_KEY
, FURGA.START_DATE
, FURGA.END_DATE
, FURGA.CREATED_BY
, FUCB.USER_NAME
, FURGA.CREATION_DATE
, FURGA.LAST_UPDATED_BY
, FULUB.USER_NAME
, FURGA.LAST_UPDATE_DATE
, FURGA.LAST_UPDATE_LOGIN
, FULUL.USER_NAME
FROM
apps.FND_USER_RESP_GROUPS_ALL FURGA,
apps.FND_USER FU,
apps.FND_USER FUCB,
apps.FND_USER FULUB,
apps.FND_USER FULUL,
apps.FND_APPLICATION FA,
apps.FND_RESPONSIBILITY_TL FRTL,
apps.FND_SECURITY_GROUPS FSG
WHERE
FURGA.USER_ID = FU.USER_ID (+)
AND FURGA.CREATED_BY = FUCB.USER_ID (+)
AND FURGA.LAST_UPDATED_BY = FULUB.USER_ID (+)
AND FURGA.LAST_UPDATE_LOGIN = FULUL.USER_ID (+)
AND FURGA.RESPONSIBILITY_APPLICATION_ID = FA.APPLICATION_ID (+)
AND FURGA.RESPONSIBILITY_ID = FRTL.RESPONSIBILITY_ID (+)
AND FRTL.LANGUAGE = 'US'
AND FURGA.SECURITY_GROUP_ID = FSG.SECURITY_GROUP_ID (+)
and fu.user_name='&user_name'
ORDER BY FRTL.RESPONSIBILITY_NAME;
, FU.USER_NAME
, FURGA.RESPONSIBILITY_ID
, FRTL.RESPONSIBILITY_NAME
, FURGA.RESPONSIBILITY_APPLICATION_ID
, FA.APPLICATION_SHORT_NAME
, FURGA.SECURITY_GROUP_ID
, FSG.SECURITY_GROUP_KEY
, FURGA.START_DATE
, FURGA.END_DATE
, FURGA.CREATED_BY
, FUCB.USER_NAME
, FURGA.CREATION_DATE
, FURGA.LAST_UPDATED_BY
, FULUB.USER_NAME
, FURGA.LAST_UPDATE_DATE
, FURGA.LAST_UPDATE_LOGIN
, FULUL.USER_NAME
FROM
apps.FND_USER_RESP_GROUPS_ALL FURGA,
apps.FND_USER FU,
apps.FND_USER FUCB,
apps.FND_USER FULUB,
apps.FND_USER FULUL,
apps.FND_APPLICATION FA,
apps.FND_RESPONSIBILITY_TL FRTL,
apps.FND_SECURITY_GROUPS FSG
WHERE
FURGA.USER_ID = FU.USER_ID (+)
AND FURGA.CREATED_BY = FUCB.USER_ID (+)
AND FURGA.LAST_UPDATED_BY = FULUB.USER_ID (+)
AND FURGA.LAST_UPDATE_LOGIN = FULUL.USER_ID (+)
AND FURGA.RESPONSIBILITY_APPLICATION_ID = FA.APPLICATION_ID (+)
AND FURGA.RESPONSIBILITY_ID = FRTL.RESPONSIBILITY_ID (+)
AND FRTL.LANGUAGE = 'US'
AND FURGA.SECURITY_GROUP_ID = FSG.SECURITY_GROUP_ID (+)
and fu.user_name='&user_name'
ORDER BY FRTL.RESPONSIBILITY_NAME;
Script for checking Profile Option
SELECT p.profile_option_name short_name,
n.user_profile_option_name name,
TO_CHAR (v.last_update_date, 'DD-MON-YYYY') "Last Updated",
DECODE (v.level_id,
10001, 'Site',
10002, 'Application',
10003, 'Responsibility',
10004, 'User',
10005, 'Server',
10007, 'SERVRESP',
'UnDef')
level_set,
DECODE (TO_CHAR (v.level_id),
'10001', '',
'10002', app.application_short_name,
'10003', rsp.responsibility_key,
'10005', svr.node_name,
'10006', org.name,
'10004', usr.user_name,
'10007', 'Serv/resp',
'UnDef')
"CONTEXT",
v.profile_option_value VALUE
FROM fnd_profile_options p,
fnd_profile_option_values v,
fnd_profile_options_tl n,
fnd_user usr,
fnd_application app,
fnd_responsibility rsp,
fnd_nodes svr,
hr_operating_units org
WHERE p.profile_option_id = v.profile_option_id(+)
AND p.profile_option_name = n.profile_option_name
AND UPPER (n.user_profile_option_name) LIKE
UPPER ('FND: View Object Max Fetch Size') -- Profile Option Name
AND usr.user_id(+) = v.level_value
AND rsp.application_id(+) = v.level_value_application_id
AND rsp.responsibility_id(+) = v.level_value
AND app.application_id(+) = v.level_value
AND svr.node_id(+) = v.level_value
AND org.organization_id(+) = v.level_value
ORDER BY short_name, level_set;
n.user_profile_option_name name,
TO_CHAR (v.last_update_date, 'DD-MON-YYYY') "Last Updated",
DECODE (v.level_id,
10001, 'Site',
10002, 'Application',
10003, 'Responsibility',
10004, 'User',
10005, 'Server',
10007, 'SERVRESP',
'UnDef')
level_set,
DECODE (TO_CHAR (v.level_id),
'10001', '',
'10002', app.application_short_name,
'10003', rsp.responsibility_key,
'10005', svr.node_name,
'10006', org.name,
'10004', usr.user_name,
'10007', 'Serv/resp',
'UnDef')
"CONTEXT",
v.profile_option_value VALUE
FROM fnd_profile_options p,
fnd_profile_option_values v,
fnd_profile_options_tl n,
fnd_user usr,
fnd_application app,
fnd_responsibility rsp,
fnd_nodes svr,
hr_operating_units org
WHERE p.profile_option_id = v.profile_option_id(+)
AND p.profile_option_name = n.profile_option_name
AND UPPER (n.user_profile_option_name) LIKE
UPPER ('FND: View Object Max Fetch Size') -- Profile Option Name
AND usr.user_id(+) = v.level_value
AND rsp.application_id(+) = v.level_value_application_id
AND rsp.responsibility_id(+) = v.level_value
AND app.application_id(+) = v.level_value
AND svr.node_id(+) = v.level_value
AND org.organization_id(+) = v.level_value
ORDER BY short_name, level_set;
How to add Sys Admin Responsibility
วิธีการเพิ่ม Responsibility โดยใช้ scipt
set serveroutput on
BEGIN
fnd_user_pkg.addresp
(username => 'MYNAME',
resp_app => 'SYSADMIN',
resp_key => 'SYSTEM_ADMINISTRATOR',
security_group => 'STANDARD',
description => 'DESCRIPTION',
start_date => SYSDATE,
end_date => SYSDATE +1
);
COMMIT;
DBMS_OUTPUT.put_line ('Added');
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Error '|| SQLCODE|| SUBSTR (SQLERRM, 1, 100));
ROLLBACK;
END;
/
set serveroutput on
BEGIN
fnd_user_pkg.addresp
(username => 'MYNAME',
resp_app => 'SYSADMIN',
resp_key => 'SYSTEM_ADMINISTRATOR',
security_group => 'STANDARD',
description => 'DESCRIPTION',
start_date => SYSDATE,
end_date => SYSDATE +1
);
COMMIT;
DBMS_OUTPUT.put_line ('Added');
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Error '|| SQLCODE|| SUBSTR (SQLERRM, 1, 100));
ROLLBACK;
END;
/
วันอังคารที่ 7 พฤษภาคม พ.ศ. 2556
How to enable About This Page (at Site Level)
วิธีการกำหนดให้ eBusiness Suite แสดงลิงค์ About This Page ในระดับ Site Level
- Log in eBusiness Suite
- เลือก responsibility เป็น System Administrator > Profile > System
- ให้เสิร์ชว่า FND%Dia% แล้วกด Find
- หน้าต่าง System Profile Values จะแสดงขึ้นมา ให้แก้ไขค่าเป็น Yes แล้วบันทึก
How to find the correct version of JDeveloper to use with eBusiness Suite 11i or Release 12.x
วิธีหาเวอร์ชั่นของ Jdev เพื่อพัฒนา OA Framework
ก่อนอื่นเราต้องไปดูว่าใน eBusiness Suite instance
ของเรามันต้องการ Jdev เวอร์ชันไหน
โดยเมื่อ
1)
log in เข้าไปที่ eBusiness Suite แล้ว
2)
มันจะมีลิงค์
About This Page อยู่ด้านล่าง ให้คลิ๊กเข้าไป
(ถ้าไม่มีให้ทำตามนี้ How to enable About This Page)
3) คลิ๊กที่ Technology
Components จะเห็นเวอร์ชั่นของ OA
Framework
เมื่อเราได้เวอร์ชั่นของ OA Frameworkมาแล้ว
ต่อไปเราจะไปดูว่า Jdev ที่เรามีมันใช้ได้ไหม
โดยเมื่อเปิด Jdev ขึ้นมาแล้วก็เลือกเมนู
Help > About
เมื่อเรารู้ว่าต้องใช้ตัวไหนก็ไปดาวน์โหลดมาลงเป็นอันเรียบร้อย
สมัครสมาชิก:
บทความ (Atom)