When changing ownership of an object, use the appropriate copy method to:
Before changing ownership of a database object, take the following preparatory steps:
If this is the case, the existing duplicate object must be destroyed before proceeding.
Important! If you fail to do this, the new object, owned by the new user, cannot be successfully created, and you can potentially corrupt the existing object with unwanted data.
Follow these basic steps to change ownership of a database object:
There are now two copies of the object in the database, one owned by the original owner and one owned by the new owner.
Follow these steps to change the ownership of a table:
For detailed steps for performing these procedures in VDBA, see online help.
These tasks can also be accomplished using the copydb and sql commands. For more information, see the Command Reference Guide.
For more information on copying tables and other database objects, see the chapter "Loading and Unloading Databases."
The following example changes the ownership of any table from the currently selected user, John, to the user named dba.
sql -ujohn mydb <copy.out
Note: The grant statements are present only if grants are defined for the table being copied.
There are now two copies of the table, one owned by the user john and the other owned by the user dba. In the usual case, John's version is no longer needed and can be removed. For example, the user john (or another user impersonating john) can easily drop the table in VDBA. For more information, see online help.
sql -udba mydb <copy.in
You also need to grant access permissions to the new table owned by user dba. For more information, see the chapter "Ensuring Access Security."
To change the ownership of an application (created with Applications-By-Forms or Vision) from any current owner to any new owner, use the copyapp command.
The command syntax has two forms: copyapp out and copyapp in. To change the ownership, you issue the first form of the command under the current ownership, and the second form under the new ownership.
Assume the user john wants to transfer ownership of the application named app1 in the database mydb to the user dba. The following commands, entered at the operating system prompt, accomplish this, using the default intermediate text file and the current working directory:
copyapp out mydb app1 –ujohn
copyapp in mydb iicopyapp.tmp –a –udba
At this point, there are two copies of the application, one owned by the user john and the other owned by the user dba. In the usual case, John's application is no longer needed and can be removed using Vision or Application-By-Forms.
For a complete description of the flags and parameters for this command, see the copyapp entry in the Command Reference Guide.
Change the ownership of a form from any current owner to any new owner using the copyform command. There are two forms of syntax, one without the –i flag, which copies the forms from a database to a file. The next form, using the –i flag, copies the forms from the text file into a database. To change the ownership, issue the first form of the command under the current ownership, and the second form under the new ownership, as shown in the example that follows.
Assume the user john wants to transfer ownership of the forms named customers and parts in the database mydb to the user dba. The following commands, entered at the operating system prompt, accomplish this:
copyform –ujohn mydb forms.txt customers parts
copyform -i –udba mydb forms.txt
For a complete description of the flags and parameters for this command, see the copyform entry in the Command Reference Guide.
At this point, there are two copies of each form, one owned by the user john and the other owned by the user dba. In the usual case, John's forms are no longer needed and can be removed in Visual Forms Editor.
Change the ownership of a report from any current owner to any new owner using the copyrep and sreport commands. The copyrep command copies the reports out under the current ownership, and sreport copies them back in under the new ownership, as shown in the example that follows.
Assume the user john wants to transfer ownership of the reports named parts_restock and parts_on_order in the database mydb to the user dba. The following commands, entered at the operating system prompt, accomplish this:
copyrep –ujohn -f mydb text.rw parts_restock parts_on_order
sreport –udba mydb text.rw
For a complete description of the flags and parameters for copyrep and sreport, see the Forms-based Application Development Tools User Guide. These commands are also described in the Command Reference Guide.
At this point, there are two copies of each report, one owned by the user john and the other owned by the user dba. In the usual case, John's reports are no longer needed and can be removed in Report-By-Forms.