ddlgen,計算機術語。用於導出資料庫的數據。
基本介紹
- 中文名:ddlgen
- 類型:文章
- 語種:英語
- 注意:用戶許可權必須是資料庫的dbo或sa
ddlgen的描述,ddlgen參數說明,Object type描述,ddlgen用法,注意,
ddlgen的描述
A Java-based tool that generates definitions for server- and database-level
objects in Adaptive Server. ddlgen supports Adaptive Server version 11.9.2 and
later.
語法:
ddlgen
-Ulogin
-Ppassword
-Shost_name : port_number
[-Tobject_type]
[-Nobject_name]
[-Ddatabase_name]
[-Xextended_object_type]
[-Ooutput_file]
[-Eerror_file]
Or
ddlgen -v
ddlgen參數說明
-U login
specifies a login name, and is case-sensitive.
-P password
specifies your password.
-Shost_name : port_number
specifies the host name or IP address of Adaptive Server, as well as its port
number. Separate host_name and port_number with a colon, without spaces
before or after it.
Note You must use the -S option because ddlgen does not connect to a default
server, and does not support interface files.
-Tobject_type
specifies the type of object you are creating. If you do not use -T, ddlgen
creates a DDL for the default database of login. Table 6-3 lists object types
for -T.
-Nobject_name
specifies the fully qualified name of the object you are creating, such as
-Ndb_name.owner.table.index.
The -N option:
is required if you specify any object_type other than DB (database) in
the -T parameter.
accepts wildcards with the use of %.
Use -N% to generate a DDL for all items of a specific object type on your
server.
-Ddatabase_name
specifies the name of the database for the object you specify in the -N option.
The default is the user’s default database.
-Xextended_object_type
differentiates user tables (OU) from proxy tables (OD) when you specify a
table as your object type (-TU). If object_type (-T) is U (table) and -X is not
specified, ddlgen generates DDL for both user tables and proxy tables. To
generate a DDL only for:
user tables – use the OU extended object type with the -X option.
proxy tables – use the OD extended object type with the -X option.
-Ooutput_file
specifies an output file for the generated DDL. If you do not specify -O, the
DDL you create appears in a console window.
-Eerror_file
specifies a log file for recording errors. If you do not specify -E, the
generated errors appear in a console window.
-v
displays the version and copyright message of ddlgen and returns to the
operating system.
Object type描述
C cache
D default
DB database
DBD database device
DPD dump device
EC execution class
EG engine group
GRP group
I index
L login
P stored procedure
R rule
RO role
RS remote server
SGM segment
TR trigger
U table
UDD user-defined datatype
USR user
V view
XP extended stored procedure
ddlgen用法
1、存儲過程
ddlgen -Usa -P -Sip:port -Duserdb -TP -N% -O proc.ddl
2、資料庫
ddlgen -Usa -P -Sip:port -Duserdb -TDB -Nuserdb -O db.ddl
3、表結構
ddlgen -Usa -P -Sip:port -Duserdb -TU -N% -O table.ddl
4、視圖
ddlgen -Usa -P -Sip:port -Duserdb -TV -N% -O view.ddl
注意
1、正常只要導出這些就可以了。當然如果你定義了觸發器或需要導出用戶信息都可以。
2、導出資料庫的情況下,已經包含了導出表結構定義。如果不需要創建資料庫,可以只導表結構定義。
3、表結構定義的所有外鍵是在最後的,因此無需擔心表的先後順序。
4、用戶許可權必須是資料庫的dbo或sa。