Home » RDBMS Server » Server Utilities » Policy - function_schema is not exp/imp properly
Policy - function_schema is not exp/imp properly [message #438800] Tue, 12 January 2010 05:40 Go to next message
dyahav
Messages: 32
Registered: March 2009
Member
Hi,
I have a schema that contains a policy as follows:

BEGIN
  SYS.DBMS_RLS.ADD_POLICY     (
    object_schema          => 'DYAHAV'
    ,object_name           => 'TBL_BASE'
    ,policy_name           => MY_VPD_PREDICATE'
    ,function_schema       =>NULL
    ,policy_function       => 'MY_VPD_PREDICATE'
    ,statement_types       => 'SELECT,INSERT,UPDATE,DELETE'
    ,policy_type           => dbms_rls.dynamic
    ,long_predicate        => FALSE
    ,update_check          => FALSE
    ,static_policy         => FALSE
    ,enable                => TRUE );
END;



After export and import to other schema, the object_schema is updated correctly
but the function_schema is still DYAHAV.
I really don't know if it's a feature or a bug...
How can I avoid it?
Thanks
dyahav


Re: Policy - function_schema is not exp/imp properly [message #438802 is a reply to message #438800] Tue, 12 January 2010 05:50 Go to previous messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is neither a bug nor a feature, just something that import does not rename because it is the object of the rule and not the owner of this one.
You don't expect Oracle will change 'DYAHAV' in all the data, don't you?

Regards
Michel
Re: Policy - function_schema is not exp/imp properly [message #438804 is a reply to message #438802] Tue, 12 January 2010 05:59 Go to previous messageGo to next message
dyahav
Messages: 32
Registered: March 2009
Member
Thanks for the quick response.

The policy is defined for a specific schema such that the
function_schema => 'DYAHAV'

I would expect that value of 'function_schema' in the new schema will be the new schema name (the schema in which the import applied).


Furthermore, I would expect that Oracle will change the value of
'function_schema' if it changes the 'object_schema' properly.

Am I still mistake?
Thanks
dyahav
Re: Policy - function_schema is not exp/imp properly [message #438805 is a reply to message #438804] Tue, 12 January 2010 06:03 Go to previous messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes, in this the schema is data not metadata.
You don't expect Oracle will scan all the data to check if there is any 'DYAHAV' in them and change them.
I bet you would not it does it in your data.

Anyway, it does not do it.

Regards
Michel
Re: Policy - function_schema is not exp/imp properly [message #438807 is a reply to message #438805] Tue, 12 January 2010 06:15 Go to previous messageGo to next message
dyahav
Messages: 32
Registered: March 2009
Member
Hi,
Could you please explain why the 'object_schema' is changed
and the function_schema not?

As I understand, policies imp/exp can't work properly if
the function_schema is defined on the current schema name?

Thanks a lot
dyahav
Re: Policy - function_schema is not exp/imp properly [message #438812 is a reply to message #438807] Tue, 12 January 2010 06:47 Go to previous messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
In you example, the function_schema is NULL.
I think you should open a SR and ask Oracle why it does things as it does them.

Regards
Michel

[Updated on: Tue, 12 January 2010 06:48]

Report message to a moderator

Re: Policy - function_schema is not exp/imp properly [message #438828 is a reply to message #438812] Tue, 12 January 2010 08:02 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I had a similar problem exporting function based indexes, and re-importing them into a different schema.
The function based index was exported including the schema that owned the function, and when you imported it into a different schema, the function owning schema wasn't changed.

Previous Topic: export and import issue
Next Topic: I'm New to Oracle and need help with DataPump in Oracle 10.2.3
Goto Forum:
  


Current Time: Sun Sep 25 12:57:08 CDT 2016

Total time taken to generate the page: 0.24995 seconds