zoukankan      html  css  js  c++  java
  • 数据库相关配置

    MySql 数据库

    修改最大字符长度限制:

    查看可以执行的 sql 字符串的最大长度: show VARIABLES like '%max_allowed_packet%';

    修改可执行的 sql 字符串的最大长度的方法:SET GLOBAL max_allowed_packet=20971520; -- 不用重启 MySql

    Oracle 数据库

    1. 手动更新物化视图:API 官方说明

    SELECT MVIEW_NAME,STALENESS FROM USER_MVIEWS; --查询物化视图的状态:FRESH 最新、STALE 陈旧、NEEDS_COMPILE 需要编译等
    ALTER MATERIALIZED VIEW UCADM.VIEW_M_EMPLOYEE COMPILE; --重新编译物化视图
    CALL DBMS_MVIEW.REFRESH('UCADM.VIEW_M_EMPLOYEE','C');  --C完全更新,F快速更新(如果访问其他用户[如:UCADM]下的表,还需添加表空间前缀,[如:UCADM])

    2. 表回滚到一个指定的时间

    alter table ucadm.m_employee enable row movement;
    flashback table ucadm.m_employee to timestamp to_timestamp('2017-08-30 15:00:00','yyyy-mm-dd HH24:MI:SS');

    3. 基本查询语句

        --1、用户: 
       select username from dba_users; 
        --改口令 
       alter user spgroup identified by spgtest; 
      --2、表空间: 
       select * from dba_data_files; 
       select * from dba_tablespaces;--表空间 
    
       select tablespace_name,sum(bytes), sum(blocks) 
        from dba_free_space group by tablespace_name;--空闲表空间 
    
       select * from dba_data_files 
        where tablespace_name='RBS';--表空间对应的数据文件 
    
       select * from dba_segments 
        where tablespace_name='INDEXS'; 
      --3、数据库对象: 
       select * from dba_objects; 
       CLUSTER、DATABASE LINK、FUNCTIONINDEX、LIBRARY、PACKAGE、PACKAGE BODY、 
       PROCEDURE、SEQUENCE、SYNONYM、TABLETRIGGER、TYPE、UNDEFINED、VIEW。 
      --4、表: 
       select * from dba_tables; 
       analyze my_table compute statistics;->dba_tables后6列 
       select extent_id,bytes from dba_extents 
       where segment_name='CUSTOMERS' and segment_type='TABLE' 
       order by extent_id;--表使用的extent的信息。segment_type='ROLLBACK'查看回滚段的空间分配信息 
       --列信息: 
        select distinct table_name 
        from user_tab_columns 
        where column_name='SO_TYPE_ID'; 
      --5、索引:  
       select * from dba_indexes;--索引,包括主键索引 
       select * from dba_ind_columns;--索引列 
       select i.index_name,i.uniqueness,c.column_name 
        from user_indexes i,user_ind_columns c 
         where i.index_name=c.index_name 
         and i.table_name ='ACC_NBR';--联接使用 
      --6、序列: 
       select * from dba_sequences; 
      --7、视图: 
       select * from dba_views; 
       select * from all_views; 
      --text 可用于查询视图生成的脚本 
      --8、聚簇: 
       select * from dba_clusters; 
      --9、快照: 
       select * from dba_snapshots; 
      --快照、分区应存在相应的表空间。 
      --10、同义词: 
       select * from dba_synonyms 
        where table_owner='SPGROUP'; 
        --if owner is PUBLIC,then the synonyms is a public synonym. 
         if owner is one of users,then the synonyms is a private synonym. 
      --11、数据库链: 
       select * from dba_db_links; 
      --在spbase下建数据库链 
       create database link dbl_spnew 
       connect to spnew identified by spnew using 'jhhx'; 
       insert into acc_nbr@dbl_spnew 
       select * from acc_nbr where nxx_nbr='237' and line_nbr='8888'; 
      --12、触发器: 
       select * from dba_trigers; 
      --存储过程,函数从dba_objects查找。 
      --其文本:select text from user_source where name='BOOK_SP_EXAMPLE'; 
      --建立出错:select * from user_errors;  
    --13、数据文件信息:
    select * from dba_data_files;

     SQL Server 数据库 SSIS 配置参考资料:

    1. 如何在 SQL Server 中创建链接服务器

    http://www.cnblogs.com/spring_wang/p/5409394.html

    2. 如何安装 SSIS 开发工具

    在安装 SQL Server 时,选中 SSIS 选项即可

    3. SSIS 的使用示例

    http://www.cnblogs.com/heqichang/archive/2012/09/19/2693214.html
    https://wenku.baidu.com/view/915f4ce1d1f34693daef3ef8.html
    http://pan.baidu.com/s/1o6iDu90

    4. 如何运行 SSIS 程序包

    http://www.cnblogs.com/aspnetx/p/3377003.html

    http://www.360doc.com/content/11/1231/17/7655970_176339682.shtml

    5. 如何导出 SQL Server 数据库中的数据

    http://www.cnblogs.com/527289276qq/p/4515813.html

  • 相关阅读:
    C# 控制反转
    控制反转和依赖注入
    C#中使用AOP
    jquery ajax
    python(7)- 小程序练习:循环语句for,while实现99乘法表
    007所谓性格与条件并不是成功的阻碍,懦弱才是
    006学习有可能速成吗
    005自学与有人带着哄着逼着学的不同在于自学是一种成熟的自律
    005单打独斗意味着需要更好地管理自己
    004真正的教育是自我教育,真正的学习是自学
  • 原文地址:https://www.cnblogs.com/hellowzl/p/6690208.html
Copyright © 2011-2022 走看看