2011. 10. 27. 17:12

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

Oracle2009. 9. 18. 11:16
해당 서버의 table, procedure, trigger.. 등의 내용을 스크립트로 저장
Toad For Oracle

2009/02/04 15:22

복사 http://blog.naver.com/csr1214/20061393061

간혹 서버의 내용을 테스트하기 위해서 table, procedure 등등.. 내용을

다른 컴퓨터에 셋팅할때까 있다. 그 많은 table 을 하나 하나 만든다면... 헉 ㅠㅠ

생각만해도 끔찍할 수 없다.

토드에서 스크립트로 만들어서, 데이터만 옮긴다면 많은 시간을 절약 할 수 있을것이다.

 

1. "Database" → "Export" → "Export DDL" 선택

 

 

2. "Add" 버튼을 눌러준다.

 

 

3. 어떤 계정의 table, function, procedure, trigger, index... 등을 내려 받을지 선택을해준다

    → "▶" 눌러준다.

 

 

4. 만들 자료들이 들어와 있을것이다. 여기에서 불필요한것을 제외 시키고 "OK" 버튼을 눌러준다.

 

 

5. "Output" 에서 자료를 어떻게 받을지를 설정 한 후 → "▶" 눌러준다.

     나는 "HR.SQL" 파일로 받으라고 설정을 해주었다

 

 

6. 밑에 파일은 HR.SQL 파일을 열어 본것이다. ㅋㅋㅋ

    이 파일을 다른 PC로 가지고 가서 실행하면 서버의 테이블, 프로시저, 트리거, 함수등의

    내용이 금방 만들어진다. 움하하.. 쉽지 않은가... ㅋㅋ

 

 


Posted by Julyus
Oracle2009. 9. 18. 10:52

[출처] 토드 export and Import|작성자 살가죽

TOAD 메뉴의

DBA->Export Utility Wizard 에서

3번째의

Export this database

Exports this entire database. EXP_FULL_DATABASE role required.

선택후

Next 후 옵션 그대로 Next  후

Export 파일명 입력 후 Next

그다음 Finish 를 누르면 백업성공

 

Import!!

Local 일경우

도스창에서

imp system/manager FROMUSER=유저명 file=export파일명 을 넣으면

복구완성

 

 

원하는 Table 내용 백업

Table 우클릭후 export  => 내용에 맞게 선택후 파일이름 설정

 

 

결과값 Excel 파일로 저장

결과창 우클릭후 save As => 내용에 맞게 선택후 파일이름 설정 (단, write wide String 항목을 선택해줘야 한글깨짐이 없다)

Posted by Julyus
Oracle2009. 8. 12. 11:26

9i에서 10g export시 에러 (BLOB 컬럼) java/jsp/servlet

2008/04/11 10:20

복사 http://blog.naver.com/woorinil/140050413262

9i 서버에서 10g서버의 데이터를 export 에서 9i서버에 import 할려고 합니다.

 

테스트 (3가지 방법시도)

1. 10g에서 export -> ftp 9i로 전송 -> 9i import 에러

exp  aaa/aaa tables=atable,btable file=exp.dmp compress=y

ftp 전송

imp aaa/aaa file=exp.dmp fromuser=aaa touser=aaa  --> 에러발생


Import: Release 9.2.0.4.0 - Production on Tue Jan 8 09:58:54 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
JServer Release 9.2.0.4.0 - Production

IMP-00010: not a valid export file, header failed verification
IMP-00000: Import terminated unsuccessfully




2. 10g에서 export후 9i로 import 시 에러발생

exp  aaa/aaa tables=atable,btable file=exp.dmp compress=y

imp aaa/aaa@9i file=exp.dmp fromuser=aaa touser=aaa    ---> 에러발생

 

Import: Release 10.2.0.1.0 - Production on Tue Jan 8 10:45:51 2008

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


IMP-00058: ORACLE error 6550 encountered
ORA-06550: line 1, column 33:
PLS-00302: component 'SET_NO_OUTLINES' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
IMP-00000: Import terminated unsuccessfully


3. 9i 에서 10g export시도 에러

exp 
aaa/aaa@10g tables=atable,btable file=exp.dmp compress=y  --> 에러발생

Export: Release 9.2.0.4.0 - Production on Tue Jan 8 10:54:48 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Export done in KO16KSC5601 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table                   atable       2380 rows exported
. . exporting table                   btable
EXP-00003: no storage definition found for segment(6, 32691)
Export terminated successfully with warnings.

 

===> 해결책

참고로 아래의 내용은 예전에 9i -> 9i 할때 했던 방식입니다..

테스트 DB 세팅하면서 했던 기억이..

10g도 별문제 없이 될거라 예상되네요..

안되면 다시 리플 달아 주세요.. 테스트 해보게요.. ^^

그리고 CLOB 일때 테스트 한거에요..^^

 

catexp.sql 에서 exu9tne 뷰를 정의해 놓은 부분을 찾으시던지..

아니면 sys.exu9tne view  생성 스크립트 찾으셔서..

아래의 것을 추가 해주시면 됩니다.

 

UNION ALL
SELECT * from sys.exu9tneb

즉 sys 유저로 exu9tne 뷰만 다시생성 한후 export 를 실행하세요~~

 

ex)
CREATE OR REPLACE VIEW exu9tne (
tsno, fileno, blockno, length) AS
SELECT ts#, segfile#, segblock#, length
FROM sys.uet$
WHERE ext# = 1 =====================> 원래 요기까지 있습니다.
UNION ALL
SELECT * from sys.exu9tneb
/

 

--> export 후에 다시 원보하시면 끝납니다..

ex)
CREATE OR REPLACE VIEW exu9tne (
tsno, fileno, blockno, length) AS
SELECT ts#, segfile#, segblock#, length
FROM sys.uet$
WHERE ext# = 1 =====================> 원래 요기까지 있습니다.
UNION ALL         =====================> 이줄삭제.
SELECT * from sys.exu9tneb ===========> 이줄삭제.
/

 

출처 : DBGuide.net http://www.dbguide.net/dbqa/dbqa111003.jsp?catenum=26&idx=8618

Posted by Julyus
Oracle2009. 8. 12. 11:15
exp PVMS/PVMS123@ORCL file=UANGEL_PVMS_%DATE:~2,10%.dmp log=UANGEL_PVMS_%DATE:~2,10%_exp.log buffer=1048576
exp OROMMAN/OROMMAN@OROM161 file=KMS_OROMMAN_%DATE:~2,10%.dmp log=KMS_OROMMAN_%DATE:~2,10%_exp.log buffer=1048576

imp maestro_soon/maestro_soon@orom170 file=maestro_soonchun_exp.dmp log=maestro_kistep_imp.log buffer=1048576 commit=y grants=y ignore=y full=y

Posted by Julyus