Mysqldump is a common mysql database tool. We often use it for data and backup, for example, data import and export. This article introduces the code for exporting the most basic database and exporting tables.]
# Mysqldump Database Name> Database
Mysql backup and database restoration mysqldump instance and parameter description mysqldump
BitsCN.com
We will certainly encounter the situation of backing up the database and restoring the database during the operation of the project. we generally use the following two methods to deal with it:
1. use into outfile and
Tags: incremental nod alter MySQL backup cannot back up art so useIn MySQL database scenario, when using the mysqldump command backup, we will encounter a lock table problem? If the lock table is made, the user cannot access the number during the backup, if the
the SQL script.
Note:If the operator has sufficient permissions, a prompt is displayed.Whether the database can be connected or not. You can use tnsping TestDB to obtain whether the database can be connected.
Appendix 1:Add data import permissions to usersFirst, start SQL * pulsSecond, log in with system/managerThird, create user username identified by password. If you have already created a user, skip thi
We will certainly encounter the situation of backing up the database and restoring the database during the operation of the project. We generally use the following two methods to deal with it:
1. Use into outfile and load data infile to import and export backup data
The advantage of this method is that the exported data can be in the specified format and exported
Tags: otherwise password HTTPS--format out alter INNODB existsDescription: MySQL innodb and MyISAM type database, the latest version of this tool seems to have been supported, previously may exist in the MyISAM only cold backup way of saying.To back up the specified library:Mysqldump-h127.0.0.1-uroot-p--lock-tables--events--triggers--routines--flush-logs--master-
) "Full" incremental export (complete)//back up the entire database$ exp user/pwd file=/dir/xxx.dmp Log=xxx.log inctype=complete(2) "incremental" incremental export exports the data that was changed after the last backup.$ exp user/pwd file=/dir/xxx.dmp Log=xxx.log inctype=incremental(3) "Cumulative" incremental export (cumulative) Only exports changes in the database
must be backed up. If the file is damaged, the database will no longer be started.
SQL> select name from V $ controlfile;
Name--------------------------------------------------------------D:/Oracle/oradata/ora92/control01.ctlD:/Oracle/oradata/ora92/control02.ctlD:/Oracle/oradata/ora92/control03.ctl
(2) Data File: saves user data files and must be backed up:
SQL> select name from V $ datafile;
Name---------
( empno int PRIMARY KEY, ... Deptno int, CONSTRAINT fk_emp FOREIGN KEY (MGR) REFERENCES EMP (empno) ); To add a foreign key constraint when modifying a table ALERT TABLE EMP AddConstraint fk_emp_deptno FOREIGN KEY (deptno) REFERENCES dept (DEPTNO); To delete a foreign key constraint when modifying a table ALTER TABLE EMP DROP FOREIGN KEY fk_emp_deptno;/* constraint name */ -------------------------- 7 Relationship between a
Database Backup
Restore database:
Keywords: Alter database recovered database name set offline with rollback immediate;
From disk = 'backup file path ';
. Create a test table named test1.
Create table test1 (Ts int, tsname varchar2 (30 ));
6. Create a backup directory and use exp to export the data (executed on the server)
[Oracle @ u01] $ mkdir dump
[Root @ u01] # chown-R oracle: oinstall dump
[Root @ u01] # chmod 775 dump
[Oracle @ dump] $ exp
Export: Release 10.2.0.1.0-Production on Wed May 16 06:44:20 2012
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Username: sys as sysdbaPassword:
C
1. First, I created a user named "bkjia" and set his password to "bkjia123" (an SQL statement operated as sys)
Create user bkjia identified by bkjia123;
2. assign some permissions to new users
Grant create session to bkjia;Grant create table to bkjia;
3. Create a directory to store files. (Root operation on the server. And modify the owner and group attributes for this object)
[Root @ www.bkjia.com ~] # Cd/u01/
[Root @ www.bkjia.com u01] # mkdir ts
[Root @ www.bkjia.com u01] # chown-R Oracle: oi
the backup dataUSE masterEXEC sp_addumpdevice disk, testBack, c: \ mssql7backup \ MyNwind_1.dat
--- Start backupBackup database pubs TO testBack
27. Description: Create a new tableCreate table tabname (col1 type1 [not null] [primary key], col2 type2 [not null],...)Create a new table based on an existing table:A: create table tab_new like tab_old (use the old table to create A new table)B: create table tab_
Tags: Modify OCA res scope control File View 11g routed iOS1. Understanding Backup and Recovery issuesThree indicators related to backup recovery are: MTBF average trouble-free timeMTTR mean failure recovery time.Data loss: How much to lose the book data.There are three advanced options for Oracle RAC Steam and DG that have an impact on performance (good bad)2. Type of failure1) Statement failure: DML state
1. backup and recovery problems
The final result of considering business needs, performance, and capital costs is usually a compromise. It is extremely important to record this scheme, usually in the form of a service level agreemenet ).
The service level agreement is related to backup and recovery in three aspects:
Mean Time (mean time Betwwen failures, MTBF)
Mean time to recover (MTTR)
Data Loss
The
1. Copy the cold backup data files, log files, and control files to the target folder. 2. Create a pfile of init: $ ORACLE_SID.ora.
1. Copy the cold backup data files, log files, and control files to the target folder. 2. Create a pfile of init: $ ORACLE_SID.ora.
1. Copy the cold backup data files, log files, and control files to the target folder.
2. Cre
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.