Oracle SQLcl을 통해 전용 Exadata 인프라의 자율운영 AI 데이터베이스에 연결

참고:

For a "try it out" alternative that demonstrates these instructions, run Task 4: Connect to your autonomous DB using SQL Worksheets from Database Actions, SQLCL and SQL Plus from Lab 2: Configure a Development System in the Oracle Autonomous AI Database Dedicated Workshop.
SQLcl(Oracle SQL Developer Command Line)은 Oracle Database용 명령행 인터페이스입니다. 대화식으로 실행하거나 SQL 및 PL/SQL을 일괄 실행할 수 있습니다. SQLcl는 기능이 풍부한 환경을 위해 인라인 편집, 명령문 완료 및 명령 리콜을 제공하는 동시에 이전에 작성한 SQL*Plus 스크립트도 지원합니다.
SQLCl를 자율운영 AI 데이터베이스에 연결하려면 SQLCl를 실행하는 시스템에 자율운영 AI 데이터베이스에 대한 네트워크 액세스 권한이 있어야 합니다. 이 작업은 다음 방법 중 하나를 사용하여 수행할 수 있습니다.

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

SQLcl는 Oracle Call Interface(OCI) 또는 JDBC Thin 연결을 사용하여 자율운영 AI 데이터베이스에 연결할 수 있습니다.

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 클라우드 구성을 구성한 다음 자율운영 AI 데이터베이스에 접속합니다.

  1. /nolog 옵션으로 SQLcl을 시작합니다.
    sql /nolog
    
  2. Oracle Wallet을 사용하도록 SQLcl 세션을 구성합니다.
    SQL> set cloudconfig directory/client_credentials.zip
    Wallet Password:  **********
  3. 자율운영 AI 데이터베이스에 연결하기:
    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에 지정된 연결 유형에 대한 Predefined Database Service Names for Autonomous AI Databases을 참조하십시오.

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