Oracle DB 사용하는법

Chan·2021년 11월 30일

Oracle

목록 보기
5/17

오렌지 단축키

https://jhnyang.tistory.com/227

오렌지

  • create user scott identified by "tiger" default tablespace scott_ts temporary tablespace temp ;
  • grant connect, resource, imp_full_database, exp_full_database to SCOTT;

TABLESPACE 생성하고 USER 로그인

  1. DIR 만들기
    oradata 안에 apa55353_ts 생성

  2. TABLESPACE 만들기
    apa55353_ts 안에서 sqlplus '/as sysdba'

  3. DATAFILE 만들기, 2g 크기
    SQL> create tablespace APA55353_TS datafile '/oradata/apa55353_ts/apa55353_ts.dbf' size 2g;

  4. apa55353 사용자 생성
    Orange> CREATE USER APA55353 IDENTIFIED BY "tiger" DEFAULT TABLESPACE APA55353_TS TEMPORARY TABLESPACE TEMP;

  5. 권한 connect, resource, imp_full_database, exp_full_database 주기
    Orange> grant connect, resource, imp_full_database, exp_full_database to APA55353;

TABLESPACE DATAFILE 추가, 크기 조절

  • DATAFILE 추가
    alter tablespace apa55353_ts add datafile
    '/oradata/apa55353_ts/apa55353_ts_data2.dbf' size 3g;

  • DATAFILE 크기 조절
    alter database datafile '/oradata/apa55353_ts/apa55353_ts.dbf' resize 1g;

USER 생성, 권한 주고 사용량 할당하기

  • create user apa55353 identified by "tiger" default tablespace apa55353_ts temporary tablespace temp ;
  • grant connect, resource, imp_full_database, exp_full_database to apa55353;
  • alter user apa55353 quota 30G on apa55353_ts ;
  • alter user apa55353 quota 5G on system ;

실험 기본 데이터 생성/복구

  • apa55353.dmp 생성

  • dmp 파일 있는 곳에서

  • imp apa55353/tiger file=apa55353.dmp log=apa55353_imp.log buffer=102400000 commit=n fromuser=apa55353 touser=apa55353 ignore=yes

  • Orange> select * from USER_TABLES;

profile
Backend Web Developer

0개의 댓글