Backup recovery:
- Backup conditions:
Fixed server role SysAdmin (System Administrator)
Fixed database role db_owner (database owner)
Fixed database role db_backupoperator (users who are allowed to back up the database)
- Backup media (target carrier ):
Hard Disk: The most common
Tape: large capacity, but only used to back up local files
- Method:
Complete (overwrite) and difference (append)
Database and transaction log backup
Database file or file group backup (used when the database is large)
- Backing up a disk to a disk is faster than a tape. backing up a disk to a disk is faster than backing up multiple physical devices and less concurrent operations.
- During backup, the following commands cannot be executed: Create or delete database files, create indexes, and do not remember logs.
- A database can create up to 32 backup files.
Separate additional:
Right-click the database ------ task ------ detach does not affect the entire database, but only the database that affects the detach
Two files are too large to be used.
Import and export:
If the customer database is stored in the system database, use import/export.
No table structure in the target database ---> create the same table structure and import data
The target database has a table structure ---> direct data import
The import and export between databases is essentially the import and export between data.
Import and export between databases and files, provided that the same table structure is created
Copy and paste:
Stopping SQL Server services is a prerequisite for copying MDF and LDF files.
The disadvantage is that if the database is connected to multiple servers, after the database service is stopped, the user cannot access other files in the database through other servers.
Backup separation Import