Database schema creation

You can create the schema for an entire database or for a portion of the database.

Use the dbschema utility options to perform the following actions:
  • Display CREATE SYNONYM statements by owner, for a specific table or for the entire database.
  • Display the CREATE TABLE, CREATE VIEW, CREATE FUNCTION, or CREATE PROCEDURE statement for a specific table or for the entire database.
  • Display all GRANT privilege statements that affect a specified user or that affect all users for a database or a specific table. The user can be either a user name or role name.
  • Display user-defined and row data types with or without type inheritance.
  • Display the CREATE SEQUENCE statement defining the specified sequence object, or defining all sequence objects in the database.
When you use dbschema and specify only the database name, it is equivalent to using dbschema with all its options (except for the -hd and -ss options). In addition, if Information Schema views were created for the database, this schema is shown. For example, the following two commands are equivalent:
dbschema -d stores_demo
dbschema -s all -p all -t all -f all -d stores_demo

SERIAL fields included in CREATE TABLE statements that dbschema displays do not specify a starting value. New SERIAL fields created with the schema file have a starting value of 1, regardless of their starting value in the original database. If this value is not acceptable, you must modify the schema file.


Copyright© 2018 HCL Technologies Limited