EXP 邊匯出邊壓縮打包(原)

zhangweizhao發表於2011-04-11
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 = 
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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章