Jump to: navigation, search

Difference between revisions of "UBIK DBTool"


(Created page with "The command line applictaion DBTool can be used for managing UBIK.Databases (and partially also for any other database) on a Microsoft SQL Server: Usage: DBTOOL <COMMAND> /<p...")
 
Line 57: Line 57:
 
DBTOOL RUN /server myservername /user myusername /pwd mypassword /spi false /cat mynewcatalog /sql "SELECT * from mytable"
 
DBTOOL RUN /server myservername /user myusername /pwd mypassword /spi false /cat mynewcatalog /sql "SELECT * from mytable"
  
==================
+
===Examples===
AUGMENSYS-EXAMPLES
+
==================
+
  
//RUN
+
RUN
dbtool RUN /sql "SELECT * FROM dbo.UST_BASECLASS" /cat "UBIK.MANUALTEST02" /server "auglnz2sql" /user "sa" /pwd ****** /verbose false
+
dbtool RUN /sql "SELECT * FROM dbo.UST_BASECLASS" /cat "UBIK.TEST" /server "sqlserver" /user "sa" /pwd ****** /verbose false
dbtool RUN /sql "update UST_SYSTEMSETTINGS set PR_VALUE='\\auglnz0file\UBIKData\DBG\UBIK.MANUALTEST07' where PR_KEY=0" /cat "UBIK.MANUALTEST02" /server "auglnz2sql" /user "sa" /pwd ******
+
dbtool RUN /sql "update UST_SYSTEMSETTINGS set PR_VALUE='\\fileserver\UBIKData\UBIK.TEST.COPY' where PR_KEY=0" /cat "UBIK.TEST.COPY" /server "sqlserver" /user "myuser" /pwd "mypwd"
  
//UBIKSET
+
UBIKSET
dbtool UBIKSET /cat "UBIK.MANUALTEST02" /server auglnz2sql /user sa /pwd ******* /key 0 /setting "\\auglnz0file\UBIKData\DBG\UBIK.MANUALTEST08"
+
dbtool UBIKSET /cat "UBIK.TEST:COPY" /server sqlserver /user myuser /pwd mypwd /key 0 /setting "\\fileserver\UBIKData\UBIK.TEST.COPY"
  
//RESTORE
+
RESTORE
dbtool RESTORE /cat UBIK.MANUALTEST03 /server auglnz2sql /user sa /pwd ******* /bak "C:\MSSQL\Backup\DBG\AUG\UBIK.MANUALTEST\UBIK.MANUALTEST.bak"
+
dbtool RESTORE /cat UBIK.MANUALTEST03 /server auglnz2sql /user myuser /pwd mypwd /bak "C:\MSSQL\Backup\UBIK.TEST.bak"
dbtool RESTORE /cat UBIK.MANUALTEST04 /server auglnz2sql /user sa /pwd ******* /bak "C:\MSSQL\Backup\DBG\AUG\UBIK.MANUALTEST\UBIK.MANUALTEST.bak" /force true /ndpath "C:\MSSQL\Data\UBIK.MANUALTEST04.mdf" /nlpath "C:\MSSQL\Data\UBIK.MANUALTEST04.ldf" /odname "UBIK.Simulation" /olname "UBIK.Simulation_log"
+
dbtool RESTORE /cat UBIK.MANUALTEST04 /server auglnz2sql /user sa /pwd mypwd /bak "C:\MSSQL\Backup\UBIK.TEST.bak" /force true /ndpath "C:\MSSQL\Data\UBIK.TEST.COPY.mdf" /nlpath "C:\MSSQL\Data\UBIK.TEST.COPY.ldf" /odname "UBIK.TEST" /olname "UBIK.TEST_log"

Revision as of 09:07, 27 March 2018

The command line applictaion DBTool can be used for managing UBIK.Databases (and partially also for any other database) on a Microsoft SQL Server:

Usage: DBTOOL <COMMAND> /<parameter> <value> etc.

DBTOOL RESTORE (restore a database)

Parameters

/server ... the database server (e.g. /server "mysqlserver")
/user   ... (optional) the database user (e.g. /user sa, default: sa)
/pwd    ... (optional) the database user's password (e.g. /pwd ***), not required for SPI!
/spi    ... (optional) integrated security 'true' = yes, 'false' = no (default false).
/cat    ... the new catalog's name (e.g. /cat "XYZ")
/bak    ... the backup file path (e.g. /bak "C:\SQL\BAK\XYZ01.bak")
/force  ... (optional) force existing databases and/or data/log files to be overwritten! (default: false)
/ndpath ... (optional) the path of the new data file on the server (e.g. /ndpath "C:\SQL\DATA\XYZ02.mdf")
/nlpath ... (optional) the path of the new log file on the server (e.g. /nlpath "C:\SQL\DATA\XYZ02.ldf")
/odname ... (optional) the path of the original data file on the server (e.g. /odname "XYZ01.mdf")
/olname ... (optional) the path of the original log file on the server (e.g. /originallogfilename "XYZ01.mdf")

Examples:

DBTOOL restore /server myservername /user myusername /pwd mypassword /spi false /cat mynewcatalog /bak "C:\MSSQL\Backup\mybackup.bak"

DBTOOL restore /server myservername /user myusername /pwd mypassword /spi false /cat mynewcatalog /bak "C:\MSSQL\Backup\mybackup.bak" /force false /ndpath "C:\SQL\Data\mynewcatalog.mdf" /nlpath "C:\SQL\Data\mynaewcatalog.ldf" /odname myoriginalcatalog /olname myoriginalcatalog_log


DBTOOL UBIKSET (set a UBIK setting value)

Parameters

/server  ... the database server (e.g. /server "mysqlserver")
/user    ... (optional, default: sa) the database user (e.g. /user sa)
/pwd     ... (optional, default: empty) the database user's password (e.g. /pwd ***), not required for SPI!
/spi     ... (optional, default: false) integrated security 'true' = yes, 'false' = no.
/cat     ... the catalog's name (e.g. /cat "XYZ")
/key     ... the system setting key (e.g. /key 0)
/setting ... the system setting key (e.g. /setting 0)

Examples:

DBTOOL UBIKSET /server myservername /user myusername /pwd mypassword /spi false /cat mynewcatalog /key 0 /setting "\\myserver\mydatapath"


DBTOOL RUN (run a sql expression)

Parameters

/server ... the database server (e.g. /server "mysqlserver")
/user   ... (optional, default: sa) the database user (e.g. /user sa)
/pwd    ... (optional, default: empty) the database user's password (e.g. /pwd ***), not required for SPI!
/spi    ... (optional, default: false) integrated security 'true' = yes, 'false' = no.
/cat    ... the catalog's name (e.g. /cat "XYZ")
/sql    ... the expression (e.g. /sql "SELECT * FROM mytable")
/sep    ... (optional, default ";") the expression (e.g. /sep "\t")

Examples:

DBTOOL RUN /server myservername /user myusername /pwd mypassword /spi false /cat mynewcatalog /sql "SELECT * from mytable"

Examples

RUN dbtool RUN /sql "SELECT * FROM dbo.UST_BASECLASS" /cat "UBIK.TEST" /server "sqlserver" /user "sa" /pwd ****** /verbose false dbtool RUN /sql "update UST_SYSTEMSETTINGS set PR_VALUE='\\fileserver\UBIKData\UBIK.TEST.COPY' where PR_KEY=0" /cat "UBIK.TEST.COPY" /server "sqlserver" /user "myuser" /pwd "mypwd"

UBIKSET dbtool UBIKSET /cat "UBIK.TEST:COPY" /server sqlserver /user myuser /pwd mypwd /key 0 /setting "\\fileserver\UBIKData\UBIK.TEST.COPY"

RESTORE dbtool RESTORE /cat UBIK.MANUALTEST03 /server auglnz2sql /user myuser /pwd mypwd /bak "C:\MSSQL\Backup\UBIK.TEST.bak" dbtool RESTORE /cat UBIK.MANUALTEST04 /server auglnz2sql /user sa /pwd mypwd /bak "C:\MSSQL\Backup\UBIK.TEST.bak" /force true /ndpath "C:\MSSQL\Data\UBIK.TEST.COPY.mdf" /nlpath "C:\MSSQL\Data\UBIK.TEST.COPY.ldf" /odname "UBIK.TEST" /olname "UBIK.TEST_log"