## backup profile
netsh wlan export profile key=clear folder=C:\wifi_profiles (폴더 없으면 C:\ 에다가)
## restore profile
netsh wlan add profile filename=”c:\wifi_profiles\totoli_AP.xml” user=all (백업된 프로파일 하나씩 복원)
## backup profile
netsh wlan export profile key=clear folder=C:\wifi_profiles (폴더 없으면 C:\ 에다가)
## restore profile
netsh wlan add profile filename=”c:\wifi_profiles\totoli_AP.xml” user=all (백업된 프로파일 하나씩 복원)
Oracle Data Pump 유틸리티의 사용법을 알아보겠습니다.
Oracle Data Pump 유틸리티를 사용하기 위해서는 덤프 파일이 생성될 폴더를 지정하고, 그 폴더에 읽기, 쓰기 권한이 있어야 합니다.(데이터 import 를 위해 읽기, export를 위해 쓰기 권한이 필요합니다.)
이 예제에서는 Oracle Express Editon 11g r2를 사용해서 테스트 했습니다.
※ 디렉토리 생성 및 권한 주기
1. SYSTEM으로 로그인합니다.(일반 계정으로는 디렉토리를 추가할 권한이 없으므로 SYSTEM 계정으로 추가하고, 권한을 줍니다.)
2. 덤프 파일이 생성될 디렉토리를 생성합니다. 여기서는 ‘E:\export’ 를 만들었습니다.(이 폴더는 데이터베이스 서버에 만드는 것입니다.)
3. ‘E:\export’ 디렉토리를 TEST_DUMP 다른 이름으로 데이터베이스에 등록합니다.
CREATE OR REPLACE DIRECTORY TEST_DUMP AS 'E:\export';
4. 일반유저인 xeuser에게 이 디렉토리에 읽기, 쓰기 권한을 줍니다.
GRANT READ, WRITE ON DIRECTORY TEST_DUMP TO xeuser;
5. xeuser 계정으로 로그인하여 권한을 확인합니다.
– 디렉토리는 all_directories 뷰에서 확인할 수 있습니다.
SELECT * FROM all_directories; 결과) OWNER DIRECTORY_NAME DIRECTORY_PATH SYS TEST_DUMP E:\export
– 권한의 확인은 다음과 같이 할 수 있습니다.
SELECT * FROM all_tab_privs WHERE TABLE_NAME IN ( SELECT DIRECTORY_NAME FROM all_directories ); 결과) GRANTOR GRANTEE TABLE_SCHEMA TABLE_NAME PRIVILEGE GRANTABLE HIERARCHY SYSTEM XEUSER SYS TEST_DUMP READ NO NO SYSTEM XEUSER SYS TEST_DUMP WRITE NO NO
– Oracle 11g r2 이상이라면 다음 쿼리도 사용할 수 있습니다.
SELECT * FROM datapump_dir_objs; 결과) NAME PATH READ WRITE TEST_DUMP E:\export TRUE TRUE
※ 데이터 export/import 하기
Oracle Data Pump는 명령행 유틸리티 expdp/impdp를 사용해서 작업합니다.
1. 테이블 export/import(특정 테이블을 export/import 합니다.)
E:\>expdp xeuser/xeuser@xe tables=EMP,DEPT directory=TEST_DUMP dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log E:\>impdp xeuser/xeuser@xe tables=EMP,DEPT directory=TEST_DUMP dumpfile=EMP_DEPT.dmp logfile=impdpEMP_DEPT.log
* xeuser/xeuser@xe – 로그인아이디/비밀번호@SID 입니다.
* tables=EMP, DEPT – 테이블을 콤마(,)로 분리해서 나열합니다.
* directory=TEST_DUMP – 덤프 파일이 생성될 디렉토리입니다. 위해서 만들것 입니다.
* dumpfile=EMP_DEPT.dmp – 생성될 덤프 파일의 이름 입니다.
* logfile=expdpEMP_DEPT.log – 로그 파일의 이름입니다. 덤프파일과 같은 위치에 만들어 집니다.
2. 스키마(Schema) export/import 하기
E:\>expdp xeuser/xeuser@xe schemas=XEUSER directory=TEST_DUMP dumpfile=XEUSER.dmp logfile=expdpXEUSER.log E:\>impdp xeuser/xeuser@xe schemas=XEUSER directory=TEST_DUMP dumpfile=XEUSER.dmp logfile=impdpXEUSER.log
* schemas=XEUSER : 주어진 사용자(schema)가 가진 전체 객체를 export/import합니다.(이전 exp의 OWNER와 같은 기능의 옵션 입니다.)
3. 데이터베이스 전체 export/import 하기
E:\>expdp system/password@xe full=Y directory=TEST_DUMP dumpfile=XE.dmp logfile=expdpXE.log E:\>impdp system/password@xe full=Y directory=TEST_DUMP dumpfile=XE.dmp logfile=impdpXE.log
* 전체 작업은 권한이 있는 system 계정으로 작업합니다.
* full=Y – 전체 데이터베이스를 대상으로 합니다.
4. 데이터베이스 Link를 export/import 하기
데이터베이스 Link를 통해서 export/import 하기 위해서는 로컬과 리모트 사용자 모두에게 EXP_FULL_DATABASE / IMP_FULL_DATABASE 롤이 부여되어 있어야 합니다.
다음 예는 로컬계정 은 xeuser이고, 리모트 서버가 REMOTE_SCOTT라는 이름으로 링크 되어 있다고 가정합니다. 리모트 계정은 scott 입니다.
E:\>expdp xeuser/xeuser@xe tables=SCOTT.EMP network_link=REMOTE_SCOTT directory=TEST_DUMP dumpfile=EMP.dmp logfile=expdpEMP.log E:\>impdp xeuser/xeuser@xe tables=SCOTT.EMP network_link=REMOTE_SCOTT directory=TEST_DUMP logfile=impdpSCOTT.log remap_schema=SCOTT:XEUSER
* remap_schema=SCOTT:XEUSER – SCOTT계정의 객체들을 XEUSER계정으로 로드 합니다.
5. 버전을 지정하여 export 합니다.(버전은 9.2 이상만 지정할 수 있습니다.)
E:\>expdp xeuser/xeuser@xe schemas=XEUSER version=10.2 directory=TEST_DUMP dumpfile=XEUSER.dmp logfile=expdpXEUSER.log
이것으로 Oracle Data Pump 사용법에 대해 알아보았습니다.
자세한 옵션들에 대해서는 다음 URL을 참고 하세요.
출처 : https://oracle-base.com/articles/10g/oracle-data-pump-10g