Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
BACKUP	 [	 DATABASE	 |	 TABLE	 table_name	 ]		  [	 time_duration	 ]	 INTO [	 DISK	 |	 IBFILE	 ]	 =	 'path/backup_name';

time_duration	 =	 FROM	 start_time	 TO	 end_time
path	 =	 'absolute_path'	 or		  'relative_path'

Example:

Code Block


When backing up a database, types of backup, time duration and location must be inserted. If you want to backup the entire database, insert "DATABASE" as backup type. If you want to back up a specified table, enter "TABLE" and a table name.Example:

With time_duration syntax, you can set a particular period of time for backup. You can select and back up the data by setting up the starting time and date in FROM and the ending time and date in TO part. In the case of example above, "2015-0714 00:00:00" is set in FROM and "2015-07-14 23:59:59" in TO from time_duration syntax so that the user can back up the data for 14th of July in 2015. If none is specified for time_duration, "1970-01-01 00:00:00" will be applied to FROM and the time when you are executing the command will be applied TO.
Now, you need to select the storage medium for backup results. If you want to create the backup with a single file, set to "IBFILE" and set to "DISK" if you want to create it as directory. Caution should be exercised when setting up the path for the backup storage. That is, if you set a relative path, the path will be created in "$MACHBASE_HOME/dbs" of database environments which is currently running. If you want to store the data in other locations rather than "$MACHBASE_HOME/dbs", it is required to type in the absolute path starting with "/" symbol.

...

Syntax:

Code Block
machadmin	 -r	 backup_database_path

Example:

Code Block
 backup	 database	 into	 disk	 =	 '/home/machbase/backup';

 machadmin	 -k	
 machadmin	 -d	
 machadmin	 -r	 /home/machbase/backup;


Extract as a Single File

...

Code Block
machadmin	-x	single_file_backup_file_name	extract_target_path

Example:

...

...

machadmin	-x	backup_20150101.ibf	/db/data/
machadmin	-r	/db/data/backup_20150101.ibf/

Retrieve Information of a Single Backup File

...

Example:

Code Block
machadmin	 -w	 ib_backup01
----------------------------------------------------------------					Machbase	Administration	Tool					Release	Version	-	-
     Machbase Administration Tool
     Release Version - 3.0.0	official					Copyright	2014,	Machbase	Inc.	or	its	subsidiaries					All	Rights	Reserved  official
     Copyright 2014, Machbase Inc. or its subsidiaries
     All Rights Reserved
-----------------------------------------------------------------
Display	 information	 of	 Backup	 Image	 successfully.
-----------------------------------------------------------------					File	name								-	
     File name        - mach_backup_19700101090000_2015072514201 7_3					Create	time						-	20150725142017_3
     Create time      - 2015-07-25	 14:19:22					Data	duration				-	
     Data duration    - 1970-01-01	 09:00:00	 ~	 2015-07-25	 14:20:1 7					Backup	duration		-	17
     Backup duration  - 2015-07-25	 14:20:18	 ~	 2015-07-25	 14:20:1 8					Version										-	18
     Version          - DB(4.0)	 Meta(1.6)	 CM(1.5)
---------------------------------------------------------

...