Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
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
Tags
more
Archives
Today
Total
관리 메뉴

히바리 쿄야 와 함께 하는 Developer Cafe

오라클 SQL PLUS CMD 계정 권한 설정 12G 엔터프라이즈 에서 적용 본문

DATABASE

오라클 SQL PLUS CMD 계정 권한 설정 12G 엔터프라이즈 에서 적용

TWICE&GFRIEND 2020. 12. 11. 13:19

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

Comments