DBMS_RLS

Is there any way I can use this package in the standard version. (legitimately)
It is the only 'extra' from the enterprise edition that i require and cannot justify the upgrade purely based on this.
Can the package be installed on the standard edition or does it require other packages only present within the enterprise edition.

Actually, i have 2 machines, one is working fine, the other keeps getting 'Fine-grained access not enable'
Both of the machines use same CD to installed.
Thanks,

Similar Messages

  • Dbms_rls.add_policy with Oracle 10g Express Edition

    SQL> begin
    2 dbms_rls.add_policy(
    3 object_schema => 'VPD',
    4 object_name => 'TRANSACTIONS',
    5 policy_name => 'VPD_TEST_POLICY',
    6 function_schema => 'VPD',
    7 policy_function => 'VPD_POLICY.VPD_PREDICATE',
    8 statement_types => 'select, insert, update, delete',
    9 update_check => TRUE,
    10 enable => TRUE,
    11 static_policy => FALSE);
    12 end;
    13 /
    Gives an ORA error as follows
    ERROR at line 1:
    ORA-00439: feature not enabled: Fine-grained access control
    ORA-06512: at "SYS.DBMS_RLS", line 20
    ORA-06512: at line 2
    i'am using Oracle 10g Express Edition
    Please get back as soon as possible

    It should more appropriate to post your question into Oracle Database Express Edition (XE)<br>
    <br>
    Nicolas.

  • Import and Package errors (DBMS_RLS security)

    I imported a schema recently, but i users can't log and i found out that dis package that was imported had a problem, and when i try to recompile it gave the error below
    SQL> show error
    Errors for PACKAGE BODY SYSMAINT_PKG:
    LINE/COL ERROR
    96/5 PL/SQL: SQL Statement ignored
    99/7 PL/SQL: ORA-00942: table or view does not exist
    430/3 PL/SQL: SQL Statement ignored
    430/37 PL/SQL: ORA-00942: table or view does not exist
    441/3 PLS-00201: identifier DBMS_RLS must be declared
    441/3 PL/SQL: Statement ignored
    447/3 PLS-00201: identifier 'DBMS_RLS' must be declared
    447/3 PL/SQL: Statement ignored
    SQL>
    the package stated to be declared, i tried to re-compiled but found the below statement and some numbers/alphabets
    create or replace PACKAGE BODY dbms_rls wrapped
    Can anybody help please.
    Message was edited by:
    olu

    At least you can grant execute on dbms_rls to the owner of that package first :)
    Then you need to compare contents of dba_tab_privs for imported user on source database and target. Missed rows in target database would be the missed grants.
    Otherwise you need to check logs for any errors or just use show=y option to find out if missing grant commands present in dump file.
    Best Regards,
    Alex

  • DBMS_RLS를 이용한 FINE GRANED ACCESS CONTROL (FGAC)의 개념 및 사용방법 (8I ~ 10G)

    제품 : ORACLE SERVER
    작성날짜 : 2005-11-23
    DBMS_RLS를 이용한 FINE GRANED ACCESS CONTROL (FGAC)의 개념 및 사용방법 (8I ~ 10G)
    =====================================================================
    PURPOSE
    여러 사용자가 같은 테이블을 조회하더라도, 각 사용자마다 자신의 정보만을
    표시해 준다거나, 특정 시간 범위 내에서는 다른 조건의 데이타만 보여지는 등
    row level의 security및 context를 지정하는 것이 8i부터
    FGAC (Fine Graned Access Control)을 통해 가능해졌다.
    이것은 VPD (Virtual Private Database)라는 용어로도 언급되어지는대,
    dbms_rls pacakge를 통해 policy 및 predicate을 생성하여 사용되어진다.
    Explanation & Examples
    FGAC는 row level로 security 및 context를 부여하는 것으로 결국 tranparent하게
    수행하는 SQL문장에 where절 조건을 추가하는 것이다.
    이렇게 추가되는 where 조건을 predicate이라고 부른다.
    1. FGAC의 간단한 예제
    scott의 emp table에 대해서 login한 username과 같은 ename에 대한 정보만을
    보여주는 예제를 제시한다. super_user라는 role을 가진 user에 대해서는
    전체 emp table이 모두 display되는 방법도 첨부한다.
    (1) dbms_rls package에 대한 실행 권한을 scott에게 부여한다.
    SQL> grant execute on dbms_rls to scott;
    (2) emp table의 ename에 해당하는 user몇명을 생성하고 권한을 부여한다.
    SQL> create user king identified by king;
    SQL> create user adams identified by adams;
    SQL> grant connect to king, adams, james;
    SQL> connect scott/tiger
    SQL> grant select on emp to king, adams, james, eykim;
    (3) scott user에서 다음과 같이 predicate을 포함한 function을 생성한다.
    SQL> connect scott/tiger
    SQL> create or replace function predicate
    (obj_schema varchar2, obj_name varchar2)
    return varchar2 is d_predicate varchar2(2000);
    BEGIN
    d_predicate := 'ename = sys_context (''USERENV'', ''SESSION_USER'')';
    RETURN d_predicate;
    END predicate;
    policy이 제대로 만들어졌는지 다음과 같이 scott user에서 확인한다.
    SQL> select predicate('dummy','dummy') from dual;
    PREDICATE('DUMMY','DUMMY')
    ename = sys_context ('USERENV', 'SESSION_USER')
    (4) 다음 문장을 system 혹은 scott user에서 실행한다.
    이때 parameter의 의미는, object_schema, object_name, policy_name,
    function_schema, policy_function 순이다. 이 외의 parameter가 더 있지만
    나머지는 default값을 이용한다.
    SQL> exec dbms_rls.add_policy('scott', 'emp', 'pol1', 'scott', 'predicate');
    기존의 같은 policy name이 존재하는 경우에는 다음과 같이 지우고 새로 생성할
    수 있다.
    SQL> exec dbms_rls.drop_policy( 'SCOTT', 'EMP', 'pol1' );
    (5) king/scott등 user로 접속하여 emp table을 조회해 본다.
    SQL> connect king/king
    SQL> select * from scott.emp;
    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    DEPTNO
    7839 KING PRESIDENT 17-NOV-81 5000
    10
    SQL> connect scott/tiger
    SQL> select * from emp;
    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    DEPTNO
    7788 SCOTT ANALYST 7566 19-APR-87 3000
    20
    (6) emp table의 ename에 속해있지 않은 user로 접속하여 조회해 본다.
    eykim user에 대해서 emp table의 select권한은 (2)번 단계에서 제공되었다.
    SQL> connect eykim/eykim
    SQL> select * from scott.emp;
    no rows selected
    (7) super_user라는 role을 생성하고 이 role을 가진 사용자는 모두 데이타가 조회
    가능하도록 policy function을 변경하여 본다.
    SQL> grant select on dba_role_privs to scott;
    SQL> create or replace function predicate (obj_schema varchar2, obj_name varchar2)
    return varchar2 is d_predicate varchar2(2000);
    counter number;
    begin
    select count(*) into counter
    from dba_role_privs
    where granted_role='SUPER_USER'
    and grantee = sys_context ('USERENV', 'SESSION_USER');
    if counter = 1 then
    d_predicate := '';
    else
    d_predicate := 'ename = sys_context (''USERENV'', ''SESSION_USER'')';
    end if;
    return d_predicate;
    end predicate;
    (8) king user에게 super_user role을 부여한 후 (5)번과 어떻게 결과가 다르게
    나오는지 확인한다.
    SQL> create role super_user;
    SQL> grant super_user to king;
    SQL> connect king/king
    SQL> select * from emp;
    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    DEPTNO
    7369 SMITH CLERK 7902 17-DEC-80 800
    20
    7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300
    30
    7902 FORD ANALYST 7566 03-DEC-81 3000
    20
    7934 MILLER CLERK 7782 23-JAN-82 1300
    10
    14 rows selected.
    RELATED DOCUMENTS
    <Note 67977.1> Oracle8i Fine Grained Access Control - Working Examples

  • FINE GRAINED ACCESS CONTROL(FGAC)를 위한 DBMS_RLS.ADD_POLICY의 VERSION별 특징

    제품 : ORACLE SERVER
    작성날짜 : 2005-11-24
    FINE GRAINED ACCESS CONTROL(FGAC)를 위한 DBMS_RLS.ADD_POLICY의 VERSION별 특징
    =======================================================================
    PURPOSE
    row leve의 security 및 context관리 방법인 FGAC에 대한 간단한 개념 및 사용방법은
    <bul 23026>에 제시하였다.
    이 문서에는 FGAC를 위한 dbms_rls package의 8i ~ 10g까지의 version별 특징을
    정리하며, STATIC_POLICY와 POLCICY_TYPE parameter에 대해서는 예제를 이용하여
    자세히 살펴보도록 한다.
    Explanation & Examples
    dbms_rls.add_policy를 사용할 때 일반적으로 주는 value값의 예제는 다음과 같다.
    이중 대부분은 default값을 이용하여, 일반적으로는 앞의 5개의 parameter만
    value를 주면 된다.
    SQL> exec DBMS_RLS.ADD_POLICY ( -
    > object_schema => 'SCOTT', -
    > object_name => 'EMP', -
    > policy_name => 'POL1', -
    > function_schema => 'SYS', -
    > policy_function => 'PREDICATE', -
    > statement_types => 'SELECT', -
    > static_policy => false, -
    > policy_type => DBMS_RLS.DYNAMIC
    > long_predicate => false);
    1. FGAC의 version별 특징
    (1) sec_relevant_cols/sec_relevant_cols_opt : 10G
    위에 기술한 add_policy procedure의 parameter외에 10g에서 추가된
    parameter로 다음 두 parameter가 존재한다.
    이 parameter는 해당되는 column이 조회될때만 policy가 작동하게 하기 위한
    것으로 metalink.oracle.com site에서 <Note 250795.1> 를 살펴보면 사용 방법
    및 예제를 확인 가능하다.
    - sec_relevant_cols
    - sec_relevant_cols_opt
    (2) long_predicate : 10G
    default는 false이며, true로 지정하는 경우 predicate이 4000 bytes이상이
    될 수 있다.
    (3) statement_types : 10G부터 INDEX type추가
    9i까지는 SELECT, INSERT, UPDATE, DELETE에 대해서는 FGAC를 적용할 수
    있었으나, 10g부터는 INDEX type도 지정 가능하다.
    index를 지정하는 경우, function-based index 생성을 제한할 수 있으며,
    자세한 예제는 metalink.oracle.com site에서 <Note 315687.1>를 조회하여
    확인할 수 있다.
    (4) EXEMPT ACCESS POLICY 권한 : 9i
    특정 user가 모든 fine-grained access control policy의 영향을 받지
    않도록 하려면 exempt access policy권한을 grant하면 되며, 이것은 9i부터
    소개되었다.
    SQL> grant exempt access policy to scott;
    와 같은 방식으로 권한을 부여하면 되며, 이에 대한 자세한 예제는
    metalink.oracle.com site에서 <Note 174799.1>를 통해 확인 가능하다.
    (5) synonym에 대한 policy설정 : 9.2
    synonym에 대해서 VPD (Virtudal Private Database)에 대한 policy를 설정하는
    것이 가능해 졌으며 이에 대해서는 metalink.oracle.com에서 <Note 174368.1>를
    조회하여 자세한 방법 및 예제를 살펴볼 수 있다.
    (6) static_policy : 8.1.7.4
    static_policy paramter는 8i에는 없던 것으로 9i에서 도입되면서, 8.1.7.4에도
    반영되었다. default값은 false이며, 8173까지는 항상 false인 형태로 동작한다.
    즉, policy function이 매번 object를 access할때마다 실행된다.
    8.1.7.4부터는 이 parameter를 true로 설정할 수 있는대, 이렇게 되면
    해당 session에서 policy function이 한번 실행되고 그 function이 shared pool에
    cache되어 있으면 재실행없이 그대로 사용된다.
    10g부터는 (7)번에 설명하는 policy_type parameter가 추가되어,
    이 parameter에 true로 지정하는 대신, static_type은 false로 두고,
    policy_type을 dbms_rls.static 으로 지정하면,
    9i와 8174에서 static_policy를 true로 한것과 같은 결과가 나타난다.
    (7) policy_type: 10g
    다음과 같이 5가지 value가 가능하며, 이 중 default는 dynamic이다.
    - STATIC
    policy fuction에 포함된 predicate이 runtime환경에 따라 다른 결과를 내지
    않는 경우 사용하게 된다. 예를 들어 sysdate의해 다른 결과를 return하는
    경우에는 사용하면 사용하면 문제가 될 수 있다.
    static을 사용하는 경우 policy function은 한번 실행되어 SGA에 올라온 다음
    이후 같은 session에서 같은 object를 사용시에는 재실행 없이 해당 predicate의
    결과를 그대로 사용한다.
    - SHARD_STATIC
    STATIC과 같으나, 이 값은 다른 object에 대해서도 같은 predicate function이
    사용되는 경우, 먼저 cache된 predicate을 찾아서 있으면 그 값을 이용한다.
    STATIC의 경우는 다른 object 사이에서는 공유하지 않으며 같은 object에
    대해서만 cache된 값을 사용한다.
    - CONTEXT_SENSITIVE
    한 session에서 context가 변경되면 그때 predicate를 재 실행시킨다.
    WAS(web application server)를 사용하는 경우 connection pooling방법을
    기본적으로 사용하는대, 이 경우 하나의 session을 여러 사용자가 이어서
    교대로 사용하는 방식이 된다. 이 경우 middle tier단에서 context를 설정해
    주면 context가 변경될때마다 predicate를 새로 실행시켜 변경된 sysdate나
    session_user등의 값을 다시 계산하게 되는것이다.
    jdbc에서 context설정에 관한 예제는 metalink.oracle.com에서
    <Note 110604.1>에서 확인가능하다.
    - SHARED_CONTEXT_SENSITIVE
    context_sensitive와 동일하며, 단 shared_static과 마찬가지로 여러 object에
    대해서 같은 predicate을 사용하는 경우 다른 object에 대한 같은 predicate이
    cache되어 있는지를 먼저 살펴본다.
    존재하면 session private application context가 변경되기 전까지 그 predicate의
    결과를 그대로 사용한다.
    - DYNAMIC
    이 값이 default값이다. 즉, predicate function이나 시스템이나 환경에
    영향을 받는다고 판단하여 statement가 실행될때마다 매번 predicate function을
    재 실행하여 환경에 맞는 값을 return하여 준다.
    아래에서 sysdate 값에 따라 다른 결과를 return하게 되어 있는
    predicate을 이용한 예제를 통해 정확한 메카니즘을 확인한다.
    2. static_policy 및 policy_type의 value에 따른 policy function의 작동예제
    (a) STATIC_POLICY => TRUE and POLICY_TYPE => NULL
    (1) 기존에 pol1 policy가 존재하는 경우 다음과 같이 drop시킨다.
    SQL> exec DBMS_RLS.DROP_POLICY ('SCOTT', 'EMP','POL1');
    (2) 다음과 같이 predicate function을 scott user로 만들어둔다.
    SQL> create or replace function PREDICATE (obj_schema varchar2, obj_name varchar2)
    2 return varchar2 is d_predicate varchar2(2000);
    3 begin
    4 if to_char(sysdate, 'HH24') >= '06' and to_char(sysdate, 'MI')<'05' then
    5 d_predicate := 'ename = sys_context (''USERENV'' , ''SESSION'');
    6 else d_predicate := 'sal>=3000';
    7 end if;
    8 return d_predicate;
    9 end predicate;
    10 /
    (3) pol1을 새로 add시킨다.
    SQL> exec DBMS_RLS.ADD_POLICY ( -
    object_schema => 'SCOTT', -
    object_name => 'EMP', -
    policy_name => 'POL1', -
    function_schema => 'SCOTT', -
    policy_function => 'PREDICATE', -
    statement_types => 'SELECT', -
    static_policy => TRUE, -
    policy_type => NULL);
    (4) adams user에서 scott.emp를 조회해 본다.
    단 다음과 같이 scott.emp에 대한 select권한을 king에게 주어야 한다.
    SQL>grant select on emp to king;
    SQL>!date
    Thu Nov 24 14:01:13 EST 2005
    SQL> connect king/king
    SQL> select * from scott.emp;
    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    DEPTNO
    7839 KING PRESIDENT 17-NOV-81 5000
    10
    5분이후가 되어 predicate function의 if조건을 만족하지 않아도,
    king user는 같은 값을 emp table에 대해서 return한다.
    SQL>!date
    Thu Nov 24 14:10:13 EST 2005
    SQL> connect king/king
    SQL> select * from scott.emp;
    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    DEPTNO
    7839 KING PRESIDENT 17-NOV-81 5000
    10
    (b) STATIC_POLICY => FALSE and POLICY_TYPE => DBMS_RLS.DYNAMIC
    (1) 기존의 policy를 다음과 같이 drop시킨다.
    SQL> exec DBMS_RLS.DROP_POLICY ('SCOTT', 'EMP','POL1');
    (2) pol1을 새로 add시키는대 이대 static_policy와 policy_type을 다음과 같이
    변경한다.
    SQL> exec DBMS_RLS.ADD_POLICY ( -
    object_schema => 'SCOTT', -
    object_name => 'EMP', -
    policy_name => 'POL1', -
    function_schema => 'SCOTT', -
    policy_function => 'PREDICATE', -
    statement_types => 'SELECT', -
    static_policy => flase, -
    policy_type => dbms_rls.dynamic);
    (3) king user에서 조회해본다.
    predicate function은 위의 2-(a)에서 실행한 것을 그대로 사용한다.
    즉 (a)를 실행하지 않은 경우, 조회전에 (a)-(2)번을 실행해야 한다.
    SQL>!date
    Thu Nov 24 15:01:13 EST 2005
    SQL> connect king/king
    SQL> select * from scott.emp;
    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    DEPTNO
    7839 KING PRESIDENT 17-NOV-81 5000
    10
    5분 이후가 되어 다시한번 king user에서 실행해본다.
    SQL>!date
    Thu Nov 24 15:10:13 EST 2005
    SQL> select * from scott.emp;
    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    DEPTNO
    7788 SCOTT ANALYST 7566 19-APR-87 3000
    20
    7839 KING PRESIDENT 17-NOV-81 5000
    10
    7902 FORD ANALYST 7566 03-DEC-81 3000
    20
    RELATED DOCUMENTS
    <Note 281970.1> 10g Enhancement on STATIC_POLICY with POLICY_TYPE Behaviors
    in DBMS_RLS.ADD_POLICY Procedure
    <Note 281829.1> Evolution of Fine Grain Access Control FGAC Feature From 8i
    to 10g

    first you could use default column values, not a trigger, which is more expensive.
    if your apps already assumes full access to table to get max id ( another RT ), this is bad. Current RLS can not really help if you can not change the apps because of this flaw logic ( you can store the maxid anywhere, why scanning the whole table to find it )

  • Need grant execute on dbms_rls for VPD

    Hi,
    I need grant execute on dbms_rls to setup "Virtual Private Database".
    How do I go about getting it?
    Thank you, Bill
    [email protected]

    Hi Scott and All,
    I got the DBA to grant execute to the workspace userid BHRS and run the 2 policies I have for the VPD as BHRS.
         begin
         dbms_rls.add_policy (
         object_schema => 'BHRS',
         object_name => 'MR_REQUEST',
         policy_name => 'USER_SU_POLICY',
         function_schema => 'BHRS',
         policy_function => 'GET_SU_USER_ID',
         statement_types => 'SELECT, UPDATE',
         update_check => TRUE
         end;
    But, when I went to select * from MR_REQUEST
    I got ORA-28112: failed to execute policy function
    So I reduced my function down to returning null
         create or replace function GET_SU_USER_ID
         return varchar2
         as
         l_retstr varchar2(2000);
         l_count integer:=0;
         begin
         l_retstr := null;
         return l_retstr;
         end;
    Researched a bit and found could look in the USER_DUMP file but the DBA here says the DB doesn't have one because we use the XDB ???
    How can I check the policy errors or debug this problem?
    Thanks Bill

  • Install dbms_rls package

    Hi All,
    I want to use dbms_rls package in one of my applications and I dont know which script to apply to create the package. Kindly guide me. My DB version is 10.2.0.1.0.

    I hope you have enterprise edition, and its installed be default
    sql> desc dbms_rls
    If its not installed,
    run the below as SYS
    $ORACLE_HOME/rdbms/admin/dbmsrlsa.sql
    $ORACLE_HOME/rdbms/admin/prvtrlsa.plb

  • ORA-439: DBMS_RLS 패키지사용시

    제품 : ORACLE SERVER
    작성날짜 : 2004-08-31
    ORA-439: DBMS_RLS 패키지사용시
    ========================
    Problem Description
    'fine-grained access control' 기능을 활성화하기 위하여 DBMS_RLS 패키지를
    사용하려 할때 다음의 Error를 만날 수 있다:
    Error: ORA-439
    Text: feature not enabled: %s
    Cause: The specified feature is not enabled.
    Action: Do not attempt to use this feature.
    Solution Description:
    Oracle 8i의 Standard Edition을 사용하고 있는데 이 기능을 사용하기
    위해서는 Enterprise Edition 이 필요합니다.
    현재 어떠한 Version의 데이터베이스를 사용하고 있는지 확인하기 위해서는
    다음의 문장을 sqlplus에서 수행한다.
    SQL> select * from v$version;
    BANNER
    Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
    PL/SQL Release 8.1.6.0.0 - Production
    CORE 8.1.6.0.0 Production
    TNS for 32-bit Windows: Version 8.1.6.0.0 - Production
    NLSRTL Version 3.4.1.0.0 - Production
    여기에서는 현재 접속되어 있는 Version이 8.1.6.0.0 Enterprise Edition 이란것을
    알려 주고 있다.
    Reference Ducumment
    <Note:117058.1> ORA-439 When Trying to Use DBMS_RLS

    It should more appropriate to post your question into Oracle Database Express Edition (XE)<br>
    <br>
    Nicolas.

  • Difference between DBMS_FGA and DBMS_RLS

    Hi all,
    I've learnt that both DBMS_FGA and DBMS_RLS can be used to apply fine-grained policies on tables with some more procedures for the later.
    My simple question is What is the main difference between DBMS_FGA and DBMS_RLS when it comes to add a policy? When shall I use either of them?
    Thanks in advance.

    Hi,
    I believe DBMS_FGA is being kept to support the old oracle version, but is being replaced with DBMS_RLS from 10g onward.
    Regards

  • DBMS_RLS and FGAC

    Hello All,
    I have questions concerning DBMS_RLS and FGAC.
    Can I use in APEX - apex.oracle.com?
    Thanks,
    NYorker

    user12268235 wrote:
    Thanks Guru Alex Nuijten,
    blush
    I would like to learn about DBMS_RLS and FGAC.
    I want to have own for all to see big scope.
    For instance, I learn using apex.oracle.com a lot and I understand user names and passwords that DBA created for developers. I got free apex.oracle.com and I love it.
    You can learn a lot playing there, especially on Application Express..
    I want to spend $0 or as less as possible. I got free apex.oracle.com and I love it.or less?... wow
    Why don't you get the Oracle Express Edition, easy install database and since you own it you can do whatever you want on it. Or get a Personal Edition, also easy install - very good edition for learning Oracle.
    http://www.oracle.com/technology/software/index.html

  • Using wwctx_api.get_user in dbms_rls policy

    We have not been able to succesfully use a call to wwctx_api.get_user in the function we use as a policy for row level security. The package compiles fine. The policy adds fine. When we try to select from the table where the policy is on from portal (LOV, REPORT, DYNAMIC PAGE) we get Ora-28112.
    Help?

    The error code maps to the following message:
    ORA-28112 failed to execute policy function
    Cause: The policy function has one or more error during execution.
    Action: Check the trace file and correct the errors.
    Could you try returning a static value from the security policy and do your select and see if that works.

  • DBMS_RLS Package

    Is there any way I can use this package in the standard version.
    It is the only 'extra' from the enterprise edition that i require and cannot justify the upgrade purely based on this.
    Can the package be installed on the standard edition or does it require other packages only present within the enterprise edition.

    Is there any way I can use this package in the
    standard version.Depends how you feel about being in breach of your licence I guess.
    Cheers, APC

  • Oracle VPD on Remote database using DBLINk

    Hi All,
    How can i apply row level security on a table that is available in another database using DBlink
    we have two databases PDSSM and EVTA, and i would like to apply row level security on a table in EVTA from a schema in PDSSM using dblink. MXODSADM IS A SCHEMA IN EVTA AND MXEMBARGO IS A SCHEMA IN PDSSM. there is a dblink(EVTA.GMM.COM) between mxembargo and mxodsadm.
    begin
    dbms_rls.add_policy (
    object_schema => 'MXODSADM',
    object_name => 'vehicle_retail_sale',
    policy_name => ' MXEMBARGO_EVTA_POLICY',
    function_schema =>'MXEMBARGO',
    policy_type => dbms_rls.SHARED_CONTEXT_SENSITIVE,
    --policy_type => dbms_rls.STATIC,
    policy_function => ' MXEMBARGO_EVTA_POLICY.MXEMBARGO_EVTA_PREDICATE',
    statement_types => 'select, insert,update,delete',
    update_check => TRUE,
    enable => TRUE,
    static_policy => TRUE
    end;
    I am a complete Database person and i need to do this in my application, can anyone provide me how can i do this using dblink.

    wojpik wrote:
    hello
    I have one short question to you.
    Is that possible to create view at remote database using dblink? Following syntax returns error
    create view ViewName@DbLinkDame (ColumnName) as
    (select 1 from dual )
    "ORA-00905:missing keyword"
    Is that possible at all?
    And particulary - is that possible when remote database is MSSQL and I am using heterogeneous services?
    I really appreciate your help
    best regards
    Wojtek
    Edited by: wojpik on Oct 21, 2009 3:59 AMI doubt you would be able to fire any ddl through database link. You have to connect to remote database to run any ddl even if it is Oracle or some other database.
    Regards
    Anurag

  • Restrict SQL output by User

    In the sample sql below, I figured out how to be able to restrict output to terms that end with a 5 for a specific user and would like to know if there is a more compact way to write this or is this the best way. This sql will only list out terms that end with a 5 if the user = 'MYSELF', otherwise if a different user is logged in, then they would see all the terms within the range.
    with ODP as
    (select distinct user, case when user = 'MYSELF' then
                           substr(term,1,5)|| '5'
                 else term
          end as ODPTerm
    from status_table
    where substr(term,6,1) = '5'
    select distinct user, term, odpterm
    from status_table
    left outer join ODP
    on term = ODPTerm
    where (user = 'MYSELF' AND ODPTerm IS NOT NULL)
    OR (user !='MYSELF' AND term between '201220' and '201245') There are many issues with how security was set up and the actual query will be used in an Oracle Report that is run via a URL. We were told that ITS prefers we create a separate report and restrict on term rather than trying to identify by user, however, that method would require we maintain several reports since users are able to enter parameters at run time. We thought that since at this point there are only two users (Non Employees) who need the restriction, this would be better at our end for report maintenance. The other reason is that eventually, we will be converting this report to another reporting tool, which would have a different security arrangement, so wouldn't be a long term issue about maintaining the hard coded user exclusion in the SQL statement.

    Hi,
    Here's one way of doing it:
    SELECT DISTINCT
            user
    ,     term
    ,     term     AS odpterm
    WHERE     (    user          = 'MYSELF'
         AND  SUBSTR (term, -1)     = '5'
    OR     (    user          != 'MYSELF'
         AND  TERM          BETWEEN     '201220'
                             AND     '201245'
    ;If you'd care to post some sample data (CREATE TABLE and INSERT statements), then I could test this.
    If you're using Oracle Enterprise Edition, then you can create a row-level security policy, such that limitations like this automatically apply to any query done on the table. Look up Virtual Private Database (or VPD ) and the Oracle-supplied package dbms_rls for more.
    Edited by: Frank Kulash on Oct 26, 2011 6:47 PM

  • How to get All Users from OID LDAP

    Hi all,
    I have Oracle Internet Directory(OID) and have created the users in it manually.
    Now I want to extract all the users from OID. How can I get Users from OID??
    Any response will be appritiated. If some one could show me demo code for that I shall be greatful to you.
    Thanks and reagards
    Pravy

    hi,
    the notes from metalink:
    bgards
    elvis
    Doc ID: Note:276688.1
    Subject: How to copy (export/import) the Portal database schemas of IAS 9.0.4 to another database
    Type: BULLETIN
    Status: PUBLISHED
    Content Type: TEXT/X-HTML
    Creation Date: 18-JUN-2004
    Last Revision Date: 05-AUG-2005
    How to copy (export/import) Portal database schemas of IAS 9.0.4 to another database
    Note 276688.1
    Download scripts Unix: Attachment 276688.1:1
    Download Perl scripts (Unix/NT) :Attachment 276688.1:2
    This article is being delivered in Draft form and may contain errors. Please use the MetaLink "Feedback" button to advise Oracle of any issues related to this article.
    HISTORY
    Version 1.0 : 24-JUN-2004: creation
    Version 1.1 : 25-JUN-2004: added a link to download the scripts from Metalink
    Version 1.2 : 29-JUN-2004: Import script: Intermedia indexes are recreated. Imported jobs are reassigned to Portal. ptlconfig replaces ptlasst.
    Version 1.3 : 09-JUL-2004: Additional updates. Usage of iasconfig.xml. Need only 3 environment variables to import.
    Version 1.4 : 18-AUG-2004: Remark about 9.2.0.5 and 10.1.0.2 database
    Version 1.5 : 26-AUG-2004: Duplicate job id
    Version 1.6 : 29-NOV-2004: Remark about WWC-44131 and WWSBR_DOC_CTX_54
    Version 1.7 : 07-JAN-2005: Attached perl scripts (for NT/Unix) at the end of the note
    Version 1.8 : 12-MAY-2005: added a work-around for the WWSTO_SESS_FK1 issue
    Version 1.9 : 07-JUL-2005: logoff trigger and 9.0.1 database export, import in 10g database
    Version 1.10: 05-AUG-2005: reference to the 10.1.2 note
    PURPOSE
    This document explains how to copy a Portal database schema from a database to another database.
    It allows restoring the Portal repository and the OID security associated with Portal.
    It can be used to go in production by copying physically a database from a development portal to a production environment and avoid to use the export/import utilities of Portal.
    This note:
    uses the export/import on the database level
    allows the export/import to be done between different platforms
    The script are Unix based and for the BASH shell. They can be adapted for other platforms.
    For the persons familiar with this technics in Portal 9.0.2, there is a list of the main differences with Portal 9.0.2 at the end of the note.
    These scripts are based on the experience of a lot of persons in Portal 902.
    The scripts are attached to the note. Download them here: Attachment 276688.1:1 : exp_schema_904.zip
    A new version of the script was written in Perl. You can also download them, here: Attachment 276688.1:2 : exp_schema_904_v2.zip. They do exactly the same than the bash ones. But they have the advantage of working on all platforms.
    SCOPE & APPLICATION
    This document is intented for Portal administrators. For using this note, you need basic DBA skills.
    This notes is for Portal 9.0.4.x only. The notes for Portal 9.0.2 are :
    Note 228516.1 : How to copy (export/import) Portal database schemas of IAS 9.0.2 to another database
    Note 217187.1 : How to restore a cold backup of a Portal IAS 9.0.2 on another machine
    The note for Portal 10.1.2 is:
    Note 330391.1 : How to copy (export/import) Portal database schemas of IAS 10.1.2 to another databaseMethod
    The method that we will follow in the document is the following one:
    Export:
    - export of the 4 portal schemas of a database (DEV / development)
    - export the LDAP OID users and groups (optional)
    Install a new machine with fresh IAS installation (PROD / production)
    Import:
    - delete the new and empty portal schema on PROD
    - import the schemas in the production database in place of the deleted schemas
    - import the LDAP OID users and groups (optional)
    - modify the configuration such that the infrastructure uses the portal repository of the backup
    - modify the configuration such that the portal repository uses the OID, webcache and SSO of the new infrastructure
    The export and the import are divided in several steps. All of these steps are included in 2 sample scripts:
    export : exp_portal_schema.sh
    import : imp_portal_schema.sh
    In the 2 scripts, all the steps are runned in one shot. It is just an example. Depending of the configuration and circonstance, all the steps can be runned independently.
    Convention
    Development (DEV) is the name of the machine where resides the copied database
    Production (PROD) is the name of the machine where the database is copied
    Prerequisite
    Some prerequisite first.
    A. Environment variables
    To run the import/export, you will need 3 environment variables. In the given scripts, they are defined in 'portal_env.sh'
    SYS_PASSWORD - the password of user sys in the Portal database
    IAS_PASSWORD - the password of IAS
    ORACLE_HOME - the ORACLE_HOME of the midtier
    The rest of the settings are found automatically by reading the iasconfig.xml file and querying the OID. It is done in 'portal_automatic_env.sh'. I wish to write a note on iasconfig.xml and the way to transform it in usefull environment variables. But it is not done yet. In the meanwhile, you can read the old 902 doc, that explains the meaning of most variables :
    < Note 223438.1 : Shell script to find your portal passwords, settings and place them in environment variables on Unix >
    B. Definition: Cutter database
    A 'Cutter Database' is the term used to designate a Database created by RepCA or OUI and that contains all the schemas used by a IAS 9.0.4 infrastructure. Even if in most cases, several schemas are not used.
    In Portal 9.0.4, the option to install only the portal repository in an empty database has been removed. It has been replaced by RepCA, a tool that creates an infrastructure database. Inside all the infrastucture database schemas, there are the portal schemas.
    This does not stop people to use 2 databases for running portal. One for OID and one for Portal. But in comparison with Portal 9.0.2, all schemas exist in both databases even if some are not used.
    The main idea of Cutter database is to have only 1 database type. And in the future, simplify the upgrades of customer installation
    For an installation where Portal and OID/SSO are in 2 separate databases, it looks like this
    Portal 9.0.2 Portal 9.0.4
    Infrastructure database
    (INFRA_SID)
    The infrastructure contains:
    - OID (used)
    - OEM (used)
    - Single Sign-on / orasso (used)
    - Portal (not used)
    The infrastructure contains:
    - OID (used)
    - OEM (used)
    - Single Sign-on / orasso (used)
    - Portal (not used)
    Portal database
    (PORTAL_SID)
    The custom Portal database contains:
    - Portal (used)
    The custom Portal database (is also an infrastructure):
    - OID (not used)
    - OEM (not used)
    - Single Sign-on / orasso (not used)
    - Portal (used)
    Whatever, the note will suppose there is only one single database. But it works also for 2 databases installation like the one explained above.
    C. Directory structure.
    The sample scripts given inside this note will be explained in the next paragraphs. But first, the scripts are done to use a directory structure that helps to classify the files.
    Here is a list of important files used during the process of export/import:
    File Name
    Description
    exp_portal_schema.sh
    Sample script that exports all the data needed from a development machine
    imp_portal_schema.sh
    Sample script that import all the data into a production machine
    portal_env.sh
    Script that defines the env variable specific to your system (to configure)
    portal_automatic_env.sh
    Helper script to get all the rest of the Portal settings automatically
    xsl
    Directory containing all the XSL files (helper scripts)
    del_authpassword.xsl
    Helper script to remove the authpassword tags in the DSML files
    portal_env_unix.sql
    Helper script to get Portal settings from the iasconfig.xml file
    exp_data
    Directory containing all the exported data
    portal_exp.dmp
    export on the database level of the portal, portal_app, ... database schemas
    iasconfig.xml
    copy the name of iasconfig.xml of the midtier of DEV. Used to get the hostname and port of Webcache
    portal_users.xml
    export from LDAP of the OID users used by Portal (optional)
    portal_groups.xml export from LDAP of the OID groups used by Portal (optional)
    imp_log
    Directory containing several spool and logs files generated during the import
    import.log Log file generated when running the imp command
    ptlconfig.log
    Log generated by ptlconfig when rewiring portal to the infrastructure.
    Some other spool files.
    D. Known limitations
    The scripts given in this note have the following known limitations:
    It does not copy the data stored in the SSO schema: external applications definitions and the passwords stored for them.
    See in the post steps: SSO migration to know how to do.
    The ssomig command resides in the Infrastructure Oracle home. And all commands of Portal in the Midtier home. And practically, these 2 Oracle homes are most of the time not on the same machine. This is the reason.
    The export of the users in OID exports from the default user location:
    ldapsearch .... -b "cn=users,dc=domain,dc=com"
    This is not 100% correct. The users are by default stored in something like "cn=users,dc=domain,dc=com". So, if the users are stored in the default location, it works. But if this location (user install base) is customized, it does not work.
    The reason is that such settings means that the LDAP most of the time highly customized. And I prefer that the administrator to copy the real LDAP himself. The right command will probably depend of the customer case. So, I prefered not to take the risk..
    orclCommonNicknameAttribute must match in the Target and Source OID .
    The orclCommonNicknameAttribute must match on both the source and target OID. By default this attribute is set to "uid", so if this has been changed, it must be changed in both systems.
    Reference Note 282698.1
    Migration of custom Java portlets.
    The script migrates all the data of Portal stored in the database. If you have custom java portlet deployed in your development machine, you will need to copy them in the production system.
    Step 1 - Export in Development (DEV)
    To export a full Portal installation to another machine, you need to follow 3 steps:
    Export at the database level the portal schemas + related schemas
    Get the midtier hostname and port of DEV
    Export of the users and groups with LDAPSEARCH in 2 XML files
    A script combining all the steps is available here.
    A. Export the 4 portals schemas (DEV)
    You need to export 3 types of database schemas:
    The 4 portal schemas created by default by the portal installation :
    portal,
    portal_app,
    portal_demo,
    portal_public
    The schemas where your custom database portlets / providers resides (if any)
    - The custom schemas you have created for storing your portlet / provider code
    The schemas where your custom tables resides. (if any)
    - Your custom schemas accessed by portal and containing only data (tables, views ...)
    You can get an approximate list of the schemas: default portal schemas (1) and database portlets schemas (2) with this query.
    SELECT USERNAME, DEFAULT_TABLESPACE, TEMPORARY_TABLESPACE
    FROM DBA_USERS
    WHERE USERNAME IN (user, user||'_PUBLIC', user||'_DEMO', user||'_APP')
    OR USERNAME IN (SELECT DISTINCT OWNER FROM WWAPP_APPLICATION$ WHERE NAME != 'WWV_SYSTEM');
    It still misses your custom schemas containing data only (3).
    We will export the 4 schemas and your custom ones in an export file with the user sys.
    Please, use a command like this one
    exp userid="'sys/change_on_install@dev as sysdba'" file=portal_exp.dmp grants=y log=portal_exp.log owner=(portal,portal_app,portal_demo,portal_public)The result is a dump file: 'portal_exp.dmp'. If you are using a database 9.2.0.5 or 10.1.0.2, the database of the exp/imp dump file has changed. Please read this.
    B. Hostname and port
    For the URL to access the portal, you need the 2 following infos to run the script 'imp_portal_schema.sh below :
    Webcache hostname
    Webcache listen port
    These values are contained in the iasconfig.xml file of the midtier.
    iasconfig.xml
    <IASConfig XSDVersion="1.0">
    <IASInstance Name="ias904.dev.dev_domain.com" Host="dev.dev_domain.com" Version="9.0.4">
    <OIDComponent AdminPassword="@BfgIaXrX1jYsifcgEhwxciglM+pXod0dNw==" AdminDN="cn=orcladmin" SSLEnabled="false" LDAPPort="3060"/>
    <WebCacheComponent AdminPort="4037" ListenPort="7782" InvalidationPort="4038" InvalidationUsername="invalidator" InvalidationPassword="@BR9LXXoXbvW1iH/IEFb2rqBrxSu11LuSdg==" SSLEnabled="false"/>
    <EMComponent ConsoleHTTPPort="1813" SSLEnabled="false"/>
    </IASInstance>
    <PortalInstance DADLocation="/pls/portal" SchemaUsername="portal" SchemaPassword="@BR9LXXoXbvW1c5ZkK8t3KJJivRb0Uus9og==" ConnectString="cn=asdb,cn=oraclecontext">
    <WebCacheDependency ContainerType="IASInstance" Name="ias904.dev.dev_domain.com"/>
    <OIDDependency ContainerType="IASInstance" Name="ias904.dev.dev_domain.com"/>
    <EMDependency ContainerType="IASInstance" Name="ias904.dev.dev_domain.com"/>
    </PortalInstance>
    </IASConfig>
    It corresponds to a portal URL like this:
    http://dev.dev_domain.com:7782/pls/portalThe script exp_portal_schema.sh copy the iasconfig.xml file in the exp_data directory.
    C. Export the security: users and groups (optional)
    If you use other Single Sing-On uses than the portal user, you probably need to restore the full security, the users and groups stored in OID on the production machine. 5 steps need to be executed for this operation:
    Export the OID entries with LDAPSEARCH
    Before to import, change the domain in the generated file (optional)
    Before to import, remove the 'authpassword' attributes from the generated files
    Import them with LDAPADD
    Update the GUID/DN of the groups in portal tables
    Part 1 - LDAPSEARCH
    The typical commands to do this operation look like this:
    ldapsearch -h $OID_HOSTNAME -p $OID_PORT -X -b "cn=portal.040127.1384,cn=groups,dc=dev_domain,dc=com" -s sub "objectclass=*" > portal_group.xml
    ldapsearch -h $OID_HOSTNAME -p $OID_PORT -X -D "cn=orcladmin" -w $IAS_PASSWORD -b "cn=users,dc=dev_domain,dc=com" -s sub "objectclass=inetorgperson" > portal_users.xmlTake care about the following points
    The groups are stored in a LDAP directory containing the date of installation
    ( in this example: portal.040127.1384,cn=groups,dc=dev_domain,dc=com )
    If the domain of dev and prod is different, the exported files contains the name of the development domain in the form of 'dc=dev_domain,dc=com' in a lot of place. The domain name needs to be replaced by the production domain name everywhere in the files.
    Ldapsearch uses the option '- X '. It it to export to DSML files (XML). It avoids a problem related with common LDAP files, LDIF files. LDIF files are wrapped at 78 characters. The wrapping to 78 characters make difficult to change the domain name contained in the LDIF files. XML files are not wrapped and do not have this problem.
    A sample script to export the 2 XML files is given here in : step 3 - export the users and groups (optional) of the export script.
    Part 2 : change the domain in the DSML files
    If the domain of dev and prod is different, the exported files contains the name of the development domain in the form of 'dc=dev_domain,dc=com' in a lot of place. The domain name need to be replaced by the production domain name everywhere in the files.
    To do this, we can use these commands:
    cat exp_data/portal_groups.xml | sed -e "s/$DEV_DN/$PROD_DN/" > imp_log/portal_groups.xml
    cat exp_data/portal_users.xml | sed -e "s/$DEV_DN/$PROD_DN/" > imp_log/temp_users.xml
    Part 3 : Remove the authpassword attribute
    The export of all attributes from the all users has also exported an automatically generated attribute in OID called 'authpassword'.
    'authpassword' is a list automatically generated passwords for several types of application. But mostly, it can not be imported. Also, there is no option in ldapsearch (that I know) that allows removing an attribute. In place of giving to the ldapsearch command the list of all the attributes that is very long, without 'authpassword', we will remove the attribute after the export.
    For that we will use the fact that the DSML files are XML files. There is a XSLT in the Oracle IAS, in the executable '$ORACLE_HOME/bin/xml'. XSLT is a standard specification of the internet consortium W3C to transform a XML file with the help of a XSL file.
    Here is the XSL file to remove the authpassword tag.
    del_autpassword.xsl
    <!--
    File : del_authpassword.xsl
    Version : 1.0
    Author : mgueury
    Description:
    Remove the authpassword from the DSML files
    -->
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xml:output method="xml"/>
    <xsl:template match="*|@*|node()">
    <xsl:copy>
    <xsl:apply-templates select="*|@*|node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="attr">
    <xsl:choose>
    <xsl:when test="@name='authpassword;oid'">
    </xsl:when>
    <xsl:when test="@name='authpassword;orclcommonpwd'">
    </xsl:when>
    <xsl:otherwise>
    <xsl:copy>
    <xsl:apply-templates select="*|@*|node()"/>
    </xsl:copy>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>
    And the command to make the transfomation:
    xml -f -s del_authpassword.xsl -o imp_log/portal_users.xml imp_log/temp_users.xmlWhere :
    imp_log/portal_users.xml is the final file without authpassword tags
    imp_log/temp_users.xml is the input file with the authpassword tags that can not be imported.
    Part 4 : LDAPADD
    The typical commands to do this operation look like this:
    ldapadd -h $OID_HOSTNAME -p $OID_PORT -D "cn=orcladmin" -w $IAS_PASSWORD -c -X portal_group.xml
    ldapadd -h $OID_HOSTNAME -p $OID_PORT -D "cn=orcladmin" -w $IAS_PASSWORD -c -X portal_users.xmlTake care about the following points
    Ldapadd uses the option ' -c '. Existing users/groups are generating an error. The option -c allows continuing and ignoring these errors. Whatever, the errors should be checked to see if it is just existing entries.
    A sample script to import the 2 XML files given in the step 5 - import the users and groups (optional) of the import script.
    Part 5 : Update the GUID/DN
    In Portal 9.0.4, the update of the GUID is taken care by PTLCONFIG during the import. (Import step 7)
    D. Example script for export
    Here is a example script that combines the 3 steps.
    Depending of you need, you will :
    or execute all the steps
    or just execute the 1rst one (export of the database users). It will be enough you just want to login with the portal user on the production instance.
    if your portal repository resides in a database 9.2.0.5 or 10.1.0.2, please read this
    you can download all the scripts here, Attachment 276688.1:1
    Do not forget to modify the script to your need and mostly add the list of users like explained in point A above.
    exp_portal_schema.sh
    # BASH Script : exp_portal_schema.sh
    # Version : 1.3
    # Portal : 9.0.4.0
    # History :
    # mgueury - creation
    # Description:
    # This script export a portal dump file from a dev instance
    # -------------------------- Environment variables --------------------------
    . portal_env.sh
    # In case you do not use portal_env.sh you have to define all the variables
    # For exporting the dump file only.
    # export SYS_PASSWORD=change_on_install
    # export PORTAL_TNS=asdb
    # For the security (optional)
    # export IAS_PASSWORD=welcome1
    # export PORTAL_USER=portal
    # export PORTAL_PASSWORD=A1b2c3de
    # export OID_HOSTNAME=development.domain.com
    # export OID_PORT=3060
    # export OID_DOMAIN_DN=dc=`echo $OID_HOSTNAME | cut -d '.' -f2,3,4,5,6 --output-delimiter=',dc='`
    # ------------------------------ Help function -----------------------------------
    function press_any_key() {
    if [ $PRESS_ANY_KEY_AFTER_EACH_STEP = "Y" ]; then
    echo
    echo Press enter to continue
    read $ANY_KEY
    else
    echo
    fi
    echo "------------------------------- Export ------------------------------------"
    # create a directory for the export
    mkdir exp_data
    # copy the env variables in the log just in case
    export > exp_data/exp_env_variable.txt
    echo "--------------------- step 1 - export"
    # export the portal users, but take care to add:
    # - your users containing DB providers
    # - your users containing data (tables)
    exp userid="'sys/$SYS_PASSWORD@$PORTAL_TNS as sysdba'" file=exp_data/portal_exp.dmp grants=y log=exp_data/portal_exp.log owner=(portal,portal_app,portal_demo,portal_public)
    press_any_key
    echo "--------------------- step 2 - store iasconfig.xml file of the MIDTIER"
    cp $MIDTIER_ORACLE_HOME/portal/conf/iasconfig.xml exp_data
    press_any_key
    echo "--------------------- step 3 - export the users and groups (optional)"
    # Export the groups and users from OID in 2 XML files (not LDIF)
    # The OID groups of portal are stored in GROUP_INSTALL_BASE that depends
    # of the installation date.
    # For the user, I use the default place. If it does not work,
    # you can find the user place with:
    # > exec dbms_output.put_line(wwsec_oid.get_user_search_base);
    # Get the GROUP_INSTALL_BASE used in security export
    sqlplus $PORTAL_USER/$PORTAL_PASSWORD@$PORTAL_TNS <<IASDB
    set serveroutput on
    spool exp_data/group_base.log
    begin
    dbms_output.put_line(wwsec_oid.get_group_install_base);
    end;
    IASDB
    export GROUP_INSTALL_BASE=`grep cn= exp_data/group_base.log`
    echo '--- Exporting Groups'
    echo 'creating portal_groups.xml'
    ldapsearch -h $OID_HOSTNAME -p $OID_PORT -X -s sub -b "$GROUP_INSTALL_BASE" -s sub "objectclass=*" > exp_data/portal_groups.xml
    echo '--- Exporting Users'
    echo 'creating portal_users.xml'
    ldapsearch -h $OID_HOSTNAME -p $OID_PORT -D "cn=orcladmin" -w $IAS_PASSWORD -X -s sub -b "cn=users,$OID_DOMAIN_DN" -s sub "objectclass=inetorgperson" > exp_data/portal_users.xml
    The script is done to run from the midtier.
    Step 2 - Install IAS in a new machine (PROD)
    A. Installation
    This note does not distinguish if Portal is sharing the same database than Single-Sign On and OID. For simplicity, I will speak only about 1 database. But I could also create a second infrastructure database just for the portal repository. This way is better for production system, because the Portal repository is only product used in the 2nd database. Having 2 separate databases allows taking easily backup of the portal repository.
    On the production machine, you need to install a fresh install of IAS 9.0.4. Take care to use :
    the same IAS patchset 9.0.4.1, 9.0.4.2, ...on the middle-tier and infrastruture than in development
    and same characterset than in development (or UTF8)
    The result will be 2 ORACLE_HOMES and 1 infrastructure database:
    the ORACLE_HOME of the infrastructure (SID:infra904)
    the ORACLE_HOME of the midtier (SID:ias904)
    an infrastructure database (SID:asdb)
    The empty new Portal install should work fine before to go to the next step.
    B. About tablespaces (optional)
    The size of the tablespace of the production should match the one of the Developement machine. If not, the tablespace will autoextend. It is not really a concern, but it is slow. You should modify the tablespaces for to have as much space on prod and dev.
    Also, it is safer to check that there is enough free space on the hard disk to import in the database.
    To modify the tablespace size, you can use Oracle Entreprise Manager console,
    On Unix, . oraenv
    infra904oemapp dbastudio
    On NT Start/ Programs/ Oracle Application server - infra904 / Enterprise Manager Console
    Launch standalone
    Choose the portal database (typically asdb.domain.com)
    Connect with a DBA user, sys or system
    Click Storage/Tablespaces
    Change the size of the PORTAL, PORTAL_DOC, PORTAL_LOGS, PORTAL_IDX tablespaces
    C. Backup
    It could be a good idea to take a backup of the MIDTIER and INFRASTRUCTURE Oracle Homes at that point to allow retesting the import process if it fails for any reason as much as you want without needing to reinstall everything.
    Step 3 - Import in production (on PROD)
    The following script is a sample of an Unix script that combines all the steps to import a portal repository to the production machine.
    To import a portal reporistory and his users and group in OID, you need to do 8 things:
    Stop the midtier to avoid errors while dropping the portal schema
    SQL*Plus with Portal
    Drop the 4 default portal schemas
    Create the portal users with the same passwords than the just deleted users and give them grants (you need to create your own custom shemas too if you have some).
    Import the dump file
    Import the users and groups into OID (optional)
    SQL*Plus with SYS : Post import changes
    Recompile everything in the database
    Reassign the imported jobs to portal
    SQL*Plus with Portal : Post import changes
    Recreate the Portal intermedia indexes
    Correct an import errror on wwsrc_preference$
    Make additional post import changes, by updating some portal tables, and replacing the development hostname, port or domain by the production ones.
    Rewire the portal repository with ptlconfig -dad portal
    Restart the midtier
    Here is a sample script to do this on Unix. You will need to adapt the script to your needs.
    imp_portal_schema.sh
    # BASH Script : imp_portal_schema.sh
    # Version : 1.3
    # Portal : 9.0.4.0
    # History :
    # mgueury - creation
    # Description:
    # This script import a portal dump file and relink it with an
    # infrastructure.
    # Script to be started from the MIDTIER
    # -------------------------- Environment variables --------------------------
    . portal_env.sh
    # Development and Production machine hostname and port
    # Example
    # .._HOSTNAME machine.domain.com (name of the MIDTIER)
    # .._PORT 7782 (http port of the MIDTIER)
    # .._DN dc=domain,dc=com (domain name in a LDAP way)
    # These values can be determined automatically with the iasconfig.xml file of dev
    # and prod. But if you do not know or remember the dev hostname and port, this
    # query should find it.
    # > select name, http_url from wwpro_providers$ where http_url like 'http%'
    # These variables are used in the
    # > step 4 - security / import OID users and groups
    # > step 6 - post import changes (PORTAL)
    # Set the env variables of the DEV instance
    rm /tmp/iasconfig_env.sh
    xml -f -s xsl/portal_env_unix.xsl -o /tmp/iasconfig_env.sh exp_data/iasconfig.xml
    . /tmp/iasconfig_env.sh
    export DEV_HOSTNAME=$WEBCACHE_HOSTNAME
    export DEV_PORT=$WEBCACHE_LISTEN_PORT
    export DEV_DN=dc=`echo $OID_HOSTNAME | cut -d '.' -f2,3,4,5,6 --output-delimiter=',dc='`
    # Set the env variables of the PROD instance
    . portal_env.sh
    export PROD_HOSTNAME=$WEBCACHE_HOSTNAME
    export PROD_PORT=$WEBCACHE_LISTEN_PORT
    export PROD_DN=dc=`echo $OID_HOSTNAME | cut -d '.' -f2,3,4,5,6 --output-delimiter=',dc='`
    # ------------------------------ Help function -----------------------------------
    function press_any_key() {
    if [ $PRESS_ANY_KEY_AFTER_EACH_STEP = "Y" ]; then
    echo
    echo Press enter to continue
    read $ANY_KEY
    else
    echo
    fi
    echo "------------------------------- Import ------------------------------------"
    # create a directory for the logs
    mkdir imp_log
    # copy the env variables in the log just in case
    export > imp_log/imp_env_variable.txt
    echo "--------------------- step 1 - stop the midtier"
    # This step is needed to avoid most case of ORA-01940: user connected
    # when dropping the portal user
    $MIDTIER_ORACLE_HOME/opmn/bin/opmnctl stopall
    press_any_key
    echo "--------------------- step 2 - drop and create empty users"
    sqlplus "sys/$SYS_PASSWORD@$PORTAL_TNS as sysdba" <<IASDB
    spool imp_log/drop_create_user.log
    ---- Drop users
    -- Warning: You need to stop all SQL*Plus connection to the
    -- portal schema before that else the drop will give an
    -- ORA-01940: cannot drop a user that is currently connected
    drop user portal_public cascade;
    drop user portal_app cascade;
    drop user portal_demo cascade;
    drop user portal cascade;
    ---- Recreate the users and give them grants"
    -- The new users will have the same passwords as the users we just dropped
    -- above. Do not forget to add your exported custom users
    create user portal identified by $PORTAL_PASSWORD default tablespace portal;
    grant connect,resource,dba to portal;
    create user portal_app identified by $PORTAL_APP_PASSWORD default tablespace portal;
    grant connect,resource to portal_app;
    create user portal_demo identified by $PORTAL_DEMO_PASSWORD default tablespace portal;
    grant connect,resource to portal_demo;
    create user portal_public identified by $PORTAL_PUBLIC_PASSWORD default tablespace portal;
    grant connect,resource to portal_public;
    alter user portal_public grant connect through portal;
    start $MIDTIER_ORACLE_HOME/portal/admin/plsql/wwv/wdbigra.sql portal
    exit
    IASDB
    press_any_key
    echo "--------------------- step 3 - import"
    imp userid="'sys/$SYS_PASSWORD@$PORTAL_TNS as sysdba'" file=exp_data/portal_exp.dmp grants=y log=imp_log/import.log full=y
    press_any_key
    echo "--------------------- step 4 - import the OID users and groups (optional)"
    # Some errors will be raised when running the ldapadd because at least the
    # default entries will not be able to be inserted. Remove them from the
    # ldif file if you want to avoid them. Due to the flag '-c', ldapadd ignores
    # duplicate entries. Another more radical solution is to erase all the entries
    # of the users and groups in OID before to run the import.
    # Replace the domain name in the XML files.
    cat exp_data/portal_groups.xml | sed -e "s/$DEV_DN/$PROD_DN/" > imp_log/portal_groups.xml
    cat exp_data/portal_users.xml | sed -e "s/$DEV_DN/$PROD_DN/" > imp_log/temp_users.xml
    # Remove the authpassword attributes with a XSL stylesheet
    xml -f -s xsl/del_authpassword.xsl -o imp_log/portal_users.xml imp_log/temp_users.xml
    echo '--- Importing Groups'
    ldapadd -h $OID_HOSTNAME -p $OID_PORT -D "cn=orcladmin" -w $IAS_PASSWORD -c -X imp_log/portal_groups.xml -v
    echo '--- Importing Users'
    ldapadd -h $OID_HOSTNAME -p $OID_PORT -D "cn=orcladmin" -w $IAS_PASSWORD -c -X imp_log/portal_users.xml -v
    press_any_key
    echo "--------------------- step 5 - post import changes (SYS)"
    sqlplus "sys/$SYS_PASSWORD@$PORTAL_TNS as sysdba" <<IASDB
    spool imp_log/sys_post_changes.log
    ---- Recompile the invalid packages"
    -- On the midtier, the script utlrp is not present. This step
    -- uses a copy of it stored in patch/utlrp.sql
    select count(*) INVALID_OBJECT_BEFORE from all_objects where status='INVALID';
    start patch/utlrp.sql
    set lines 999
    select count(*) INVALID_OBJECT_AFTER from all_objects where status='INVALID';
    ---- Jobs
    -- Reassign the JOBS imported to PORTAL. After the import, they belong
    -- incorrectly to the user SYS.
    update dba_jobs set LOG_USER='PORTAL', PRIV_USER='PORTAL' where schema_user='PORTAL';
    commit;
    exit
    IASDB
    press_any_key
    echo "--------------------- step 6 - post import changes (PORTAL)"
    sqlplus $PORTAL_USER/$PORTAL_PASSWORD@$PORTAL_TNS <<IASDB
    set serveroutput on
    spool imp_log/portal_post_changes.log
    ---- Intermedia
    -- Recreate the portal indexes.
    -- inctxgrn.sql is missing from the 9040 CD-ROMS. This is the bug 3536937.
    -- Fixed in 9041. The missing script is contained in the downloadable zip file.
    start patch/inctxgrn.sql
    start $MIDTIER_ORACLE_HOME/portal/admin/plsql/wws/ctxcrind.sql
    ---- Import error
    alter table "WWSRC_PREFERENCE$" add constraint wwsrc_preference_pk
    primary key (subscriber_id, id)
    using index wwsrc_preference_idx1
    begin
    DBMS_RLS.ADD_POLICY ('', 'WWSRC_PREFERENCE$', 'WEBDB_VPD_POLICY',
    '', 'webdb_vpd_sec', 'select, insert, update, delete', TRUE,
    static_policy=>true);
    end ;
    ---- Modify tables with full URLs
    -- If the domain name of prod and dev are different, this step is really important.
    -- It modifies the portal tables that contains reference to the hostname or port
    -- of the development machine. (For more explanation: see Addional steps in the note)
    -- groups (dn)
    update wwsec_group$
    set dn=replace( dn, '$DEV_DN', '$PROD_DN' )
    update wwsec_group$
    set dn_hash = wwsec_api_private.get_dn_hash( dn )
    -- users (dn)
    update wwsec_person$
    set dn=replace( dn, '$DEV_DN', '$PROD_DN' )
    update wwsec_person$
    set dn_hash = wwsec_api_private.get_dn_hash( dn)
    -- subscriber
    update wwsub_model$
    set dn=replace( dn, '$DEV_DN', '$PROD_DN' ), GUID=':1'
    where dn like '%$DEV_DN%'
    -- preferences
    update wwpre_value$
    set varchar2_value=replace( varchar2_value, '$DEV_DN', '$PROD_DN' )
    where varchar2_value like '%$DEV_DN%'
    update wwpre_value$
    set varchar2_value=replace( varchar2_value, '$DEV_HOSTNAME:$DEV_PORT', '$PROD_HOSTNAME:$PROD_PORT' )
    where varchar2_value like '%$DEV_HOSTNAME:$DEV_PORT%'
    -- page url items
    update wwv_things
    set title_link=replace( title_link, '$DEV_HOSTNAME:$DEV_PORT', '$PROD_HOSTNAME:$PROD_PORT' )
    where title_link like '%$DEV_HOSTNAME:$DEV_PORT%'
    -- web providers
    update wwpro_providers$
    set http_url=replace( http_url, '$DEV_HOSTNAME:$DEV_PORT', '$PROD_HOSTNAME:$PROD_PORT' )
    where http_url like '%$DEV_HOSTNAME:$DEV_PORT%'
    -- html links created by the RTF editor inside text items
    update wwv_text
    set text=replace( text, '$DEV_HOSTNAME:$DEV_PORT', '$PROD_HOSTNAME:$PROD_PORT' )
    where text like '%$DEV_HOSTNAME:$DEV_PORT%'
    -- Portlet metadata nls: help URL
    update wwpro_portlet_metadata_nls$
    set help_url=replace( help_url, '$DEV_HOSTNAME:$DEV_PORT', '$PROD_HOSTNAME:$PROD_PORT' )
    where help_url like '%$DEV_HOSTNAME:$DEV_PORT%'
    -- URL items (There is a trigger on this table building absolute_url automatically)
    update wwsbr_url$
    set absolute_url=replace( absolute_url, '$DEV_HOSTNAME:$DEV_PORT', '$PROD_HOSTNAME:$PROD_PORT' )
    where absolute_url like '%$DEV_HOSTNAME:$DEV_PORT%'
    -- Things attributes
    update wwv_thingattributes
    set value=replace( value, '$DEV_HOSTNAME:$DEV_PORT', '$PROD_HOSTNAME:$PROD_PORT' )
    where value like '%$DEV_HOSTNAME:$DEV_PORT%'
    commit;
    exit
    IASDB
    press_any_key
    echo "--------------------- step 7 - ptlconfig"
    # Configure portal such that portal uses the infrastructure database
    cd $MIDTIER_ORACLE_HOME/portal/conf/
    ./ptlconfig -dad portal
    cd -
    mv $MIDTIER_ORACLE_HOME/portal/logs/ptlconfig.log imp_log
    press_any_key
    echo "--------------------- step 8 - restart the midtier"
    $MIDTIER_ORACLE_HOME/opmn/bin/opmnctl startall
    date
    Each step can generate his own errors due to a lot of factors. It is better to run the import step by step the first time.
    Do not forget to check the output of log files created during the various steps of the import:
    imp_log/drop_create_user.log
    Spool when dropping and recreating the portal users
    imp_log/import.log Import log file when importing the portal_exp.dmp file
    imp_log/sys_post_changes.log
    Spool when making post changes with SYS
    imp_log/portal_post_changes.log
    Spool when making post changes with PORTAL
    imp_log/ptlconfig.log
    Log file of ptconfig when rewiring the midtier
    Step 4 - Test
    A. Check the log files
    B. Test the website and see if it works fine.
    Step 5 - take a backup
    Take a backup of all ORACLE_HOME and DATABASES to prevent all hardware problems. You need to copy:
    All the files of the 2 ORACLE_HOME
    And all the database files.
    Step 6 - Additional steps
    Here are some additional steps.
    SSO external application ( that are part of the orasso schema and not imported yet )
    Page URL items ( they seems to store the full URL ) - included in imp_portal_schema.sh
    Web Providers ( the URL needs to be changed ) - included in imp_portal_schema.sh
    Text items edited with the RTF editor in IE and containing links - included in imp_portal_schema.sh
    Most of them are taken care by the "step 8 - post import changes". Except the first one.
    1. SSO import
    This script imports only Portal and the users/groups of OID. Not the list of the external application contained in the orasso user.
    In Portal 9.0.4, there is a script called SSOMIG that resides in $INFRA_ORACLE_HOME/sso/bin and allows to move :
    Definitions and user data for external applications
    Registration URLs and tokens for partner applications
    Connection information used by OracleAS Discoverer to access various data sources
    See:
    Oracle® Application Server Single Sign-On Administrator's Guide 10g (9.0.4) Part Number B10851-01
    14. Exporting and Importing Data
    2. Page items: the page URL items store the full URL.
    This is Bug 2661805 fixed in Portal 9.0.2.6.
    This following work-around is implemented in post import step of imp_portal_schema.sh
    -- page url items
    update wwv_things
    set title_link=replace( title_link, 'dev.dev_domain.com:7778', 'prod.prod_domain.com:7778' )
    where title_link like '%$DEV_HOSTNAME:$DEV_PORT%'
    2. Web Providers
    The URL to the Web providers needs also change. Like for the Page items, they contain the full path of the webserver.
    Or you can get the list of the URLs to change with this query
    select name, http_url from PORTAL.WWPRO_PROVIDERS$ where http_url like '%';
    This following work-around is implemented in post import step of imp_portal_schema.sh
    -- web providers
    update wwpro_providers$
    set http_url=replace( http_url, 'dev.dev_domain.com:7778', 'prod.prod_domain.com:7778' )
    where http_url like '%$DEV_HOSTNAME:$DEV_PORT%'
    4. The production and development machine do not share the same domain
    If the domain of the production and the development are not the same, the DN (name in LDAP) of all users needs to change.
    Let's say from
    dc=dev_domain,dc=com -> dc=prod_domain,dc=com
    1. before to upload the ldif files. All the strings in the 2 ldifs files that contain 'dc=dev_domain,dc=com', have to be replaced by 'dc=prod_domain,dc=com'
    2. in the wwsec_group$ and wwsec_person$ tables in portal, the DN need to change too.
    This following work-around is implemented in post import step of imp_portal_schema.sh
    -- groups (dn)
    update wwsec_group$
    set dn=replace( dn, 'dc=dev_domain,dc=com', 'dc=prod_domain,dc=com' )
    update wwsec_group$
    set dn_hash = wwsec_api_private.get_dn_hash( dn )
    -- users (dn)
    update wwsec_person$
    set dn=replace( dn, 'dc=dev_domain,dc=com', 'dc=prod_domain,dc=com' )
    update wwsec_person$
    set dn_hash = wwsec_api_private.get_dn_hash( dn)
    5. Text items with HTML links
    Sometimes people stores full URL inside their text items, it happens mostly when they use link with the RichText Editor in IE .
    This following work-around is implemented in post import step in imp_portal_schema.sh
    -- html links created by the RTF editor inside text items
    update wwv_text
    set text=replace( text, 'dev.dev_domain.com:7778', 'prod.prod_domain.com:7778' )
    where text like '%$DEV_HOSTNAME:$DEV_PORT%'
    6. OID Custom password policy
    It happens quite often that the people change the password policy of the OID server. The reason is that with the default policy, the password expires after 60 days. If so, do not forget to make the same changes in the new installation.
    PROBLEMS
    1. Import log has some errors
    A. EXP-00091 -Exporting questionable statistics
    You can ignore this error.
    B. IMP-00017 - WWSRC_PREFERENCE$
    When importing, there is one import error:
    IMP-00017: following statement failed with ORACLE error 921:
    "ALTER TABLE "WWSRC_PREFERENCE$" ADD "
    IMP-00003: ORACLE error 921 encountered
    ORA-00921: unexpected end of SQL commandThe primary key is not created. You can create it with this commmand
    in SQL*Plus with the user portal.. Then readd the missing VPD policy.
    alter table "WWSRC_PREFERENCE$" add constraint wwsrc_preference_pk
    primary key (subscriber_id, id)
    using index wwsrc_preference_idx1
    begin
    DBMS_RLS.ADD_POLICY ('', 'WWSRC_PREFERENCE$', 'WEBDB_VPD_POLICY',
    '', 'webdb_vpd_sec', 'select, insert, update, delete', TRUE,
    static_policy=>true);
    end ;
    Step 8 in the script "imp_portal_schema.sh" take care of this. This can also possibly be solved by the
    C. IMP-00017 - WWDAV$ASL
    . importing table "WWDAV$ASL"
    Note: table contains ROWID column, values may be obsolete 113 rows importedThis error is normal, the table really contains a ROWID column.
    D. IMP-00041 - Warning: object created with compilation warnings
    This error is normal too. The packages giving these error have
    dependencies on package not yet imported. A recompilation is done
    after the import.
    E. ldapadd error 'cannot add add entries containing authpasswords'
    # ldap_add: DSA is unwilling to perform
    # ldap_add: additional info: You cannot add entries containing authpasswords.
    "authpasswords" are automatically generated values from the real password of the user stored in userpassword. These values do not have to be exported from ldap.
    In the import script, I remove the additional tag with a XSL stylesheet 'del_authpassword.xsl'. See above.
    F. IMP-00017: WWSTO_SESSION$
    IMP-00017: following statement failed with ORACLE error 2298:
    "ALTER TABLE "WWSTO_SESSION$" ENABLE CONSTRAINT "WWSTO_SESS_FK1""
    IMP-00003: ORACLE error 2298 encountered
    ORA-02298: cannot validate (PORTAL.WWSTO_SESS_FK1) - parent keys not found
    Here is a work-around for the problem. I will normally integrate it in a next version of the scripts.
    SQL> delete from WWSTO_SESSION_DATA$;
    7690 rows deleted.
    SQL> delete from WWSTO_SESSION$;
    1073 rows deleted.
    SQL> commit;
    Commit complete.
    SQL> ALTER TABLE "WWSTO_SESSION$" ENABLE CONSTRAINT "WWSTO_SESS_FK1";
    Table altered.
    G. IMP-00017 - ORACLE error 1 - DBMS_JOB.ISUBMIT
    This error can appear during the import when the import database is not empty and is already customized for some reasons. For example, you export from an infrastructure and you import in a database with a lot of other programs that uses jobs. And unhappily the same job id.
    Due to the way the export/import of jobs is done, the jobs keeps their id after the import. And they may conflict.
    IMP-00017: following statement failed with ORACLE error 1: "BEGIN DBMS_JOB.ISUBMIT(JOB=>42,WHAT=>'begin execute immediate " "''begin wwutl_cache_sys.process_background_inval; end;'' ; exc" "eption when others then wwlog_api.log(p_domain=> ''utl'', " " p_subdomain=>''cache'', p_name=>''background'', " " p_action=>''process_background_inval'', p_information => ''E" "rror in process_background_inval ''|| sqlerrm);end;', NEXT_DATE=" ">TO_DATE('2004-08-19:17:32:16','YYYY-MM-DD:HH24:MI:SS'),INTERVAL=>'SYSDATE " "+ 60/(24*60)',NO_PARSE=>TRUE); END;"
    IMP-00003: ORACLE error 1 encountered ORA-00001: unique constraint (SYS.I_JOB_JOB) violated
    ORA-06512: at "SYS.DBMS_JOB", line 97 ORA-06512: at line 1
    Solutions:
    1. use a fresh installed database,
    2. Due that the jobs conflicting are different because it happens only in custom installation, there is no clear rule. But you can
    recreate the jobs lost after the import with other_ids
    and/or change the job id of the other program before to import. This type of commands can help you (you need to do it with SYS)
    select * from dba_jobs;
    update dba_jobs set job=99 where job=52;
    commit
    2. Import in a RAC environment
    Be aware of the Bug 2479882 when the portal database is in a RAC database.
    Bug 2479882 : NEEDED TO BOUNCE DB NODES AFTER INSTALLING PORTAL 9.0.2 IN RAC NODE3. Intermedia
    After importing a environment, the intermedia indexes are invalid. To correct the error you need to run in SQL*Plus with Portal
    start $MIDTIER_ORACLE_HOME/portal/admin/plsql/wws/inctxgrn.sql
    start $MIDTIER_ORACLE_HOME/portal/admin/plsql/wws/ctxcrind.sql
    But $MIDTIER_ORACLE_HOME/portal/admin/plsql/wws/inctxgrn.sql is missing in IAS 9.0.4.0. This is Bug 3536937. Fixed in 9041. The missing scripts are contained in the downloadable zip file (exp_schema904.zip : Attachment 276688.1:1 ), directory sql. This means that practically in 9040, you have to run
    start sql/inctxgrn.sql
    start $MIDTIER_ORACLE_HOME/portal/admin/plsql/wws/ctxcrind.sql
    In the import script, it is done in the step 6 - recreate Portal Intermedia indexes.
    You can not WA the problem without the scripts. Running ctxcrind.sql alone does not work. You will have this error:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "PORTAL.WWERR_API_EXCEPTION", line 164
    ORA-06512: at "PORTAL.WWV_CONTEXT", line 1035
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "PORTAL.WWERR_API_EXCEPTION", line 164
    ORA-06512: at "PORTAL.WWV_CONTEXT", line 476
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-20000: Oracle Text error:
    DRG-12603: CTXSYS does not own user datastore procedure: WWSBR_THING_CTX_69
    ORA-06512: at line 13
    4. ptlconfig
    If you try to run ptlconfig simply after an import you will get an error:
    Problem processing Portal instance: Configuring HTTP server settings : Installing cache data : SQL exception: ERROR: ORA-23421: job number 32 is not a job in the job queue
    This is because the import done by user SYS has imported the PORTAL jobs to the SYS schema in place of portal. The solution is to run
    update dba_jobs set LOG_USER='PORTAL', PRIV_USER='PORTAL' where schema_user='PORTAL';
    In the import script, it is done in the step 8 - post import changes.
    5. WWC-41417 - invalid credentials.
    When you try to login you get:
    Unexpected error encountered in wwsec_app_priv.process_signon (User-Defined Exception) (WWC-41417)
    An exception was raised when accessing the Oracle Internet Directory: 49: Invalid credentials
    Details
    Error:Operation: dbms_ldap.simple_bind_s
    OID host: machine.domain.com
    OID port number: 4032
    Entry DN: orclApplicationCommonName=PORTAL,cn=Portal,cn=Products,cn=OracleContext. (WWC-41743)Solution:
    - run secupoid.sql
    - rerun ptlconfig
    This problem has been seen after using ptlasst in place of ptlconfig.
    6. EXP-003 with a database 9.2.0.5 or 10.1.0.2
    In fact, the DB format of imp/exp has changed in 9.2.0.5 or 10.1.0.2. The EXP-3 error only occurs when the export from the 9.2.0.5.0 or 10.1.0.2.0 database is done with a lower release export utility, e.g. 9.2.0.4.0.
    Due to the way this note is written, the imp/exp utility used is the one of the midtier (9014), if your portal resides in a 9.2.0.5 database, it will not work. To work-around the problem, there are 2 solutions:
    Change the script so that it uses the exp and imp command of database.
    Make a change to the 9.2.0.5 or 10.1.0.2 database to make them compatible with previous version. The change is to modify a database internal view before to export/import the data.
    A work-around is given in Bug 3784697
    1. Make a note of the export definition of exu9tne from
    $OH/rdbms/admin/catexp.sql
    2. Copy this to a new file and add "UNION ALL select * from sys.exu9tneb" to the end of the definition
    3. Run this as sys against the DB to be exported.
    4. Export as required
    5. Put back the original definition of exu9tne
    eg: For 9204 the workaround view would be:
    CREATE OR REPLACE VIEW exu9tne (
    tsno, fileno, blockno, length) AS
    SELECT ts#, segfile#, segblock#, length
    FROM sys.uet$
    WHERE ext# = 1
    UNION ALL
    select * from sys.exu9tneb
    7. EXP-00006: INTERNAL INCONSISTENCY ERROR
    This is Bug 2906613.
    The work-around given in this bug is the following:
    - create the following view, connected as sys, before running export:
    CREATE OR REPLACE VIEW exu8con (
    objid, owner, ownerid, tname, type, cname,
    cno, condition, condlength, enabled, defer,
    sqlver, iname) AS
    SELECT o.obj#, u.name, c.owner#, o.name,
    decode(cd.type#, 11, 7, cd.type#),
    c.name, c.con#, cd.condition, cd.condlength,
    NVL(cd.enabled, 0), NVL(cd.defer, 0),
    sv.sql_version, NVL(oi.name, '')
    FROM sys.obj$ o, sys.user$ u, sys.con$ c,
    sys.cdef$ cd, sys.exu816sqv sv, sys.obj$ oi
    WHERE u.user# = c.owner# AND
    o.obj# = cd.obj# AND
    cd.con# = c.con# AND
    cd.spare1 = sv.version# (+) AND
    cd.enabled = oi.obj# (+) AND
    NOT EXISTS (
    SELECT owner, name
    FROM sys.noexp$ ne
    WHERE ne.owner = u.name AND
    ne.name = o.name AND
    ne.obj_type = 2)
    The modification of exu8con simply adds support for a constraint type that had not previously been supported by this view. There is no negative impact.
    8. WWSBR_DOC_CTX_54 is invalid
    After the recompilation of the package, one package remains invalid (in sys_post_changes.log):
    INVALID_OBJECT_AFTER
    1
    select owner, object_name from all_objects where status='INVALID'
    CTXSYS WWSBR_DOC_CTX_54
    CREATE OR REPLACE procedure WWSBR_DOC_CTX_54
    (rid in rowid, bilob in out NOCOPY blob)
    is begin PORTAL.WWSBR_CTX_PROCS.DOC_CTX(rid,bilob);end;
    This object is not used anymore by portal. The error can be ignored. The procedure can be removed too. This is Bug 3559731.
    9. You do not have permission to perform this operation. (WWC-44131)
    It seems that there are problems if
    - groups on the production machine are not residing in the default place in OID,
    - and that the group creation base and group search base where changed.
    After this, the cloning of the repository work without problem. But it seems that the command 'ptlconfig -dad portal' does not reset the GUID and DN of the groups correctly. I have not checked this yet.
    The solution seems to use the script given in the 9.0.2 Note 228516.1. And run group_sec.sql to reset all the DN and GUID in the copied instance.
    10. Invalid Java objects when exporting from a 9.x database and importing in a 10g database
    If you export from a 9.x database and import in a 10g database, after running utlrp.sql, 18 Java objects will be invalid.
    select object_name, object_type from user_objects where status='INVALID'
    SQL> /
    OBJECT_NAME OBJECT_TYPE
    /556ab159_Handler JAVA CLASS
    /41bf3951_HttpsURLConnection JAVA CLASS
    /ce2fa28e_ProviderManagerClien JAVA CLASS
    /c5b98d35_ServiceManagerClient JAVA CLASS
    /d77cf2ab_SOAPServlet JAVA CLASS
    /649bf254_JavaProvider JAVA CLASS
    /a9164b8b_SpProvider JAVA CLASS
    /2ee43ac9_StatefulEJBProvider JAVA CLASS
    /ad45acec_StatelessEJBProvider JAVA CLASS
    /da1c4a59_EntityEJBProvider JAVA CLASS
    /66fdac3e_OracleSOAPHTTPConnec JAVA CLASS
    /939c36f5_OracleSOAPHTTPConnec JAVA CLASS
    org/apache/soap/rpc/Call JAVA CLASS
    org/apache/soap/rpc/RPCMessage JAVA CLASS
    org/apache/soap/rpc/Response JAVA CLASS
    /198a7089_Message JAVA CLASS
    /2cffd799_ProviderGroupUtils JAVA CLASS
    /32ebb779_ProviderGroupMgrProx JAVA CLASS
    18 rows selected.
    This is a known issue. This can be solved by applying patch one of the following patch depending of your IAS version.
    Bug 3405173 - PORTAL 9.0.4.0.0 PATCH FOR 10G DB UPGRADE (FROM 9.0.X AND 9.2.X)
    Bug 4100409 - PORTAL 9.0.4.1.0 PATCH FOR 10G DB UPGRADE (FROM 9.0.X AND 9.2.X)
    Bug 4100417 - PORTAL 9.0.4.2.0 PATCH FOR 10G DB UPGRADE (FROM 9.0.X AND 9.2.X)
    11. Import : IMP-00003: ORACLE error 30510 encountered
    When importing Portal 9.0.4.x, it could be that the import of the database side produces an error ORA-30510.The new perl script work-around the issue in the portal_post_import.sql script. But not the BASH scripts. If you use the BASH scripts, after the import, please run this command manually in SQL*Plus logged as portal.
    ---- Import error 2 - ORA-30510 when importing
    CREATE OR REPLACE TRIGGER logoff_trigger
    before logoff on schema
    begin
    -- Call wwsec_oid.unbind to close open OID connections if any.
    wwsec_oid.unbind;
    exception
    when others then
    -- Ignore all the errors encountered while unbinding.
    null;
    end logoff_trigger;
    This is logged as <Bug;4458413>.
    12. Exporting from a 9.0.1 database and import in a 9.2.0.5+ or 10g DB
    It could be that when exporting from a 9.0.1 database to a 10g database that the java classes do not get compiled correctly. The following errors are seen
    ORA-29534: referenced object PORTAL.oracle/net/www/proto/https/HttpsURLConnection could not be resolved
    errors:: class oracle/net/www/proto/https/HttpsURLConnection
    ORA-29521: referenced name oracle/security/ssl/OracleSSLSocketFactoryImpl could not be found
    ORA-29521: referenced name oracle/security/ssl/OracleSSLSocketFactory could not be found
    In such a case, please apply the following patches after the import in the 10g database.
    Bug 3405173 PORTAL REPOS DB UPGRADE TO 10G: for Portal 9.0.4.0
    Bug 4100409 PORTAL REPOS DB UPGRADE TO 10G: for Portal 9.0.4.1
    Main Differences with Portal 9.0.2
    For the persons used to this technics in Portal 9.0.2, you could be interested to read the main differences with the same note for Portal 9.0.2
    Portal 9.0.2
    Portal 9.0.4
    Cutter database
    Portal 9.0.2 can be part of an infrastructure database or in a custom external database.
    In Portal 9.0.2, the portal schema is imported in an empty database.
    Portal 9.0.4 can only be installed in a 'Cutter database', a database created with RepCA or OUI containing always OID, DCM and so on...
    In Portal 9.0.4, the portal schema is imported in an 'Cutter database' (new)
    group_sec.sql
    group_sec.sql is used to correct the GUIDs of OID stored in Portal
    ptlconfig -dad portal -oid is used to correct the GUIDs of OID stored in Portal (new)
    1 script
    The import / export are divided by several steps with several scripts
    The import script is done in one step
    Additional steps are included in the script
    This requires to know the hostname and port of the original development machine. (new)
    Import
    The steps are:
    creation of an empty database
    creation of the users with password=username
    import
    The steps are:
    creation of an IAS 10g infrastructure DB (repca or OUI)
    deletion of new portal schemas (new)
    creation of the users with the same password than the schemas just dropped.
    import
    DAD
    The dad needed to be changed
    The passwords are not changed, the dad does not need to be changed.
    Bugs
    In portal 9.0.2, 2 bugs were workarounded by change_host.sh
    In Portal 9.0.4, some tables additional tables needs to be updated manually before to run ptlasst. This is #Bug:3762961#.
    export of LDAP
    The export is done in LDIF files. If the prod and the dev have different domain, it is quite difficult to change the domain name in these file due to the line wrapping at 78 characters.
    The export is done in XML files, in the DSML format (new). It is a lot easier to change the XML files if the domain name is different from PROD to DEV.
    Download
    You have to cut and paste the scripts
    The scripts are attached to the note. Just donwload them.
    Rewiring
    9.0.2 uses ptlasst.
    ptlasst.csh -mode MIDTIER -i custom -s $PORTAL_USER -sp $PORTAL_PASSWORD -c $PORTAL_HOSTNAME:$PORTAL_DB_PORT:$PORTAL_SERVICE_NAME -sdad $PORTAL_DAD -o orasso -op $ORASSO_PASSWORD -odad orasso -host $MIDTIER_HOSTNAME -port $MIDTIER_HTTP_PORT -ldap_h $INFRA_HOSTNAME -ldap_p $OID_PORT -ldap_w $IAS_PASSWORD -pwd $IAS_PASSWORD -sso_c $INFRA_HOSTNAME:$INFRA_DB_PORT:$INFRA_SERVICE_NAME -sso_h $INFRA_HOSTNAME -sso_p $INFRA_HTTP_PORT -ultrasearch -oh $MIDTIER_ORACLE_HOME -mc false -mi true -chost $MIDTIER_HOSTNAME -cport_i $WEBCACHE_INV_PORT -cport_a $WEBCACHE_ADM_PORT -wc_i_pwd $IAS_PASSWORD -emhost $INFRA_HOSTNAME -emport $EM_PORT -pa orasso_pa -pap $ORASSO_PA_PASSWORD -ps orasso_ps -pp $ORASSO_PS_PASSWORD -iasname $IAS_NAME -verbose -portal_only
    9.0.4 uses ptlconfig (new)
    ptlconfig -dad portal
    Environment variables
    A lot of environment variables are needed
    Just 3 environment variables are needed:
    - password of SYS
    - password of IAS,
    - ORACLE_HOME of the Midtier
    All the rest is found in iasconfig.xml and LDAP (new)
    TO DO
    - Check if the orclcommonapplication name fits SID.hostname
    - Check what gives the import of a portal30 upgraded schema inside a schema named portal
    - Explain how to copy the portal*.dbf files in place of export/import and the limitation of tra

Maybe you are looking for

  • I am having a crash problem

    and it seems to be getting worse. Specifically, I have a G4 AGP, with 8xxRAM 1.3giggle cpu three firewire devices, Maxtor HD, buffalo HD and lacie dvd burner (multi recorder). I upgraded the internal DVD to a Samsung burner a long while ago. This pro

  • HT1544 hi every body!I need a cd or dvd for mac os x 10.5 to reinstal my powerbook G4.shall we arrange it with money or with manu thanks or both?

    bonjour tout le monde!j ai besoin du cd ou dvd du demarrage pour mon powerbook G4 a savoir mac os x 10.5. est ce qu il y a moyen d arranger ca avec l argent ou mes remerciements ou les deux? en tous les cas je commence par vous dire merci!

  • How to update a text file?

    I am doing an assignment about a bank account. A text file stores the accounts. Account Text file: User1|Password1|Balance1 User2|Password2|Balance2 When user wants to deposit or withdraw the account, then how can update the balance. The problem is t

  • Yahoo mail not working in firefox anymore

    Ever since last week yahoo mail has stopped working in firefox, the page loads but everything I click on doesn't open. I don't know what has changed since then. I upgraded to firefox 28 prior to it and it worked fine for about a week then all of a su

  • Problems with URL in CS5

    Hello, all.  I'm having a simple but very frustrating problem in Flash CS5 with Actionscript 3.  I'm trying to set up a link in an image, when you mouseover the image, it says video and I want to be able to click on it and have it lead to a new URL.