Command Line

From SQLBWiki

Jump to: navigation, search

[edit] SQLBrowser Executable

The sqlbrowser executable is located in <sqlbrowser installation directory>/sqlbrowser/bin, for example:

 C:\temp\sqlbrowser\bin\sqlbrowser.exe

[edit] Optional Command Line Arguments

  • --jdkhome <path>
 path to J2SE JDK or JRE. 
 Please note that if you don't specifiy this line, the latest installed JDK will take precedence over the installed JRE, even if the JRE is more recent. 
 Specify this flag if you are in such a situation.
  • --userdir <path>
 path to various caches and var files
 The directory in which sqlbrowser stores caches and other working files can get quite big. This directory is located in your user profile directory by default. 
 If you are concerned by roaming profile size issues, specify a directory located elsewhere
  • -J<jvm_option>
 this passes <jvm_option> to the Java VM, generally you want to increase memory, in this case, use for example -J-Xmx400m
  • -J-DargumentsFileName=<filename>
 this passes some options to SQLBrowser. This is a way to override the user preferences normally set in the application or to launch the batch analysis.
 NB: the file name must be a fully qualified name and not a relative path
  • Format of the Argument File:
 <arguments>
   <option name="myoption" value="myvalue"/>
   <option .../>
   <batch_analysis server="myserver" databases="db1 db2" crdate="31/01/1996" />
 </arguments>
  • option attributes
 name: option names can be either
 1) netbeans specific options, as in <option name="/org/netbeans/core/proxyType" value="2" />
 2)  sqlbrowser options: any simple name found in the file produced by the menu :
 "File / Options / SQLBrowser / Import - Export / View" or a JConnect Property
 prepended with /com/sqlbrowser/sqlbm/ 
 e.g.: "<option name="/com/sqlbrowser/sqlbm/registeredUser" value="Ngx"/>
 Do not use non simple options (options with slashes in their name), such as 
 "servers/SYBRGTOL/successful_connections/00003"
 these options are controlled automatically
 
 JConnect Properties: 
 it is possible to specify JConnect properties: to do so, prefix the option name by the string "jcon_". The option name is the string described in the JConnect Manual. 
 Please note   that not all jConnect options are overidable
 For example to specify a packet size of 1024 add an option like this:  <option name="/com/sqlbrowser/sqlbm/jcon_PACKETSIZE" value="1024"/>

 Note: You ned to prefix the name by /com/sqlbrowser/sqlbm/ which is the fully qualified root for the SQLBrowser application. 
 This allows to use preferences for other netbeans module preference roots.
 value: value for this option

example

 <option name="/org/netbeans/core/proxyType" value="1"/>
 <option name="/com/sqlbrowser/sqlbm/jcon_PACKETSIZE" value="512"/>
 <option name="/com/sqlbrowser/sqlbm/prefs_ba_doGenerateScript" value="true"/>
 <option name="/com/sqlbrowser/sqlbm/prefs_misc_outputDir" value="d:/temp/sqlBrowserOutputDir"/>
 <option name="/com/sqlbrowser/sqlbm/registeredUser" value="NGX"/>
 <option name="/com/sqlbrowser/sqlbm/registeredCompany" value="NGX"/>
 <option name="/com/sqlbrowser/sqlbm/registrationKey" value="XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX"/>


  • batch_analysis attributes
  • When this option is present, sqlbrowser will start a batch analysis immediately after starting and exit at the end of it.
  • This option allows batch analysis to be ran as part of a scheduled task e.g. a Windows Task
 server: name of the server to batch analyze
 databases: blank separated list of database to scan
 crdate: (optional) only scan objects created after this date. Format = DD/MM/YYYY
  • Argument File Example:
 <arguments>
   <option name="/org/netbeans/core/proxyType" value="1"/>
   <option name="/com/sqlbrowser/sqlbm/jcon_PACKETSIZE" value="1024"/>
   <option name="/com/sqlbrowser/sqlbm/prefs_ba_doGenerateScript" value="true"/>
   <batch_analysis server="NGX3" databases="master sybsystemprocs" crdate="31/01/1961" />
 </arguments>


[edit] Command line example

You can find a cmd example file in the bin directory. e.g.

 sqlbrowser.exe --jdkhome "C:\Program Files\Java\jre1.6.0" --userdir "C:\temp\SqlbrowserUserDir" -J-Xmx400m -J-DargumentsFileName="C:/sqlbrowser/exampleArguments.xml"
Personal tools