ExportandImportUtilities18-2ObjectivesAftercompletingthislesson,youshouldbeabletodothefollowing:•DescribetheusesoftheExportandImportutilities•DescribeExportandImportconceptsandstructures•PerformsimpleExportandImportoperations•ListguidelinesforusingExportandImport18-3OracleExportandImportUtilitiesOracledatabaseOracledatabaseExportImport18-4OracleExportandImportUtilityOverviewYoucanusetheseutilitiestodothefollowing:•Archivehistoricaldata•Savetabledefinitionstoprotectthemfromusererrorfailure•MovedatabetweenmachinesanddatabasesorbetweendifferentversionsoftheOracleserver•Transporttablespacesbetweendatabases18-5MethodsofInvokingtheExportandImportUtilities•Command-lineinterface•Aninteractivedialog•Parameterfiles•OracleEnterpriseManager18-6FullDatabaseModeTablesdefinitionsTablesdataGrantsIndexesTablesconstraintsExportModesTableModeTabledefinitionsTabledata(allorselectedrows)Owner’stablegrantsOwner’stableindexesTableconstraintsUserModeTablesdefinitionsTablesdataOwner’sgrantsOwner’sindexesTablesconstraintsTablespaceModeTabledefinitionsGrantsIndexesTableconstraintsTriggers18-7InvokingExport•Syntax:•Examples:exphr/hrTABLES=employees,departmentsrows=yfile=exp1.dmpexpkeyword=value,value2,…,valuenexpsystem/managerOWNER=hrdirect=yfile=expdat.dmpexp\'username/passwordASSYSDBA\'TRANSPORT_TABLESPACE=yTABLESPACES=ts_emplog=ts_emp.log18-8UsingtheExportWizard18-9Direct-PathExportConceptsBuffercacheGenerateSQLcommandsWriteblocksDirectPathDumpfileExportExportOracleServerReadblocksEvaluatingbufferTTCbufferBuffercachemanagerSQLcommandprocessingTwo-Taskcommon(TTC)DirectPathConventionalPath18-10Direct-PathExportFeatures•ThetypeofExportisindicatedonthescreenoutput,exportdumpfile,andthelogfile.•DataisalreadyintheformatthatExportexpects,avoidingunnecessarydataconversion.•UsesanoptimizedSQLSELECTstatement.18-11Direct-PathExportRestrictions•Thedirect-pathoptioncannotbeinvokedinteractively.•Client-sideandserver-sidecharactersetsmustbethesame.•TheBUFFERparameterhasnoaffect.18-12SpecifyingDirect-PathExport•AscommandlineargumenttotheExportcommand:•Asakeywordinaparameterfile:expparfile=Parameterfileexpuserid=hr/hrfull=ydirect=yParameterfile…..(OtherParameters)DIRECT=Y…...(OtherParameters)18-13UsesoftheImportUtilityforRecovery•Createtabledefinitions•ExtractdatafromavalidExportfile•ImportfromacompleteorcumulativeExportfile•Recoverfromuser-errorfailures18-14ImportModesModeDescriptionTableImportspecifiedtablesintoaschema.UserImportallobjectsthatbelongtoaschemaTablespaceImportalldefinitionsoftheobjectscontainedinthetablespaceFullDatabaseImportallobjectsfromtheexportfile18-15InvokingImport•Syntax:•Examples:imphr/hrTABLES=employees,departmentsrows=yfile=exp1.dmpimpkeyword=valueorkeyword=value,value2,…valuenimpsystem/managerFROMUSER=hrfile=exp2.dmpimp\'username/passwordASSYSDBA\'TRANSPORT_TABLESPACE=yTABLESPACES=ts_employees18-16UsingtheImportWizard18-17InvokingImportasSYSDBA•YouneedtoinvokeImportasSYSDBAunderthefollowingconditions:–AttherequestofOracletechnicalsupport–Whenimportingatransportabletablespaceset•ToinvokeImportasSYSDBA:imp\'username/passwordASSYSDBA\'18-18ImportProcessSequence1.Newtablesarecreated2.Dataisimported3.Indexesarebuilt4.Triggersareimported5.Integrityconstraintsareenabledonthenewtables6.Anybitmap,functional,and/ordomainindexesarebuilt18-19GlobalizationSupportConsiderations•TheExportfileidentifiesthecharacterencodingschemethatisusedforthecharacterdatainthefile.•TheImportutilitytranslatesdatatothecharactersetofitshostsystem.•AmultibytecharactersetExportfilemustbeimportedintoasystemthathasthesamecharacteristics.18-20SummaryInthislesson,youshouldhavelearnedhowto:•DescribetheusesofExportandImport•DescribeExportandImportconceptsandstructures•PerformsimpleExportandImportoperations•ListguidelinesforusingExportandImport18-21Practice18OverviewThispracticecoversthefollowingtopics:•UsingtheExportutility•UsingtheImportutility