【试验】三个用于日常监控开发库与对应测试库的存储过程
- -检查表,列是否一致
- create or replace procedure check_tab_col(v_schema varchar2)
- as
- isfindtab number;
- isfindcol number;
- begin
- dbms_output.put_line('Sechema '||v_schema||' begin searching...');
- dbms_output.put_line(chr(10));
- for i in (select table_name from dba_tables where owner=v_schema) loop
- select count(*) into isfindtab from dba_tables@dblink_testdbc where owner=v_schema
- and table_name=i.table_name;
- if isfindtab=0 then
- --没有找到表
- dbms_output.put_line(rpad(i.table_name,30,' ')||' is lost in testdbc');
- else
- --找到表,则继续搜索列
- for j in (select column_name from dba_tab_columns where owner=v_schema and table_name=i.table_name) loop
- select count(*) into isfindcol from dba_tab_columns@dblink_testdbc where owner=v_schema
- and table_name=i.table_name
- and column_name=j.column_name;
- if isfindcol=0 then
- --没有找到列
- dbms_output.put_line('alter table '||i.table_name||' add('||j.column_name);
- end if;
- end loop;
- end if;
- end loop;
- dbms_output.put_line(chr(10));
- dbms_output.put_line('Sechema '||v_schema||' end searching...');
- exception when others then
- null;
- end check_tab_col;
- --检查索引
- create or replace procedure check_indexes(v_schema varchar2)
- as
- n_isfind number;
- begin
- dbms_output.put_line(v_schema||' Index Searching');
- for c in(select index_name,table_name from dba_indexes where table_owner=v_schema) loop
- select count(*) into n_isfind from dba_indexes@dblink_testdbc
- where index_name=c.index_name
- and table_name=c.table_name
- and table_owner=v_schema;
- if n_isfind=0 then
- dbms_output.put_line(rpad(c.table_name,30,' ')||' '||c.index_name);
- end if;
- end loop;
- end check_indexes;
- --检查序列
- create or replace procedure check_seq(v_schema varchar2)
- as
- n_isfind number;
- begin
- dbms_output.put_line(v_schema||' sequence ');
- for c in(select SEQUENCE_NAME from dba_sequences where SEQUENCE_OWNER=v_schema) loop
- select count(*) into n_isfind from dba_sequences@dblink_testdbc
- where SEQUENCE_NAME=c.SEQUENCE_NAME
- and SEQUENCE_OWNER=v_schema;
- if n_isfind=0 then
- dbms_output.put_line('sequence '||rpad(c.SEQUENCE_NAME,30,' ')||' is lost in testdbc');
- end if;
- end loop;
- end;
转载于:https://blog.51cto.com/lya041/672827
【试验】三个用于日常监控开发库与对应测试库的存储过程相关推荐
- oracle建测试库,简单oracle10g测试库的建立
测试环境搭建及配置指南 (一)oracle10g数据库的搭建及配置指南 第一:安装前的环境准备 1.检查系统.内存.硬盘是否符合要求,即如图: 项目 存储系统 存储位置 最少内存 及硬盘空间 Orac ...
- Robot Framework(十四) 扩展RobotFramework框架——创建测试库
4.1创建测试库 Robot Framework的实际测试功能由测试库提供.有许多现有的库,其中一些甚至与核心框架捆绑在一起,但仍然经常需要创建新的库.这个任务并不复杂,因为正如本章所示,Robot ...
- Robot Framework自动化测试教程-通过RIDE创建工程、测试套、测试用例、测试资源、变量文件,引入测试库
1. 创建测试工程 RIDE工具中有Project概念,实际上Robot Framework中是没有工程的概念,可以理解为最顶层的测试套. 1.1. 新建测试工程 点击 File–>New Pr ...
- 将正式数据库中的表与测试库同步
刚接触项目的实习生,积累经验,欢迎交流 今天遇到了一个问题,就是将正式库数据与测试库同步 直接上解决办法: 方法一: 在正式库服务器上使用exp命令行产生dmp文件,使用imp命令导入测试库 方法二: ...
- 提供了一些工具类以及自定义 View,用于日常的 Android 快速开发
Androids 项目地址:1993hzw/Androids 简介:提供了一些工具类以及自定义 View,用于日常的 Android 快速开发.something about android 更多: ...
- iOS:iOS开发非常全的三方库、插件、大牛博客等等
iOS开发非常全的三方库.插件.大牛博客等等 github排名:https://github.com/trending, github搜索:https://github.com/search. 此文章 ...
- 调研字节码插桩技术,用于系统监控设计和实现
作者:小傅哥 博客:https://bugstack.cn ❝ 沉淀.分享.成长,让自己和他人都能有所收获!???? ❞ 目录 一.来自深夜的电话! 二.准备工作 三.使用 AOP 做个切面监控 1. ...
- 十万服务器秒级管控 腾讯云如何将AIOps用于日常管理?
AIOps,是指基于算法的 IT运维(Algorithmic IT Operations),由 Gartner定义的新类别,源自业界之前所说的 ITOA(IT Operations and Analy ...
- 整理下开发中常用的第三方库
在日常开发中,我们常常使用一些第三方库.我就在这整理下我常用的第三方库.这只是我常用的,使用习惯不一定和别人相同.但用于日常开发足够了. 1. AFNetworking 这是用于网络请求的库,使用方法 ...
最新文章
- Nessus更新到8.3.0
- python合并excel文件关键字_python合并多个excel文件的示例
- 这是啥?也太秀了吧?
- [html] title与h1、b与strong、i与em的区别分别是什么?
- java中为什么使用上转型和下转型
- 数据分析中的可视化-常见图形
- grpc python异步实现_在grpcpython中处理异步流请求
- STC89C52点亮LED
- C++自学06:sizeof运算符
- 国际图形学大会(SIGGRAPH)2017届主席竞选答辩是如此场景
- python信息技术答案_高中信息技术《Python语言》模块试卷习题.doc
- 【概率论基础01】:通俗解释,啥叫随机变量?
- Win10下 vc++6.0打开文件闪退解决
- 主动降噪(ANC),让你静心聆听声音
- 用户运营day2用户分层:以用户为中心的精细化运营
- 金仓数据库KingbaseES的连接方法
- PowerApps教程10-图表的设计与嵌入
- matlab中如何调用子函数
- 【仿美团点餐App】—— 首页(一)
- html+css唯品会的登录页面