블로그 이미지
소소한 일상
by 라르시엔

NOTICE

CALENDAR

«   2009/07   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
  • Total : 320
  • Today : 0  | Yesterday : 0

CATEGORY

분류 전체보기 (1)
oracle (0)
working holiday (0)
music (0)

RECENT COMMENT

RECENT TRACKBACK

ARCHIVE



10g R2 까지 공식적으로 지원하지 않는다.
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:30020192108317 참조.

어떤 사이트에서는
====================
select * from user$ ;
user#  name
23      OEM_MONITOR 
24      DBSNMP 
55      olduser

update user$ set olduser = newuser where user$=55;
commit;
====================
하면 된다지만, 해봤으나 안된다 - _-

다른 사이트 많이 찾아보았으나, 대다수가 공식적으로 지원안딘다고 한다. 위 링크참조해보면 Tom아저씨도 긍정적으로 생각하는듯(해석한게 맞다면 - _-;)

그대신 링크에서 찾은 transport_tablespace를 이용한 빠르게 table과 index 옴기기 방법.
톰아저씨가 'very nice'란다 ㅋ

1. create user new_user...
2. grant ... to new_user;
3. execute dbms_tts.transport_set_check(...);
--만약 table과 index가 각기 다른 tablespace에 저장되어 있다면, 두개를 모두 포함시켜야 한다. select * from transport_set_violations; 로 체크 가능. 없어야 정상.
4. alter tablespace ... read only;-- tablespace의 transaction방지를 위해 하는 듯.
--물리적인 data파일도 import할 때 필요하므로 백업해 놓는다. .
--select tablespace_name, file_name from dba_data_files
--where tablespace_name = 'USERS';
--copy 'c:\.....' 'c:\backup\....'
5. exp transport_tablespace=y tablespaces=...
--export 한뒤 바로 tablespace를 read write 상태로 바꾸는게 좋을듯. 10번참조.
--alter tablespace users read write;
6. drop tablespace ... including contents;
--test이므로 같은 instance에서 import하기 위해 함.
--찾아본 결과 transport tablespace는 이기종간의 깔린 오라클 끼리
--모두 실행 가능하다고 한다.

7. imp transport_tablespace=y tablespaces=... datafiles=... fromuser=old_user touser=newuser
8. create nondata objects in new_user schema
--명령은 아니고, 정상적으로 임포트되었는지 테스트해보라는 의미인듯 하다.
9. [drop user old_user cascade;
10. alter tablespace ... read write;

더 자세하게 알고 싶으시면
http://www.superuser.co.kr/home/lecture/index.php?cateNo=3&secNo=17&theNo=52&leccode=10085
참고해보시길 ^^

Trackback 0 And Comment 0