on 2020 Oct 01 6:45 AM
Using 16.0.0.2798
This is more of a warning to others rather than a question, but please feel free to comment.
It seems as if the dbunload utility when executed with the -e option to exclude a table, doesn't produce a complete rebuild script skipping users, functions etc. I don't understand this behavior, the help says
Excludes the specified tables from the reload.sql file. Table names are always case insensitive, even in case sensitive databases. A reload.sql file created with the -e option should not be used to rebuild a database because the file will not include all the database tables. If a table has foreign keys referring to it, the database cannot be rebuilt without the contents of the table. It is recommended that you only use the -e option with the -d option to unload data for all tables except those identified by -e. <<
In my case the -d option was not included so I expected a complete reload script to be generated. I guess the only alternative is to delete the table prior to unload.
If memory serves, all my attempts to use dbunload -e for any purpose whatsoever have failed.
A simple comparison of V16 demo database dbunload commands with and without -e GROUPO.MarketingInformation reveals that a lot of stuff is included, but even more is excluded.
In particular, note that it's not just users and functions that are missing, but all the views and procedures:
"%SQLANY16%\\bin64\\dbunload.exe"^ -c "ENG=demo;DBN=demo;UID=dba;PWD=sql;"^ -o dbunload_16_log_demo.txt^ -r reload_16.sql^ -v^ reload_16 "%SQLANY16%\\bin64\\dbunload.exe"^ -c "ENG=demo;DBN=demo;UID=dba;PWD=sql;"^ -e GROUPO.MarketingInformation^ -o dbunload_16_log_demo_e.txt^ -r reload_16_e.sql^ -v^ reload_16_e dbunload -e output omits these sections... -- Create dbspaces -- Create ldap servers -- Create login policies -- Create users -- Create role definitions -- Create user types -- Create spatial units of measure -- Create spatial reference systems -- Create remote servers -- Create dbspace permissions -- Create external environments -- Create external environment objects -- Create certificates -- Create text configurations -- Create materialized views -- Create immediate materialized views -- Create functions -- Create views -- Create user messages -- Create procedures -- Create SQL Remote definitions -- Create MobiLink definitions -- Create Synchronization profiles -- Create logins -- Create events -- Create services -- Create mirror options and servers -- Set DBA password -- Create options
Other sections (like ALTER TABLE) appear in different orders so it's difficult to determine if they are the same.
It is difficult to imagine how the output from dbunload -e could be useful for ANY PURPOSE without editing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.