1、下载软件:
(1) 下载相应的10201_companion_win32.zip(点击下载)。(如数据库是10.2.0.1,则Companion CD也需要是这个版本的。)
(2) 从ORACLE网站上面下载相应Data Miner工具Oracle Data Miner 10.2.0.2(点击下载)
(3) 下载示例Oracle Data Miner 10.2.0.1 Tutorial(点击下载)
2、安装Companion CD。(确认安装目录在原有的数据库的主目录下,否则安装不成功。)
Install Oracle Database 10g Products 10.2.0.0
3、创建Data Miner用户。
(1) create tablespace:
SQL> create tablespace "ODMPERM" datafile 'E:oracleoradatatest10odm1.dbf'
2 size 20M reuse autoextend on next 20M;
表空间已创建。
(2) create temp tablespace:
SQL> create temporary tablespace "ODMTEMP" tempfile
2 'E:oracleoradatatest10odmtemp.tmp' size 20m reuse autoextend on next 20m;
表空间已创建。
(3) 创建用户及授权(For text mining, users must also have access to the Oracle Text package ctxsys.ctx_ddl):
SQL> create user dmuser identified by dmuser default tablespace odmperm
2 temporary tablespace odmtemp quota unlimited on odmperm;
用户已创建。
SQL> GRANT create procedure to DMUSER
2 /
SQL> GRANT create session to DMUSER
2 /
SQL> GRANT create table to DMUSER
2 /
SQL> GRANT create sequence to DMUSER
2 /
SQL> GRANT create view to DMUSER
2 /
SQL> GRANT create job to DMUSER
2 /
SQL> GRANT create type to DMUSER
2 /
SQL> GRANT create synonym to DMUSER
2 /
SQL> GRANT execute on ctxsys.ctx_ddl to DMUSER
2 /
授权成功。
如果想对其它用户的表进行分析,必需将select on权限授予用户dmuser.
例:GRANT SELECT ON hr.employees TO DMUSER1;
4、打开odminerbin下的dbminer.exe
(1) 配置连接
User: dmuser
Password: dmuser
Connection Name: user definition
(2) 导入下载示例中的数据:在tutorial.zip解压后Supplemental_Data文件夹下的demo_import_mag.txt
i) 设置SQL Loader: miner.exe -> tools -> Preferences -> Environment -> Choose right SQL Loader (Default under $ORACLE_HOME/BIN)
ii) 导入数据:Miner.exe -> Data -> import… -> 选择正确的import file (Encoding = Windows 1252)-> 在First record containts field name -> Next ->OK
iii) 导入完成后,会在dbuser下创建一张名为demo_import_mag的表。
5、IMP/EXP数据模型:
(1) Export and import models at different levels:
i) Database level
ii) Schema level
iii) Model only level
(2) 相关权限:
GRANT EXP_FULL_DATABASE TO dmuser;
GRANT IMP_FULL_DATABASE TO dmuser;
(3) The DBMS_DATA_MINING PL/SQL package contains these two procedures:
EXPORT_MODEL
IMPORT_MODEL
示例:
i) EXECUTE DBMS_DATA_MINING.EXPORT_MODEL('allmodels.dmp','DMTEST');
--DMTEST is a Schema’s name
ii) EXECUTE DBMS_DATA_MINING.IMPORT_MODEL('allmodels01.dmp','DMTEST');