on 07-31-2013 4:19 PM
hi, I have a schema and there are procedures developed by different developers. I want to change the ownership of a particular procedure to a different user. How do we change the ownership of objects in HANA
I am looking something similar to this in HANA -> REASSIGN OWNED BY old_role [, ...] TO new_role
-Thanks
Vinod Nair
The owner of an object and the owner of the schema in which the object is located are the only users who can access the object and grant object privileges on it to other users.
So what I think is if you change the schema of objects your job is done.
Try with the import-export utility of HANA, it have the rename_schema option and will make your life easier.
IMPORT - SAP HANA SQL and System Views Reference - SAP Library
There is also the other option to do it programmatically.
You can do in the script with the dynamic SQL which would be to like create the object into the target schema and drop the object in Source schema.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
we can change the all objects with "Switch ownership job"
Switch ownership job will run and upon successful completion.
thanks
Ravindar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vinod,
If developer develops procedure based on sql console, then as my knowledge, you cannot change ownership for them, you only can grant privilege to related user.
Besides, if developer develops procedure based on modeler perspective, then it already define default package and schema (_SYS_BIC), you cannot change ownership, and cannot move it.
Hope this can help you.
Regards,
Jerry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try this command
GRANT <object_privilege>,... ON <object_name> TO <grantee> [WITH GRANT OPTION].
Thanks,
Shashi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vinod,
Frankly I am not aware if there is a direct method to change the owneship of objects like Stored Procedures.
One alternative I can think of, is to collect the script for the "Create procedure" (s) and then drop the procedures in the earlier user schema and re-create them with the new user schema.
I think with SP05 / SP06, the procedures can also be created under packages as HANA artifacts. Personally I haven't tried this, but it is worth looking into that option too. That way, it might be easy to change the ownership again, if required.
As I said, I don't have personal experience with this yet, but may be you can look into this and share on this forum.
Regards,
Ravi
User | Count |
---|---|
77 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.