cancel
Showing results for 
Search instead for 
Did you mean: 

Change ownership of Scehma

former_member186082
Active Contributor
0 Kudos

Hi,

Can we change owner of a schema to other user? Can you throw some light on this ?

Regards,

Chandra.

Accepted Solutions (1)

Accepted Solutions (1)

former_member198032
Active Contributor

Hi,

have you seen this thread:

How to change objects owners in HANA | SCN

Regards,

Cristiano

former_member186082
Active Contributor
0 Kudos

Hi Cristiano,

Ya, I've seen that - I think it talks about objects in a schema, particularly procedures. I'm looking for information to change owner of a schema. Scenario is - user A created schema S. Now I want to change owner of this schema S to user B.

Regards,

Chandra.

former_member198032
Active Contributor
0 Kudos

Hi,

I believe it is not possible. I look for this but did not find anything.

At that time schema creator was always schema owner. With recent revisions you can create schema and set other user as owner but cannot change it later:

CREATE SCHEMA <schema_name> [OWNED BY <user_name>]

Regards,

Cristiano

former_member186082
Active Contributor
0 Kudos

Yes Cristiano, even to my knowledge we cannot change owner of a schema.

Any help on this ??

Regards,
Chandra.

lbreddemann
Active Contributor
0 Kudos

You're right Chandra, schema ownership cannot be changed.

However, it's possible to export a schema, drop it from the database, recreate the schema owned by the target user and import the objects back into the database.

One important aspect to be careful of with this is that EXPORT/IMPORT don't care for the privileges assigned to the objects. So, after the import all privilege assignments need to be re-done manually for the affected objects.

former_member186082
Active Contributor
0 Kudos

Thanks Lars for your inputs.

Answers (0)