度量快速开发平台-专业、快速的软件定制快开平台

标题: ORA-00904:"POLTYP":标识符无效 [打印本页]

作者: 陈晓龙    时间: 2020-3-27 18:50
标题: ORA-00904:"POLTYP":标识符无效

数据拆分迁移后,在逻辑备份方面保留使用就的备份策略。由于新库为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备份脚本

作者: 张兴康    时间: 2020-3-30 14:02
收藏
作者: 张兴康    时间: 2020-3-30 14:03

作者: 陈晓龙    时间: 2020-3-30 20:23
张兴康 发表于 2016-10-31 14:02
收藏


作者: 张兴康    时间: 2020-4-1 14:45
陈晓龙 发表于 2016-10-31 20:23


作者: 陈晓龙    时间: 2020-4-1 19:49
张兴康 发表于 2016-11-1 14:45


作者: 张兴康    时间: 2020-4-2 14:04

作者: 陈晓龙    时间: 2020-4-2 19:16
张兴康 发表于 2016-11-2 14:04


作者: 张兴康    时间: 2020-4-3 14:05
陈晓龙 发表于 2016-11-2 19:16

出太阳了,好暖和
作者: 陈晓龙    时间: 2020-4-3 20:15
张兴康 发表于 2016-11-3 14:05
出太阳了,好暖和


作者: 张兴康    时间: 2020-4-5 08:58
陈晓龙 发表于 2016-11-3 20:15

这两天的天气属于冬天来临前的最后挣扎
作者: 陈晓龙    时间: 2020-4-5 19:36
张兴康 发表于 2016-11-5 08:58
这两天的天气属于冬天来临前的最后挣扎


作者: 张兴康    时间: 2020-4-7 14:08

作者: 陈晓龙    时间: 2020-4-7 22:32
张兴康 发表于 2016-11-7 14:08


作者: 张兴康    时间: 2020-4-8 18:37
陈晓龙 发表于 2016-11-7 22:32

这边信息科暖气开得好足
作者: 陈晓龙    时间: 2020-4-8 21:24
张兴康 发表于 2016-11-8 18:37
这边信息科暖气开得好足

安逸撒
作者: 张兴康    时间: 2020-4-9 14:01
陈晓龙 发表于 2016-11-8 21:24
安逸撒

现在都不敢出去了,外边跟里边的温差太大了
作者: 陈晓龙    时间: 2020-4-10 08:54
张兴康 发表于 2016-11-9 14:01
现在都不敢出去了,外边跟里边的温差太大了

这么老火呀
作者: 陈晓龙    时间: 2020-4-10 08:55
张兴康 发表于 2016-11-9 14:01
现在都不敢出去了,外边跟里边的温差太大了


作者: 张兴康    时间: 2020-4-10 18:01

作者: 陈晓龙    时间: 2020-4-11 15:32
张兴康 发表于 2016-11-10 18:01


作者: 张兴康    时间: 2020-4-14 17:10
陈晓龙 发表于 2016-11-11 15:32


作者: 陈晓龙    时间: 2020-4-17 17:27
张兴康 发表于 2016-11-14 17:10


作者: 张兴康    时间: 2020-4-17 17:59

作者: 陈晓龙    时间: 2020-4-21 09:45
张兴康 发表于 2016-11-17 17:59


作者: 张兴康    时间: 2020-4-21 14:24

作者: 陈晓龙    时间: 2020-4-21 15:24
张兴康 发表于 2016-11-21 14:24


作者: 张兴康    时间: 2020-4-22 13:44

作者: 陈晓龙    时间: 2020-4-22 17:34
张兴康 发表于 2016-11-22 13:44


作者: 张兴康    时间: 2020-4-23 16:49

作者: 陈晓龙    时间: 2020-4-24 16:42
张兴康 发表于 2016-11-23 16:49






欢迎光临 度量快速开发平台-专业、快速的软件定制快开平台 (http://bbs.delit.cn/) Powered by Discuz! X3.2