Oracle Cloud Free Tier 가입이 새롭게 변경되었습니다.

기존보다 간편하고 바로 사용할 수 있도록 개편되었습니다.

Oracle Cloud Free Tier(2021 ver.)

https://yooloo.tistory.com/28

 

Oracle Cloud Free Tier란?

오라클 클라우드 프리티어는 평생 무료인 Always Free 서비스와 30일 무료체험인 30-day Free Trial 서비스입니다. 이전에 Oracle Cloud Free Tier 또는 Free Trial에 가입하지 않은 사람은 누구나 신청 가능합니다. 기존에 Free Tail에 가입한 사람도 Always Free를 제공한다고 했는데, 제 경우에는 Always Free 서비스가 되지 않더군요. 기존에 이미 등록한 분에 대해서는 추후 확인하여 사용할 수 있는 방법을 알려드리겠습니다.

 

Oracle Free Tier에서 제공하는 서비스

  • 무제한 서비스(Always Free)
  • 30일 Free Trial(30-day Free Trial)

Always Free서비스는 다음의 제공받은 자원을 평생 제한없이 사용할 수 있습니다.

  • 1 OCPU와 20GB 스토리지를 가진 2개의 자율주행 데이터베이스(ATP, ADW)
  • 1/8 OCPU and 1 GB 메모리를 가진 VM 2개
  • 100GB Block Volume 2개.
  • 10 GB Object Storage.
  • 10 GB Archive Storage.
  • Load Balancer, 1 instance, 10 Mbps bandwidth.
  • Monitoring, 500 million ingestion datapoints, 1 billion retrieval datapoints.
  • Notifications, 1 million delivery options per month, 1,000 emails sent per month.
  • Outbound Data Transfer, 10 TB per month.

30-day Free Trial은 USD 300$ 크레딧을 30일간 무료로 제공하는 프로그램입니다

  • Compute  : 3,500 hours, 1.5 TB of storage. High-performance VMs and bare metal servers.
  • 112 million invocations and 20 million gigabyte memory-seconds of execution time.
  • Storage : 5 TB storage. Object and block storage to store and access data at scale.

사용 가능 서비스(별첨 참조)

30일이 경과하거나, 300불이 소진될 때까지 사용할 수 있습니다. 크레딧은 시간 단위로 계산됩니다.

오라클 클라우드 프리티어 신청 시 신용카드를 입력해야 합니다.

사용자 확인을 위해 오라클 싱가폴에서 1달러(SGD 1$)를 결제하고 바로 해당 결제를 승인취소합니다. 오라클 클라우드 트라이얼은 사용 기간과 크레딧이 한정된 서비스입니다. 30일 동안 제공된 크레딧을 초과하여 사용할 수 없습니다. 사용량 초과에 대한 신용카드 청구는 발생하지 않습니다.

오라클 클라우드 프리티어 신청

프리티어 신청 페이지

오라클 클라우드 프리티어를 신청하기 위해서는 Email, 핸드폰번호, 신용카드가 필요합니다. 오라클 클라우드 프리티어 신청 홈페이지는 https://cloud.oracle.com 이나 https://oracle.com 입니다. 얼마전까지는(2019.8월) cloud.oracle.com 이었으나, 최근(2019년 9월) 기존 oracle홈페이지와 oracle cloud 홈페이지를 하나로 통합했습니다.

우측 상단의 “Oracle cloud Free Tier”를 클릭합니다. 무료 등록 페이지가 나타납니다.

그림 1: http://cloud.oracle.com

 

아래 페이지에서 “Start for free” 버튼을 클릭합니다. Email 계정과 국가선택, 약관동의 화면이 나타납니다.

그림 2: Start for free클릭

계정생성

아래의 계정 생성 화면에서 Email Address 입력, 국가 선택, 4개의 약관에 동의한 후 “Next” 버튼을 클릭합니다. 단, 기존에 Try for Free를 이용했거나, Free Tier를 이용한 Email Address를 입력할 경우, 이미 등록이 되어 있다는 오류 메시지가 출력됩니다.

It looks like you are already registered.

This email address is already assigned to an Oracle Cloud Account.

Email Address : Email 주소 입력

Country/Territory : South Korea 선택

Terms of Use : 이용약관 동의

<그림 3>은 계정에 대한 상세 내역을 입력하는 화면입니다.

계정 상세 정보 입력.

Account Type : 회사용인지 개인용인지 선택

Cloud Account Name : 클라우드의 모든 자원을 관리할 수 있는 root Account입니다. 중복 이름은 허용이 안되고 영문 소문자와 숫자의 조합만 가능합니다.

Home Region : 클라우드를 구축할 기본 지역을 선택. 예) South Korea Central(Seoul). 참고로 대한민국에는 현재(2019년 9월) 가용도메인(Avalibility Domain)이 하나입니다. 2개 이상의 가용도메인이 필요한 경우, 가용도메인이 3개인 US East(Ashburn)를 선택해도 됩니다. 대한민국에는 2020년 상반기에 가용도메인(또는 Region)을 추가할 예정입니다.

First Name, Last Name, Address, City, Province, Zip/Postal code : 이름, 성, 주소, 도시, 지역, 우편번호 입력

예) City와 Province : 외국의 경우에는 State(미국 등에서 사용), Province(캐나다, 호주에서 사용)를 행정구역을 나누는데 한국은 City는 ‘시’로 State/Province는 ‘도’로 보시면 됩니다. 경기도 성남시라면 City는 ‘성남’, State/Province는 ‘경기’로 보시면 됩니다.

영문 주소 sample : 서울 강서구 마곡중안 8로 LG사이언스파크 E14

Address : LG sciencepark E14 Magockjungang 8-ro Gangseo-gu,Seoul

City : Seoul

Province : Seoul

Zip/Postal code : 07795

 

휴대폰 번호 : 휴대폰 번호 입력 시 010 으로 시작하는 ‘0’을 입력해도 되고 안해도 됩니다. ‘0’을 입력하지 않았을 경우에는 주소 검증창에서 “Use Original”이나 “Use Validated”를 클릭합니다. ‘0’을 입력한 경우에는 주소 검증창에서 “Use Validated”를 클릭해야 합니다. 국제전화 표기법에 따라 ‘010’으로 시작하는 ‘0’을 입력하지 않는 것이 좋습니다. 해외직구나 다른 사이트에서 대한민국 국제전화 입력 시 ‘0’을 처리해주지 않을 수 있습니다.

“Next: Verify Mobile Number” 버튼 클릭합니다.

Account Details: 사용자 정보 입력 - 이름, 메일, 주소

Validation Code: 핸드폰 SMS 코드 인증

Credit Card Details: 신용카드 정보 입력(비자카드, 마스터카드)

Terms&Condition: 라이선스 및 사용권 동의

 

휴대폰 인증

입력한 휴대폰 정보가 올바른지 휴대폰으로 인증코드 전송을 요청하는 화면입니다. “Use Validated” 를 클릭합니다.

EDIT : 기존 입력사항 수정

Use Orginal : 입력한 휴대폰번호로 인증코드 전송. 만일 010으로 입력을 했다면 그 번호를 그대로 사용하여 인증코드를 전송하는데, 전송이 되지 않습니다. 휴대폰번호를 0을 제외하고 입력했다면 인증코드가 전송됩니다.

Use Validated : 검증된 휴대폰번호로 인증코드 전송. 만일 010으로 입력을 했다면 처츰 ‘0’을 제거하고 인증코드를 전송합니다.

 

인증코드 입력

휴대폰으로 전송된 오라클 인증코드 7자리의 숫자를 2분 이내로 입력한 후 “Verify code”를 클립합니다.

휴대폰 문자내역 à [국제발신] Your Oracle Cloud verification code is xxxxxxx : 7자리 숫자.

 

클라우드 root 계정에 대한 패스워드를 생성합니다. 보안 규칙이 까다롭습니다. 클라우드 계정은 클라우드의 모든 자원과 사용자 권한, 비용 등을 관리하므로 패스워드 관리를 잘 해야 합니다. 패스워드 입력 후 “Next Payment Information”을 클릭합니다.

패스워드 생성 규칙

12자 이상

40자 미만

First Name(이름) 포함 불가

Last Name(성) 포함 불가

Email 주소 포함 불가

최소 1자 이상 소문자 포함

최소 1자 이상 대문자 포함

최소 1자 이상 숫자 포함

최소 1자 이상 특수문자 포함

지불정보 입력

지불정보 내용입니다. 계정을 upgrade하지 않는 한 과금되지 않고, 인증을 위해 지불수단(카드)에 임시로 청구한 후 자동으로 취소됩니다. 싱가폴 달러로 1달러(SGD 1$)가 결제된 후 취소됩니다.

신용카드를 정보를 입력하기 위해 “Add Credit Card Details” 버튼을 클릭합니다.

카드는 Visa, Mastercard, Amex 만 가능합니다. 보유하고 있는 카드번호, 카드 유효년월, CVN을 입력한 후 “Finish” 버튼을 클릭합니다.

최종 지불 정보에 동의를 체크한 후 “Complete Sign-Up” 을 클릭한다.

 

계정 생성에 약 1~2분 정도 소요됩니다.

 

등록에 대한 감사 페이지입니다.

계정 생성에 15분 정도 소요된다는 내용과 email을 확인하라는 내용입니다. 처음에 입력한 email을 확인합니다.

 

최종 승인 메일

등록한 Email을 확인합니다.

Thank you for signing up for an Oracle Cloud Account. We are reviewing your request”라는 제목으로 이메일이 날라옵니다. 계정생성 요청에 대해 검토한다는 내용입니다. 아직 오라클 클라우드를 사용할 수 있는 환경이 구성된 상태는 아닙니다.

 

Email을 통한 사인인

 

약 2~3일 후에, oracle에서 메일이 2개 더 옵니다.

Oracle(noreply@oracle.com)에서 Get Started Now with Oracle Cloud 제목과 Your Oracle Cloud Account is Fully Provisioned 제목으로 2통의 메일이 옵니다.

 

Get Started Now with Oracle Cloud의 내용은 Always Free 서비스를 사용할 수 있고, billing과 몇가지 세부적인 내용을 설정하고 있지만, 클라우드를 시작할 수 있다는 내용입니다. Sign In to Oracle Cloud를 클릭합니다.

 

 

Your Oracle Cloud Account is Fully Provisioned 메일 내용은 계정설정이 완료되었고 30일동안 SG 400$를 사용할 수 있다는 메일입니다. Sign In to Oracle Cloud를 클릭합니다.

 

Email을 통해서 오라클 클라우드를 접속하는 경우에는 아래와 같은 화면에 email과 비밀번호를 입력한 후 사인인 버튼을 클릭합니다. 사용자에 따라 영문으로 표기될 수도 있습니다.

최초 사인인 화면입니다. 우측에 보면 체험크레딧과 체험일수가 표기되어 있습니다.

 

홈페이지를 통한 사인인

수신한 Email로 접속하지 않고, 직접 오라클 홈페이지를 통해서 접속하는 경우에는 아래와 같이 우측상단의  클릭합니다. 기존 Oracle계정 사인인과 클라우드 계정 사인인이 같이 나타납니다. 클라우드 계정으로 사인인하기 위해서는 CLOUD ACCOUNT의 Sing in to Cloud를 클릭합니다.

Account 항목에 기존에 생성한 Cloud Account를 입력한 후 “Next”를 클릭합니다. Email로 접속하는 경우에는 이 부분이 생략됩니다.

계정 등록 시 입력했던 email주소와 비밀번호를 입력 후 “사인인”을 클릭합니다.

 

 

최초 사인인 화면입니다. 우측에 보면 체험크레딧과 체험일수가 표기되어 있습니다.

 

 

 

OCI란

OCI(Oracle Cloud Infrastructure)는 고가용성 호스팅 환경에서 어플리케이션 및 서비스를 구축하고 실행할 수 있는 서버, 네트워크, 스토리지, 보안과 같은 인프라 환경을 제공하는 클라우드 서비스입니다.

Amazon AWS, Google GCP, Microsoft Azure와 같은 Oracle Public Cloud 입니다.

 

 

주요용어 설명

오라클 클라우드에 대한 이해를 위해 기본적인 용어를 설명합니다. 각 CSP(Cloud Service Provider)마다 동일하거나 유사한 기능에 대해 약간씩 상이한 용어를 사용하고 있습니다. 

 

Tenancy(root compartment)

Oracle Cloud Infrastructure 에 등록 하면 Oracle은 등록 account에 대한 위한 테넌시를 생성합니다. 테넌시는 Oracle Cloud Infrastructure 내에서 클라우드 리소스를 생성, 구성 및 관리할 수 있는 격리된 파티션 입니다.

OCI의 최상위 구성은 테넌시입니다.

 

Compartments(구획)

컴파트먼트는 클라우드 자원을 구성하고 접근을 제어하기 위한 논리적인 단위입니다

테넌시가 생성되면 루트 구획이 생성됩니다. 루트 구획은 파일 시스템의 루트 폴더와 같다고 생각할 수 있습니다. 디렉터리 구조와 같이 Root Compartment 아래에 새로운 Compartment를 추가할 수 있습니다.

콘솔에서 자원을 구성할 때 반드시 컴파트먼트를 지정해야 합니다. 

 

OCI 문서 가이드에서는 크게 아래 두 가지 방법을 예로 들고 있습니다. Compartment 구성시 이를 참조하여 구성합니다.

예시 #1, 하나만 사용하기

Tenancy를 소규모 조직이 사용하는 경우 최초 생성된 Root Compartment 하나만 사용합니다. 다만, 기능 테스트 등을 고려하여 오라클 문서에서는 Sandbox Compartment 하나는 적어도 생성한 다음에 일반 사용자그룹에 Sandbox에 대해서는 많은 권한을 부여하되, Root Compartment에 대해서는 엄격하게, 세부적인 권한을 부여하도록 하는 방법을 예로 들고 있습니다.

예시 #2, 부서, 프로젝트 등을 고려한 Compartment 구성

Root Compartment, Sandbox Compartment 이외에 부서별, 프로젝트별 등을 고려해 Compartment를 구성하여 해당 Compartment 별로 세부적인 권한을 부여하도록 하는 방법을 예로 들고 있습니다.

 

VCN(Virtual Cloud Network)

Virtual Cloud Network (VCN)은 서브넷, 라우트 테이블과 게이트웨이 등으로 구성되는 가상 네트워크 환경입니다.

VCN은 리전 범위의 자원입니다. VCN은 특정 리전에 종속됩니다. VCN을 구성하는 서브넷(Subnet)을 만들 때, 리전 범위와 AD 범위를 선택할 수 있습니다. 리전 범위로 지정하면 리전을 구성하는 모든 AD에 걸쳐 서브넷이 구성됩니다. AD 범위를 지정하면 특정 AD에 구성됩니다.

SANDBOX, DEV, QAS, PRD, SHARED, COMMON 으로 구성합니다.

 

Subnet

하나의 네트워크를 분할하여 나눈 작은 네트워크입니다. 즉, VCN을 작게 나눈 네트워크입니다.

  • public subnet: 인터넷 게이트웨이와 연결된 subnet. 서브넷에 포함되는 VM 인스턴스에 Public IP 설정 가능
  • private subnet: 인터넷 게이트웨이와 연결이 안된 subnet.서브넷에 포함되는 VM 인스턴스가 Public IP를 설정 못함

 

Security Lists

VCN을 위한 가상의 방화벽으로 Subnet에 들어오고 나가는 트래픽에 대한 ingress 규칙 및 egress 규칙을 설정할 수 있습니다.

 

라우팅 테이블

라우팅 테이블(routing table)은 컴퓨터 네트워크에서 목적지에 도달하기 위해 목적지 주소를  네트워크 노선으로 변환시키는 목적으로 사용됩니다.  각 라우터의 라우팅 테이블은 모든 목적지 정보에 대해 해당 목적지에 도달하기 위해서 거쳐야 할 다음 라우터의 정보를 가지고 있습니다.

 

Internet Gateway

인터넷과 연결하기 위한 관문입니다.

 

security zones

보안 구역보안 영역은 구획과 연결됩니다. 보안 영역에서 클라우드 리소스를 생성 및 업데이트할 때 Oracle Cloud Infrastructure 는 보안 영역 정책에 대해 이러한 작업을 검증합니다. 정책을 위반하면 작업이 거부됩니다. 보안 영역을 사용하면 리소스가 Oracle 보안 원칙을 준수한다고 확신할 수 있습니다.

 

인스턴스 생성

오라클 클라우드에 Sign in 하고 인스턴스 생성하기.

 

  1. 오라클 클라우드 접속(https://oracle.com) 후 우측 상단의  View Accounts 클릭 후 Sign in to Cloud 클릭.
  2. Oracle Cloud 계정 입력 후 Next 클릭
    Description of the illustration cloud_login
  3. 사용자이름과 패스워드 입력 후 Sign In 클릭
    Description of the illustration cloud sign in
  4. Oracle Cloud page에서 왼쪽 상단의 navigation menu 클릭(일명 햄버거 메뉴).
    Description of the illustration cloud console
  5. Autonomous Transaction Processing 클릭.
    Description of the illustration console navigation
  6. The console for Autonomous Database displays. You can use the List Scope drop-down menu to select a compartment; in this example the Doc compartment is selected. Click here for documentation on creating compartments.ㄹㅇㄴㅁㄹ

  7. This console shows no databases. If there were a long list of databases, you could filter the list by using the Filters drop-down menu to filter by the state of the databases (available, stopped, terminated, and so on). You can also sort by workload type. Here Transaction Processing is selected.
    Click Create Autonomous Database to create a database instance.
    Description of the illustration create_autonomous_transaction_processing_database
  8. The Create Autonomous Database dialog appears. Enter the following information:

    Provide basic information for the Autonomous Database:

    • Choose a compartment - Select a compartment for the database from the drop-down list.
    • Display Name - Enter a name for the database for display purposes.
    • Database Name - Use letters and numbers only, starting with a letter. Maximum length is 14 characters. (Underscores not initially supported.)

    Choose a workload type. Select the workload type for your database from the choices:

    • Transaction Processing - For this tutorial, choose Transaction Processing as the workload type. Do not choose Data Warehouse.
    •  Data Warehouse - (Alternatively you can chosen Transaction Processing as the workload type.)

    Choose a deployment type. When you choose Transaction Processing as the workload type, you are presented with a choice of two deployment types:

    • Serverless - For this tutorial, select Serverless. This choice creates the autonomous database without provisioning a dedicated infrastructure.
    • Dedicated Infrastructure - (Alternatively, you can choose the Dedicated Infrastructure deployment type to create the autonomous database on a dedicated Exadata infrastructure. This tutorial does not cover the Dedicated Infrastructure deployment type.)

    Configure the database:

    • Always Free - For this tutorial, do not activate this option. Always Free databases are provided free of charge, and are suitable for small-scale applications or for learning about and exploring Oracle Cloud Infrastructure.
    • CPU core count - Number of CPUs for your service.
    • Storage (TB) - Select your storage capacity in terabytes. It is the actual space available to your service instance, including system-related space allocations.
    • Auto Scaling - For this tutorial, do not activate this option. If you select the auto scaling option, Autonomous Transaction Processing can use up to three times more CPU and IO resources than specified by the number of OCPUs. When auto scaling is enabled, if your workload requires additional CPU and IO resources, the database automatically uses the resources without any manual intervention required.
    • Enable Preview Mode - For this tutorial, do not activate this option. Oracle periodically provides a preview version of Autonomous Database. You can enable the preview mode to test your applications and become familiar with features in the next release of Autonomous Database.

    Create administrator credentials:

    • Password and Confirm Password - Specify the password for ADMIN user of the service instance. The password must meet the following requirements:
    • The password must be between 12 and 30 characters long and must include at least one uppercase letter, one lowercase letter, and one numeric character.
    • The password cannot contain the username.
    • The password cannot contain the double quote (") character.
    • The password must be different from the last 4 passwords used.
    • The password must not be the same password that is set less than 24 hours ago.
    Choose network access:
    • By default, secure connections are allowed from all IP addresses. You can control and restrict access to your Autonomous Database by setting network access control lists (ACLs). You can select from 4 IP notation types: IP Address, CIDR Block, Virtual Cloud Network, Virtual Cloud Network OCID).

    Choose a license type:

    • Bring Your Own License - Select when you have existing licenses.
    • License Included - Select when you want to subscribe to new database software licenses and the database cloud service.

        Click
     Create Autonomous Database
    Description of the illustration create_dialog_finish_top
    Description of the illustration create_dialog_finish
  9. The Create Autonomous Database dialog closes. On the console, the Lifecycle State field indicates that the database is Provisioning. When creation is completed, the Lifecycle State field changes to Available.
    Description of the illustration provisioning_state

자율 데이터베이스 콘솔이 표시됩니다. 목록 범위 드롭 다운 메뉴를 사용하여 구획을 선택할 수 있습니다. 이 예에서는 Doc 구획이 선택되었습니다. 구획 만들기에 대한 설명서를 보려면 여기를 클릭하십시오

자율 데이터베이스 콘솔이 표시됩니다. 목록 범위 드롭 다운 메뉴를 사용하여 구획을 선택할 수 있습니다. 이 예에서는 Doc 구획이 선택되었습니다. 구획 만들기에 대한 설명서를 보려면 여기를 클릭하십시오.

 


Download the Credentials Zip File

Once you have created the database, download the credentials zip file for client access to that database. You will use this file in the next step, and in the next tutorial to connect SQL Developer to your Autonomous Transaction Processing database.

  1. In the console, in the details page of your new Autonomous Transaction Processing database, select DB Connection.
    Description of the illustration open_service_console
  2. The Database Connection dialog opens for downloading client credentials. For wallet type, select Instance Wallet.
    Note: Oracle recommends you download the database-specific wallet type, Instance Wallet, to provide to your end users and for application use whenever possible. The other wallet type, Regional wallet, should only be used for administrative purposes that require potential access to all Autonomous Databases within a region.
    Click Download Wallet.
    Description of the illustration database_connection_dialog
  3. In the Download Wallet dialog, enter an encryption password for the wallet, confirm the password, and then click Download.
    Description of the illustration download_wallet
  4. Click Save File, and then click OK.
  5. Store the zip file and make note of the password. You will use the zip file in the next step to define a SQL Developer connection to your Autonomous Transaction Processing database.

Define a SQL Developer Connection

Define a SQL Developer connection to the database in your Autonomous Transaction Processing service.

    1. Open SQL Developer on your local computer. In the Connections panel, right-click Connections and select New Connection.
      Note:
      Depending on your version of SQL Developer, do not right-click Cloud Connection or Database Schema Service Connections. That menu selection is for connecting to a different Oracle cloud service, the Oracle Database Schema Service.
      Description of the illustration select_new_connection
    2. The New/Select Database Connection dialog appears. Enter the following information:
      • Connection Name - Enter the name for this cloud connection.
      • Username - Enter the database username. Use the default administrator database account (admin) that is provided as part of the service.
      • Password - Enter the admin user's password that you or your Autonomous Transaction Processing administrator specified when creating the service instance.
      • Connection Type - Select Cloud Wallet.
      • Configuration File - Click Browse, and select the Client Credentials zip file, downloaded from the Autonomous Transaction Processing service console by you, or given to you by your Autonomous Transaction Processing administrator.
      • Service - In the drop-down menu, service selections are prepended with database names. Select the tpurgent, tp, high, medium, or low menu item for your database. These service levels map to the TPURGENT, TP, HIGH, MEDIUM and LOW consumer groups, which provide different levels of priority for your session.
        Note: Earlier versions of SQL Developer may not support this feature.  

Description of the illustration new_select_database_connection_dialog

  1. Click Test.
    Status: Success displays at the left-most bottom of the New/Select Database Connection dialog.
  2. Click Connect.
    An entry for the new connection appears under Connections.

Create a User in your Autonomous Transaction Processing Database

Once you have connected SQL Developer to your Autonomous Transaction Processing database, use a SQL Developer worksheet to define a create user statement to create the user atpc_user. In the next tutorial, you will create sales history tables in the atpc_user schema and load data into these tables from an object store.

  1. Open a SQL Developer worksheet and run the following SQL statements to create the user atpc_user, swapping in a password with the guidelines provided in the following Note section.
    create user atpc_user identified by "<password>";
    grant dwrole to atpc_user;
    Description of the illustration sql_developer_commands_create_atpc_userNote: Autonomous Transaction Processing requires strong passwords. The password you specify must meet the default password complexity rules. This database checks for the following requirements when you create or modify passwords:
    • The password must be between 12 and 30 characters long and must include at least one uppercase letter, one lowercase letter, and one numeric character.
    • The password cannot contain the username.
    • The password cannot be one of the last four passwords used for the same username.
    • The password cannot contain the double quote (") character

    Note
    : Autonomous Transaction Processing databases come with a pre-defined database role named DWROLE.
    This role provides the common privileges for a database user: CREATE ANALYTIC VIEW, CREATE ATTRIBUTE DIMENSION, ALTER SESSION, CREATE HIERARCHY, CREATE JOB, CREATE MINING MODEL, CREATE PROCEDURE, CREATE SEQUENCE, CREATE SESSION, CREATE SYNONYM, CREATE TABLE, CREATE TRIGGER, CREATE TYPE, CREATE VIEW, READ,WRITE ON directory DATA_PUMP_DIR, EXECUTE privilege on the PL/SQL package DBMS_CLOUD  

  2. In the next tutorial, "Connecting SQL Developer to Autonomous Transaction Processing", you will connect SQL Developer to your Autonomous Transaction Processing database as user atpc_user, and define SH tables(sales history tables from an Oracle sample schema) for that user. Later, you will load data into those tables from an Object Store.

 


Next Tutorial

Connecting SQL Developer to Autonomous Transaction Processing

Create an Instance

Sign in to Autonomous Transaction Processing and create an instance.

  1. Sign in from https://cloud.oracle.com/home. On the Oracle Cloud page, click Sign In.
  2. On the Cloud Account page, enter your cloud account name and click Next.
    Description of the illustration cloud_login
  3. Enter your User Name and Password and click Sign In to sign in to your Oracle Cloud Account
    Description of the illustration cloud sign in
  4. On the Oracle Cloud Infrastructure page, click the navigation menu in the upper left to show top level navigation choices.
    Description of the illustration cloud console
  5. Click Autonomous Transaction Processing.
    Description of the illustration console navigation
  6. The console for Autonomous Database displays. You can use the List Scope drop-down menu to select a compartment; in this example the Doc compartment is selected. Click here for documentation on creating compartments.
    This console shows no databases. If there were a long list of databases, you could filter the list by using the Filters drop-down menu to filter by the state of the databases (available, stopped, terminated, and so on). You can also sort by workload type. Here Transaction Processing is selected.
    Click Create Autonomous Database to create a database instance.
    Description of the illustration create_autonomous_transaction_processing_database
  7. The Create Autonomous Database dialog appears. Enter the following information:

    Provide basic information for the Autonomous Database:

    • Choose a compartment - Select a compartment for the database from the drop-down list.
    • Display Name - Enter a name for the database for display purposes.
    • Database Name - Use letters and numbers only, starting with a letter. Maximum length is 14 characters. (Underscores not initially supported.)

    Choose a workload type. Select the workload type for your database from the choices:

    • Transaction Processing - For this tutorial, choose Transaction Processing as the workload type. Do not choose Data Warehouse.
    •  Data Warehouse - (Alternatively you can chosen Transaction Processing as the workload type.)

    Choose a deployment type. When you choose Transaction Processing as the workload type, you are presented with a choice of two deployment types:

    • Serverless - For this tutorial, select Serverless. This choice creates the autonomous database without provisioning a dedicated infrastructure.
    • Dedicated Infrastructure - (Alternatively, you can choose the Dedicated Infrastructure deployment type to create the autonomous database on a dedicated Exadata infrastructure. This tutorial does not cover the Dedicated Infrastructure deployment type.)

    Configure the database:

    • Always Free - For this tutorial, do not activate this option. Always Free databases are provided free of charge, and are suitable for small-scale applications or for learning about and exploring Oracle Cloud Infrastructure.
    • CPU core count - Number of CPUs for your service.
    • Storage (TB) - Select your storage capacity in terabytes. It is the actual space available to your service instance, including system-related space allocations.
    • Auto Scaling - For this tutorial, do not activate this option. If you select the auto scaling option, Autonomous Transaction Processing can use up to three times more CPU and IO resources than specified by the number of OCPUs. When auto scaling is enabled, if your workload requires additional CPU and IO resources, the database automatically uses the resources without any manual intervention required.
    • Enable Preview Mode - For this tutorial, do not activate this option. Oracle periodically provides a preview version of Autonomous Database. You can enable the preview mode to test your applications and become familiar with features in the next release of Autonomous Database.

    Create administrator credentials:

    • Password and Confirm Password - Specify the password for ADMIN user of the service instance. The password must meet the following requirements:
    • The password must be between 12 and 30 characters long and must include at least one uppercase letter, one lowercase letter, and one numeric character.
    • The password cannot contain the username.
    • The password cannot contain the double quote (") character.
    • The password must be different from the last 4 passwords used.
    • The password must not be the same password that is set less than 24 hours ago.
    Choose network access:
    • By default, secure connections are allowed from all IP addresses. You can control and restrict access to your Autonomous Database by setting network access control lists (ACLs). You can select from 4 IP notation types: IP Address, CIDR Block, Virtual Cloud Network, Virtual Cloud Network OCID).

    Choose a license type:

    • Bring Your Own License - Select when you have existing licenses.
    • License Included - Select when you want to subscribe to new database software licenses and the database cloud service.

        Click
     Create Autonomous Database
    Description of the illustration create_dialog_finish_top
    Description of the illustration create_dialog_finish
  8. The Create Autonomous Database dialog closes. On the console, the Lifecycle State field indicates that the database is Provisioning. When creation is completed, the Lifecycle State field changes to Available.
    Description of the illustration provisioning_state

 

Next Tutorial

Connecting SQL Developer to Autonomous Transaction Processing

ORACLE ATP DB 접속

'ORACLE' 카테고리의 다른 글

Oracle sequence cache  (0) 2021.12.21
Oracle RMAN  (0) 2021.12.17
Oracle ATP DB 생성  (0) 2020.01.27
sql  (0) 2019.12.23
V$SQL  (0) 2019.12.22

오라클 클라우드에 sign-in 한 후,

좌측 메뉴의 Autonomous Transaction Processing 를 클릭한다.

아래와 같은 화면에서 [Create Autonomous Database]를 클릭한다 

 

다음 화면에서 각 항목을 입력한 후 자율 데이터베이스를 생성한다.

Provide basic information for the Autonomous Database

  • Choose a compartment : autonomous DB 생성하고자 하는 compartment 선택
  • Display name : 원하는 Display name 입력(예시는 ATPDB 입력하였음)

  • Database name : 원하는 Database name 입력(예시는 ATPDB 입력하였음)

  • Choose a workload type : Transaction Processing 선택

  • Choose a deployment type : Shared Infrastructure 선택

 

 

 

 

 

 

 

 

 

 

Create administrator credentials

  • Password : 패스워드 입력(암호는 12 이상 30 이하, 대문자, 소문자 숫자가 각각 하나 이상. 암호에는 따옴표 (") 또는 사용자 이름 "admin" 사용할 없음)

  • Confirm password : password와 동일하게 입력

  • Choose a license type : License Included 선택

 


 

 

[Create Autonomous Database] 클릭한다.

 

프로비저닝 다음과 같이 Autonomous Database 생성된다.

 

'ORACLE' 카테고리의 다른 글

Oracle RMAN  (0) 2021.12.17
ORACLE ATP DB 접속  (0) 2020.01.27
sql  (0) 2019.12.23
V$SQL  (0) 2019.12.22
Oracle tkprof  (0) 2019.12.21

sqlselect * from DBA_HIST_SQLTEXT  where sql_id ='4b6z0rh5jrktx';
select * from  DBA_HIST_SQL_PLAN  where sql_id ='4b6z0rh5jrktx' order by plan_hash_value, id;
select * from  DBA_HIST_SQLSTAT where sql_id ='4b6z0rh5jrktx';
select * from  v$sql  where sql_id ='4b6z0rh5jrktx';

select sql_id, plan_hash_value, id, count(*) from dba_hist_sql_plan group by sql_id, plan_hash_value, id
having count(*) > 1;
WRH$_SQL_PLAN
select * from(
select a.aid, b.bid from 
(select distinct sql_id as aid from DBA_HIST_SQLTEXT) A full outer join
(select sql_id as bid from DBA_HIST_SQLSTAT ) B
on a.aid = b.bid) c
where c.bid is null;

select * from(
select a.aid, b.bid from 
(select distinct sql_id as aid from sys.WRH$_SQLTEXT) A full outer join
(select sql_id as bid from sys.WRH$_SQLSTAT ) B
on a.aid = b.bid) c
where c.bid is null;

select * from sys.WRH$_SQLTEXT  where sql_id ='6rjdxthsp2yd4';
select * from sys.WRH$_SQLSTAT  where sql_id ='6rjdxthsp2yd4';
select * from sys.WRH$_SQL_PLAN where sql_id ='6rjdxthsp2yd4';

select * 
     FROM WRM$_SNAPSHOT sn, WRH$_SQLSTAT sql
    WHERE     sn.snap_id = sql.snap_id
          AND sn.dbid = sql.dbid
          AND sn.instance_number = sql.instance_number
          AND sn.status = 0;
          
select * From dba_hist_snapshot where snap_id = 96410 order by 1 desc;
select * From sys.WRH$_SQLTEXT b where not exists(select 'x' from sys.WRH$_SQLstat a where a.sql_id = b.sql_id);

select * From dba_objects where object_name='AWR_ROOT_SQLTEXT';
select * From dict where table_name='AWR_ROOT_SQLTEXT';


select sql_id, plan_hash_value, count(*) 
from  DBA_HIST_SQLSTAT s  
where    s.parsing_schema_name = 'KALMHS'
group by sql_id, plan_hash_value order by 1
;
----------------------
-- sql_id 추출
----------------------
select sql_id, sql_text, replace(dbms_lob.substr(sql_text, 20, 1), chr(10), ' '), 
       (select command_name from DBA_HIST_SQLCOMMAND_NAME where command_type=t.command_type) type
from   DBA_HIST_SQLTEXT T
where  exists (select 'EXIST' 
               from   DBA_HIST_SQLSTAT S
               where  t.sql_id = s.sql_id
               and    s.parsing_schema_name = 'KALMHS');
;

select * from (
select t.sql_id,
       t.sql_text,
       replace(dbms_lob.substr(t.sql_text, 20, 1), chr(10), ' '),
       (select command_name from DBA_HIST_SQLCOMMAND_NAME where command_type=t.command_type) type,
       p.plan_hash_value 
from DBA_HIST_SQLTEXT T,
     (select sql_id, plan_hash_value from
         (select sql_id, plan_hash_value,
                row_number() over (partition by sql_id order by sql_id, timestamp desc) row_num
          from  DBA_HIST_SQL_PLAN
          where 1 = 1) -- 전체 SQL
      where row_num = 1) P
where t.sql_id = p.sql_id(+))
where plan_hash_value is null and type='SELECT';

select a.sql_id, b.sql_id, b.command_type from 
(select distinct sql_id from v$sql) a, DBA_HIST_SQLTEXT b
where a.sql_id = b.sql_id(+)
;-- where sql_id='3hc96wfvxp4tk';
-- 56196, 9610
select distinct sql_id from DBA_HIST_SQLTEXT;
--> 5540 

select sql_id, sql_text, sql_t, type, plan_hash_value, parsing_schema_name
from (
    select t.sql_id,
           t.sql_text,
           replace(dbms_lob.substr(t.sql_text, 20, 1), chr(10), ' ') sql_t,
           (select command_name from DBA_HIST_SQLCOMMAND_NAME where command_type=t.command_type) type,
           p.plan_hash_value,
           (select parsing_schema_name from DBA_HIST_SQLSTAT S where 1=1 and   s.sql_id = t.sql_id
                   and   s.plan_hash_value = p.plan_hash_value and rownum = 1) parsing_schema_name 
    from DBA_HIST_SQLTEXT T,
         (select sql_id, plan_hash_value from
             (select sql_id, plan_hash_value,
                    row_number() over (partition by sql_id order by sql_id, timestamp desc) row_num
              from  DBA_HIST_SQL_PLAN
              where 1 = 1) -- 전체 SQL
          where row_num = 1) P
    where t.sql_id = p.sql_id
    and   exists ( select 'X' 
                   from DBA_HIST_SQLSTAT S 
                   where s.parsing_schema_name in ('KALMHS','KALPPO','NETBACKUP','KALPPO_SSO','KALSTD')
                   and   module like '%%'
                   and   s.sql_id = t.sql_id
                   and   s.plan_hash_value = p.plan_hash_value)
)
order by 1;

select t.*,
       sql_id, replace(dbms_lob.substr(t.sql_text, 20, 1), chr(10), ' ') sql_t,
       (select command_name from DBA_HIST_SQLCOMMAND_NAME where command_type=t.command_type) type,
       parsing_schema_name
 From v$sql t
 where t.parsing_schema_name in ('KALMHS','KALPPO','NETBACKUP','KALPPO_SSO','KALSTD');

where plan_hash_value is null and type='SELECT';

select sql_id, count(*) From v$sql group by sql_id having count(*) > 1;


select * From dba_tab_columns where column_name = 'MODULE' order by table_name;

select * from v$sql where sql_id='grvaq6wc3s189';

select * From dict where table_name like '%SHARED%';
select * from V$SQL_SHARED_CURSOR where sql_id='grvaq6wc3s189';

SELECT  
       A.SQL_ID,
       A.SQL_TEXT, 
       A.COMMAND_TYPE, --> IF NEEDED
       B.PLAN_HASH_VALUE,
       B.ID,
       B.OPERATION,
       B.OPTIONS,
       B.OBJECT_OWNER,
       B.OBJECT_NAME,
       B.OBJECT_TYPE,
       B.OPTIMIZER,
       B.PARTITION_START,
       B.PARTITION_STOP,
       B.PARTITION_ID
FROM   DBA_HIST_SQLTEXT A, DBA_HIST_SQL_PLAN B
WHERE  A.DBID = B.DBID
AND    A.SQL_ID = B.SQL_ID
AND    A.SQL_ID IN('03y5xw17vncxd')
AND    EXISTS
       (SELECT 'E' 
        FROM  DBA_HIST_SQLSTAT C 
        WHERE A.DBID = C.DBID 
        AND   A.SQL_ID = C.SQL_ID 
        AND   B.SQL_ID = C.SQL_ID
        AND   B.PLAN_HASH_VALUE <> C.PLAN_HASH_VALUE
        AND   PARSING_SCHEMA_NAME  IN('KALMHS'))
ORDER BY A.DBID, A.SQL_ID, B.PLAN_HASH_VALUE, B.ID;

'ORACLE' 카테고리의 다른 글

Oracle RMAN  (0) 2021.12.17
ORACLE ATP DB 접속  (0) 2020.01.27
Oracle ATP DB 생성  (0) 2020.01.27
V$SQL  (0) 2019.12.22
Oracle tkprof  (0) 2019.12.21

V$SQL에 뷰에는 SQL 문의 복사본이 두 개 이상 있을 수 있습니다. 예를 들어, 두 명의 사용자에게 각각 T 테이블이 있다고 가정해 보겠습니다. USERA가 SELECT * FROM T를 쿼리합니다. 마찬가지로 USERB도 SELECT * FROM T를 실행합니다. 이 두 SQL 문이 같은 것처럼 보이지만 다른 쿼리입니다. 따라서 V$SQL에는 두 개의 SQL문이 존재합니다.

주어진 SQL 문에 대해 V$SQL에 둘 이상의 커서가 존재하는 데에는 여러 가지 이유가 있습니다. 쿼리할 예제 테이블을 생성합니다.

SQL> create table t 2 ( x varchar2(30) primary key, 3 y int );
SQL> begin
 dbms_stats.set_table_stats 
 ( user, 'T',  
    numrows => 1000000,  
    numblks=>100000 ); 
 end; 
 /

 

the optimizer is told that there are 1,000,000 rows in it. Now we'll ensure that the shared pool has no cached copies of SQL against this table (this is for demonstration purposes—do not do this on a production system!):

옵티마이저에게 1,000,000개의 행이 있다고 알려줍니다. 공유 풀에 이 테이블에 대해 캐시된 SQL 복사본이 없는지 확인합니다(이는 데모용입니다. 프로덕션 시스템에서는 이 작업을 수행하면 안됩니다.)

 

SQL> alter system flush shared_pool; 

 

SQL> select sql_id, sql_text from v$sql where upper(sql_text) like 'SELECT % T LOOK_FOR_ME %B1_'; 

 

 

이제 Listing 1과 같이 동일한 쿼리 텍스트를 네 번 실행하는 PL/SQL 블록을 구성합니다.

 

Code Listing 1: PL/SQL block executing query text four times

SQL> declare 

     l_x_number     number;
     l_x_string     varchar2(30);
begin
     execute immediate 'alter session set optimizer_mode=all_rows';
     for x in (select * from t look_for_me where x = l_x_number) loop null; end loop;
     for x in (select * from t look_for_me where x = l_x_string) loop null; end loop;
     
     execute immediate 'alter session set optimizer_mode=first_rows';
     for x in (select * from t look_for_me where x = l_x_number) loop null; end loop;
     for x in (select * from t look_for_me where x = l_x_string) loop null; end loop;
end;
/

 

Listing 2와 같이 모두 정확히 동일한 SQL_ID를 가지고 있다는 것을 알 수 있기 때문에 그것들이 동일하다는 것을 압니다.

해당 블록을 실행한 후 V$SQL을 살펴보면 Listing 1에서 실행한 동일한 SQL 문에 대해 하나씩 4개가 있음을 알 수 있습니다. Listing 2와 같이 모두 동일한 SQL_ID를 가지고 있다는 것을 알 수 있습니다.

 

Code Listing 2: Query on V$SQL showing same SQL_ID for four query executions

SQL> select sql_id, sql_text 2 from v$sql 3 where upper(sql_text) 4 like 5 'SELECT % T LOOK_FOR_ME %B1_'; 

SQL_ID SQL_TEXT
------------- ----------------------------------------
1qqtru155tyz8 SELECT * FROM T LOOK_FOR_ME WHERE X = :B1
1qqtru155tyz8 SELECT * FROM T LOOK_FOR_ME WHERE X = :B1
1qqtru155tyz8 SELECT * FROM T LOOK_FOR_ME WHERE X = :B1
1qqtru155tyz8 SELECT * FROM T LOOK_FOR_ME WHERE X = :B1

4 rows selected.

이 4개의 SQL은 동일하게 보이지만 서로 다릅니다. 

  • Cursor 1 used ALL_ROWS and bound a NUMBER datatype.
  • Cursor 2 used ALL_ROWS and bound a VARCHAR2 datatype.
  • Cursor 3 used FIRST_ROWS with a NUMBER datatype.
  • Cursor 4 used FIRST_ROWS with a VARCHAR2 datatype.

Listing 3은  커서 1과 2에 대한 계획을 보여줍니다. 이 두 계획(자식 번호 0과 자식 번호 1, Oracle Database 번호가 0부터 시작)은 바인드변수 때문에 다릅니다. 문자열을 숫자와 비교할 때 암시적으로 to_number()가 문자열에 배치됩니다. to_number(x)를 인덱싱하지 않았으므로 첫 번째 커서에 대해 전체 테이블 스캔을 수행하고 VARCHAR2에 바인딩된 두 번째 커서는 인덱스를 사용합니다.

 

Code Listing 3: Plans for cursors 1 and 2

SQL> select * from table( dbms_xplan.display_cursor('1qqtru155tyz8', 0 ) );

SQL_ID  1qqtru155tyz8, child number 0
-------------------------------------
SELECT * FROM T LOOK_FOR_ME WHERE X = :B1
 
Plan hash value: 1601196873
--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |       |       | 27112 (100)|          |
|*  1 |  TABLE ACCESS FULL| T    |     1 |    30 | 27112   (1)| 00:00:02 |
--------------------------------------------------------------------------
 
Predicate Information (identified by operation id):
---------------------------------------------------
     1 - filter(TO_NUMBER("X")=:B1)

SQL> select * from table( dbms_xplan.display_cursor('1qqtru155tyz8', 1 ) );

SQL_ID  1qqtru155tyz8, child number 1
-------------------------------------
SELECT * FROM T LOOK_FOR_ME WHERE X = :B1
 
Plan hash value: 2324989435
---------------------------------------------------------------------------------
| Id  | Operation                   | Name         | Rows  | Bytes | Cost (%CPU)|
---------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |              |       |       |     1 (100)|
|   1 |  TABLE ACCESS BY INDEX ROWID| T            |     1 |    30 |     0   (0)|
|*  2 |   INDEX UNIQUE SCAN         | SYS_C0010204 |     1 |       |     0   (0)|
---------------------------------------------------------------------------------
 
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access("X"=:B1)


 

Listing 4 커서 3과 4(자식 번호 2와 3)에 대한 실행계획을 살펴봅니다. 커서 3과 4에 대한 계획은 처음 두 커서(커서 1, 2)와 같이 ALL_ROWS가 아닌 FIRST_ROWS로 최적화되었기 때문에 실행계획이 다를 수 있습니다. 따라서 옵티마이저 모드가 다르기 때문에 옵티마이저 환경이 다르므로 자식 커서도 다릅니다. V$SQL_SHARED_CURSOR를 통해 무엇이 다른지 확인할 수 있습니다.

Code Listing 4: Plans for cursors 3 and 4

SQL> select * from table( dbms_xplan.display_cursor('1qqtru155tyz8', 2 ) );

SQL_ID  1qqtru155tyz8, child number 2
-------------------------------------
SELECT * FROM T LOOK_FOR_ME WHERE X = :B1
 
Plan hash value: 1601196873
--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |       |       | 27112 (100)|          |
|*  1 |  TABLE ACCESS FULL| T    |     1 |    30 | 27112   (1)| 00:00:02 |
--------------------------------------------------------------------------
 
Predicate Information (identified by operation id):
---------------------------------------------------
   1 - filter(TO_NUMBER("X")=:B1)
 
SQL> select * from table( dbms_xplan.display_cursor('1qqtru155tyz8', 3 ) );

SQL_ID  1qqtru155tyz8, child number 3
-------------------------------------
SELECT * FROM T LOOK_FOR_ME WHERE X = :B1
 
Plan hash value: 2324989435
---------------------------------------------------------------------------------
| Id  | Operation                   | Name         | Rows  | Bytes | Cost (%CPU)|
---------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |              |       |       |     1 (100)|
|   1 |  TABLE ACCESS BY INDEX ROWID| T            |     1 |    30 |     0   (0)|
|*  2 |   INDEX UNIQUE SCAN         | SYS_C0010204 |     1 |       |     0   (0)|
---------------------------------------------------------------------------------
 
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access("X"=:B1)
 
SQL> select child_number, 
       bind_mismatch B, 
       optimizer_mode_mismatch O
  from v$sql_shared_cursor
  where sql_id = '1qqtru155tyz8';

CHILD_NUMBER B O
------------ - -
0 N N
1 N N
2 N Y
3 N Y

V$SQL_SHARED_CURSOR를 사용하면 공유 풀에 지정된 SQL 문의 복사본이 두 개 이상 있는 이유에 대한 알 수 있습니다.

 

'ORACLE' 카테고리의 다른 글

Oracle RMAN  (0) 2021.12.17
ORACLE ATP DB 접속  (0) 2020.01.27
Oracle ATP DB 생성  (0) 2020.01.27
sql  (0) 2019.12.23
Oracle tkprof  (0) 2019.12.21

+ Recent posts