THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
No Format |
---|
derby|mysql|postgres|oracle |
Usage Examples
- Initialize to current schema for a new Hive setup:
No Format $ schematool -dbType derby -initSchema Metastore connection URL: jdbc:derby:;databaseName=metastore_db;create=true Metastore Connection Driver : org.apache.derby.jdbc.EmbeddedDriver Metastore connection User: APP Starting metastore schema initialization to 0.13.0 Initialization script hive-schema-0.13.0.derby.sql Initialization script completed schemaTool completeted
- Get schema information:
No Format $ schematool -dbType derby -info Metastore connection URL: jdbc:derby:;databaseName=metastore_db;create=true Metastore Connection Driver : org.apache.derby.jdbc.EmbeddedDriver Metastore connection User: APP Hive distribution version: 0.13.0 Metastore schema version: 0.13.0 schemaTool completeted
- Attempt to get schema information with older metastore:
Since the older metastore doesn't store the version information, the tool reports an error retrieving it.No Format $ schematool -dbType derby -info Metastore connection URL: jdbc:derby:;databaseName=metastore_db;create=true Metastore Connection Driver : org.apache.derby.jdbc.EmbeddedDriver Metastore connection User: APP Hive distribution version: 0.13.0 org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version. *** schemaTool failed ***
- Upgrade schema from an 0.10.0 release by specifying the 'from' version:
No Format $ schematool -dbType derby -upgradeSchemaFrom 0.10.0 Metastore connection URL: jdbc:derby:;databaseName=metastore_db;create=true Metastore Connection Driver : org.apache.derby.jdbc.EmbeddedDriver Metastore connection User: APP Starting upgrade metastore schema from version 0.10.0 to 0.13.0 Upgrade script upgrade-0.10.0-to-0.11.0.derby.sql Completed upgrade-0.10.0-to-0.11.0.derby.sql Upgrade script upgrade-0.11.0-to-0.12.0.derby.sql Completed upgrade-0.11.0-to-0.12.0.derby.sql Upgrade script upgrade-0.12.0-to-0.13.0.derby.sql Completed upgrade-0.12.0-to-0.13.0.derby.sql schemaTool completeted
- Upgrade dry run can be used to list the required scripts for the given upgrade.
This is useful if you just want to find out all the required scripts for the schema upgrade.No Format $ build/dist/bin/schematool -dbType derby -upgradeSchemaFrom 0.7.0 -dryRun Metastore Connection Driver : org.apache.derby.jdbc.EmbeddedDriver Metastore connection User: APP Starting upgrade metastore schema from version 0.7.0 to 0.13.0 Upgrade script upgrade-0.7.0-to-0.8.0.derby.sql Upgrade script upgrade-0.8.0-to-0.9.0.derby.sql Upgrade script upgrade-0.9.0-to-0.10.0.derby.sql Upgrade script upgrade-0.10.0-to-0.11.0.derby.sql Upgrade script upgrade-0.11.0-to-0.12.0.derby.sql Upgrade script upgrade-0.12.0-to-0.13.0.derby.sql schemaTool completeted