Oracle¤Ï¤Û¤È¤ó¤ÉÃΤé¤Ê¤¤¤Î¤Ç¡¢¤È¤ê¤¢¤¨¤ºÈ÷˺¡£ ¥æ¡¼¥¶°ìÍ÷¤ò¼èÆÀ †-bash-3.2$ sqlplus / as sysdba SQL> SELECT username FROM dba_users; USERNAME ------------------------------ SYS XDB ¡Á ³ä°¦ x¹Ô¤¬ÁªÂò¤µ¤ì¤Þ¤·¤¿¡£ SQL> ³°Éô¥¡¼¤Î°ìÍ÷ †SQL Plus¤Ê¤É¤Ç³ºÅö¥¹¥¡¼¥Þ¤Î¥æ¡¼¥¶¤Ç¥í¥°¥¤¥ó¤·¤Æ°Ê²¼¤ÎSQL¤ò¼Â¹Ô¡£ select CONSTRAINT_NAME,TABLE_NAME,STATUS from USER_CONSTRAINTS where CONSTRAINT_TYPE = 'R' ¥Æ¡¼¥Ö¥ë̾¤ÈFK̾¡¢¤½¤ì¤¬Í¸ú¾õÂÖ¤«¤ò³Îǧ¤Ç¤¤Þ¤¹¡£ SQL> select count(*) from USER_CONSTRAINTS where CONSTRAINT_TYPE = 'R' and status='ENABLED'; COUNT(*) ---------- 0 SQL> select count(*) from USER_CONSTRAINTS where CONSTRAINT_TYPE = 'R' and status='DISABLED'; COUNT(*) ---------- 39 ¤³¤ó¤Ê´¶¤¸¤Ç¤¹¡£ ¤Á¤Ê¤ß¤Ë Unique Key select CONSTRAINT_NAME,TABLE_NAME,STATUS from USER_CONSTRAINTS where CONSTRAINT_TYPE = 'U' Primary Key select CONSTRAINT_NAME,TABLE_NAME,STATUS from USER_CONSTRAINTS where CONSTRAINT_TYPE = 'P' Foreign Key select CONSTRAINT_NAME,TABLE_NAME,STATUS from USER_CONSTRAINTS where CONSTRAINT_TYPE = 'R' ¥´¥ß¥Æ¡¼¥Ö¥ë¤Îºï½ü †purge user_recyclebin; SQL*Plus¤ÎTIPS †ÊÌ¥µ¡¼¥Ð¤ÎOracle¤ËÀܳ¤¹¤ë †-bash-3.2$ sqlplus hoge/pass@192.168.10.100:1521/xe ¤Ê¤É¤ÇOK! ³°Éô¥Õ¥¡¥¤¥ë¤«¤éSQL¼Â¹Ô †sqlplus user/pass @hogehoge.sql ¤Çhogehoge.sql¤ÎSQL¤¬¼Â¹Ô¤Ç¤¤ë hogehoge.sql¤Îʸˡ †
SQL*Plus¤ÈTeraTerm?¤Çüâ¤Ê¤É¤¬Ê¸»ú²½¤±¤¹¤ë †DB¤Îʸ»ú¥³¡¼¥É¤òJA16SJISTILDE¤È¤·¤Æ¤¤¤ë¤È¤¡¢TerraTerm?¤Çselect¤·¤Æ¤ß¤ë¤Èü⤬ʸ»ú²½¤±¤·¤Æ¤¿¡£¡£ export NLS_LANG=Japanese_Japan.JA16SJISTILDE ¤È¤·¤Æ´Ä¶ÊÑ¿ô¤òÀßÄꤷ¡¢¤µ¤é¤ËTeraTerm?¤òSJIS¤Ë¤·¤Æ¤ª¤±¤ÐOK¤Ç¤¹¡£ ¥æ¡¼¥¶¤Îºï½ü †SQL> drop user hogehoge cascade; DB¤ÎExport,Import †DB¥µ¡¼¥Ð¤Ëoracle¥æ¡¼¥¶¤Ç¥í¥°¥¤¥ó¤·¡¢²¼µ¥³¥Þ¥ó¥É¤ò¼Â¹Ô exp hoge/fuga@xe owner=hoge file=hoge.20070709.dmp statistics=none °ÕÌ£¤Ï¡Öhoge¥æ¡¼¥¶¤Ç¥¹¥¡¼¥Þhoge¤Î¥Æ¡¼¥Ö¥ë¤òÁ´¤Æ¥À¥ó¥×*1¡×¡£ exp userid=hoge/fuga tables=TABLE1 file=hoge_TABLE1.20070709.dmp statistics=none ¤Æ¥Æ¡¼¥Ö¥ë»ØÄê¤â²Äǽ¤Ç¤¹¡£ import¤Ï°Ê²¼¤ÎÄ̤ê imp userid=hoge2/fuga2 tables=TABLE1 fromuser=hoge touser=hoge2 file=hoge_TABLE1.20070709.dmp ignore=y fromuser:¸µ¤Î¥æ¡¼¥¶ touser:¤Ê¤ó¤Æ¥¹¥¡¼¥Þ¤ËÆþ¤ì¤ë¤«¡£ DDL¤ò¼èÆÀ¤¹¤ë¡£ †£Ï£Ò£Á£Ã£Ì£Å¡¿¥ª¥é¥¯¥ë£Ó£Ñ£Ì¥ê¥Õ¥¡¥ì¥ó¥¹¡ÊDBMS_METADATA.GET_DDL¡Ë ¤³¤Îµ»ö¤Ï
¸½ºß¤Î¥¢¥¯¥»¥¹:39693 |