1. -检查表,列是否一致
  2. create or replace procedure check_tab_col(v_schema varchar2)
  3. as
  4. isfindtab number;
  5. isfindcol number;
  6. begin
  7. dbms_output.put_line('Sechema '||v_schema||' begin searching...');
  8. dbms_output.put_line(chr(10));
  9. for i in (select table_name from dba_tables where owner=v_schema) loop
  10. select count(*) into isfindtab from dba_tables@dblink_testdbc where owner=v_schema
  11. and table_name=i.table_name;
  12. if isfindtab=0 then
  13. --没有找到表
  14. dbms_output.put_line(rpad(i.table_name,30,' ')||' is lost in testdbc');
  15. else
  16. --找到表,则继续搜索列
  17. for j in (select column_name from dba_tab_columns where owner=v_schema and table_name=i.table_name) loop
  18. select count(*) into isfindcol from dba_tab_columns@dblink_testdbc where owner=v_schema
  19. and table_name=i.table_name
  20. and column_name=j.column_name;
  21. if isfindcol=0 then
  22. --没有找到列
  23. dbms_output.put_line('alter table '||i.table_name||' add('||j.column_name);
  24. end if;
  25. end loop;
  26. end if;
  27. end loop;
  28. dbms_output.put_line(chr(10));
  29. dbms_output.put_line('Sechema '||v_schema||' end searching...');
  30. exception when others then
  31. null;
  32. end check_tab_col;
  33. --检查索引
  34. create or replace procedure check_indexes(v_schema varchar2)
  35. as
  36. n_isfind number;
  37. begin
  38. dbms_output.put_line(v_schema||'  Index Searching');
  39. for c in(select index_name,table_name from dba_indexes where table_owner=v_schema) loop
  40. select count(*) into n_isfind from dba_indexes@dblink_testdbc
  41. where index_name=c.index_name
  42. and table_name=c.table_name
  43. and table_owner=v_schema;
  44. if n_isfind=0 then
  45. dbms_output.put_line(rpad(c.table_name,30,' ')||'  '||c.index_name);
  46. end if;
  47. end loop;
  48. end check_indexes;
  49. --检查序列
  50. create or replace procedure check_seq(v_schema varchar2)
  51. as
  52. n_isfind number;
  53. begin
  54. dbms_output.put_line(v_schema||' sequence ');
  55. for c in(select SEQUENCE_NAME from dba_sequences where SEQUENCE_OWNER=v_schema) loop
  56. select count(*) into n_isfind from dba_sequences@dblink_testdbc
  57. where SEQUENCE_NAME=c.SEQUENCE_NAME
  58. and SEQUENCE_OWNER=v_schema;
  59. if n_isfind=0 then
  60. dbms_output.put_line('sequence '||rpad(c.SEQUENCE_NAME,30,' ')||' is lost in testdbc');
  61. end if;
  62. end loop;
  63. end;

转载于:https://blog.51cto.com/lya041/672827

【试验】三个用于日常监控开发库与对应测试库的存储过程相关推荐

  1. oracle建测试库,简单oracle10g测试库的建立

    测试环境搭建及配置指南 (一)oracle10g数据库的搭建及配置指南 第一:安装前的环境准备 1.检查系统.内存.硬盘是否符合要求,即如图: 项目 存储系统 存储位置 最少内存 及硬盘空间 Orac ...

  2. Robot Framework(十四) 扩展RobotFramework框架——创建测试库

    4.1创建测试库 Robot Framework的实际测试功能由测试库提供.有许多现有的库,其中一些甚至与核心框架捆绑在一起,但仍然经常需要创建新的库.这个任务并不复杂,因为正如本章所示,Robot ...

  3. Robot Framework自动化测试教程-通过RIDE创建工程、测试套、测试用例、测试资源、变量文件,引入测试库

    1. 创建测试工程 RIDE工具中有Project概念,实际上Robot Framework中是没有工程的概念,可以理解为最顶层的测试套. 1.1. 新建测试工程 点击 File–>New Pr ...

  4. 将正式数据库中的表与测试库同步

    刚接触项目的实习生,积累经验,欢迎交流 今天遇到了一个问题,就是将正式库数据与测试库同步 直接上解决办法: 方法一: 在正式库服务器上使用exp命令行产生dmp文件,使用imp命令导入测试库 方法二: ...

  5. 提供了一些工具类以及自定义 View,用于日常的 Android 快速开发

    Androids 项目地址:1993hzw/Androids  简介:提供了一些工具类以及自定义 View,用于日常的 Android 快速开发.something about android 更多: ...

  6. iOS:iOS开发非常全的三方库、插件、大牛博客等等

    iOS开发非常全的三方库.插件.大牛博客等等 github排名:https://github.com/trending, github搜索:https://github.com/search. 此文章 ...

  7. 调研字节码插桩技术,用于系统监控设计和实现

    作者:小傅哥 博客:https://bugstack.cn ❝ 沉淀.分享.成长,让自己和他人都能有所收获!???? ❞ 目录 一.来自深夜的电话! 二.准备工作 三.使用 AOP 做个切面监控 1. ...

  8. 十万服务器秒级管控 腾讯云如何将AIOps用于日常管理?

    AIOps,是指基于算法的 IT运维(Algorithmic IT Operations),由 Gartner定义的新类别,源自业界之前所说的 ITOA(IT Operations and Analy ...

  9. 整理下开发中常用的第三方库

    在日常开发中,我们常常使用一些第三方库.我就在这整理下我常用的第三方库.这只是我常用的,使用习惯不一定和别人相同.但用于日常开发足够了. 1. AFNetworking 这是用于网络请求的库,使用方法 ...

最新文章

  1. Nessus更新到8.3.0
  2. python合并excel文件关键字_python合并多个excel文件的示例
  3. 这是啥?也太秀了吧?
  4. [html] title与h1、b与strong、i与em的区别分别是什么?
  5. java中为什么使用上转型和下转型
  6. 数据分析中的可视化-常见图形
  7. grpc python异步实现_在grpcpython中处理异步流请求
  8. STC89C52点亮LED
  9. C++自学06:sizeof运算符
  10. 国际图形学大会(SIGGRAPH)2017届主席竞选答辩是如此场景
  11. python信息技术答案_高中信息技术《Python语言》模块试卷习题.doc
  12. 【概率论基础01】:通俗解释,啥叫随机变量?
  13. Win10下 vc++6.0打开文件闪退解决
  14. 主动降噪(ANC),让你静心聆听声音
  15. 用户运营day2用户分层:以用户为中心的精细化运营
  16. 金仓数据库KingbaseES的连接方法
  17. PowerApps教程10-图表的设计与嵌入
  18. matlab中如何调用子函数
  19. 【仿美团点餐App】—— 首页(一)
  20. html+css唯品会的登录页面

热门文章

  1. maven package和install
  2. 通过View.post()获取View的宽高
  3. tomcat使用redis存储共享session
  4. Ubuntu配置交叉编译环境
  5. angularJS(5)
  6. 策略路由和路由策略的不同
  7. 关于标签系统的又一点想法。
  8. servlet基础知识
  9. 在SQL Server中sqlserver,access,excel之间数据如何使用sql语句直接操作
  10. centos7输入shell找不到命令_反弹shell原理与实现