Wiki source code of JDBC2XML Usage

Version 1.1 by christoph_lechleitner@iteg_at on 2012-08-03 05.41:00

Show last authors
1 = {{id name="JDBC2XMLUsage-JDBC2XMLUsage"/}}JDBC2XML Usage =
2
3 This section refers to the command-line tool. For information on the uses of the java library, please refer to our [[java documentation>>doc:JDBC2XML.Java Library Documentation.WebHome]].
4
5 === {{id name="JDBC2XMLUsage-Aliases"/}}Aliases ===
6
7 JDBC2XML registers under several aliases on the command line, to cover the most common usecases. They are presented here with minimal options, see a full list of options below.
8
9 ==== {{id name="JDBC2XMLUsage-DumpingaDBtoXML:"/}}Dumping a DB to XML: ====
10
11 {{code language="none"}}
12 jdbc2xml --url <jdbc-url> --file <path-to-file>
13 {{/code}}
14
15 ==== {{id name="JDBC2XMLUsage-RestoringaDBfromXML:"/}}Restoring a DB from XML: ====
16
17 {{code language="none"}}
18 xml2jdbc --file <path-to-file> --url <jdbc-url>
19 {{/code}}
20
21 ==== {{id name="JDBC2XMLUsage-CopyingfromoneDBtoanother"/}}Copying from one DB to another ====
22
23 {{code language="none"}}
24 jdbc2jdbc --from-url <jdbc-url> --to-url <jdbc-url>
25 {{/code}}
26
27 ==== {{id name="JDBC2XMLUsage-ParseandcopyanXMLfile"/}}Parse and copy an XML file ====
28
29 This can be useful for extracting a schema from a database (see options below)
30
31 {{code language="none"}}
32 xml2xml --from-file <path-to-file> --to-file <path-to-file>
33 {{/code}}
34
35 ==== {{id name="JDBC2XMLUsage-TestDBconnectionandserverstatus"/}}Test DB connection and server status ====
36
37 {{code language="none"}}
38 jdbcping --url <jdbc-url>
39 {{/code}}
40
41 ==== {{id name="JDBC2XMLUsage-ExtractpartsofaDB"/}}Extract parts of a DB ====
42
43 {{code language="none"}}
44 jdbcextr --url <jdbc-url> --file <path-to-file>
45 {{/code}}
46
47 === {{id name="JDBC2XMLUsage-Fulllistofoptions"/}}Full list of options ===
48
49 ==== {{id name="JDBC2XMLUsage-Databaseaccess"/}}Database access ====
50
51 JDBC URL to access the DB (like jdbc:servertype:~/~/host[:port]/db[?options]):
52
53 {{code language="none"}}
54 --from-url "jdbcurl"
55 --to-url "jdbcurl"
56 --url "jdbcurl"
57 {{/code}}
58
59 User to access the DB (some drivers can parse that from the URL):
60
61 {{code language="none"}}
62 --from-user user
63 --to-user user
64 --user user
65
66 {{/code}}
67
68 Password to access the DB (some drivers can parse that from the URL):
69
70 {{code language="none"}}
71 --from-password password
72 --to-password password
73 --password password
74 {{/code}}
75
76 ==== {{id name="JDBC2XMLUsage-Fileaccess"/}}File access ====
77
78 Win32 wrapper needs absolut paths. The given filenames may contain compressed input. The implementation instantiates an appropriate inflating/deflating stream if the filename ends with .gz or .bz2
79
80 {{code language="none"}}
81 --from-file file
82 --to-file file
83 --file file
84 {{/code}}
85
86 ==== {{id name="JDBC2XMLUsage-Restrictprocessingtotables"/}}Restrict processing to tables ====
87
88 Whitelist tables (comma seperated, without whitespace)
89
90 {{code language="none"}}
91 --tables table1,table2,...
92 {{/code}}
93
94 Blacklist tables
95
96 {{code language="none"}}
97 --exclude-tables table1,table2,...
98 {{/code}}
99
100 Do not include table data in dump (creates a full schema from a populated database):
101
102 {{code language="none"}}
103 --no-data
104 {{/code}}
105
106 Ignore constraints
107
108 {{code language="none"}}
109 --no-constraints
110 {{/code}}
111
112 Combined{{code language="none"}}--no-data{{/code}} and {{code language="none"}}--no-constraints{{/code}}
113
114 {{code language="none"}}
115 --schema-only
116 {{/code}}
117
118 ==== {{id name="JDBC2XMLUsage-Expertoptions"/}}Expert options ====
119
120 Drop the affected tables before actually importing a dump. If {{code language="none"}}--tables{{/code}} or {{code language="none"}}--exclude-tables{{/code}} is given, only tables affected by the specified filter are dropped.
121
122 {{code language="none"}}
123 --drop-tables
124 {{/code}}
125
126 Overrides the default bzip2 output compression, if {{code language="none"}}--to-file{{/code}} ends with .bz2
127
128 {{code language="none"}}
129 --compression <n>
130 {{/code}}
131
132 Force a timezone
133
134 {{code language="none"}}
135 --timezone timezoneid
136 {{/code}}
137
138 allows to select a JDBC driver, overriding autoselection
139
140 {{code language="none"}}
141 --from-driver drivername
142 --to-driver drivername
143 --driver drivername
144 {{/code}}
145
146 linux only: add given drivers to the classpath
147
148 {{code language="none"}}
149 --jdbc-drivers jarfilename[;jarfilename...]
150 {{/code}}
151
152 ==== {{id name="JDBC2XMLUsage-Optionsfortranslationtojdbc"/}}Options for translation to jdbc ====
153
154 Change the batch size for inserts (def.: 1000)
155
156 {{code language="none"}}
157 --batch-size n
158 {{/code}}
159
160 Fetch the contents of the database using a read-only transaction
161
162 {{code language="none"}}
163 --transactional
164 {{/code}}
165
166 ==== {{id name="JDBC2XMLUsage-Optionsfortranslationfromxml"/}}Options for translation from xml ====
167
168 Enable schema checking on the xml file
169
170 {{code language="none"}}
171 --check-xml-schema
172 {{/code}}
173
174 Create an extra index on each foreign key
175
176 {{code language="none"}}
177 --create-fk-indices
178 {{/code}}
179
180 ==== {{id name="JDBC2XMLUsage-Optionsfortranslationtoxml"/}}Options for translation to xml ====
181
182 Force or supress pretty printing of xml data
183
184 {{code language="none"}}
185 --pretty, --no-pretty
186 {{/code}}
187
188 Forces the transformation of SQL identifiers to lower case
189
190 {{code language="none"}}
191 --to-lower
192 {{/code}}
193
194 Force the transformation of SQL identifiers to upper case
195
196 {{code language="none"}}
197 --to-upper
198 {{/code}}
199
200 Write internal indices, which are generated by the RDBMS
201
202 {{code language="none"}}
203 --keep-internal-indices
204 {{/code}}
205
206 ==== {{id name="JDBC2XMLUsage-OutputVerbosity"/}}Output Verbosity ====
207
208 The default log level prints {{code language="none"}}Fatal{{/code}}, {{code language="none"}}Error{{/code}} and {{code language="none"}}Warning{{/code}} logs
209
210 Suppresses any output except for the return code
211
212 {{code language="none"}}
213 --quiet
214 {{/code}}
215
216 Increase log-level to {{code language="none"}}Info{{/code}}
217
218 {{code language="none"}}
219 --verbose
220 {{/code}}
221
222 Log everything (command-line spam warning)
223
224 {{code language="none"}}
225 --debug
226 {{/code}}
227
228 Activate loggers in wrapper scripts (only useful if you know what you're doing)
229
230 {{code language="none"}}
231 --debug-startup
232 {{/code}}