Oracle SQLcl로 Autonomous Database on Dedicated Exadata Infrastructure에 연결하기

참고:

이 지침을 설명하는 "체험하기" 대안을 제시하려면 Oracle Autonomous Database 전용 워크숍Lab 2: Configure a Development System에서 Task 4: Connect to your autonomous DB using SQL Worksheets from Database Actions, SQLCL and SQL Plus를 실행하세요.
SQLcl(Oracle SQL Developer Command Line)은 Oracle Database용 명령행 인터페이스입니다. 대화식으로 실행하거나 SQL 및 PL/SQL을 일괄 실행할 수 있습니다. SQLcl는 기능이 풍부한 환경을 위해 인라인 편집, 명령문 완료 및 명령 리콜을 제공하는 동시에 이전에 작성한 SQL*Plus 스크립트도 지원합니다.
SQLCl을 Autonomous Database에 연결하려면 SQLCl를 실행하는 시스템에 Autonomous Database에 대한 네트워크 액세스 권한이 있어야 합니다. 이를 위해 다음 방법 중 하나를 사용할 수 있습니다.

SQLcl 버전 4.2 이상을 Autonomous Database와 함께 사용할 수 있습니다. oracle.com에서 SQLcl을 다운로드합니다.

SQLcl는 Oracle Call Interface(OCI) 또는 JDBC Thin 접속을 사용하여 Autonomous Database에 접속할 수 있습니다.

SQLcl 및 Oracle Call Interface

Oracle Call Interface를 사용하여 접속하려면 –oci 옵션을 사용하여 tnsnames.ora 파일에 제공된 데이터베이스 사용자 이름, 비밀번호 및 데이터베이스 서비스 이름을 제공합니다. 예:

sql -oci

SQLcl: Release 19.1 Production on Mon Jan 18 09:28:38 2021

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

Username? (''?) sales_trans@atpc1_low
Password? (**********?) **************
Last Successful login time: Mon Jan 17 2019 15:29:19 -07:00

Connected to:
Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production
Version 19.9.0.0.0

SQL>

Oracle Call Interface를 사용하여 접속할 때 Oracle Wallet은 SQLcl에 투명합니다.

JDBC Thin 접속이 있는 SQLcl

JDBC Thin 접속을 사용하여 접속하려면 먼저 SQLcl 클라우드 구성을 구성한 다음 Autonomous Database에 접속합니다.

  1. /nolog 옵션으로 SQLcl을 시작합니다.
    sql /nolog
    
  2. Oracle Wallet을 사용하도록 SQLcl 세션을 구성합니다.
    SQL> set cloudconfig directory/client_credentials.zip
    Wallet Password:  **********
  3. 다음과 같이 Autonomous Database에 연결합니다.
    SQL> connect username@servicename
    password

    예:

    sql /nolog
    
    SQLcl: Release 19.1 Production on Mon Jan 18 09:28:38 2021
    
    Copyright (c) 1982, 2021, Oracle.  All rights reserved.
    
    SQL> set cloudconfig /home/atpc/wallet_ATPC.zip
    Operation is successfully completed.
    Operation is successfully completed.
    Using temp directory:/tmp/oracle_cloud_config3643858537577169472
    
    SQL> connect admin@atpc_medium
    Password? (**********?) ************
    Connected.

tnsnames.ora에 지정된 접속 유형에 대한 자세한 내용은 자율운영 데이터베이스에 대해 미리 정의된 데이터베이스 서비스 이름을 참조하십시오.

SQLcl에 대한 자세한 내용은 Oracle SQLcl을 참조하십시오.