ITPub博客

首页 > Linux操作系统 > Linux操作系统 > EXP 边导出边压缩打包(原)

EXP 边导出边压缩打包(原)

原创 Linux操作系统 作者:zhangweizhao 时间:2011-04-11 16:27:42 0 删除 编辑
shell 版本bash
 
--以下操作在rhel 5,下实现同导出压缩同时进行
--by zhangweizhao www.anbob.com
 
--边导出边压缩打包
SQL> conn test/test;
Connected.
SQL> select * from tab;
 
TNAME                                                        TABTYPE
------------------------------------------------------------ --------------
 CLUSTERID
----------
TEST_TRAN                                                    TABLE
 
 
TEST_UNUSE                                                   TABLE
 
 
 
SQL> set linesize 200
SQL> run
  1* select * from tab
 
TNAME                                                        TABTYPE         CLUSTERID
------------------------------------------------------------ -------------- ----------
TEST_TRAN                                                    TABLE
TEST_UNUSE                                                   TABLE
 
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@orazhang ~]$ exp test/test file=>(gzip >test.dmp.gz)
 
Export: Release 10.2.0.1.0 - Production on 星期一 4月 11 15:50:46 2011
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
 
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user TEST
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user TEST
About to export TEST's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export TEST's tables via Conventional Path ...
. . exporting table                      TEST_TRAN          5 rows exported
. . exporting table                     TEST_UNUSE      50706 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
[oracle@orazhang ~]$ ls
afiedt.buf  baiji.class  b.sql    doub.java  dwhelper  on.lst        orcldrop.sql  sqlnet.log   wxWidgets-2.9.1
a.sql       baiji.java   Desktop  Download   ed.hup    oraInventory  record        test.dmp.gz
[oracle@orazhang ~]$ ora
 
SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 4月 11 15:52:22 2011
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
 
SQL> create user test2 identified by test2;
 
User created.
 
SQL> grant connect to test2;
 
Grant succeeded.
SQL> grant resource to test2;
 
Grant succeeded.
 
SQL> exit
[oracle@orazhang ~]$ imp system/oracle fromuser=test touser=test2 file =<(gunzip  
Import: Release 10.2.0.1.0 - Production on 星期一 4月 11 15:58:13 2011
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
 
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
 
Export file created by EXPORT:V10.02.01 via conventional path
 
Warning: the objects were exported by TEST, not by you
 
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
. importing TEST's objects into TEST2
. . importing table                    "TEST_TRAN"          5 rows imported
. . importing table                   "TEST_UNUSE"      50706 rows imported
Import terminated successfully without warnings.
[oracle@orazhang ~]$ sqlplus test2/test2
 
SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 4月 11 16:01:33 2011
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
 
SQL> set linesize 200
SQL> select * from tab;
 
TNAME                                                        TABTYPE         CLUSTERID
------------------------------------------------------------ -------------- ----------
TEST_TRAN                                                    TABLE
TEST_UNUSE                                                   TABLE
 
SQL> col name for a20
SQL> select * from test_tran;
 
        ID NAME
---------- --------------------
         1 anbob.com
         2 sesebook.com
         2 sesebook.com
         2 sesebook.com
         2 sesebook.com
 
SQL>

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23368118/viewspace-692235/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 我的个人网站
请登录后发表评论 登录
全部评论

注册时间:2010-11-22

  • 博文量
    9
  • 访问量
    145660