UTILITY TO EXPORT/IMPORT DATA Gary M. Noble LDS Church

Slides:



Advertisements
Similar presentations
Chapter 20 Oracle Secure Backup.
Advertisements

18 Copyright © Oracle Corporation, All rights reserved. Transporting Data Between Databases.
CHAPTER 13 Data Pump. Tool that replaces legacy exp/imp utilities Data Pump is a scalable, feature-rich utility that allows you to extract objects and.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
18 Copyright © 2005, Oracle. All rights reserved. Moving Data.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
18 Copyright © 2005, Oracle. All rights reserved. Moving Data.
17 Copyright © 2007, Oracle. All rights reserved. Moving Data.
The New Data Pump Caleb Small Next generation Import / Export New features Better performance Improved security Versatile interfaces.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 12 System and Object Privileges.
CERN - IT Department CH-1211 Genève 23 Switzerland t Transportable Tablespaces for Scalable Re-Instantiation Eva Dafonte Pérez.
Harvard University Oracle Database Administration Session 10 Database Backups.
System Administration Accounts privileges, users and roles
Advanced Databases Basic Database Administration Guide to Oracle 10g 1.
Presenter: Raman Chohan. AGENDA Oracle Best Practices Oracle Backups Why upgrade to Oracle 11? Performance Troubleshooting axiUm Pre-Upgrade Checklist.
Chapter 5 Configuring the RMAN Environment. Objectives Show command to see existing settings Configure command to change settings Backing up the controlfile.
9 Copyright © Oracle Corporation, All rights reserved. Oracle Recovery Manager Overview and Configuration.
CHAPTER 17 Configuring RMAN. Introduction to RMAN RMAN was introduced in Oracle 8.0. RMAN is Oracle’s tool for backup and recovery. RMAN is much more.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
Data Pump in Oracle Database 10 g : Foundation for Ultra-High Speed Data Movement Utilities Session id: George H. Claborn Data Pump Technical Project.
Introduction to Oracle Backup and Recovery
Oracle Database 12c is the latest version of Oracle Corporations flagship database and has added many new features. In this presentation I am capturing.
IS 4510 – Database Administration Module – 2 Database Backup 10/24/20141Compiled by: Zafar Iqbal Khan.
Adapted from Afyouni, Database Security and Auditing DB Auditing Examples (Ch. 9) Dr. Mario Guimaraes.
University of Wolverhampton, UK
Module 8: Server Management. Overview Server-level and instance-level resources such as memory and processes Database-level resources such as logical.
CHAPTER 11 Large Objects. Need for Large Objects Data type to store objects that contain large amount of text, log, image, video, or audio data. Most.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Oracle 10g Data Pump Say good bye to exp and imp (or not)! 2006/02/23 Simon Pane.
By Lecturer / Aisha Dawood 1.  Administering Users  Create and manage database user accounts.  Create and manage roles.  Grant and revoke privileges.
Chapter 7 Making Backups with RMAN. Objectives Explain backup sets and image copies RMAN Backup modes’ Types of files backed up Backup destinations Specifying.
■ Decide on the local database name, and which domain will contain this database. These names are set in the initialization parameters DB_NAME and DB_DOMAIN.
Cao Tiến Đức. Outline What is TDE How TDE works Basic TDE operations Tablespace encryption HSM Reference.
Week 6 Lecture 2 System and Object Privileges. Learning Objectives  Identify and manage system and object privileges  Grant and revoke privileges to.
June 6 th – 8 th 2005 Deployment Tool Set Synergy 2005.
MISSION CRITICAL COMPUTING Moving Data and Other Planning Considerations.
Controlling User Access. Objectives After completing this lesson, you should be able to do the following: Create users Create roles to ease setup and.
Oracle Data Integrator Procedures, Advanced Workflows.
DB Zip Expert Portable database backup and export/import Copyright © SoftTree Technologies, Inc.
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
A Brief Documentation.  Provides basic information about connection, server, and client.
IT Database Administration SECTION 01. Starting Up and Shutting Down the Database Database Administration Facilities – A number of tools are available.
IT Database Administration Section 09. Backup and Recovery Backup: The available options Full Consistent (cold) Backup Database shutdown, all files.
12 Copyright © 2009, Oracle. All rights reserved. Managing Backups, Development Changes, and Security.
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1.
Getting the Most from Oracle Data Pump Roy Swonger Director, Oracle Database Utilities January, 2007.
Distributed Logging Facility Castor External Operation Workshop, CERN, November 14th 2006 Dennis Waldron CERN / IT.
Hyperion Artifact Life Cycle Management Agenda  Overview  Demo  Tips & Tricks  Takeaways  Queries.
2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager.
3 Copyright © 2007, Oracle. All rights reserved. Using the RMAN Recovery Catalog.
Introduction to Utilities for New DBAs Session #332 4/19/2008 Erik Hobbs Introduction to Utilities for New DBAs.
6 Copyright © 2007, Oracle. All rights reserved. Managing Security and Metadata.
 CONACT UC:  Magnific training   
Dept. of Computer & Information Sciences
Controlling User Access
Backup and Recovery.
How To Pass Oracle 1z0-060 Exam In First Attempt?
Managing Privileges.
Managing Privileges.
Export and Import Utilities
Using SQL*Plus.
Oracle Database for APM 9.1
Clonedb: The quick and easy cloning solution you never knew you had.
Using SQL*Plus.
Getting the Most from Oracle Data Pump
Recovering from Noncritical Losses
RAC Performance Lab.
Using the RMAN Recovery Catalog
Managing Privileges.
Using SQL*Plus.
Presentation transcript:

UTILITY TO EXPORT/IMPORT DATA Gary M. Noble LDS Church DATAPUMP UTILITY TO EXPORT/IMPORT DATA Gary M. Noble LDS Church

Background Experience with Oracle Databases Familiar with Export/Import Utility RMAN backups Datapump to replace old Export/Import

Introduction More features than the standard export/import Use in addition to RMAN backups Another means to upgrade to a higher version of Oracle

Why Use Datapump DataPump handles Oracle 10g data types. DataPump features DataPump speed

Datapump Components Command line client expdp Command line client impdp DBMS_DATAPUMP (Datapump API) DBMS_METADATA (Metadata API)

Outline Datapump is faster than standard export/import Setup for datapump export Setup for datapump import Datapump features Experiences Kill the job

Datapump Speed Standard Export and Import utilities ran as clients Datapump is run as part of the database instance on the database server Datapump can do parallel work Create multiple thread processes Create multiple data files (file sets)

Datapump Control Master Control Process Master Table Worker Process

Major Features PARALLEL – maximum number of threads START_JOB – ability to restart a job ATTACH – detach and reattach to job NETWORK_LINK – export and import over network REMAP_DATAFILE – import to a different datafile. REMAP_TABLESPACE – map to new tablespace

Additional Datapump Features Filter by using EXCLUDE and INCLUDE VERSION – specify version of objects. Parameters are compatible, latest, or version number.

DataPump Export Setup Make a server file system directory Create a database directory that references the file system directory Grant read write privileges to the directory Grant privileges for full export Create an export parameter file

Default Datapump Directory Oracle default datapump directory DATA_PUMP_DIR $ORACLE_HOME/rdbms/log/ Information is found in table DBA_DIRECTORIES

Export Preliminary Setup mkdir /backup/<database>/datapump Set up your environment for ORACLE_HOME and ORACLE_SID then sqlplus “/ as sysdba” create DIRECTORY datapump_dir as ‘/backup/<database>/datapump’ ; grant read, write on Directory datapump_dir to <dp_schema> ; grant exp_full_database to <dp_schema> ;

Start Datapump Export Job Expdp parfile=/backup/<database>/datapump/expdp_<database>_<db_schema>.par Expdp <db_schema>/<password> directory=datapump_dir schema=schema dumpfile=expdp_<database>_<schema>.dmp parallel=4 job_name=job_<database>_schema

Example Export Parameter File Userid=<dp_schema>/password Dumpfile=expdp_<database>_<schema>.dmp Logfile=expdp_<database>_<schema>.log Directory=datapump_dir Schemas=schema Job_name=job_expdp_<database>_<schema> Status=240

Datapump Import Setup Make a server file system directory Create a database directory Grant read privileges to directory Grant privileges for full import Create an import parameter file

Import Preliminary Setup mkdir /backup/<database>/datapump Set up your environment for ORACLE_HOME and ORACLE_SID then sqlplus “/ as sysdba” create DIRECTORY datapump_dir as ‘/backup/<database>/datapump’ ; grant read, write on Directory datapump_dir to <dp_schema> grant imp_full_database to <dp_schema>

Start Datapump Import Job impdp parfile=/backup/<database>/datapump/impdp_<database>_<schema>.par impdp <dp_schema>/<password> directory=datapump_dir table_exists_action=truncate dumpfile=impdp_<database>_<schema>.dmp parallel=4 job_name=job_impdp_<database>_<schema>

Example Import Parfile Userid=<dp_schema>/<password> Schemas=<schema> Exclude=grant Directory=datapump_dir Dumpfile=expdp_<database>_<schema>.dmp Table_exists_action=replace

Some Basic Parameters Directory=Datapump_dir - Specify the datapump directory that has been defined in the database Schemas=User1,User2,User3 Dumpfile=datapump_job_file%U.dmp Tables=Table1,Table2 Estimate=Statistics – The default is blocks, to estimate the size of the export

Important Features EXCLUDE you can exclude schemas REMAP_SCHEMA user1 to user2 REMAP_TABLESPACE user1_data to user2_data SQLFILE script of sql (DDL) statements STATUS list status every few seconds JOB_NAME run as an instance job

Exclude EXCLUDE=USER – Exclude a specific user and all objects of that user EXCLUDE=GRANT – Exclude definitions or privileges but not objects of the user EXCLUDE=VIEW, PACKAGE, FUNCTION – Exclude a specific type of object EXCLUDE=INDEX:”LIKE ‘EMP%’” – Exclude indexes whose names start with EMP.

Include INCLUDE=PROCEDURE – Include just the procedure objects INCLUDE=TABLE:”IN (‘MANAGERS’,’FACILITIES’)” INCLUDE=INDEX:”LIKE ‘JOB%’” Note, INCLUDE and EXCLUDE parameters are mutually exclusive

Network_Link NETWORK_LINK=database_link If this is an export then, retrieved data from the referenced database and written to a datapump file. If this is an import then, retrieved data from the referenced database is imported into the current database.

Filters QUERY=employees: ”WHERE department_id >10 AND salary > 10000” QUERY=salary:”WHERE manager_id <> 13” What can I filter with exclude and include – DATABASE_EXPORT_OBJECTS, SCHEMA_EXPORT_OBJECTS, and TABLE_EXPORT_OBJECTS For example – select object_path, comments from schema_export_objects where object_path not like ‘%/%’ ;

Table_Exists_Action Skip Append Truncate Replace

Import Parameters Remap_schema=User1:User2 Remap_tablespace=User1_tblspace:User2_tblspace Transform=OID:N Do not use the original Oracle Identification. Transform=segment_attributes:N Useful when you do not want to keep the original storage definition.

Interactively Work With The Job Check on the status Stop the job Restart the job Kill the job

Check Status of Datapump Job Select job_name, operation, job_mode, state from user_datapump_jobs ; Expdp <dp_schema>/<password> attach=<job_name> Status Exit_Client – Exit client but leave job running Continue_Client – Resume logging

Kill Datapump Job Select job_name, operation, job_mode, state from user_datapump_jobs ; Expdp <dp_schema>/<password> attach=<job_name> Kill_job

Interactive Commands Add_File – Add dumpfile to dumpfile set. Continue_Client – Restart job if idle. Exit_Client – Exit interactive session. Filesize – File size of new files (Add_File). Help – Interactive session commands. Kill_Job – Delete the attached job and exit.

More Interactive Commands Parallel – Specify the maximum number of active workers Set to more than twice the number of CPUs Worker processes are created as needed Reuse_Dumpfiles – Overwrite dump file if it exists Stop_Job – Stop job execution & exit client Start_Job – Start or resume current job

Restrictions DataPump is an Oracle utility, therefore the dump file can only be imported by datapump. You can still get the error snap shot too old. If the job is started using “/ as sysdba”, you need to know the Oracle database system password, to check status, kill job, etc.

Oracle 11g Features Compression – besides none, and metadata_only the new features are all, and data_only Encryption – Oracle 10g exported already encrypted columns. Oracle 11g can encrypt all of the metadata and/or data Data_Options – XML_CLOBS exports XML columns in uncompressed CLOB format

More Oracle 11g Features Partition – On import only. Used to merge partitions into one table. Partition options are departition and merge (all partitions) Transportable – permits exporting metadata for specific tables. Remap_Data – enables data to be modified to obscure sensitive information.

Oracle 11g OEM Tab Data Movement Move Row Data Export to Export files (expdp) Import from Export files (impdp) Import from Database (NETWORK_LINK) Monitor Export and Import Jobs

Problems Encountered The previous run has created the datapump datafile with the same name as current job Space on the tablespaces The job suspends Make the file extensible or add another datafile NFS mounted soft Set event 10298 and bounce the database Migrate to Oracle 11g

Job Will Not Die The datapump processes are killed Drop the master table with the same job name Delete the datapump file The datapump file has been delete or moved Cannot now attach to the job

Review Use datapump as another tool for the DBA Take the time to set it up properly Learn the basic and rich features Create scripts for backups and refreshes

Comments Comments or questions Thank you for coming References: Oracle Database Utilities 10g Release2(10.2), Part #B14215-01 Oracle Database Utilities 11g Release1(11.1), Part#B28319-01 Oracle is a registered trademark of Oracle Corp.

The End Last slide: - Speaker: Gary M. Noble - Session name: Data Pump - Contact information for further questions: noblegm@ldschurch.org Be sure to include UTOUG Training Days in the title. Thank You