[bbk4992] 第98集 第12章 数据移植 04

/*

实验目的:使用impdp and expdmp

实验步骤:

  1. test user ->create table -> emp1
  2. test user -> create index -> emp1
  3. create directory -> test_dir -> grant
    1. grant create any directory to test;--授权创建目录对象
    2.  create directory test_dir as '/RealData/oracle/backup/data_pump';--创建目录对象
    3. drop directory test_dir;--删除目录对象
    4. revoke create any directory from test;--撤销创建目录的权限
  4. show directory
  5. expdp-emp1
  6. 破坏性实验
  7. impdmp

*/

SQL> create tablespace test_tab datafile '/RealData/oradata/DATACENTER/test_tab_01.dbf' size 20M AUTOEXTEND ON NEXT 10M MAX                                           SIZE 50M;

Tablespace created.

SQL> create user test identified by test default tablespace test_tab;

User created.

SQL> grant connect,resource to test;

Grant succeeded.

SQL> conn test/test
Connected.
SQL> select * from tab;

no rows selected
SQL> conn / as sysdba
Connected.
SQL> grant select on HR.employees to test;

Grant succeeded.

SQL> conn test/test
Connected.
SQL> create table emp1 as select * from HR.employees;

Table created.

SQL> select employee_id,last_name,salary from emp1;

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        198 OConnell                        2600
        199 Grant                           2600
        200 Whalen                          4400
        201 Hartstein                      13000
        202 Fay                             6000
        203 Mavris                          6500
        204 Baer                           10000
        205 Higgins                        12008
        206 Gietz                           8300
        100 King                           24000
        101 Kochhar                        17000

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        102 De Haan                        17000
        103 Hunold                          9000
        104 Ernst                           6000
        105 Austin                          4800
        106 Pataballa                       4800
        107 Lorentz                         4200
        108 Greenberg                      12008
        109 Faviet                          9000
        110 Chen                            8200
        111 Sciarra                         7700
        112 Urman                           7800

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        113 Popp                            6900
        114 Raphaely                       11000
        115 Khoo                            3100
        116 Baida                           2900
        117 Tobias                          2800
        118 Himuro                          2600
        119 Colmenares                      2500
        120 Weiss                           8000
        121 Fripp                           8200
        122 Kaufling                        7900
        123 Vollman                         6500

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        124 Mourgos                         5800
        125 Nayer                           3200
        126 Mikkilineni                     2700
        127 Landry                          2400
        128 Markle                          2200
        129 Bissot                          3300
        130 Atkinson                        2800
        131 Marlow                          2500
        132 Olson                           2100
        133 Mallin                          3300
        134 Rogers                          2900

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        135 Gee                             2400
        136 Philtanker                      2200
        137 Ladwig                          3600
        138 Stiles                          3200
        139 Seo                             2700
        140 Patel                           2500
        141 Rajs                            3500
        142 Davies                          3100
        143 Matos                           2600
        144 Vargas                          2500
        145 Russell                        14000

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        146 Partners                       13500
        147 Errazuriz                      12000
        148 Cambrault                      11000
        149 Zlotkey                        10500
        150 Tucker                         10000
        151 Bernstein                       9500
        152 Hall                            9000
        153 Olsen                           8000
        154 Cambrault                       7500
        155 Tuvault                         7000
        156 King                           10000

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        157 Sully                           9500
        158 McEwen                          9000
        159 Smith                           8000
        160 Doran                           7500
        161 Sewall                          7000
        162 Vishney                        10500
        163 Greene                          9500
        164 Marvins                         7200
        165 Lee                             6800
        166 Ande                            6400
        167 Banda                           6200

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        168 Ozer                           11500
        169 Bloom                          10000
        170 Fox                             9600
        171 Smith                           7400
        172 Bates                           7300
        173 Kumar                           6100
        174 Abel                           11000
        175 Hutton                          8800
        176 Taylor                          8600
        177 Livingston                      8400
        178 Grant                           7000

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        179 Johnson                         6200
        180 Taylor                          3200
        181 Fleaur                          3100
        182 Sullivan                        2500
        183 Geoni                           2800
        184 Sarchand                        4200
        185 Bull                            4100
        186 Dellinger                       3400
        187 Cabrio                          3000
        188 Chung                           3800
        189 Dilly                           3600

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        190 Gates                           2900
        191 Perkins                         2500
        192 Bell                            4000
        193 Everett                         3900
        194 McCain                          3200
        195 Jones                           2800
        196 Walsh                           3100
        197 Feeney                          3000

107 rows selected.
create user
SQL> show user
USER is "TEST"
SQL> create index emp_employee_id_idx on emp1(employee_id);

Index created.

SQL> select segment_name,tablespace_name from user_segments;

SEGMENT_NAME                   TABLESPACE_NAME
------------------------------ ------------------------------
EMP1                           TEST_TAB
EMP_EMPLOYEE_ID_IDX            TEST_TAB
create index
SQL> create directory test_dir as '/RealData/oracle/backup/data_pump';
create directory test_dir as '/RealData/oracle/backup/data_pump'
*
ERROR at line 1:
ORA-01031: insufficient privileges


SQL> conn / as sysdba
Connected.
SQL> grant create any directory to test;

Grant succeeded.

SQL> conn test/test
Connected.
SQL> create directory test_dir as '/RealData/oracle/backup/data_pump';

Directory created.
create directory
SQL> set linesize 200
SQL> select * from dba_directories;

OWNER                          DIRECTORY_NAME                 DIRECTORY_PATH
------------------------------ ------------------------------ --------------------------------------------------
SYS                            TEST_DIR                       /RealData/oracle/backup/data_pump
SYS                            SUBDIR                         /RealData/oracle/demo/schema/order_entry//2002/Sep
SYS                            SS_OE_XMLDIR                   /RealData/oracle/demo/schema/order_entry/
SYS                            LOG_FILE_DIR                   /RealData/oracle/demo/schema/log/
SYS                            DATA_FILE_DIR                  /RealData/oracle/demo/schema/sales_history/
SYS                            XMLDIR                         /ade/b/2125410156/oracle/rdbms/xml
SYS                            MEDIA_DIR                      /RealData/oracle/demo/schema/product_media/
SYS                            DATA_PUMP_DIR                  /RealData/admin/DATACENTER/dpdump/
SYS                            ORACLE_OCM_CONFIG_DIR          /RealData/oracle/ccr/state

9 rows selected.

SQL> show user;
USER is "SYS"
查看目录对象与物理文件的映射关系
[oracle@arcerzhang ~]$ expdp test/test dumpfile=emp1.dmp directory=test_dir tabl                                                                                      es=emp1 logfile=emp1.log

Export: Release 11.2.0.1.0 - Production on Fri Jun 7 10:43:54 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit                                                                                       Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "TEST"."SYS_EXPORT_TABLE_01":  test/******** dumpfile=emp1.dmp director                                                                                      y=test_dir tables=emp1 logfile=emp1.log
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
. . exported "TEST"."EMP1"                               16.80 KB     107 rows
Master table "TEST"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for TEST.SYS_EXPORT_TABLE_01 is:
  /RealData/oracle/backup/data_pump/emp1.dmp
Job "TEST"."SYS_EXPORT_TABLE_01" successfully completed at 10:44:00
expdp-emp1
SQL> drop table emp1 purge;

Table dropped.
破坏数据
C:\Users\MaryHu>impdp test/test@DB234 dumpfile=emp1.dmp directory=test_dir logfile=emp1.log

Import: Release 11.2.0.1.0 - Production on Fri Jun 7 11:20:47 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "TEST"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "TEST"."SYS_IMPORT_FULL_01":  test/********@DB234 dumpfile=emp1.dmp directory=test_dir logfile=emp1.log
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "TEST"."EMP1"                               16.80 KB     107 rows
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Job "TEST"."SYS_IMPORT_FULL_01" successfully completed at 11:20:35


SQL> select employee_id,last_name,salary from emp1;

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        198 OConnell                        2600
        199 Grant                           2600
        200 Whalen                          4400
        201 Hartstein                      13000
        202 Fay                             6000
        203 Mavris                          6500
        204 Baer                           10000
        205 Higgins                        12008
        206 Gietz                           8300
        100 King                           24000
        101 Kochhar                        17000

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        102 De Haan                        17000
        103 Hunold                          9000
        104 Ernst                           6000
        105 Austin                          4800
        106 Pataballa                       4800
        107 Lorentz                         4200
        108 Greenberg                      12008
        109 Faviet                          9000
        110 Chen                            8200
        111 Sciarra                         7700
        112 Urman                           7800

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        113 Popp                            6900
        114 Raphaely                       11000
        115 Khoo                            3100
        116 Baida                           2900
        117 Tobias                          2800
        118 Himuro                          2600
        119 Colmenares                      2500
        120 Weiss                           8000
        121 Fripp                           8200
        122 Kaufling                        7900
        123 Vollman                         6500

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        124 Mourgos                         5800
        125 Nayer                           3200
        126 Mikkilineni                     2700
        127 Landry                          2400
        128 Markle                          2200
        129 Bissot                          3300
        130 Atkinson                        2800
        131 Marlow                          2500
        132 Olson                           2100
        133 Mallin                          3300
        134 Rogers                          2900

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        135 Gee                             2400
        136 Philtanker                      2200
        137 Ladwig                          3600
        138 Stiles                          3200
        139 Seo                             2700
        140 Patel                           2500
        141 Rajs                            3500
        142 Davies                          3100
        143 Matos                           2600
        144 Vargas                          2500
        145 Russell                        14000

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        146 Partners                       13500
        147 Errazuriz                      12000
        148 Cambrault                      11000
        149 Zlotkey                        10500
        150 Tucker                         10000
        151 Bernstein                       9500
        152 Hall                            9000
        153 Olsen                           8000
        154 Cambrault                       7500
        155 Tuvault                         7000
        156 King                           10000

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        157 Sully                           9500
        158 McEwen                          9000
        159 Smith                           8000
        160 Doran                           7500
        161 Sewall                          7000
        162 Vishney                        10500
        163 Greene                          9500
        164 Marvins                         7200
        165 Lee                             6800
        166 Ande                            6400
        167 Banda                           6200

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        168 Ozer                           11500
        169 Bloom                          10000
        170 Fox                             9600
        171 Smith                           7400
        172 Bates                           7300
        173 Kumar                           6100
        174 Abel                           11000
        175 Hutton                          8800
        176 Taylor                          8600
        177 Livingston                      8400
        178 Grant                           7000

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        179 Johnson                         6200
        180 Taylor                          3200
        181 Fleaur                          3100
        182 Sullivan                        2500
        183 Geoni                           2800
        184 Sarchand                        4200
        185 Bull                            4100
        186 Dellinger                       3400
        187 Cabrio                          3000
        188 Chung                           3800
        189 Dilly                           3600

EMPLOYEE_ID LAST_NAME                     SALARY
----------- ------------------------- ----------
        190 Gates                           2900
        191 Perkins                         2500
        192 Bell                            4000
        193 Everett                         3900
        194 McCain                          3200
        195 Jones                           2800
        196 Walsh                           3100
        197 Feeney                          3000

107 rows selected.
impdp
SQL> select segment_name,tablespace_name from user_segments;

SEGMENT_NAME                   TABLESPACE_NAME
------------------------------ ------------------------------
EMP1                           TEST_TAB
EMP_EMPLOYEE_ID_IDX            TEST_TAB
数据恢复情况查看

其他导入导出情况总结

impdp test/test@DB234 dumpfile=emp1.dmp directory=test_dir logfile=emp1.log exclude=index
导入时排除索引导入

/*

实验目的:使用impdp remap_schema来映射导入数据

实验结论:

  在之前的imp、exp命令中,导出的表再次导入到其他schema下的时候,不是将表放在目标schema所对应的表空间当中,而是继续存放在表原来所在的表空间当中.使用impdp、expdp命令后,通过remap_schemal参数,可以实现表空间的转移.  

*/ 

[oracle@arcerzhang data_pump]$ impdp test02/test02 dumpfile=emp1.dmp directory=test_dir logfile=emp1.log remap_schema=test:test02

Import: Release 11.2.0.1.0 - Production on Fri Jun 7 12:14:53 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39087: directory name TEST_DIR is invalid
SQL> grant read,write on directory test_dir to test02;

Grant succeeded.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@arcerzhang data_pump]$ impdp test02/test02 dumpfile=emp1.dmp directory=test_dir logfile=emp1.log remap_schema=test:test02

Import: Release 11.2.0.1.0 - Production on Fri Jun 7 12:17:44 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "TEST02"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "TEST02"."SYS_IMPORT_FULL_01":  test02/******** dumpfile=emp1.dmp directory=test_dir logfile=emp1.log remap_schema=test:test02
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "TEST02"."EMP1"                             16.80 KB     107 rows
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Job "TEST02"."SYS_IMPORT_FULL_01" successfully completed at 12:17:45

执行完成上述操作之后,发现数据导入过来了,但是emp1表所在的表空间还是没有映射到test_02用户所在的表空间上,任然在原来所在表空间.

SQL> set linesize 300
SQL> select segment_name,tablespace_name from user_segments;

SEGMENT_NAME                                                                      TABLESPACE_NAME
--------------------------------------------------------------------------------- ------------------------------
DEPT                                                                              TEST_TAB_02
EMP1                                                                              TEST_TAB
EMP_EMPLOYEE_ID_IDX                                                               TEST_TAB

推到重来

SQL> drop table emp1 purge;

Table dropped.

SQL> select segment_name,tablespace_name from user_segments;

SEGMENT_NAME                                                                      TABLESPACE_NAME
--------------------------------------------------------------------------------- ------------------------------
DEPT                                                                              TEST_TAB_02 

指定remap_tablespace后,重新执行导入操作

SQL> grant imp_full_database to test02;

Grant succeeded.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@arcerzhang data_pump]$ impdp test02/test02 dumpfile=emp1.dmp directory=test_dir logfile=emp1.log remap_schema=test:test02 remap_tablespace=test_tab:test_tab_02

Import: Release 11.2.0.1.0 - Production on Fri Jun 7 12:31:41 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39146: schema "REMAP_TABLESPACE:TEST_TAB" does not exist
Master table "TEST02"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "TEST02"."SYS_IMPORT_FULL_01":  test02/******** dumpfile=emp1.dmp directory=test_dir logfile=emp1.log remap_schema=test:test02 remap_tablespace=test_tab:test_tab_02
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "TEST02"."EMP1"                             16.80 KB     107 rows
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Job "TEST02"."SYS_IMPORT_FULL_01" successfully completed at 12:31:42
SQL> select segment_name,tablespace_name from user_segments;

SEGMENT_NAME                                                                      TABLESPACE_NAME
--------------------------------------------------------------------------------- ------------------------------
DEPT                                                                              TEST_TAB_02
EMP1                                                                              TEST_TAB_02
EMP_EMPLOYEE_ID_IDX                                                               TEST_TAB_02

/*

  实验目的:映射表名称(映射schema、映射表空间)

impdp test02/test02 dumpfile=emp1.dmp directory=test_dir exclude=index logfile=emp1.log remap_schema=test:test02 remap_tablespace=test_tab:test_tab_02 remap_table=emp1:emp2

*/ 

SQL> show user
USER is "TEST02"
SQL> drop table emp1 purge;

Table dropped.

SQL> select segment_name,tablespace_name from user_segments;

SEGMENT_NAME                                                                      TABLESPACE_NAME
--------------------------------------------------------------------------------- ------------------------------
DEPT                                                                              TEST_TAB_02

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@arcerzhang data_pump]$ impdp test02/test02 dumpfile=emp1.dmp directory=test_dir exclude=index logfile=emp1.log remap_schema=test:test02 remap_tablespace=test_tab:test_tab_02 remap_table=emp1:emp2

Import: Release 11.2.0.1.0 - Production on Fri Jun 7 12:56:46 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "TEST02"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "TEST02"."SYS_IMPORT_FULL_01":  test02/******** dumpfile=emp1.dmp directory=test_dir exclude=index logfile=emp1.log remap_schema=test:test02 remap_tablespace=test_tab:test_tab_02 remap_table=emp1:emp2
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "TEST02"."EMP2"                             16.80 KB     107 rows
Job "TEST02"."SYS_IMPORT_FULL_01" successfully completed at 12:56:47

[oracle@arcerzhang data_pump]$ sqlplus test02/test02

SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 7 12:56:53 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> set linesize 300
SQL> select segment_name,tablespace_name from user_segments;

SEGMENT_NAME                                                                      TABLESPACE_NAME
--------------------------------------------------------------------------------- ------------------------------
DEPT                                                                              TEST_TAB_02
EMP2                                                                              TEST_TAB_02

/*

  实验目的:使用remap_data参数

*/

SQL> create or replace package p1 is
  2  function f1(p_comm number) return number;
  3  end;
  4  /

Package created.

SQL> create or replace package body p1 is
  2  function f1(p_comm number) return number
  3  is
  4  begin
  5  return 0.1;--return nvl(p_comm,0.9);也可以这样改,改的稍微复杂一点.
  6  end;
  7  end;
  8  /

Package body created.
[oracle@arcerzhang data_pump]$ impdp test02/test02 dumpfile=emp1.dmp directory=test_dir exclude=index logfile=emp1.log remap_schema=test:test02 remap_tablespace=test_tab:test_tab_02 remap_data=emp1.commission_pct:p1.f1

Import: Release 11.2.0.1.0 - Production on Fri Jun 7 13:26:21 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "TEST02"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "TEST02"."SYS_IMPORT_FULL_01":  test02/******** dumpfile=emp1.dmp directory=test_dir exclude=index logfile=emp1.log remap_schema=test:test02 remap_tablespace=test_tab:test_tab_02 remap_data=emp1.commission_pct:p1.f1
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "TEST02"."EMP1"                             16.80 KB     107 rows
Job "TEST02"."SYS_IMPORT_FULL_01" successfully completed at 13:26:23

[oracle@arcerzhang data_pump]$ sqlplus test02/test02

SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 7 13:26:27 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select employee_id,last_name,salary,commission_pct from emp2;
select employee_id,last_name,salary,commission_pct from emp2
                                                        *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> select employee_id,last_name,salary,commission_pct from emp1;

EMPLOYEE_ID LAST_NAME                     SALARY COMMISSION_PCT
----------- ------------------------- ---------- --------------
        198 OConnell                        2600             .1
        199 Grant                           2600             .1
        200 Whalen                          4400             .1
        201 Hartstein                      13000             .1
        202 Fay                             6000             .1
        203 Mavris                          6500             .1
        204 Baer                           10000             .1
        205 Higgins                        12008             .1
        206 Gietz                           8300             .1
        100 King                           24000             .1
        101 Kochhar                        17000             .1

EMPLOYEE_ID LAST_NAME                     SALARY COMMISSION_PCT
----------- ------------------------- ---------- --------------
        102 De Haan                        17000             .1
        103 Hunold                          9000             .1
        104 Ernst                           6000             .1
        105 Austin                          4800             .1
        106 Pataballa                       4800             .1
        107 Lorentz                         4200             .1
        108 Greenberg                      12008             .1
        109 Faviet                          9000             .1
        110 Chen                            8200             .1
        111 Sciarra                         7700             .1
        112 Urman                           7800             .1

EMPLOYEE_ID LAST_NAME                     SALARY COMMISSION_PCT
----------- ------------------------- ---------- --------------
        113 Popp                            6900             .1
        114 Raphaely                       11000             .1
        115 Khoo                            3100             .1
        116 Baida                           2900             .1
        117 Tobias                          2800             .1
        118 Himuro                          2600             .1
        119 Colmenares                      2500             .1
        120 Weiss                           8000             .1
        121 Fripp                           8200             .1
        122 Kaufling                        7900             .1
        123 Vollman                         6500             .1

EMPLOYEE_ID LAST_NAME                     SALARY COMMISSION_PCT
----------- ------------------------- ---------- --------------
        124 Mourgos                         5800             .1
        125 Nayer                           3200             .1
        126 Mikkilineni                     2700             .1
        127 Landry                          2400             .1
        128 Markle                          2200             .1
        129 Bissot                          3300             .1
        130 Atkinson                        2800             .1
        131 Marlow                          2500             .1
        132 Olson                           2100             .1
        133 Mallin                          3300             .1
        134 Rogers                          2900             .1

EMPLOYEE_ID LAST_NAME                     SALARY COMMISSION_PCT
----------- ------------------------- ---------- --------------
        135 Gee                             2400             .1
        136 Philtanker                      2200             .1
        137 Ladwig                          3600             .1
        138 Stiles                          3200             .1
        139 Seo                             2700             .1
        140 Patel                           2500             .1
        141 Rajs                            3500             .1
        142 Davies                          3100             .1
        143 Matos                           2600             .1
        144 Vargas                          2500             .1
        145 Russell                        14000             .1

EMPLOYEE_ID LAST_NAME                     SALARY COMMISSION_PCT
----------- ------------------------- ---------- --------------
        146 Partners                       13500             .1
        147 Errazuriz                      12000             .1
        148 Cambrault                      11000             .1
        149 Zlotkey                        10500             .1
        150 Tucker                         10000             .1
        151 Bernstein                       9500             .1
        152 Hall                            9000             .1
        153 Olsen                           8000             .1
        154 Cambrault                       7500             .1
        155 Tuvault                         7000             .1
        156 King                           10000             .1

EMPLOYEE_ID LAST_NAME                     SALARY COMMISSION_PCT
----------- ------------------------- ---------- --------------
        157 Sully                           9500             .1
        158 McEwen                          9000             .1
        159 Smith                           8000             .1
        160 Doran                           7500             .1
        161 Sewall                          7000             .1
        162 Vishney                        10500             .1
        163 Greene                          9500             .1
        164 Marvins                         7200             .1
        165 Lee                             6800             .1
        166 Ande                            6400             .1
        167 Banda                           6200             .1

EMPLOYEE_ID LAST_NAME                     SALARY COMMISSION_PCT
----------- ------------------------- ---------- --------------
        168 Ozer                           11500             .1
        169 Bloom                          10000             .1
        170 Fox                             9600             .1
        171 Smith                           7400             .1
        172 Bates                           7300             .1
        173 Kumar                           6100             .1
        174 Abel                           11000             .1
        175 Hutton                          8800             .1
        176 Taylor                          8600             .1
        177 Livingston                      8400             .1
        178 Grant                           7000             .1

EMPLOYEE_ID LAST_NAME                     SALARY COMMISSION_PCT
----------- ------------------------- ---------- --------------
        179 Johnson                         6200             .1
        180 Taylor                          3200             .1
        181 Fleaur                          3100             .1
        182 Sullivan                        2500             .1
        183 Geoni                           2800             .1
        184 Sarchand                        4200             .1
        185 Bull                            4100             .1
        186 Dellinger                       3400             .1
        187 Cabrio                          3000             .1
        188 Chung                           3800             .1
        189 Dilly                           3600             .1

EMPLOYEE_ID LAST_NAME                     SALARY COMMISSION_PCT
----------- ------------------------- ---------- --------------
        190 Gates                           2900             .1
        191 Perkins                         2500             .1
        192 Bell                            4000             .1
        193 Everett                         3900             .1
        194 McCain                          3200             .1
        195 Jones                           2800             .1
        196 Walsh                           3100             .1
        197 Feeney                          3000             .1

107 rows selected.


原文地址:https://www.cnblogs.com/arcer/p/3123602.html