- 데이터베이스 백업
- 데이터베이스 복구
- 단일 백업 파일 추출
- 단일 백업 파일의 정보 확인
데이터베이스 백업
...
Database Backup
There are two methods of Machbase backup:
1. 현재 DB의 전체 백업Full backup of current DB
2. 특정 테이블만 선택해서 백업Select and backup only specific tables
Syntax:
Code Block | ||
---|---|---|
| ||
BACKUP [ DATABASE | TABLE table_name ] [ time_duration ] INTO [ DISK ] = 'path/backup_name'; time_duration = FROM start_time TO end_time path = 'absolute_path' or 'relative_path' BACKUP [ DATABASE | TABLE table_name ] AFTER 'previous_backup_dir' |
...
Code Block |
---|
# Directory backup BACKUP DATABASE INTO DISK = 'backup_dir_name'; # Set backup duration - Directory backup BACKUP DATABASE FROM TO_DATE('2015-07-14 00:00:00','YYYY-MM-DD HH24:MI:SS') TO TO_DATE('2015-07-14 23:59:59','YYYY-MM-DD HH24:MI:SS') INTO DISK = '/home/machbase/backup_20150714' |
백업 명령을 실행할 때, 백업 타입과 duration 시간 조건절, 백업 대상 경로를 반드시 정의하여야 한다. 전체 데이터베이스를 백업하려면 "DATABASE"를, 특정 테이블을 백업하려면 "TABLE"을 백업 타입에 지정하고, 특정 테이블을 백업할 때에는 테이블 이름을 지정하여야 한다.
DURATION 조건절을 이용하여 백업 대상을 지정할 수 있다. 백업 대상 데이터의 시작 시간과 끝 시간을 FROM 및 TO 절에서 지정한다. 위 예제에서 When executing the backup command, the backup type, duration condition, and backup destination path must be defined. To back up the entire database, you must specify "DATABASE". To back up specific tables, specify "TABLE" as the backup type. When backing up specific tables, you must specify the table name.
You can specify the backup destination using the DURATION conditional statement. Specify the start time and end time of the backup target data in the FROM and TO clauses. In the example above, "2015-07-14 00:00:00" 가 FROM으로 정의되었고, is defined as FROM and "2015-07-14 23:59:59" 이 TO로 정의되었으므로, 사용자는 2015년 7월 14일의 전체 데이터를 백업하는 것이다. duration 시간 조건절을 지정하지 않으면 is defined as TO, so the user will be able to see all data for July 14, 2015 Quot; Duration If you do not specify a time condition, "1970-01-01 00:00:00" 이 FROM으로 설정되고 실행되는 현재 시점이 TO절에 설정된다.DURATION절은 Tag 테이블과 Tag 테이블을 포함하는 DATABASE에서는 이용할 수 없으며, 추가된 데이터만을 백업하려면 증분 백업 (Backup .... AFTER is set to FROM and the current time at which it is executed is set in the TO clause.
The DURATION clause cannot be used in the DATABASE including the tag table and the tag table, and to back up only the added data, you must perform the incremental backup (Backup .... AFTER 'previous_backup')
...
statement.
Specify "IBFILE" to create a backup file as a single file, or "DISK" as a backup option to create multiple files and directories. Note that when specifying a backup path, backup files are created under "$ MACHBASE_HOME / dbs" 아래에 백업 파일들이 생성되므로 주의하여야 한다. 절대 경로를 지정하려면 항상 "/"로 시작하는 경로를 설정하여야 한다.
데이터베이스 복구
백업 파일에서 데이터 복원을 수행할 때는 질의 명령으로 수행할 수 없으며, "machadmin -r" 명령을 데이터베이스가 동작하지 않는 상황에서 실행해야 한다. 백업 실행 이전에 다음의 조건들을 검토해야 한다.
...
when a relative path is specified. To specify an absolute path, you must always set a path that starts with "/".
Database Recovery
When restoring data from a backup file, it can not be executed by a query command, and the command "machadmin -r" should be executed in a situation where the database does not operate. Before running the backup, you should review for the following conditions:
- Is the Machbase database down?
- Is the current database deleted and replaced with the data to be recovered, and is the deletion of the current database allowed?
For incremental backup, previous full backup file is required.
Syntax:
Code Block |
---|
machadmin -r backup_database_path |
...