ºìÁªLinuxÃÅ»§
Linux°ïÖú

Oracle8i/9i EXP/IMPʹÓþ­Ñé

·¢²¼Ê±¼ä:2006-08-21 09:39:03À´Ô´:ºìÁª×÷Õß:romeobh
Ò»¡¢8i EXP³£ÓÃÑ¡Ïî

1¡¢FULL£¬Õâ¸öÓÃÓÚµ¼³öÕû¸öÊý¾Ý¿â£¬ÔÚROWS=NÒ»ÆðʹÓÃʱ£¬¿ÉÒÔµ¼³öÕû¸öÊý¾Ý¿âµÄ½á¹¹¡£ÀýÈ磺

exp sys file=./db_str.dmp log=./db_str.log full=y rows=n compress=y direct=y

2¡¢BUFFERºÍFEEDBACK£¬ÔÚµ¼³ö±È½Ï¶àµÄÊý¾Ýʱ£¬ÎһῼÂÇÉèÖÃÕâÁ½¸ö²ÎÊý¡£ÀýÈ磺

exp new file=yw97_2003.dmp log=yw97_2003_3.log feedback=10000 buffer=100000000 tables=WO4,OK_YT

3¡¢FILLºÍLOG£¬ÕâÁ½¸ö²ÎÊý·Ö±ðÖ¸¶¨±¸·ÝµÄDMPÃû³ÆºÍLOGÃû³Æ£¬°üÀ¨ÎļþÃûºÍĿ¼£¬Àý×Ó¼ûÉÏÃæ¡£

ÐèҪ˵Ã÷µÄÊÇ£¬EXP¿ÉÒÔÖ±½Ó±¸·Ýµ½´Å´øÖУ¬¼´Ê¹ÓÃFILE=/dev/rmt0(´Å´øÉ豸Ãû)£¬µ«ÊÇÒ»°ãÎÒÃǶ¼²»Õâô×ö£¬Ô­ÒòÓжþ£ºÒ»¡¢ÕâÑù×öµÄËٶȻáÂýºÜ¶à£¬¶þ¡¢ÏÖÔÚÒ»°ã¶¼ÊÇʹÓôŴø¿âµÄ£¬²»½¨ÒéÖ±½Ó¶Ô´Å´ø½øÐвÙ×÷¡£ÖÁÓÚûÓÐʹÓôŴø¿âµÄÅóÓÑ¿ÉÒÔ¿¼ÂǺÍUNIXµÄTAR½áºÏʹÓá£

Èç¹ûÄãÕæÏëʹÓÃEXPÖ±½Óµ½´Å´ø£¬Äã¿ÉÒԲο¼MetalinkÎÄÕ¡°EXPORTING TO TAPE ON UNIX SYSTEMS¡±£¨ÎĵµºÅ£º30428.1£©£¬¸ÃÎÄÖÐÓÐÏêϸ½âÊÍ¡£

4¡¢COMPRESS²ÎÊý½«ÔÚµ¼³öµÄͬʱºÏ²¢Ëé¿é£¬¾¡Á¿°ÑÊý¾ÝѹËõµ½initialµÄEXTENTÀĬÈÏÊÇN£¬Ò»°ã½¨ÒéʹÓá£DIRECT²ÎÊý½«¸æËßEXPÖ±½Ó¶ÁÈ¡Êý¾Ý£¬¶ø²»Ïñ´«Í³µÄEXPÄÇÑù£¬Ê¹ÓÃSELECTÀ´¶ÁÈ¡±íÖеÄÊý¾Ý£¬ÕâÑù¾Í¼õÉÙÁËSQLÓï¾ä´¦Àí¹ý³Ì¡£Ò»°ãÒ²½¨ÒéʹÓᣲ»¹ýÓÐЩÇé¿öÏÂDIRECT²ÎÊýÊÇÎÞ·¨Ê¹Óõġ£

5¡¢ÈçºÎʹÓÃSYSDBAÖ´ÐÐEXP/IMP£¿

ÕâÊÇÒ»¸öºÜÏÖʵµÄÎÊÌ⣬ÓÐʱºòÎÒÃÇÐèҪʹÓÃSYSDBAÀ´Ö´ÐÐEXP/IMP£¬Èç½øÐд«Êä±í¿Õ¼äµÄEXP/IMP£¬ÒÔ¼°ÔÚ9iÏÂÓÃSYSÓû§À´Ö´ÐÐEXP/IMPʱ£¬¶¼ÐèҪʹÓÃSYSDBA²Å¿É¡£ÎÒÃÇ¿ÉÒÔʹÓÃÏÂÃ淽ʽÁ¬ÈëEXP/IMP£º

exp "'sys/sys as sysdba'" file=1.dmp tables=gototop.t rows=n

6¡¢QUERY²ÎÊýºóÃæ¸úµÄÊÇwhereÌõ¼þ£¬ÖµµÃ×¢ÒâµÄÊÇ£¬Õû¸öwhere×Ó¾äÐèҪʹÓÃ""À¨ÆðÀ´£¬where×Ó¾äµÄд·¨ºÍSELECTÖÐÏàͬ£¬Èç¹ûÊÇUNIXƽ̨ËùÓÐ"ºÍ'¶¼ÐèҪʹÓÃ\u26469ÆÁ±ÎËüÃǵÄÌØÊ⺬Ò壺

exp gototop/gototop file=1.dmp log=1.log tables=cyx.t query="where c1=20 and c2=gototop"

Èç¹ûÊÇwindowsƽ̨£¬ÔòʹÓÃÏÂÃæµÄ¸ñʽ£º

exp c/c@ncn file=c.dmp log=c.log tables=t query="""where id=1 and name='gototop'"""

¶þ¡¢8i IMP³£ÓÃÑ¡Ïî

1¡¢FROMUSERºÍTOUSER£¬Ê¹ÓÃËüÃÇʵÏÖ½«Êý¾Ý´ÓÒ»¸öSCHEMAÖе¼Èëµ½ÁíÍâÒ»¸öSCHEMAÖС£

2¡¢IGNORE¡¢GRANTSºÍINDEXES£¬ÆäÖÐIGNORE²ÎÊý½«ºöÂÔ±íµÄ´æÔÚ£¬¼ÌÐøµ¼È룬Õâ¸ö¶ÔÓÚÐèÒªµ÷Õû±íµÄ´æ´¢²ÎÊýʱºÜÓÐÓã¬ÎÒÃÇ¿ÉÒÔÏȸù¾Ýʵ¼ÊÇé¿öÓúÏÀíµÄ´æ´¢²ÎÊý½¨ºÃ±í£¬È»ºóÖ±½Óµ¼ÈëÊý¾Ý¡£¶øGRANTSºÍINDEXESÔò±íʾÊÇ·ñµ¼ÈëÊÚȨºÍË÷Òý£¬Èç¹ûÏëʹÓÃеĴ洢²ÎÊýÖؽ¨Ë÷Òý£¬»òÕßΪÁ˼ӿ쵽ÈëËٶȣ¬ÎÒÃÇ¿ÉÒÔ¿¼Âǽ«INDEXESÉèΪN£¬¶øGRANTSÒ»°ã¶¼ÊÇY¡£

ÁíÍâÒ»¸öEXP/IMP¶¼ÓеIJÎÊýÊÇPARFILE£¬ËüÊÇÓÃÀ´¶¨ÒåEXP/IMPµÄ²ÎÊýÎļþ£¬Ò²¾ÍÊÇ˵£¬ÉÏÃæµÄ²ÎÊý¶¼¿ÉÒÔдÔÚÒ»¸ö²ÎÊýÎļþÖУ¬µ«ÎÒÃÇÒ»°ãºÜÉÙʹÓá£

Èý¡¢Oracle9i EXP¹¦ÄÜÃèÊö

Oracle9i EXPÔÚÔ­ÓеĻù´¡ÉÏÐÂÔöÁ˲¿·ÖеIJÎÊý£¬°´¹¦ÄÜÖ÷Òª·ÖΪÒÔϼ¸¸ö²¿·Ö£º

1¡¢OBJECT_CONSISTENT - ÓÃÓÚÉèÖÃEXP¶ÔÏóΪֻ¶ÁÒÔ±£³Ö¶ÔÏóµÄÒ»ÖÂÐÔ¡£Ä¬ÈÏÊÇN¡£

2¡¢FLASHBACK_SCNºÍFLASHBACK_TIME - ÓÃÓÚÖ§³ÖFLASHBACK¹¦ÄܶøÐÂÔö¡£

3¡¢RESUMABLE¡¢RESUMABLE_NAMEºÍRESUMABLE_TIMEOUT - ÓÃÓÚÖ§³ÖRESUMABLE¿Õ¼ä·ÖÅä¶øÐÂÔö¡£

4¡¢TTS_FULL_CHECK - ÓÃÓÚÔÚ´«Êä±í¿Õ¼äʱʹÓÃÒÀÀµÐÔ¼ì²é¡£

5¡¢TEMPLATE - ÓÃÓÚÖ§³ÖiAS¡£

6¡¢TABLESPACES - ÉèÖñí¿Õ¼äµ¼³öģʽ¡£¸öÈ˾õµÃ¶ÔÓÚÒ»°ãÓû§¶øÑÔ£¬Õâ¸ö²ÅÊÇÐÂÔö²ÎÊýÖÐ×îʵÓõÄÒ»¸ö£¬¿ÉÒÔÈÃÓû§ÔÚÔ­À´µÄFULL¡¢OWNER¡¢TABLESµÄ»ù´¡É϶àÁËÒ»ÖÖÑ¡Ôñ£¬Ê¹µÃEXP¸ü¼ÓÁé»î¡£

ËÄ¡¢²»Í¬°æ±¾µÄEXP/IMPÎÊÌ⣿

Ò»°ãÀ´Ëµ£¬´ÓµÍ°æ±¾µ¼Èëµ½¸ß°æ±¾ÎÊÌâ²»´ó£¬Âé·³µÄÊǽ«¸ß°æ±¾µÄÊý¾Ýµ¼Èëµ½µÍ°æ±¾ÖУ¬ÔÚOracle9i֮ǰ£¬²»Í¬°æ±¾OracleÖ®¼äµÄEXP/IMP¿ÉÒÔͨ¹ýÏÂÃæµÄ·½·¨À´½â¾ö£º

1¡¢Ôڸ߰汾Êý¾Ý¿âÉÏÔËÐеװ汾µÄcatexp.sql£»

2¡¢Ê¹ÓõͰ汾µÄEXPÀ´µ¼³ö¸ß°æ±¾µÄÊý¾Ý£»

3¡¢Ê¹ÓõͰ汾µÄIMP½«Êý¾Ý¿âµ¼Èëµ½µ×°æ±¾Êý¾Ý¿âÖУ»

4¡¢Ôڸ߰汾Êý¾Ý¿âÉÏÖØÐÂÔËÐи߰汾µÄcatexp.sql½Å±¾¡£

µ«ÔÚ9iÖУ¬ÉÏÃæµÄ·½·¨²¢²»Äܽâ¾öÎÊÌâ¡£Èç¹ûÖ±½ÓʹÓõװ汾EXP/IMP»á³öÏÖÈçÏ´íÎó£º

EXP-00008: ORACLE error %lu encountered

ORA-00904: invalid column name

ÕâÒѾ­ÊÇÒ»¸ö¹«²¼µÄBUG£¬ÐèÒªµÈµ½Oracle10.0²ÅÄܽâ¾ö£¬BUGºÅΪ2261722£¬Äã¿ÉÒÔµ½METALINKÉÏÈ¥²é¿´ÓйشËBUGµÄÏêϸÐÅÏ¢¡£

BUG¹éBUG£¬ÎÒÃǵŤ×÷»¹ÊÇÒª×ö£¬ÔÚûÓÐOracleµÄÖ§³Ö֮ǰ£¬ÎÒÃǾÍ×Ô¼º½â¾ö¡£ÔÚOracle9iÖÐÖ´ÐÐÏÂÃæµÄSQLÖؽ¨exu81rlsÊÓͼ¼´¿É¡£

CREATE OR REPLACE view exu81rls

(objown,objnam,policy,polown,polsch,polfun,stmts,chkopt,enabled,spolicy)

AS select u.name, o.name, r.pname, r.pfschma, r.ppname, r.pfname,
>decode(bitand(r.stmt_type,1), 0,'', 'SELECT,')

|| decode(bitand(r.stmt_type,2), 0,'', 'INSERT,')

|| decode(bitand(r.stmt_type,4), 0,'', 'UPDATE,')

|| decode(bitand(r.stmt_type,8), 0,'', 'DELETE,'),

r.check_opt, r.enable_flag,

DECODE(BITAND(r.stmt_type, 16), 0, 0, 1)

from user$ u, obj$ o, rls$ r

where u.user# = o.owner#

and r.obj# = o.obj#

and (uid = 0 or

uid = o.owner# or

exists ( select * from session_roles where role='SELECT_CATALOG_ROLE')

)

/

grant select on sys.exu81rls to public;

/

Îå¡¢ÆäËûÎÊÌâ

±¾ÎÄÖ»ÌÖÂÛÁËOracle8iºÍ9iÖеÄEXP/IMPµÄһЩÇé¿ö£¬¶ÔÓÚ֮ǰµÄ°æ±¾£¬ÔÚ8.0.XÖУ¬³ýÁËQUERY²ÎÊý²»ÄÜÓÃÍ⣬ÆäËü²î±ð²»´ó¡£Õë¶ÔûÓÐQUERYµÄÇé¿ö£¬ÎÒÃÇ¿ÉÒÔÏÈÔÚÊý¾Ý¿âÖÐʹÓòéѯÌõ¼þ½¨Á¢ÁÙʱÖмä±í£¬È»ºóʹÓÃEXPµ¼³öÕâ¸öÖмä±í¼´¿É¡£ÖÁÓÚOracle7ÒòΪĿǰʹÓõÄÈ˽ÏÉÙ£¬gototop²»´òËãÔÚ´Ë×öÏêϸ½âÊÍÁË£¬Èç¹û¶ÁÕßÅóÓÑÓÐÐèÇó£¬Äã¿ÉÒԲο¼MetalinkÎĵµ£º¡°Overview of Export and Import in Oracle7¡±£¨ÎĵµºÅ£º61949.1£©¡£¹ØÓÚEXP/IMPµÄÏêϸ²ÎÊýÐÅÏ¢Äã¿ÉÒÔͨ¹ýEXP/IMP HELP=YÀ´»ñµÃ¡£

ÁíÍâ¹ØÓÚ´«Êä±í¿Õ¼äµÄ¸ü¶àÐÅÏ¢¿ÉÒԲο¼ÏÂÃæµÄMetelinkÎĵµ£¬±¾ÎIJ»ÔÙÏêÊö¡£

[NOTE:77523.1] Transportable Tablespaces -- An Example to setup and use.

[NOTE:100698.1] Perform tablespace point-in-time recovery using Transportable Tablespace.

ÔÚ½øÐв¢ÐÐEXP/IMPµÄʱºò£¬Èç¹ûIMP¹ý³Ì½¨Ë÷ÒýµÄ»°²»½¨ÒéͬʱÔËÐÐ5¸öÒÔÉϵÄIMP£¬Èç¹ûÄãÏë¼Ó¿ìËٶȣ¬¿ÉÒÔÔÚIMPµÄʱºò²»½¨Ë÷Òý£¬ÕâÑùÖ»ÒªÄÚ´æÔÊÐí£¬¿ÉÒÔ¶àÅܼ¸¸ö£¬È»ºóÊÇSQL½Å±¾´´½¨ÐèÒªµÄË÷Òý¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ