Copy Object from one database to another database
What is the easiest way to copy a object from one database/schema to another database/schema?
I am particulary interested in copying a view from one schema to another schema in Oracle.
Please sign in to leave a comment.
Hello. Do you mean just create a view in another schema?
1. First copy DDL from object (the Oracle view) context menu -> Copy DDL action.
2. Then use this DDL to create the view in target schema.
Now, if you also want to copy data from some table you can
1. Import data from the context menu of desired table -> Save to File -> SQL Insert Statements to generate the script.
2. Use this script on a target schema and table to populate it.
Where do I find the Copy DDL option?
See https://www.jetbrains.com/idea/help/generating-a-data-structure-definition-ddl-file.html
Thanks, but I am unable to see this menu option.
It seems it's not enabled when I am on an Oracle Database, while it's enabled on a MySQL.
Do you see other Dababase objects in Project Tree but not Oracle table views? It shows view for me:

But, actually there is a bug that IDE does not copy DDL for views correctly - https://youtrack.jetbrains.com/issue/DBE-195 .
After the last update, the option is present.
Case closed.
Thanks for informaiton!