OWB 映射挂起或花费太长时间 - 可能锁定?
Posted
技术标签:
【中文标题】OWB 映射挂起或花费太长时间 - 可能锁定?【英文标题】:OWB mapping hangs or takes too long - possible lock? 【发布时间】:2011-05-23 02:07:09 【问题描述】:我是 Oracle Warehouse Builder 11gR2 的新手,但已经不喜欢它了!我在具有 2GB RAM 和 XP 32 位的 VM 中使用它。
我有 9 个从平面文件到目标、从源关系 BD 到目标等的映射。其中 3 个映射中的问题似乎是当我从源和舞台区域连接表时。我不知道它是否相关,但我的源数据库与舞台区域(目标)在同一台机器上,但在不同的表空间中。
我可以告诉你:1- 我是如何创建源数据库用户表空间的:
CREATE TABLESPACE insrc DATAFILE 'C:\IN\tablespaces\in_src.dbf' SIZE 100M;
CREATE TEMPORARY TABLESPACE insrc_temp TEMPFILE 'C:\IN\tablespaces\insrc_temp.dbf' SIZE 50M;
CREATE USER insrc IDENTIFIED BY insrc DEFAULT TABLESPACE insrc TEMPORARY TABLESPACE insrc_temp QUOTA 0 on system;
GRANT ALL PRIVILEGES TO insrc;
-- Grant this role to be able to import a dump file
GRANT IMP_FULL_DATABASE to insrc;
-- Grant this role to be able to export to a dump file
GRANT EXP_FULL_DATABASE to insrc;
然后,在 cmd 行中,我像这样导入:imp SYSTEM/%PASSWORD_DO_ORACLE% FROMUSER=trab2 TOUSER=insrc file='trab2.DMP'
2- 我如何为目标舞台区域用户表空间和角色创建表空间:
CREATE TABLESPACE indw DATAFILE 'C:\IN\tablespaces\indw.dbf' SIZE 128M AUTOEXTEND ON NEXT 512K MAXSIZE 250M;
CREATE TEMPORARY TABLESPACE indwtemp TEMPFILE 'C:\IN\tablespaces\indwtemp.dbf' SIZE 3M AUTOEXTEND ON NEXT 512K MAXSIZE 200M;
CREATE USER indw IDENTIFIED BY indw DEFAULT TABLESPACE indw TEMPORARY TABLESPACE indwtemp;
ALTER USER indw account unlock;
GRANT CREATE SESSION TO indw;
-- grant all system privileges
GRANT ALL PRIVILEGES TO indw;
-- grant all ROLES
GRANT "OLAP_XS_ADMIN" TO "INDW" ;
GRANT "WFS_USR_ROLE" TO "INDW" ;
GRANT "DELETE_CATALOG_ROLE" TO "INDW" ;
GRANT "HS_ADMIN_SELECT_ROLE" TO "INDW" ;
GRANT "CWM_USER" TO "INDW" ;
GRANT "SPATIAL_WFS_ADMIN" TO "INDW" ;
GRANT "OLAP_DBA" TO "INDW" ;
GRANT "OWB$CLIENT" TO "INDW" ;
GRANT "RESOURCE" TO "INDW" ;
GRANT "APEX_ADMINISTRATOR_ROLE" TO "INDW" ;
GRANT "OWB_DESIGNCENTER_VIEW" TO "INDW" ;
GRANT "CTXAPP" TO "INDW" ;
GRANT "SPATIAL_CSW_ADMIN" TO "INDW" ;
GRANT "GATHER_SYSTEM_STATISTICS" TO "INDW" ;
GRANT "AUTHENTICATEDUSER" TO "INDW" ;
GRANT "CONNECT" TO "INDW" ;
GRANT "HS_ADMIN_EXECUTE_ROLE" TO "INDW" ;
GRANT "PLUSTRACE" TO "INDW" ;
GRANT "LOGSTDBY_ADMINISTRATOR" TO "INDW" ;
GRANT "JAVADEBUGPRIV" TO "INDW" ;
GRANT "XDB_WEBSERVICES_WITH_PUBLIC" TO "INDW" ;
GRANT "XDBADMIN" TO "INDW" ;
GRANT "XDB_WEBSERVICES_OVER_HTTP" TO "INDW" ;
GRANT "CSW_USR_ROLE" TO "INDW" ;
GRANT "OLAPI_TRACE_USER" TO "INDW" ;
GRANT "JAVAIDPRIV" TO "INDW" ;
GRANT "DBFS_ROLE" TO "INDW" ;
GRANT "ADM_PARALLEL_EXECUTE_TASK" TO "INDW" ;
GRANT "AQ_ADMINISTRATOR_ROLE" TO "INDW" ;
GRANT "JAVA_DEPLOY" TO "INDW" ;
GRANT "OEM_MONITOR" TO "INDW" ;
GRANT "XDB_WEBSERVICES" TO "INDW" ;
GRANT "JAVAUSERPRIV" TO "INDW" ;
GRANT "MGMT_USER" TO "INDW" ;
GRANT "OWB_USER" TO "INDW" ;
GRANT "JAVA_ADMIN" TO "INDW" ;
GRANT "JMXSERVER" TO "INDW" ;
GRANT "EXECUTE_CATALOG_ROLE" TO "INDW" ;
GRANT "SCHEDULER_ADMIN" TO "INDW" ;
GRANT "DATAPUMP_IMP_FULL_DATABASE" TO "INDW" ;
GRANT "WM_ADMIN_ROLE" TO "INDW" ;
GRANT "ORDADMIN" TO "INDW" ;
GRANT "AQ_USER_ROLE" TO "INDW" ;
GRANT "DATAPUMP_EXP_FULL_DATABASE" TO "INDW" ;
GRANT "SELECT_CATALOG_ROLE" TO "INDW" ;
GRANT "RECOVERY_CATALOG_OWNER" TO "INDW" ;
GRANT "OLAP_USER" TO "INDW" ;
GRANT "DBA" TO "INDW" ;
GRANT "JAVASYSPRIV" TO "INDW" ;
GRANT "XDB_SET_INVOKER" TO "INDW" ;
GRANT "HS_ADMIN_ROLE" TO "INDW" ;
GRANT "EJBCLIENT" TO "INDW" ;
GRANT "OEM_ADVISOR" TO "INDW" ;
ALTER USER "INDW" DEFAULT ROLE "EXP_FULL_DATABASE","IMP_FULL_DATABASE";
-- Might be needed ...just in case
-- run plustrace.bat before grant this privilege
-- GRANT plustrace TO indw;
/* To create a database directory, a user requires the CREATE DIRECTORY and DROP DIRECTORY privileges.
When you create a Warehouse Builder user, these privileges are not automatically granted
to the user. Therefore, the database administrator must explicitly grant these privileges
to the Warehouse Builder user.*/
GRANT CREATE ANY DIRECTORY TO indw;
GRANT DROP ANY DIRECTORY TO indw;
有问题的映射之一是 CLIENTS_MAPPING,它需要 CUSTOMERS(来自 src)、COUNTRIES(来自 src)、DEMOGRAPHY(来自目标)和 CLIENT_LAST_BUY(也来自目标)。插入应该包含 50,000 行,并且需要 30 多分钟,并且 CLIENTS 表上根本没有数据。
此问题也发生在包含源和目标表的其他映射上。当我只从一个地方或另一个地方使用时,没有问题。
我将把我的 Power Designer 自动生成的表 CLIENTS 代码留给您,如上所述:
create table CLIENTS
(
CLIENT_ID NUMBER not null,
CLIENT_ID_SRC NUMBER,
COUNTRY_ID_SRC CHAR(2 BYTE),
DEMOG_ID NUMBER not null,
CLIENT_NAME VARCHAR2(70),
CLIENT_BIRTH_YEAR NUMBER(4),
CLIENT_PHONE VARCHAR2(25),
CLIENT_CREDIT_LIMIT NUMBER,
CLIENT_EMAIL VARCHAR2(30),
CLIENT_STREET_ADDRESS VARCHAR2(40),
CLIENT_LAST_BUY DATE,
CLIENT_COUNTRY VARCHAR2(40),
CLIENT_STATE_PROVINCE VARCHAR2(50),
CLIENT_CITY VARCHAR2(50),
constraint PK_CLIENTS primary key (CLIENT_ID)
);
/*==============================================================*/
/* Index: CLIENT_INFO_FK */
/*==============================================================*/
create index CLIENT_INFO_FK on CLIENTS (
DEMOG_ID ASC
);
alter table CLIENTS
add constraint FK_CLIENTS_INFO foreign key (DEMOG_ID)
references DEMOGRAPHY (DEMOG_ID);
我以 rep_owner 身份登录 OWB GUI(拥有所有权限)。奇怪的是,我的同事在 OWB 11gR1 的机器上运行了这个精确的映射并且没有任何问题。但他将源数据库导入到目标用户……这是他所做的唯一不同的事情。
有人可以帮帮我吗?
【问题讨论】:
【参考方案1】:检查 DBA_RESUMABLE,您可能会用完临时表空间。
您可能想尝试尽可能多地组合您的表空间。您划分的存储越多,Oracle 就越容易耗尽空间。
【讨论】:
你是说我应该尝试,例如,为源文件和目标文件设置相同的临时文件。我会尝试使用默认文件,只是为了看看事情是否以这种方式运行得更好。谢谢 我已将用户从源和目标更改为使用默认临时表空间。每个用户都使用其表空间,但数据文件不在我同事创建的 oradata/sid 文件夹中。这会产生如此巨大的影响吗?我还能做些什么来破坏映射的执行?因为它没有给我错误或超时......但是一个多小时过去了,我仍然插入了 0 行: ( 如果您的模式在同一个数据库上,通常最好的办法是让它们尽可能共享相同的表空间。例如,使用您当前的设置,您无法对大于 200MB 的结果集进行排序。如果将两个临时表空间结合起来,最大大小会增加到 250MB。在 11g 中,查看正在运行的查询发生了什么的好方法是查看活动报告:select dbms_sqltune.report_sql_monitor(sql_id=>'[YOUR SQL ID]', type=>'active') from dual;
好的,所以我将尝试将相同的模式、源和目标放在相同的表空间上并默认使用 temp。你认为 maxsize 有问题吗?或者我应该使用另一个创建表空间的方法(
只是给大家一些反馈:我确实为源和目标共享了表空间(我创建的正常和临时),并且使用 src 和目标的这 3 个映射之一已经正确映射。但是我确实不得不放弃 fk 约束,因为它们给我带来了问题,但我不知道如何,因为我首先填充了子表。你认为这在 DW 中很重要吗?删除外键约束?我不这么认为……但无论如何我都会通知你。我认为人们应得的。以上是关于OWB 映射挂起或花费太长时间 - 可能锁定?的主要内容,如果未能解决你的问题,请参考以下文章
带有 NOT IN 子查询的 SELECT INTO 查询需要很长时间/挂起