ora-8103 解决脚本

自己写的处理ora-8103 错误的脚本,对象实际已经删除了,但相关信息还是保留在数据字典了,需要修改数据字典,最后是alter system flush shared_pool;因为数据字典环
缓存是放在共享池里的。
create or replace procedure del_dictionary(p_obj in number)
    Authid Current_User 
    as
    v_file number;
    v_block number;
    v_cnt number :=2;
    v_type number;
    v_bo number;
    v_count number;
begin
 select count(1) into v_count from obj$ where obj#=p_obj;
 
 --v_type=19 table partition
 --v_type=20 index partition
 if v_count=0 then
   dbms_output.put_line('The obj#  '||p_obj||' is alreay deleted!');
   else
   select type# into v_type from obj$ where obj#=p_obj;
  if v_type=19 then
  select bo#,file#,block# into v_bo,v_file,v_block from tabpart$ where obj#=p_obj;
  dbms_output.put_line('file# is:'||v_file||' block# is:'||v_block);
  dbms_output.put_line('The block is table partion');
  delete from obj$ where obj#=p_obj;
  delete from tabpart$ where obj#=p_obj;
  delete from  seg$ where file#=v_file and block#=v_block;
  update partobj$ set partcnt =v_cnt where obj# =v_bo;
 else
  select bo#,file#,block# into v_bo,v_file,v_block from indpart$ where obj#=p_obj;
   dbms_output.put_line('file# is:'||v_file||' block# is:'||v_block);
   dbms_output.put_line('The block is index partion');
  delete from obj$ where obj#=p_obj;
  delete from indpart$ where obj#=p_obj;
  delete from  seg$ where file#=v_file and block#=v_block;
  update partobj$ set partcnt =v_cnt where obj# =v_bo;
   end if;
end if;   
   commit;
EXCEPTION
   --WHEN v_raise THEN 
   -- RAISE_APPLICATION_ERROR(-20010, 'object_id not exists!');
  WHEN NO_DATA_FOUND THEN 
    RAISE_APPLICATION_ERROR(-20011, 'ERROR:'||p_obj||' 不存在!');
end;

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您好!感谢您提问。 ORA-39002、ORA-39070和ORA-39087是Oracle数据库中与数据泵(Data Pump)相关的错误代码。这些错误通常与导入或导出操作相关,并且可能有不同的原因导致。下面我会分别介绍这些错误的含义和可能的解决方法。 1. ORA-39002: 无效操作 这个错误表示正在尝试执行一个无效的操作。可能的原因包括: - 没有足够的权限执行该操作。请确保您具有执行所需操作的适当权限。 - 操作的语法或参数有误。请仔细检查您执行的操作,确保语法和参数正确。 2. ORA-39070: 无法打开数据泵作业 这个错误表示无法打开数据泵作业。可能的原因包括: - 数据泵作业已经在运行中。请等待当前作业完成后再尝试打开新的作业。 - 数据泵作业已经被停止或取消。请检查是否有其他会话或作业正在操作该作业,并确保作业处于可用状态。 3. ORA-39087: 目标文件名无效 这个错误表示指定的目标文件名无效。可能的原因包括: - 指定的目标文件名已经存在或被占用。请尝试使用不同的目标文件名。 - 目标文件名包含非法字符或格式有误。请确保目标文件名符合命名规则和格式要求。 如果您能提供更多的上下文信息,例如具体的操作步骤、命令或脚本,我可以更准确地帮助您解决这些错误。另外,请确保您使用的是最新版本的Oracle数据库和相关工具,以获得最佳的兼容性和稳定性。 希望对您有所帮助!如果您还有其他问题,请随时提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值