728x90
반응형

Oralce 환경설정 방법

앞서 docker-compose 를 이용한 Oracle 19c 설치 글에서는 단순히  설치 방법에 대해서 알아보았습니다. 

이번에는 Docker 설치후 테스트를 좀더 효율적으로 진행하기 위한 방법에 대해 소개하겠습니다. 

 

_ORACLE_SCRIPT 파라미터 적용 

19c 에서는 테이블이나 유저를 생성하게 되면 ORA-65096 에러가 발생 합니다. 

_ORACLE_SCRIPT  파라미터를 변경함으로서 에러발생을 해결 할 수 있습니다. 

 

 

SQL> create user test1 identified by test;
create user test1 identified by test
            *
ERROR at line 1:
ORA-65096: invalid common user or role name


SQL> ALTER SESSION SET "_ORACLE_SCRIPT"=true;

Session altered.

SQL> 
SQL> create user test1 identified by test;        

User created.

외부 장비 접속 설정 (네트워크 설정)

 

tnsnames.ora 설정

ORCLCDB=localhost:1521/ORCLCDB

ora19c= 
(DESCRIPTION = 
  (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
  (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = ORCLCDB)
  )
)
ORCLPDB1= 
(DESCRIPTION = 
  (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
  (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = ORCLPDB1)
  )
)

listener.ora 설정

LISTENER =
(DESCRIPTION_LIST =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
  )
)

SID_LIST_LISTENER =
(SID_LIST =
    (SID_DESC =
        (GLOBAL_DBNAME = ORCLCDB)
        (SID_NAME = ORCLCDB)
    )     
    (SID_DESC =
        (GLOBAL_DBNAME = ORCLPDB1)
        (SID_NAME =ORCLPDB1)                
    )
)

 

 

리스너 재시작 

[oracle@01a4f713764f ~]$ lsnrctl stop

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 20-MAR-2022 13:34:19

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
The command completed successfully
[oracle@01a4f713764f ~]$ lsnrctl stop

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 20-MAR-2022 13:34:23

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=0.0.0.0)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
[oracle@01a4f713764f ~]$ lsnrctl start 

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 20-MAR-2022 13:34:36

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

Starting /opt/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/01a4f713764f/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                20-MAR-2022 13:34:37
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/01a4f713764f/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Services Summary...
Service "ORCLCDB" has 1 instance(s).
  Instance "ORCLCDB", status UNKNOWN, has 1 handler(s) for this service...
Service "ORCLPDB1" has 1 instance(s).
  Instance "ORCLPDB1", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

리스너 상태 확인 

[oracle@01a4f713764f ~]$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 20-MAR-2022 13:35:44

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                20-MAR-2022 13:34:37
Uptime                    0 days 0 hr. 1 min. 7 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/01a4f713764f/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=01a4f713764f)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/ORCLCDB/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "ORCLCDB" has 2 instance(s).
  Instance "ORCLCDB", status UNKNOWN, has 1 handler(s) for this service...
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Service "ORCLCDBXDB" has 1 instance(s).
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Service "ORCLPDB1" has 2 instance(s).
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
  Instance "ORCLPDB1", status UNKNOWN, has 1 handler(s) for this service...
Service "da8f3910a1110e42e053020012ac8b77" has 1 instance(s).
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@01a4f713764f ~]$ 

sqlplus 접속 확인

 

[oracle@01a4f713764f ~]$ sqlplus sys/oracle@ora19c as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Mar 20 13:37:44 2022
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select * from dual;

D
-
X

 

728x90
반응형

+ Recent posts