TimesTen命令—ttBackup

联系:手机/微信(+86 17813235971) QQ(107644445)QQ咨询惜分飞

标题:TimesTen命令—ttBackup

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

ttBackup使用说明

c:\>ttBackup  -h
Usage:
  ttBackup [-h | -help | -?]
  ttBackup [-V | -version]
  ttBackup -dir <directory> [-type <backupType>] [-fname <fileprefix>]
           [-force] {<DSN> | [-connstr] <connStr>}

options:
  -h | -help | -?      Prints this message and exits.
  -V | -version        Prints the release number and exits.
  -type  <backupType>  The type of backup to be performed.  Supported backup
                       types are given below.  Default is "fileFull".
  -dir   <directory>   The directory in which to store the backup files.
  -fname <fileprefix>  The file prefix for the backup files in the backup
                       directory.  Default is the base filename portion of the
                       DataStore parameter of the data store to be backed up.
  -force               Destroy existing backup files before performing backup
                       (full file-based backups only).
  <DSN>, <connStr>     The DSN or ODBC connection string of the data store to
                       be backed up.

Backup types are:
  fileFull         Full backup to the specified backup directory.  The
                   resulting backup is not enabled for incremental backup.
                   This is the default backup type.
  fileFullEnable   Full backup to the specified backup directory.  The
                   resulting backup is enabled for incremental backup.
  fileIncremental  Incremental backup.  Augments pre-existing backup given
                   by '-dir' and optionally '-fname'.
  fileIncrOrFull   If incremental backup is possible, then behaves like
                   "fileIncremental"; else behaves like "fileFullEnable".

NOTE: For above types, '-dir' is required; '-fname' and '-force' are optional.

  streamFull       Full backup to the standard output.  '-dir', '-fname' and
                   '-force' are ignored.
  incrementalStop  Does not perform a backup. Disables an incremental-enabled
                   backup.  '-dir' is required; '-fname' is optional; '-force'
                   is ignored.

ttBackupStatus函数说

全备和增量备份

--全备并启动增量备份功能
c:\>ttbackup -dir E:\oracle\timesten\tt_back\full  -type fileFullEnable    -fname xifenfei01_ -force my_ttdb
Backup started ...
Backup complete

Command> call ttBackupStatus ();
< 2, 0, 1, 2012-02-22 23:13:18.125000, 2012-02-22 23:13:18.505000, 0, 11821056,0, 5896 >
1 row found.

--增量备份
c:\>ttbackup -dir E:\oracle\timesten\tt_back\full  -type fileIncremental  -fname xifenfei01_  -force my_ttdb
Backup started ...
Backup complete

Command> call ttBackupStatus ();
< 2, 0, 0, 2012-02-22 23:19:24.453000, 2012-02-22 23:19:24.702000, 0, 11825152,0, 3960 >
1 row found.

--执行结果
E:\oracle\timesten\tt_back\full>dir
 驱动器 E 中的卷没有标签。
 卷的序列号是 38D0-2A35

 E:\oracle\timesten\tt_back\full 的目录

2012/02/22  23:19    <DIR>          .
2012/02/22  23:19    <DIR>          ..
2012/02/22  23:13        21,119,936 xifenfei01_.0.bac
2012/02/22  23:19        11,943,936 xifenfei01_.0.bac0
2012/02/22  23:19               696 xifenfei01_.sta
               3 个文件     33,064,568 字节
               2 个目录  9,432,420,352 可用字节


--补充说明
1.需要使用fileFullEnable启动增量备份
2.增量备份需要指定dir和fname和全备时一致

fileIncrOrFull测试

c:\>ttbackup -dir E:\oracle\timesten\tt_back\full  -type fileIncrOrFull    -force  -fname xifenfei01_  my_ttdb
Backup started ...
Backup complete

Command> call ttBackupStatus ();
< 2, 0, 0, 2012-02-22 23:47:57.997000, 2012-02-22 23:47:58.174000, 0, 11880448,0, 5740 >
1 row found.

c:\>ttbackup -dir E:\oracle\timesten\tt_back\full  -type fileIncrOrFull    -force  -fname xifenfei00_  my_ttdb
Backup started ...
Backup complete

Command> call ttBackupStatus ();
< 2, 0, 1, 2012-02-22 23:53:37.364000, 2012-02-22 23:53:37.753000, 0, 11886592,0, 5076 >
1 row found.

--补充说明
在有启用增量备份(启用增量的全备或者增量备份本身)的基础上,会自动进行增量备份;
在无启用增量备份(没有备份或者备份没有启用增量备份)的基础上,如果无则会进行全备

streamFull测试

c:\>ttBackup -type streamFull my_ttdb>E:\oracle\timesten\tt_back\full\xifenfei.tream
Backup started ...
Backup complete

Command> call ttBackupStatus ();
< 2, 1, 1, 2012-02-22 23:38:52.480000, 2012-02-22 23:38:52.606000, 0, 11874304,0, 4384 >
1 row found.

c:\>dir E:\oracle\timesten\tt_back\full\xifenfei.*
 驱动器 E 中的卷没有标签。
 卷的序列号是 38D0-2A35

 E:\oracle\timesten\tt_back\full 的目录

2012/02/22  23:38        33,064,596 xifenfei.tream
               1 个文件     33,064,596 字节
               0 个目录  9,399,287,808 可用字节

--补充说明
在linux/unix环境中,执行流备份可以结合dd命令
如:ttBackup -type streamFull FastIns | dd bs=64k of=/dev/rmt0
此条目发表在 TimesTen 分类目录。将固定链接加入收藏夹。

评论功能已关闭。