The following list only gives the simplest usage of backup and recovery of each database, more detailed parameters and configuration please refer to the relevant information
First, MySQL:
Parameter description:
$user |
$password |
$targethost |
$port |
$charset |
$dbname |
$table |
$filename |
User name |
Password |
IP (local localhost) |
Port |
Coding |
Database name |
Table name (required for table-level backup only) |
Filename |
Backup: Mysqldump--single-transaction-l-u $user-P ' $password '-H $targethost-P $port--default-character-set= $charset $DBN Ame $table > $filename
Recovery: MySQL $dbname-u $user-P ' $password '-H $targethost-P $port--default-character-set= $charset < $filename
Second, SQL Server:
Note: sqlserver2003 and the following only support osql,sqlserver2005 and above at the same time support osql and SQLCMD, the following methods are common to sqlcmd and osql.
Parameter description:
$user |
$passwrod |
$instance |
$dbname |
$filename |
$diff _filename |
User name |
Password |
Instance Name |
Database name |
Full-scale backup file name |
Incremental backup file name |
Full-scale backup: Osql-u $user-P "$password"-D master-s $instance-Q "ALTER DATABASE $dbname SET OFFLINE with ROLLBACK IMMEDIATE; RESTORE DATABASE $dbname from disk= ' $filename ' with REPLACE; ALTER DATABASE $dbname SET ONLINE "
Incremental backup: Osql-u $user-P "$password"-D master-s $instance-Q "ALTER DATABASE $dbname SET OFFLINE with ROLLBACK IMMEDIATE; RESTORE DATABASE $dbname from disk= ' $filename ' with replace,norecovery; RESTORE DATABASE $dbname from disk= ' $diff _filename ' with RECOVERY; ALTER DATABASE $dbname SET ONLINE "
Full volume Recovery: osql-u $user-P "$password"-D master-s $instance-Q "ALTER DATABASE $dbname SET OFFLINE with ROLLBACK IMMEDIATE; RESTORE DATABASE $dbname from disk= ' $filename ' with REPLACE; ALTER DATABASE $dbname SET ONLINE "
Incremental recovery: osql-u $user-P "$password"-D master-s $instance-Q "ALTER DATABASE $dbname SET OFFLINE with ROLLBACK IMMEDIATE; RESTORE DATABASE $dbname from disk= ' $filename ' with replace,norecovery; RESTORE DATABASE $dbname from dist= ' $diff _filename ' with RECOVERY; ALTER DATABASE $dbname SET ONLINE "
Third, Oracle:
Oracle's backup and recovery primarily uses Rman, which is interesting to know more about the specific use of Rman
Four, Redis:
Description: The Redis data backup file is stored in a full path file name consisting of Dir+dbfilename in the configuration file;
Backup: Redis-cli-h targethost-p $port-a $password save
Recovery: Simply place the backup files in the original directory and restart Redis.
Five, MONGO:
Parameter description:
$targethost |
$port |
$dbname |
$backup _dir |
$user |
$password |
$table |
$recovery _dir |
IP Address |
Port |
Database name |
Save path |
User name |
Password |
Table name (table-level recovery) |
Recovery path |
Backup: Mongodump--host $targethost: $port-D $dbname-o $backup _dir-u $user-P $password
Recovery: Mongorestore--host $targethost: $port-D $dbname-u $user-p$password-c $table $recovery _dir
Six, Postgres:
$targethost |
$port |
$user |
$dbname |
$filename |
$recovery _file |
IP Address |
Port |
User name |
Database name |
Backup files |
Recover files |
Backup: Pg_dump-c-b-h $targethost-P $port-U "$user" $dbname > $filename
Recovery: psql-h $targethost-P $port-U "$user"-D $dbname-F $recovery _file
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Mysql,sqlsever,oracle,redis,mongo,postgres database backup and recovery instruction collation