nimo2000 بتاريخ: 20 سبتمبر 2005 تقديم بلاغ مشاركة بتاريخ: 20 سبتمبر 2005 الاخوة الاعزاءتحية طيبة وكل عام وانتم بخير فى هذه الايام المباركة وعبد فقد وجدت عدد من الصفحات من كتاب oracle utilties boket refrence به شرح ممتاز لعمل export للداتابيز وذلك بواسطة expdb والموجودة فى oracle10g وهى كتالىexpdpUse expdp to extract data and metadata from an Oracle databaseinto an operating system file in order to transport that data toanother Oracle database, copy objects and data from one schemato another, or detect block corruption.TIPexpdp is a new utility in Oracle Database 10g.Syntaxexpdp [login | sysdba_login] [paramval [paramval...]login ::= username[/password][@net_service_name]]sysdba_login ::= \'username/password AS SYSDBA\'paramval ::= {parameter=one_value|parameter=(value1[,value2...]) }parameter ::= {attach=[schema_name.]expdp_job|content={ALL | DATA_ONLY | METADATA_ONLY}|directory=dir_name|dumpfile=[directory_name:]file_name [, ...]|estimate={BLOCKS | STATISTICS}|estimate_only={y|n}|exclude=object_type[:name_filter] [, ...]|filesize=fsize[b | K | M | G]|flashback_scn=fscn|flashback_time=ftime|full={y|n}|help={y|n}|include=object_type[:name_filter] [, ...]|job_name=expdp_job|logfile=[directory_name:]log_name [, ...]|network_link=source_db_link|nologfile={y|n}|parallel=dopexpdp | 35|parfile=parfile_name|query=q|schemas=schema_name [, ...]|status=interval|tables=[schema.]table[:partition] [, ...]|tablespaces=tablespace_name [, ...]|transport_full_check={y|n}|transport_tablespaces=tablespace_name [, ...]|version={COMPATIBLE | LATEST | version_string}Parametersattach=[schema_name.]expdp_jobSpecifies the name of the (already running) data pump exportthe client will be attached to. If you want your client to attachto a job in a schema other than your own, you must have theEXP_FULL_DATABASE role. When this parameter is specified,no other parameter (except the connection string) isallowed. You’ll see an Export> prompt after you connect.content={ALL | DATA_ONLY | METADATA_ONLY}Specifies the type of content for the export. The default valueis ALL, which means that both data and metadata (databaseobject definitions) are exported.directory=dir_nameSpecifies the name of an Oracle directory object, which inturn points to the actual directory to which the export dumpfile(s) and the logfile will be written. If you specify a directoryin the dumpfile and logfile parameters, the directory parameteris overridden.TIPBefore you can use expdp, you must have a directory objectcreated in the database, and the database user musthave read and write privileges (granted via the SQL grantcommand, not at the OS level) on the directory.dumpfile=[directory_name:]file_name [, ...]Specifies the name(s) of the export dumpfile(s). The defaultvalue is expdat.dmp. Optionally, you can also specify thedirectory.36 | Oracle Utilities Pocket Referenceestimate={BLOCKS | STATISTICS}Specifies the method to use to estimate disk space consumedby the export dumpfiles.estimate_only={y|n}Specifies whether to estimate the space that will be consumedby the export, rather than actually exporting.exclude=object_type[:name_filter] [, ...]Specifies the object types for which the metadata will beexcluded from exp. Optionally, you can use an expression tofilter objects based on object names.filesize=fsize[b | K | M | G]Specifies the maximum size of the file(s) to be written by exp.flashback_scn=fscnSpecifies the system change number to which the export willbe consistent. This enables flashback.flashback_time=ftimeSpecifies the timestamp to which the export will be consistent.This is another way to specify the flashback SCN. Theexpdp utility finds the SCN closest to the specified timestamp.full={y|n}Specifies whether to export in full database mode. You needto have the EXP_FULL_DATABASE role to use this mode.help={y|n}Displays a list of expdp parameters. Does no export.include=object_type[:name_filter] [, ...]Specifies the object types for which the metadata will beincluded in the export. Optionally, you can use an expressionto filter objects based on object names.job_name=expdp_jobSpecifies a name for the export job. This name can later beused in the attach parameter to attach a client.logfile=[directory_name:]log_name [, ...]Specifies the name of the logfile. The default value is export.log.Optionally, you can specify a directory object name as well.network_link=source_db_linkSpecifies a database link that is used to export from a remotedatabase.expdp | 37nologfile={y|n}Specifies whether to suppress creation of a logfile.parallel=dopSpecifies the degree of parallelism for the export job, i.e., thenumber of threads of execution for the export job.parfile=parfile_nameSpecifies the name of a file that contains a list of exportparameters and values.query=qSpecifies a WHERE clause you can use to export a subset ofthe data from a table.schemas=schema_name [, ...]Specifies the schemas you want to export. The default value isyour own schema. To be able to export other users’ schemas,you need the EXP_FULL_DATABASE role.status=intervalSpecifies the periodicity (in seconds) at which to display thestatus of the export process.tables=[schema.]table[:partition] [, ...]Specifies a list of tables, or partitions if you wish to be thatgranular, to export.tablespaces=tablespace_name [, ...]Specifies a list of tablespaces to be exported.transport_full_check={y|n}Specifies whether expdp will verify that the transportabletablespaces being exported have no dependency outside theset of tablespaces being exported.transport_tablespaces=tablespace_name [, ...]Specifies the tablespaces for which you want to export transportabletablespace metadata.version={COMPATIBLE | LATEST | version_string}Specifies a version number with which the output dumpfilewill be compatible.ExamplesYou can start the expdp utility by specifying parameters in one oftwo ways: as command-line entries or in a parameter file.38 | Oracle Utilities Pocket ReferenceYou can specify all the desired parameters as command-lineentries, as illustrated in the following example:expdp scott/tiger@sandbox dumpfile=expdp_scott1.dmpdirectory=data_pump logfile=expdp_scott.log job_name=expdp_scott status=100Alternately, you can specify the parameters in a text file called theparameter file, and then use the parfile parameter to specify thename of the parameter file to the expdp command, as illustrated inthe following example:expdp scott/tiger@sandbox parfile=expdp.parThe contents of the parameter file expdp.par are:dumpfile=expdp_scott1.dmpdirectory=data_pumplogfile=expdp_scott.logjob_name=expdp_scottInteractive modeThe expdp utility has an interactive mode as well, which can beused for monitoring and administrative tasks. Start the interactivemode by either pressing Ctrl-C when the job is running, or byinvoking expdp with the attach parameter (discussed earlier).When you invoke the interactive mode, the Export> prompt isdisplayed, and you can use the following commands:add_file=[directory_object]file_name [,...]Adds one or more dumpfiles to the dumpfile set.continue_clientChanges the export mode from interactive mode to loggingmode and, if the job was stopped, restarts it.exit_clientExits the client session and stops logging to the terminal, butthe job continues to run in the background.helpDisplays help information.kill_jobKills the client sessions and the export job.expdp | 39parallel=dopSpecifies the degree of parallelism for the export job, i.e., thenumber of threads of execution for the export job.start_jobRestarts the stopped job you are currently attached to.statusDisplays the status of the job along with estimated percentcomplete, degree of parallelism, and so forth.stop_job[=IMMEDIATE]Stops the job you are currently attached to. If the optionalvalue IMMEDIATE is not specified, it stops after completing thetask it is executing. When you specify IMMEDIATE, it stopsimmediately without completing the current task.The following example illustrates how you can begin an export asa prelude to invoking the interactive mode.C:\>expdp scott/tiger dumpfile=expdp_scott1.dmpdirectory=data_pump logfile=expdp_scott.log job_name=expdp_scott...Starting "SCOTT"."EXPDP_SCOTT": scott/********dumpfile=expdp_scott1.dmp directory=data_pumplogfile=expdp_scott.log job_name=expdp_scottEstimate in progress using BLOCKS method...At this time, press Ctrl-C to invoke the interactive mode. TheExport> prompt appears, at which you can type the interactivemode commands, such as stop_job to stop processing the currentexpdp job.Export> stop_job=immediateAre you sure you wish to stop this job ([y]/n): yC:\>You are prompted to confirm that you want to stop the job. Afteryou press y, you are brought back to the operating system prompt.Having stopped the job, you can query the data dictionary viewDBA_DATAPUMP_JOBS (using SQL*Plus) to find the status ofall the data pump jobs in the database:select owner_name, job_name, operation, state40 | Oracle Utilities Pocket Referencefrom dba_datapump_jobs;OWNER_NAME JOB_NAME OPERATION STATE----------- ------------- ----------- -------SCOTT EXPDP_SCOTT EXPORT IDLINGYou can attach to the stopped job and restart it:C:\>expdp scott/tiger attach=expdp_scottExport> start_jobExport> continue_clientJob EXPDP_SCOTT has been reopened at Saturday, 21August, 2004 22:25Restarting "SCOTT"."EXPDP_SCOTT": scott/********dumpfile=expdp_scott1.dmp directory=data_pumplogfile=expdp_scott.log job_name=expdp_scott... اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
aza بتاريخ: 22 سبتمبر 2005 تقديم بلاغ مشاركة بتاريخ: 22 سبتمبر 2005 الله يجزيك الخير اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
Recommended Posts
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.