......................

1555人阅读
转载请注明出处:正确答案:AB&&   Data Pump(Oracle10g版本中引入的,并在11g版本中得到了增强)是用于在Oracle数据库间进行大规模、快速数据传输的工具。一、Data Pump的体系结构  Data Pump是一个服务器端实用程序。我们可以从某个用户进程(使用sql*plus或通过EM)启动Data Pump,但是其所有工作都由服务器进程完成。因为运行在服务器上的Data Pump进程直接访问数据文件与SGA(不必通过会话进行访问),所以与过去的Export/Import实用程序相比,使用Data Pump能够显著地改善性能。此外,我们也可以启动一个Data Pump作业,接着分离这个作业并使其在后台运行。随后,为了监视这个作业的进度,我们随时可以重新连接该作业。许多进程都涉及一个Data Pump作业,两个队列、多个文件以及一个表。接下来,我们首先介结这些进程。   对于Unix系统来说,用户进程为expdp和对于Windows系统来说,用户进程为expdp.exe和impdp.exe。这些用户进程用于启动、控制和监视Data Pump作业。此外还存在一个EnterpriseManager界面。Expdp和expdp用户进程通过某个普通的服务器进程建立一个针对指定数据库的会话。这个会话随后可以发出控制和监视Data Pump作业的命令。启动一个Data Pump作业时,到少会启动两个进程:一个Data PumpMaster进程(DMnn),一个或多个工作者进程(命名为DWnn)。如果多个Data Pump作业同时运行,那么每个作业都具有自己的DMnn进程以及自己的DW进程集合。顾名思义,主进程控制工作者进程。如果启用并行技术,那么每个DWnn进程都可以使用两个或多个并行执行服务器(名称为Pnnn)。  我们需要为每个Data Pump作业创建下面两个队列:一个控制队列和一个状态队列。DM进程会分割所执行的工作,并且将组成指定的作业的不同任务放置在控制队列中。工作者进程获取并执行这些任务,同时可能利用并行执行服务器。控制队列一次递送(deliver-exactly-once)模型上运作,也就是说DMnn进程入列消息,而获取消息的工作者进程则出列消息。状态队列用于完成监视功能,DMnn进程在这个队列中放入描述作业状态消息。状态队列在发布与订阅(publish-and-subscribe)模型上运行,也就是说具有适当权限的任何会话都可以通过查询这个队列来监视指定作业的进度。  Data Pump生成的文件具有下列三种形式:  SQL文件、转储文件以及日志文件。SQL文件是描述指定作业所包含对象的若干DDL语句。我们可以将不包含任何数据的SQL文件生成为可能针对文档编制目的而从数据库中方便获取信息的形式,也可以将其生成为能够重新创建数据库的一组脚本。转储文件包含导出的数据,这些数据用XML标记进行格式化。使用XML意味着:为了描述数据,转储文件中存在相当大的系统开销。与HR示例模式中REGIONS表相似的一个小型表会生成94KB的转储文件,但是对于这种很小的表来说,系统开销可能过大。因此转储文件对于更大的表来说豪无价值。   日志文件则描述了指定作业的运行历史。考点:主记住下列三种Data Dump文件类型:SQL文件、转储文件以及日志文件。&二、目录和位置   Data Pump始终使用Oracle目录。为了定位将要读写的文件及其日志文个件,这些是必需的。应该说有一个目录就够了,但作业通常使用多个目录。如果数据量是要并行写入多个文件的数千M字节数据,那么你可能需要将磁盘活动分布在不同的文件系统的多个目录上。   如果没有在Data Pump命令中指定多个目录,那么将使用默认目录。每个11g数据库都有一个可供使用的Oracle目录,其名称为DATA_PUMP_DIR。如果在创建数据库时已设置了环境变量ORACLE_BASE,那么操作系统位置将是$ORACLE_BASE/admin/database_name/dpdump。如果没设置ORACLE_BASE,那么位置将是$ORACLE_HOME/admin/database_name/dpdump(其中,database_name是数据库的名称)。为了确定数据库的位置,查询DBA_DIRECTORIES目录。但即使此目录是存在的,也并不意味着可以使用它。必须首先为希望使用Data Pump的任何用户授予读写的权限。  可以在4个级别上指定用于Data Pump作业的目录。下面按优先级从高到低的顺序排列这些级别:  (1)& Data Pump作业中每个文件的位置  (2)& 应用于整个Data Pump作业参数  (3)& DATA_PUMP_DIR环境变量  (4)& DATA_PUMP_DIR目录对象&三、使用Data Pump导出1、调用方式(1)、expdp test/test@tnsnamedirectory=dump_dir dumpfile=test.tmp nologfile=y(2)创建参数文件parameter.dat,内容如下:&dumpfile=userexp.dmp&logfile=userexp_exp.log&directory=d_dmp然后通过expdp命令导出,就可以通过下列方式,不需要在命令行中附加参数和参数值:expdp& username/password@tnsnameparfile=parameter.dat&2、Data Pump执行导出SQL&create directoty dump_file_dir as'/data/backup/dmp';SQL&grant read,write on directory dump_file_(1)简单的过滤条件&& expdpusername/password@tnsname directory=dump_file_dir&&& dumpfile=gyj.dmp nologfile=ytables=(medtrade%%)&&&query=medtrade_sell_area:\&wheresupply_id=\'fr20t08872\'\&(2)高级过滤功能&& 创建参数文件zjlpd_tbl.par文件,并保存下列内容:&&directory=dump_file_dir&&dumpfile=zjlpd_med_tbls_.dmp&&logfile=zjlpd_med_tbls__expdp.log&&include=table:&like 'medtrade%'&&&quefy=medtraed_sell_area:\&where supply_id='fr20t08872'&&(3)跨数据库链方式导出数据(源库trans,本地库lxtrans)-----------在本地库中建DB_DBLINK连到源库SQL&conn&/as sysdbaSQL&create database link dblink_jbdb connect totrans identified by trans using 'jboracle_gd';SQL&select sysdate from dual@ dblink_-----------在本地库中建目标,并授权本地要导的用户(lxtrans)SQL&create directory dump_dir as 'f:\oracle\dmp';SQL&grant read,write on directory dump_------导数据(用本地的用户lxtrans导出,加上network_link就可以从远程拉过来)expdp&lxtrans/lxtrans network_link=dblink_jbdb&directory=dump_dir dumpfile=trans.dmp logfile=jboracle_gd.log& &(4)并行方式导出提高效率(在本地直接用并行)expdp zfxfzb/zfsoft_zju directory=gyjdumpfile=zjlpd__%u.dmp&filesize=2 parallel=4&(5)用DBLINK从一库迁到另一库impdp system/manager direcotry=db_dataschemas=hrnetwork_link=devdb.flashback_time= 09:00&& --指导出特定时间点的表&四、Data Pump执行导入1、仅导入对象定义impdp scott/tiger directory=dump_file_dirdumpfile=scott_.dmp nolog=y content=metadata_only2、仅导入数据impdp scott/tiger directory=dump_file_dirdumpfile=scott_.dmp nolog=y content=data_only3、导入数据时清除对象保存的原数据----table_exists_action参数用来控制,如果要导入的表对象存在,执行什么操作,有以下几个参数值:skip,append,truncate,repalceimpdp scott/tiger directory=dump_file_dirdumpfile=scott_.dmp nolog=y table_exists_action=replace4、重定义对象所属schema和表空间-----导入scott用户中的数据到JSS用户下,scott用户的数据保存在scott_tbs表空间和users表空间中,而JSS用户的默认表空间为jsstbs,并且仅对刻表空间拥有读写权限impdp gyj/gyj directory=dump_file_dirdumpfile=scott_.dmp nologfile=y remap_schema=scott:jssremap_tablespace=scott_tbs:jsstbs,users:jsstbs5、通过NETWORK_LINK导出远端数据到本地数据库---通过NETWOR_LINK方式导入zj_lpd用户中的数据到本地jss用户下。首先在jss用户中创建一个连接zj_lpd的数据链SQL&create database link zjlpk_from_db09 connectto zjlpd identified by zj_lpd using '192.168.100.66/DB09'impdp gyj/gyj network_link=zjlpd_from_db09nologfile=y remap_schema=zj_lpd:jss remap_tablespace=zj_lpd:jsstbs6、优化导入效率impdp gyj/gyj directory=dump_file_dirdumpfile=zjlpd_2090618.dmp parallel=2 nologfile=y remap_schema=zj_lpd:jssremap_tablespace=zj_lpd:&7.使用impdp复制Oracle的schema数据迁移create public database link jwgl_link connect tozjgsjwgl identified by zfsoft_zju using '10.11.119.222:1521/jwc';&impdp zjgsjwgl/zfsoft_zju network_link=jwgl_linkschemas=zjgsjwgl remap_schema=zjgsjwgl:zjgsjwgl remap_tablespace=zf:zfQQ:技术交流QQ群:DSI&Core Search &Ⅰ 群:(2000人技术群:未满)DSI&Core Search &Ⅱ 群:(1000人技术群:未满)DSI&Core Search &Ⅲ 群:(500人技术群:未满)DSI&Core Search &Ⅳ 群:(500人技术群:未满)DSI&Core Search &Ⅴ 群:(500人闲聊群:未满)MAIL:dbathink@BLOG:&WEIBO:ITPUB:&OCM: &&
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:324624次
积分:6275
积分:6275
排名:第1308名
原创:242篇
转载:15篇
译文:10篇
评论:93条
OCP认证群:
OCM认证群:
SQL优化群:
JAVA实战群:
Hadoop群:
技术分享群:
文章:97篇
阅读:121303
(1)(2)(1)(1)(2)(2)(10)(6)(1)(1)(5)(5)(1)(3)(24)(30)(31)(23)(5)(5)(10)(20)(78)..................._百度知道
...................
马上要高考了``我是艺术生``从小没怎么学过文化课``现在我该怎么办?在老师和家人的帮助下``我给了自己好大的信心``可是``现在临考试了`我又怕了```我该怎么办?
人生就是这样 事情总要发生的 你怕 它会发生 不怕 也发生 那你选怕 还是不怕那 怕没什么用的 想个办法摆平它 考试吗 考糊了 又怎么样那 有什么关系吗 没什么的 你父母不会怪你的 老师就更不用说了 只要你努力了 就没什么后悔的 阿里的老板 就是那个身价过亿资产的马云 考了3次大学 才考上 可又怎么样了那 没人说他没本事 没人敢说他没本事 什么是实力 任何人 和事情 都不能打倒你 这 就是实力
按默认排序
其他3条回答
不要担心,你也躲不了,顺其自然吧!求采纳
现在还好么?孩子
我只想知道,孩子,你现在好吗
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁1985人阅读
转载请注明出处:
正确答案:D
Oracle 11g新特性之统计信息收集
&& 在以前的数据库版本中,当收集到新的优化器统计信息时会自动发布。在11g中,这仍然是默认的动作,但你多了一个选择,
你可以将最新的统计信息挂起,直到人为地发布它们。DBMS_STATS.GET_PREFS函数运行你检查“PUBLISH”属性,查看统计信息
是否已经自动发布。默认返回的值为TRUE,意味着已经自动发布了,而FALSE表示它还处于挂起状态,等待发布。
& 检查当前数据库的PUBLISH”属性:
gyj@OCM& col get_prefs for a50
gyj@OCM& SELECT DBMS_STATS.get_prefs('PUBLISH','SH','CUSTOMERS') get_prefs FROM
--------------------------------------------------
使用存储过程DBMS_STATS.SET_TABLE_PREFS可以重新设置“PUBLISH”属性,设为FALSE表示它还处于挂起状态,等待发布:
gyj@OCM& BEGIN
DBMS_STATS.SET_TABLE_PREFS('SH', 'CUSTOMERS', 'PUBLISH', 'false');
PL/SQL procedure successfully completed.
gyj@OCM& SELECT DBMS_STATS.get_prefs('PUBLISH','SH','CUSTOMERS') get_prefs FROM
--------------------------------------------------
参考官方文档:
SET_TABLE_PREFS Procedure
This procedure isused to set the statistics preferences of the specified table in the specifiedschema.
DBMS_STATS.SET_TABLE_PREFS (
&&& ownname&&& IN& VARCHAR2,
&&& tabname&&& IN& VARCHAR2,
&&& pname&&&&& IN& VARCHAR2,
& &&pvalue&&&& IN& VARCHAR2);
Parameters
Table 141-93SET_TABLE_PREFS Procedure Parameters
Description
Owner name
Table name
Preference name. The default value for following preferences can be set:
·&&&&&&&& CASCADE
·&&&&&&&& DEGREE
·&&&&&&&& ESTIMATE_PERCENT
·&&&&&&&& METHOD_OPT
·&&&&&&&& NO_INVALIDATE
·&&&&&&&& GRANULARITY
·&&&&&&&& PUBLISH
·&&&&&&&& INCREMENTAL
·&&&&&&&& STALE_PERCENT
CASCADE&- Determines whether or not index statistics are collected as part of gathering table statistics.
DEGREE&- Determines degree of parallelism used for gathering statistics.
ESTIMATE_PERCENT&- Determines the percentage of rows to estimate. The valid range is [0.]. Use the constantDBMS_STATS.AUTO_SAMPLE_SIZE&to have Oracle determine the appropriate sample size for good statistics.
This is the default.
METHOD_OPT&- Controls column statistics collection and histogram creation. It accepts either of the following options, or both in combination:
·&&&&&&&& FOR ALL [INDEXED | HIDDEN] COLUMNS&[size_clause]
·&&&&&&&& FOR COLUMNS [size clause] column [size_clause] [,column [size_clause]...]
size_clause&is defined as&size_clause := SIZE {integer | REPEAT | AUTO | SKEWONLY}
column&is defined as&column := column_name | extension name | extension
- integer&: Number of histogram buckets. Must be in the range [1,254].
- REPEAT&: Collects histograms only on the columns that already have histograms
- AUTO&: Oracle determines the columns to collect histograms based on data distribution and the workload of the columns.
- SKEWONLY&: Oracle determines the columns to collect histograms based on the data distribution of the columns.
-&column_name&: Name of a column
-&extension :&Can be either a column group in the format of&(column_name, colume_name [, ...])&or an expression
The default is&FOR ALL COLUMNS SIZE AUTO.
NO_INVALIDATE&- The value controls the invalidation of dependent cursors of the tables for which statistics are being gathered. Does not invalidate the dependent cursors if set to&TRUE. The procedure invalidates the dependent cursors
immediately if set to&FALSE. Use&DBMS_STATS.AUTO_INVALIDATE&to have Oracle decide when to invalidate dependent cursors. This is the default.
GRANULARITY&- Determines granularity of statistics to collect (only pertinent if the table is partitioned).
'ALL'&- Gathers all (subpartition, partition, and global) statistics
'AUTO'- Determines the granularity based on the partitioning type. This is the default value.
'DEFAULT'&- Gathers global and partition-level statistics. This option is obsolete, and while currently supported, it is included in the documentation for legacy reasons only. You should use the 'GLOBAL AND PARTITION' for this functionality.
Note that the default value is now 'AUTO'.
'GLOBAL'&- Gathers global statistics
'GLOBAL AND PARTITION' - Gathers the global and partition level statistics. No subpartition level statistics are gathered even if it is a composite partitioned object.
'PARTITION&'- Gathers partition-level statistics
'SUBPARTITION'&- Gathers subpartition-level statistics.
PUBLISH&- Determines whether or not newly gathered statistics will be published once the gather job has completed. Prior to Oracle Database 11g, Release 1 (11.1), once a statistic gathering job completed the new statistics were automatically
published into the dictionary tables. The user now has the ability to gather statistics but not publish them immediately. This allows the DBA to test the new statistics before publishing them.
INCREMENTAL&- Determines whether or not the global statistics of a partitioned table will be maintained without doing a full table scan. With partitioned tables it is very common to load new data into a new partition. As new partitions are added
and data loaded, the global table statistics need to be kept up to date. Oracle will update the global table statistics by scanning only the partitions that have been changed instead of the entire table if the following conditions hold:
·&&&&&&&& INCREMENTAL&value for the partitioned table is set to&TRUE;
·&&&&&&&& PUBLISH&value for the partitioned table is set to&TRUE;
·&&&&&&&& User specifies&AUTO_SAMPLE_SIZE&for&ESTIMATE_PERCENT&and&AUTO&for&GRANULARITY&when gathering statistics on the table.
If the&INCREMENTAL&value for the partitioned table was set to&FALSE&(default value), a full table scan is used to maintain the global statistics which is a much more resource intensive and time-consuming operation for large tables.
STALE_PERCENT&- Determines the percentage of rows in a table that have to change before the statistics on that table are deemed stale and should be regathered. The default value is 10%.
Preference value. If&NULL&is specified, it will set the Oracle default value.
Exceptions
: Object doesnot exist or insufficient privileges
: Invalid orillegal input values
Usage Notes
·&&&&&&&&To run this procedure, you need to connect as owner of the tableor should have the&ANALYZE&ANY&systemprivilege.
·&&&&&&&&All arguments are of type&VARCHAR2&and values are enclosed in quotes, even when they representnumbers.
DBMS_STATS.SET_TABLE_PREFS('SH', 'SALES', 'CASCADE', 'DBMS_STATS.AUTO_CASCADE');
DBMS_STATS.SET_TABLE_PREFS('SH', 'SALES','ESTIMATE_PERCENT','9');
DBMS_STATS.SET_TABLE_PREFS('SH', 'SALES', 'DEGREE','99');
&QQ:技术交流QQ群:
DSI&Core Search &Ⅰ 群:(2000人技术群:未满)
DSI&Core Search &Ⅱ 群:(1000人技术群:未满)
DSI&Core Search &Ⅲ 群:(500人技术群:未满)
DSI&Core Search &Ⅳ 群:(500人技术群:未满)
DSI&Core Search &Ⅴ 群:(500人闲聊群:未满)
MAIL:dbathink@BLOG:&WEIBO:ITPUB:&OCM: &&
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:324625次
积分:6275
积分:6275
排名:第1308名
原创:242篇
转载:15篇
译文:10篇
评论:93条
OCP认证群:
OCM认证群:
SQL优化群:
JAVA实战群:
Hadoop群:
技术分享群:
文章:97篇
阅读:121303
(1)(2)(1)(1)(2)(2)(10)(6)(1)(1)(5)(5)(1)(3)(24)(30)(31)(23)(5)(5)(10)(20)(78)....................._土豆_高清视频在线观看}

我要回帖

更多关于 变形计 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信