zoukankan      html  css  js  c++  java
  • 052-194(新增70题2018)

    User SCOTT wants to export his objects using Oracle Data Pump and executes the following command:

    $ expdp scott/tiger

    directory = EXPORT_DIR

    dumpfile = scott.dmp

    include = table

    include = view:"like '%DEPARTMENTS%'"

    content = DATA_ONLY

    Which task would the command accomplish?

    A. Oracle Data Pump would export only the data of all of the tables and views.

    B. Oracle Data Pump would export all of the table structures along with data and all the views.

    C. Oracle Data Pump would export the table data and the view definitions where the view name contains a string named DEPARTMEN

    D. Oracle Data Pump would export the table data and the view definitions with data where view name contains a string named DEPAR

    E. Oracle Data Pump would export all of the table structures and the view definitions with data where view name contains

    DEPARTMENTS.

    Answer: C

    先上结论:加了data_only是不会导出普通视图的,物化视图和表一样,但是不会把视图定义导出,数据会导出,再导入会报错。
    这里个人觉得选A。



    CONTENT

    DATA_ONLY unloads only table row data; no database object definitions are unloaded.

    oracle数据泵备份(Expdp命令)

    ORA-39006,ORA-39213,ORA-06512,ORA-01114,ORA-39065EXPDP报错问题处理

    https://www.linuxidc.com/Linux/2013-05/83774.htm

    使用命令行运行expdp会出现错误,

    Some operating systems require that quotation marks on the command line be preceded by an escape character. The following are examples of how case-sensitivity can be preserved in the different Export modes.

    • In command-line mode:

      TABLES='"Emp"'
      
    • In parameter file mode:

      TABLES='"Emp"'

    加上转义符后正确

    grant connect to scott;
    grant resource to scott;
    grant create MATERIALIZED VIEW to scott;
    grant create view to scott; grant exp_full_database to scott; grant read, write on directory DATA_PUMP_DIR to scott; --- create table emp1 as select * from scott.emp; create view DEPARTMENTS as select * from scott.emp1; --DATA_ONLY模式导出 expdp scott/tiger directory = DATA_PUMP_DIR dumpfile = scott.dmp include = table:"like '\%EMP1\%'" include = view:"like '\%DEPARTMENTS\%'" content = DATA_ONLY --

    Total estimation using BLOCKS method: 64 KB
    . . exported "SCOTT"."EMP1" 8.570 KB 14 rows
    ORA-39168: Object path VIEW was not found.
    Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
    ******************************************************************************
    Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
    /home/oracle/app/oracle/admin/orcl/dpdump/scott.dmp
    Job "SCOTT"."SYS_EXPORT_SCHEMA_01" completed with 1 error(s) at 00:23:37

    --无DATA_ONLY
    expdp scott/tiger directory = DATA_PUMP_DIR dumpfile = scott1.dmp include = table:"like '\%EMP1\%'",view:"like '\%DEPARTMENTS\%'" 
    
    
    

    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 64 KB
    Processing object type SCHEMA_EXPORT/TABLE/TABLE
    Processing object type SCHEMA_EXPORT/VIEW/VIEW
    . . exported "SCOTT"."EMP1" 8.570 KB 14 rows
    Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded

    
    
    --

     

    drop view DEPARTMENTS;这种情况下导入并无视图的定义
    truncate table emp1;
    --1
    impdp scott/tiger directory = DATA_PUMP_DIR dumpfile = scott.dmp
    --这里数据导入了,但是视图定义并未导入
    --2drop table emp1;
    impdp scott/tiger directory = DATA_PUMP_DIR dumpfile = scott1.dmp
    --这里视图定义导入了,表和数据都导入了

    结论:加了data_only是不会导出普通视图的
    物化视图和表情况一样。



  • 相关阅读:
    UESTC--1727
    css3制作左右拉伸动画菜单
    Mysql主从数据库(master/slave),实现读写分离
    阿里云Centos7.6上面部署基于redis的分布式爬虫scrapy-redis将任务队列push进redis
    利用基于Go Lang的Hugo配合nginx来打造属于自己的纯静态博客系统
    Centos7.6上利用docker搭建Jenkins来自动化部署Django项目
    使用基于Vue.js和Hbuilder的混合模式移动开发打造属于自己的移动app
    Centos7.6上部署Supervisor来监控和操作各类服务
    Centos上配置nginx+uwsgi+负载均衡配置
    Websocket---认识篇
  • 原文地址:https://www.cnblogs.com/Babylon/p/8583081.html
Copyright © 2011-2022 走看看