Denodo - How to Change VDB Folder Ownership
When virtual databases are created by the global Denodo administrator, they are initialized with a standard set of folders. These folders are owned by the global administrator.
Viewing the Owner of a Folder in Denodo
- You can view the owner of a folder by clicking the context menu icon, and selecting Properties.

- In the Properties window, you can find the owner of the folder, the last modifier, creation date, last modification date, database the folder belongs to, folder path, and description.

Change Folder Ownership
It is advantageous for folders to be owned by the VDB administrator, as this allows for the removal or refinement of the folder structure without requiring intervention from the global administrator. Unfortunately, users cannot change the folder owner directly in the Properties window. To change ownership, a user must execute a change owner VQL script from the VQL shell. Running a change owner command for each folder individually can be cumbersome. Instead, we can utilize a VQL command to retrieve all folder names in a VDB simultaneously, and then execute commands to change ownership collectively, thereby providing complete control over all folders.
- Open the VQL shell interface to execute VQL commands.
NOTE: This should be open by default when you start the Denodo Design Studio app.
NOTE: If the VQL Shell is not open, click File in the menu bar along the top and select VQL Shell.
-
Check that the database selected in the database drop-down is the one where you want to change folder ownership.

-
Paste the VQL script below into the VQL shell. This command will return a list of all the folders in a VDB and format them into a series of change owner (CHOWN) commands for us to run in the next step.
SELECT REPLACE('CHOWN ' || 'username' || ' FOLDER ''' || folder || '/' || name || ''';', '//', '/') AS ChangeOwnerCommand
FROM GET_ELEMENTS()
WHERE input_type = 'folders'
AND input_database_name = 'vdbname'; -
Replace the username and vdbname in the script to the NetID of the user who will become the owner of these folders, typically the VDB admin, and the name of the VDB to be affected, respectively.

-
Click the 'Copy displayed results to clipboard' button.

-
Paste the content into the VQL shell, overwriting the previous command, and remove the top line, as it is simply the column header from the previous step and doesn't contain folder info. Click Execute.

- The commands should run in sequence and display an 'OK' after each step, indicating there were no errors or warnings and the commands were successful.

- Check the folder properties again to see that the folder owner has indeed been changed.
- NOTE: you may need to click File in the menu bar along the top and select Refresh to refresh the folder structure.
