히바리 쿄야 와 함께 하는 Developer Cafe
오라클 SQL PLUS CMD 계정 권한 설정 12G 엔터프라이즈 에서 적용 본문
Database
Technologies
Oracle Database 12c Release 1 (12.1.0.2.0) for Microsoft Windows (x64)
cmd 설정 오라클
Microsoft Windows [Version 10.0.19041.630]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\>sqlplus "/as sysdba"
SQL*Plus: Release 12.1.0.2.0 Production on 목 12월 10 14:23:06 2020
Copyright (c) 1982, 2014, Oracle. All rights reserved.
다음에 접속됨:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
12G 에서 처음에 이렇게 입력하면 오류남
SQL> create user 계정이름 identified by 비밀번호;
create user 계정이름 identified by 비밀번호;
*
1행에 오류:
ORA-65096: 공통 사용자 또는 롤 이름이 부적합합니다.
12G 부터 이렇게 표기 c## 기호 붙여야됨
SQL> create user c##계정이름 identified by 비밀번호;
사용자가 생성되었습니다.
SQL> grant connect, resource, dba to c##계정이름;
권한이 부여되었습니다.
c## 없애려고 alter 구문 적용
SQL> alter session set "_oracle_script"=true;
세션이 변경되었습니다.
SQL> create user 계정이름 identified by 비밀번호;
사용자가 생성되었습니다.
SQL> grant connect, resource, dba to 계정이름;
권한이 부여되었습니다.
스캇 계정
다음에 접속됨:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
create user c##scott identified by tiger;
SQL> alter session set "_oracle_script"=true;
세션이 변경되었습니다.
SQL> create user scott identified by tiger;
사용자가 생성되었습니다.
SQL> grant connect,resource,dba to scott;
권한이 부여되었습니다.
SQL> show user
USER은 "SCOTT"입니다
마지막 성공한 로그인 시간: 수 1월 13 2021 20:19:59 +09:00
다음에 접속됨:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> exit
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options에서 분리되었습니다.
C:\Users\SONG>sqlplus
SQL*Plus: Release 12.1.0.2.0 Production on 수 1월 13 20:37:01 2021
Copyright (c) 1982, 2014, Oracle. All rights reserved.
사용자명 입력: scott
비밀번호 입력:
마지막 성공한 로그인 시간: 수 1월 13 2021 20:36:30 +09:00
다음에 접속됨:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> select * from emp;
EMPNO ENAME JOB MGR HIREDATE
---------- -------------------- ------------------ ---------- --------
SAL COMM DEPTNO
---------- ---------- ----------
7369 SMITH CLERK 7902 80/12/17
800 20
7499 ALLEN SALESMAN 7698 81/02/20
1600 300 30
7521 WARD SALESMAN 7698 81/02/22
1250 500 30
EMPNO ENAME JOB MGR HIREDATE
---------- -------------------- ------------------ ---------- --------
SAL COMM DEPTNO
---------- ---------- ----------
7566 JONES MANAGER 7839 81/04/02
2975 20
7654 MARTIN SALESMAN 7698 81/09/28
1250 1400 30
7698 BLAKE MANAGER 7839 81/05/01
2850 30
EMPNO ENAME JOB MGR HIREDATE
---------- -------------------- ------------------ ---------- --------
SAL COMM DEPTNO
---------- ---------- ----------
7782 CLARK MANAGER 7839 81/06/09
2450 10
7839 KING PRESIDENT 81/11/17
5000 10
7844 TURNER SALESMAN 7698 81/09/08
1500 0 30
EMPNO ENAME JOB MGR HIREDATE
---------- -------------------- ------------------ ---------- --------
SAL COMM DEPTNO
---------- ---------- ----------
7900 JAMES CLERK 7698 81/12/03
950 30
7902 FORD ANALYST 7566 81/12/03
3000 20
7934 MILLER CLERK 7782 82/01/23
1300 10
12 행이 선택되었습니다.
SQL> select * from dept;
DEPTNO DNAME LOC
---------- ---------------------------- --------------------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL> select * from salgrade;
GRADE LOSAL HISAL
---------- ---------- ----------
1 700 1200
2 1201 1400
3 1401 2000
4 2001 3000
5 3001 9999
'DATABASE' 카테고리의 다른 글
[4일차] 오라클 데이터베이스/p360 ~ 416 / 제약조건 ,사용자, 롤, 권한관리 (0) | 2021.01.22 |
---|---|
[3일차] DO IT 오라클 데이터베이스 / p 242 ~ 358 / 서브쿼리, 트랜잭션, 뷰, 인덱스 (0) | 2021.01.21 |
[2일차] DO IT 오라클 데이터베이스/p127 ~ 240/ 그룹함수, 조인,집계함수 (0) | 2021.01.19 |
[1일차] DO IT 오라클 데이터베이스 / p15 ~ 126 / Select 문의 기본형식 Where 절과 연산자 (0) | 2021.01.15 |
오라클 12c 엔터프라이즈 스캇 계정 설정 다시 정리 (0) | 2021.01.14 |