[Oracle] 오라클 관리자 인증방법 2가지

·2025년 9월 3일
0

오라클 관리

목록 보기
82/163


[이론1] 오라클 관리자 인증방법 2가지

  1. os 인증방법
    : 원격에서 리스너를 통해서 sys 유저로 접속할 수 없는 인증방법
    --> db를 내리려면 서버실을 가거나 putty로 접속해서 내리고 올려야됨
     
  2. password file 인증방법
    : 리스너를 통해서 sys 유저로 접속할 수 있는 인증방법

[실습1] 지금 현재 os 인증방법과 password file 인증방법 중 무엇으로 되어 있는지 확인하시오

SYS @ ORA19 > show parameter remote_login_passwordfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile            string      EXCLUSIVE

💡 exclusive로 되어있으면 password file 인증방법을 사용하겠다는 것이고, orangesql developersysdba 권한으로 접속할 수 있는 상태인 것


문제1. remote_login_passwordfile을 none 으로 변경하시오

SYS @ ORA19 > alter system set remote_login_passwordfile=none scope=spfile;

시스템이 변경되었습니다.

SYS @ ORA19 > startup force

[실습2] 다시 exclusive로 하고 리스너를 통해서 sys 유져로 접속되는지 확인하시오

SYS @ ORA19 > show parameter remote

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode             string      TIMESTAMP
remote_listener                      string
remote_login_passwordfile            string      NONE
remote_os_authent                    boolean     FALSE
remote_os_roles                      boolean     FALSE
remote_recovery_file_dest            string
result_cache_remote_expiration       integer     0
SYS @ ORA19 >
SYS @ ORA19 > alter system set remote_login_passwordfile=exclusive scope=spfile;

시스템이 변경되었습니다.

SYS @ ORA19 > startup force
ORACLE 인스턴스가 시작되었습니다.

Total System Global Area 2382363352 bytes
Fixed Size                  8899288 bytes
Variable Size             587202560 bytes
Database Buffers         1761607680 bytes
Redo Buffers               24653824 bytes
데이터베이스가 마운트되었습니다.
데이터베이스가 열렸습니다.
SYS @ ORA19 >
SYS @ ORA19 > show parameter remote

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode             string      TIMESTAMP
remote_listener                      string
remote_login_passwordfile            string      EXCLUSIVE
remote_os_authent                    boolean     FALSE
remote_os_roles                      boolean     FALSE
remote_recovery_file_dest            string
result_cache_remote_expiration       integer     0
SYS @ ORA19 >
SYS @ ORA19 > exit;
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0에서 분리되었습니다.

[oracle@ora19c ~]$
[oracle@ora19c ~]$ sqlplus sys/oracle_4U@192.168.13.69:21533/ORA19 as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on93 11:46:06 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

마지막 성공한 로그인 시간: 수 903 2025 11:17:54 +09:00

다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SYS @ 192.168.13.69:21533/ORA19 >

orange로도 sysdba 권한을 가진 sys 유져로 접속이 되는지 확인하시오

ㄴ 접속됨


[실습3] 다시 none 으로 변경하고 sysdba 권한을 갖는 sys 로 접속되는지 확인하시오

[oracle@ora19c ~]$ sys

SQL*Plus: Release 19.0.0.0.0 - Production on93 11:50:25 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SYS @ ORA19 > show parameter remote

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode             string      TIMESTAMP
remote_listener                      string
remote_login_passwordfile            string      EXCLUSIVE
remote_os_authent                    boolean     FALSE
remote_os_roles                      boolean     FALSE
remote_recovery_file_dest            string
result_cache_remote_expiration       integer     0
SYS @ ORA19 >
SYS @ ORA19 > alter system set remote_login_passwordfile=none scope=spfile;

시스템이 변경되었습니다.

SYS @ ORA19 > startup force
ORACLE 인스턴스가 시작되었습니다.

Total System Global Area 2382363352 bytes
Fixed Size                  8899288 bytes
Variable Size             587202560 bytes
Database Buffers         1761607680 bytes
Redo Buffers               24653824 bytes
데이터베이스가 마운트되었습니다.
데이터베이스가 열렸습니다.
SYS @ ORA19 >
SYS @ ORA19 > exit;
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0에서 분리되었습니다.

[oracle@ora19c ~]$
[oracle@ora19c ~]$ sqlplus sys/oracle_4U@192.168.13.69:21533/ORA19 as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on93 11:51:09 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

ERROR:
ORA-01017: 사용자명/비밀번호가 부적합, 로그온할 수 없습니다.


사용자명 입력:

orange에서도 sys 유져로 접속이 안되는지 확인하시오

ㄴ 접속 안됨


[실습4] 다시 exclusive로 변경해 놓으시오

[oracle@ora19c ~]$ sys

SQL*Plus: Release 19.0.0.0.0 - Production on93 11:52:42 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SYS @ ORA19 > show parameter remote

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode             string      TIMESTAMP
remote_listener                      string
remote_login_passwordfile            string      NONE
remote_os_authent                    boolean     FALSE
remote_os_roles                      boolean     FALSE
remote_recovery_file_dest            string
result_cache_remote_expiration       integer     0
SYS @ ORA19 >
SYS @ ORA19 > alter system set remote_login_passwordfile=exclusive scope=spfile;

시스템이 변경되었습니다.

SYS @ ORA19 > startup force
ORACLE 인스턴스가 시작되었습니다.

Total System Global Area 2382363352 bytes
Fixed Size                  8899288 bytes
Variable Size             587202560 bytes
Database Buffers         1761607680 bytes
Redo Buffers               24653824 bytes
데이터베이스가 마운트되었습니다.
데이터베이스가 열렸습니다.
SYS @ ORA19 >
SYS @ ORA19 > exit;
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0에서 분리되었습니다.

[oracle@ora19c ~]$
[oracle@ora19c ~]$ sqlplus sys/oracle_4U@192.168.13.69:21533/ORA19 as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on93 11:53:29 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

마지막 성공한 로그인 시간: 수 903 2025 11:49:14 +09:00

다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SYS @ 192.168.13.69:21533/ORA19 >

[실습5] remote_login_passwordfile이 exclusive로 되어있는 상태에서 패스워드 파일을 지우면 sys 유져로 리스너를 통해서 접속되는지 확인하시오

[oracle@ora19c ~]$ cd $ORACLE_HOME/dbs
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ ls -l orapw*
-rw-r-----. 1 oracle oinstall 6144  9월  3 11:54 orapwORA19
-rw-r-----. 1 oracle oinstall 2048  8월 26 11:32 orapwora19dw
-rw-r-----. 1 oracle oinstall 2048  8월 26 16:50 orapworakbm1
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ rm orapwORA19
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ sqlplus sys/oracle_4U@192.168.13.69:21533/ORA19 as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on93 11:58:44 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

ERROR:
ORA-01017: 사용자명/비밀번호가 부적합, 로그온할 수 없습니다.


사용자명 입력:

--> 접속 안됨


[실습6] 패스워드 파일을 생성하고 접속되는지 확인하시오

[oracle@ora19c dbs]$ rm orapwORA19
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ orapwd file=orapwORA19 password=kbm#2025
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ sqlplus sys/kbm#2025@192.168.13.69:21533/ORA19 as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on93 12:05:42 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SYS @ 192.168.13.69:21533/ORA19 >
SYS @ ORA19 > alter user sys
  2            identified by oracle_4U;

사용자가 변경되었습니다.

SYS @ ORA19 > exit;
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0에서 분리되었습니다.
[oracle@ora19c dbs]$ sqlplus sys/oracle_4U@192.168.13.69:21533/ORA19 as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on93 12:08:40 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

마지막 성공한 로그인 시간: 수 903 2025 12:05:42 +09:00

다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SYS @ 192.168.13.69:21533/ORA19 >

💡 강제로 패스워드를 변경하고 싶다면 다음과 같이 기존 12c로 변경하면 됩니다.
orapwd file=orapw파일명 password=비밀번호 format=12 force=y


문제1. sys 유져의 패스워드를 oracle1234 로 변경하고 접속되는지 확인하세요

[oracle@ora19c dbs]$ rm orapwORA19
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ orapwd file=orapwORA19 password=oracle1234 format=12 force=y
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ sqlplus sys/oracle1234@192.168.13.69:21533/ORA19 as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on93 12:12:34 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SYS @ 192.168.13.69:21533/ORA19 >

문제2. sys 유져의 패스워드를 다시 oracle_4U 로 변경하시오

[oracle@ora19c dbs]$ rm orapwORA19
[oracle@ora19c dbs]$ orapwd file=orapwORA19 password=oracle_4U format=12 force=y
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ sqlplus sys/oracle_4U@192.168.13.69:21533/ORA19 as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on93 13:44:17 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SYS @ 192.168.13.69:21533/ORA19 >

문제3. 오라클 파라미터를 잘못 변경해서 db가 올라오지 않는 상황을 만드시오

[oracle@ora19c ~]$ sys

SQL*Plus: Release 19.0.0.0.0 - Production on93 13:45:19 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SYS @ ORA19 > show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/19.3.0
                                                 /dbhome_1/dbs/spfileORA19.ora
SYS @ ORA19 >
SYS @ ORA19 >  alter system set remote_login_passwordfile='NONE' scope=spfile;

시스템이 변경되었습니다.

SYS @ ORA19 >
SYS @ ORA19 > startup force
ORACLE 인스턴스가 시작되었습니다.

Total System Global Area 2382363352 bytes
Fixed Size                  8899288 bytes
Variable Size             587202560 bytes
Database Buffers         1761607680 bytes
Redo Buffers               24653824 bytes
데이터베이스가 마운트되었습니다.
데이터베이스가 열렸습니다.
SYS @ ORA19 >
SYS @ ORA19 > show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/19.3.0
                                                 /dbhome_1/dbs/spfileORA19.ora
SYS @ ORA19 >
SYS @ ORA19 > create pfile from spfile;

파일이 생성되었습니다.

SYS @ ORA19 > exit;
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0에서 분리되었습니다.
[oracle@ora19c ~]$
[oracle@ora19c ~]$ cd $ORACLE_HOME/dbs
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ ls -l initORA*
-rw-r--r--. 1 oracle oinstall 1526  9월  3 13:50 initORA19.ora
-rw-r--r--. 1 oracle oinstall 1319  8월 29 10:46 initORA19_20250829.ora
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ vi initORA19.ora
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ grep 'remote_login_passwordfile' initORA19.ora
*.remote_login_passwordfile=exclusive
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ sys

SQL*Plus: Release 19.0.0.0.0 - Production on93 13:53:11 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SYS @ ORA19 > create spfile from pfile;
create spfile from pfile
*
1행에 오류:
ORA-32002: 인스턴스가 이미 사용 중인 SPFILE을 생성할 수 없음


SYS @ ORA19 > shutdown abort
ORACLE 인스턴스가 종료되었습니다.
SYS @ ORA19 >
SYS @ ORA19 > create spfile from pfile;

File created.

SYS @ ORA19 > startup
ORACLE instance started.

Total System Global Area 2382363352 bytes
Fixed Size                  8899288 bytes
Variable Size             587202560 bytes
Database Buffers         1761607680 bytes
Redo Buffers               24653824 bytes
데이터베이스가 마운트되었습니다.
데이터베이스가 열렸습니다.
SYS @ ORA19 >
SYS @ ORA19 > show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/19.3.0
                                                 /dbhome_1/dbs/spfileORA19.ora
SYS @ ORA19 > show parameter remote

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode             string      TIMESTAMP
remote_listener                      string
remote_login_passwordfile            string      EXCLUSIVE
remote_os_authent                    boolean     FALSE
remote_os_roles                      boolean     FALSE
remote_recovery_file_dest            string
result_cache_remote_expiration       integer     0
SYS @ ORA19 >

문제4. 다음의 상황을 만들고 문제를 해결하시오

SYS @ ORA19 > shutdown abort
ORACLE 인스턴스가 종료되었습니다.


SYS @ ORA19 >
SYS @ ORA19 >
SYS @ ORA19 > exit;
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0에서 분리되었습니다.
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ cd $ORACLE_HOME/dbs
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ rm spfileORA19.ora
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ vi initORA19.ora
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ grep 'remote_login_password' initORA19.ora
*.remote_login_passwordfile=nane
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ sys

SQL*Plus: Release 19.0.0.0.0 - Production on93 13:57:19 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

휴지 인스턴스에 접속되었습니다.

SYS @ ORA19 > startup
ORA-01078: failure in processing system parameters
LRM-00121: 'nane'���(���) 'remote_login_passwordfile'��� ������������ ������ ������������.
SYS @ ORA19 >

답:

[oracle@ora19c dbs]$ cd $ORACLE_HOME/dbs
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ ls -l initORA19.ora
-rw-r--r--. 1 oracle oinstall 1544  9월  3 13:58 initORA19.ora
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ vi initORA19.ora
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ grep 'remote_login_password' initORA19.ora
*.remote_login_passwordfile=exclusive
[oracle@ora19c dbs]$
[oracle@ora19c dbs]$ sys

SQL*Plus: Release 19.0.0.0.0 - Production on93 14:01:25 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

휴지 인스턴스에 접속되었습니다.

SYS @ ORA19 > create spfile from pfile;

File created.

SYS @ ORA19 > startup
ORACLE instance started.

Total System Global Area 2382363352 bytes
Fixed Size                  8899288 bytes
Variable Size             536870912 bytes
Database Buffers         1811939328 bytes
Redo Buffers               24653824 bytes
데이터베이스가 마운트되었습니다.
데이터베이스가 열렸습니다.
SYS @ ORA19 >
SYS @ ORA19 > show parameter remote

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode             string      TIMESTAMP
remote_listener                      string
remote_login_passwordfile            string      EXCLUSIVE
remote_os_authent                    boolean     FALSE
remote_os_roles                      boolean     FALSE
remote_recovery_file_dest            string
result_cache_remote_expiration       integer     0
SYS @ ORA19 >

0개의 댓글