Oracle Data Pump (PUMP)

Source: Internet
Author: User
Tags create directory dba

The people who try hard will not be too bad at last!! Follow the blog or add q:1445696451 to work together!
~~~~~~~ ~ Split~~~~~~~~~
First, Introduction
1. Logical backup: Is the process of creating a logical copy of a database object and depositing it into a binary dump file. Logical backup and logical recovery are essentially the export and import of data.
2. Data pump: a technology that transfers data between databases or between database domain operating systems at high speed. Can be compared to water, then the data pump is like a pump, you can extract the data out to other locations. The data pump tool runs on top of the server, and the database administrator needs to specify the binary data that the database operations directory uses to hold these dumps.
Second, the operation
1. Set up a physical storage directory
Mkdir-p/opt/datapump
Chown-r Oracle:oinstall/opt/datapump
Chmod-r 775/opt/datapump
2. Create Operation Directory
Conn sys/123456 as Sysdba
Create directory Dump_dir as '/opt/datapump/';
3, authorized Scott to Dump_dir readable, writable
Grant Read,write on directory Dump_dir to Scott;
4. Set up test users
Create user Zhangsan identified by 123456;
Grant Connect,resource to Zhangsan;
Grant Read,write on directory Dump_dir to Zhangsan;
5. Operation part
Syntax format
IMPDP/EXPDP User/password Directory=operating_directory_name
Dumpfile=dumpfile_name tables /schemas/tablespaces /full
Comments:
IMPDP: Import
EXPDP: Exporting
Directory=operating_directory_name: Specify Operation directory
Dumpfile=dumpfile_name: Specifying a dump file
Tables : Action Table
Schemas
: Manipulating Users
Tablespaces : Action table Space
full
: Operation All/Entire database
# #还有其他很多参数, not explained in detail, only lists the most common
1) Export/Export the user's table (Backup/restore)
EXPDP Scott/tiger directory=dump_dir dumpfile=scott_emp.dmp tables=emp;
: Export Scott's EMP table named Scott_emp.dmp
IMPDP Scott/tiger directory=dump_dir dumpfile=scott_emp.dmp tables=emp;
: Import emp information from SCOTT_EMP.DMP to Scott
2) The user's table is directed to other users
IMPDP system/123456 Directory=dump_dir dumpfile=scott_emp.dmp
Tables=scott.emp Remap_schema=scott:zhangsan;
: The Scott's EMP meter is directed to the Zhangsan via a data pump. Operation at this time requires a user with DBA authority
3) export user mode (equivalent to user's properties)
EXPDP Scott/tiger directory=dump_dir dumpfile=scottschema.dmp Schemas=scott;
: Export user Scott Mode
IMPDP system/123456 Directory=dump_dir dumpfile=scottschema.dmp
Schemas=scott Remap_schema=scott:zhangsan
: The Scott user mode is directed to Zhangsan, which can be used to deploy Oracle users in bulk. If Scott has a permission, then Zhangsan also get that permission, and in some cases it is possible to say that the same operation requires permission to perform the authorization operation relative to the Zhangsan.
4) Import and export table space
Conn Scott/tiger: Connecting to Scott Users
Create tablespace qwe datafile '/opt/oracle/oradata/orcl/qwe1.dbf ' size 10M
Autoextend on;
: Create a tablespace under Scott Qwe, size 10M, autogrow
EXPDP system/123456 Directory=dump_dir dumpfile=scott_qwe.dmp
Tablespaces=scott
: Exporting Scott's tablespace qwe

IMPDP system/123456 Directory=dump_dir dumpfile=scott_qwe.dmp
Tablespaces=scott: Import (replace EXPDP with IMPDP)
5) Import and export the entire library
EXPDP system/123456 Directory=dump_dir dumpfile=orclfull.dmp full=y: Exporting the entire database is named Orclfull.dmp; in full=y it means backing up the entire library.
IMPDP system/123456 Directory=dump_dir dumpfile=orclfull.dmp full=y
: Import entire database (same as replace EXPDP to IMPDP)
Iii. Summary
1, want to through the data pump import and export operations first, there is a database operation directory
2. Must have read, write permission to the Operation directory
3. If the data you need to import affects other users who need DBA authority
4. DBA authority is required for table space and entire database operations
5, the data pump can operate (import and export) The object has a table, table space, user mode, the entire database.

Oracle Data Pump (PUMP)

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.