数据拆分迁移后,在逻辑备份方面保留使用就的备份策略。由于新库为11g,老版本的10g exp客户端无法导出新库数据,故升级客户端到11g,测试中又遇到ORA-00904: "POLTYP": 标识符无效 错误。查阅资料如下: This error occurs if you try the old export command from an 11g client against a database on version 10g or lower. The export command runs a query against a table called EXU9RLS in the SYS schema. On 11g this table was expanded with the column POLTYP and the export command (exp) expects to find this column. This should not be much of a problem since Data Pump export can be used.
看来依然是版本的问题。 解决方法1: 执行如下脚本
CREATE OR REPLACE VIEW exu9rls (objown, objnam, polgrp, policy, polown, polsch, polfun, stmt,chkopt, enabled, spolicy, poltyp) ASSELECT u.name, o.name, r.gname, r.pname, r.pfschma, r.ppname,r.pfname,DECODE(BITAND(r.stmt_type, 1), 0, '', 'SELECT,') ||DECODE(BITAND(r.stmt_type, 2), 0, '', 'INSERT,') ||DECODE(BITAND(r.stmt_type, 4), 0, '', 'UPDATE,') ||DECODE(BITAND(r.stmt_type, 8), 0, '', 'DELETE,'),r.check_opt, r.enable_flag,DECODE(BITAND(r.stmt_type, 16), 0, 0, 1),case bitand(r.stmt_type,16)+bitand(r.stmt_type,64)+bitand(r.stmt_type,128)+bitand(r.stmt_type,256)+ bitand(r.stmt_type,8192)+bitand(r.stmt_type,16384)+bitand(r.stmt_type,32768)when 16 then 'DBMS_RLS.STATIC'when 64 then 'DBMS_RLS.SHARED_STATIC'when 128 then 'DBMS_RLS.CONTEXT_SENSITIVE'when 256 then 'DBMS_RLS.SHARED_CONTEXT_SENSITIVE'when 8192 then 'DBMS_RLS.XDS1'when 16384 then 'DBMS_RLS.XDS2'when 32768 then 'DBMS_RLS.XDS3'else 'DBMS_RLS.DYNAMIC'endFROM sys.user$ u, sys.obj$ o, sys.rls$ rWHERE u.user# = o.owner# ANDr.obj# = o.obj# AND(UID IN (o.owner#, 0) OREXISTS (SELECT roleFROM sys.session_rolesWHERE role = 'SELECT_CATALOG_ROLE'))/GRANT SELECT ON sys.exu9rls TO PUBLIC;
由于需要修改数据库视图结构,不到万不得已本人不打算采用这种方式
方法2: 采用不同版本的客户端分别导出10g和11g数据。 但是在实施过程中又遇到exp-00000错误,最后发现是因为ORACLE_HOME 环境变量设置而引起的(在使用10g客户端时,ORACLE_HOME指向11g的安装路径) 最终修改备份脚本如下:
set ORACLE_HOME=D:\oracle\product\10.2.0\db_1.....10g备份脚本set ORACLE_HOME=D:\app\product\11.2.0\client_1....11g备份脚本
|