Python Selenium으로 naver 자동 로그인 시 자동입력방지 프로그램이 작동하여 자동 로그인을 차단한다.
[ NAVER 자동로그인 코드]
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.by import By import time
Linux는 기본적으로 Python이 설치되어 있으나, Python 2.x 대 버전이 설치되어 있을 경우 최신 버전으로 Upgrade한다.
이는 chocolatey를 통해 쉽게 설치할 수 있습니다.
# Ubutu, Debian $ apt-get install python -y
# Redhat, CentOS $ yum install python -y
3. Visual Studio Code에 Python 설정하기
Extension 설치
몇 글자만 타이핑 하면 자동으로 명령어를 선택할 수 있게 보여준다던가, 소스코드 작성 중에 어느 부분이 문제가 되는 사전에 문제점을 체크해 준다던지와 같은 기능이 추가되고 Jupyter notebook 지원기능 등 파이썬 코딩을 조금 더 개발자 입장에서 편하게 하기 위한 기능이다.
촤측의 Extensions 메뉴(창 모양)를 클릭하거나, 단축키(Ctrl+Shift+X)를 사용한다. 상단의 검색창에 Python을 입력한 후, 검색된 Extension 중 Python, Python for VSCode, Python Extension Pack을 [install] 버튼을 클릭하여 설치한다.
4. 작업 환경 생성
Python project를 저장할 새로운 폴더를 생성해준다.
예시) C:\Python\python_project
[File] - [Open Folder] 메뉴를 클릭한 후 새로 만든 폴더를 선택해준다.
5. 코드 작성
[File] - [New File] 메뉴을 클릭하여 새로운 파일을 생성한 후 다음과 같이 코드를 입력한다.
print("Hello, World!")
[File]-[Save] 메뉴를 선택하거나 단축키(Ctrl + S)로 파일을 hello.py라는 이름의 파일로 저장한다.
6. 코드 실행
[Run] - [Run Without Debugging] 메뉴을 클릭하거나 단축키(Ctrl + F5)로 코드를 수행한다.
Upload to your cloud-based object store the data files that you want to load to your Autonomous Transaction Processing database. This tutorial uses an object store in the Oracle Cloud Infrastructure Object Storage service.
Log in to your Oracle Cloud Infrastructure Console with the following credentials provided by your Oracle Cloud administrator: cloud tenant, user name, password.
Click Create Bucket to create the storage bucket in which to upload your source files. You will later copy this staged data into tables in your Autonomous Transaction Processing database.
Navigate to the location of the data files on your local computer. Drag and drop each file individually or click Upload Object to upload each file individually. This example uploads the data files of the SH tables (sales history tables from an Oracle sample schema). Click here to download a zip file of the 10 SH data files for you to upload to the object store. Unzip the data files from the zip file, because zip files cannot be uploaded. Upload each unzipped data file individually. Note: Alternatively, you can use curl commands to upload large numbers of files.
The data files are uploaded to the bucket. These files staged in the cloud are ready to be copied into the tables of your Autonomous Transaction Processing database. Remain logged in to Oracle Cloud Infrastructure Object Storage.
To load data from an Oracle Cloud Infrastructure Object Storage object store, you need to create an Auth Token for your object store account. The communication between your Autonomous Transaction Processing database and the object store relies on the Auth Token and username/password authentication.
If you have logged out of Oracle Cloud Infrastructure Object Storage, log back in with the following credentials provided by your Oracle Cloud administrator: cloud tenant, user name, password.
Hover your mouse cursor over the human figure icon at the top right of the console and click User Settings from the drop-down menu.
Create Object Store Credentials in your Autonomous Transaction Processing Schema
Now that you have created an object store Auth Token, store in your Autonomous Transaction Processing atpc_user schema the credentials of the object store in which your data is staged.
Open SQL Developer and connect to your Autonomous Transaction Processing database as user atpc_user. See the previous tutorial in this series, Connecting to SQL Developer and Creating Tables, for steps to connect SQL Developer to your Autonomous Transaction Processing database as atpc_user.
In a SQL Developer worksheet, use the create_credential procedure of the DBMS_CLOUD package to store the object store credentials in your atpc_user schema.
Create a credential name. You reference this credential name in the copy_data procedure in the next step.
Specify the credentials for your Oracle Cloud Infrastructure Object Storage service: The username and the object store Auth Token you generated in the previous step.
After you run this script, your object store's credentials are stored in your Autonomous Transaction Processing atpc_user schema.
Copy Data from Object Store to Autonomous Transaction Processing Database Tables
The copy_data procedure of the DBMS_CLOUD package requires that target tables must already exist in in your Autonomous Transaction Processing database. In the previous tutorial in this series, Connecting SQL Developer and Creating Tables,you created in your Autonomous Transaction Processing atpc_user schema all of the target tables.
Now run the copy_data procedure to copy the data staged in your object store to your Autonomous Transaction Processing atpc_user tables.
In a SQL Developer worksheet, use the copy_data procedure of the DBMS_CLOUD package to copy the data staged in your object store.
For credential_name, specify the name of the credential you defined in section 3, Create Object Store Credentials in your Autonomous Transaction Processing Schema.
For file_uri_list, specify the URL that points to the location of the file staged in your object store. The URL is structured as follows. The values you specify are in bold: https://swiftobjectstorage.<region name>.oraclecloud.com/v1/<tenant name>/<bucket name>/<file name>
Click here for an example script. In the script, use your own table names, region name, tenant name, bucket name, and file names. Note: The region name, tenant name, and bucket name can all be found in one place by clicking the ellipsis option menu and going to file details. Note: If you receive an error message that your atpc_user does not have read/write privileges into the Object Store, you may need to properly set up your user privileges or contact your administrator to do so. Description of the illustration data_loading_script
ORA-20404: Object not found - https://swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/lgcnscorp/tutorial_load_atpc/
ORA-06512: "C##CLOUD$SERVICE.DBMS_CLOUD", 757행
ORA-06512: "C##CLOUD$SERVICE.DBMS_CLOUD", 1879행
ORA-06512: 1행
All data load operations done using the PL/SQL package DBMS_CLOUD are logged in the tables dba_load_operations and user_load_operations. These tables contain the following:
dba_load_operations: shows all load operations.
user_load_operations: shows the load operations in your schema.
Query these tables to see information about ongoing and completed data loads. For example: SELECT table_name, owner_name, type, status, start_time, update_time, logfile_table, badfile_table FROM user_load_operations WHERE type = 'COPY';
Examine the results. The log and bad files are accessible as tables: TABLE_NAME STATUS ROWS_LOADED LOGFILE_TABLE BADFILE_TABLE ---------- ------------ ----------- ------------- ------------- CHANNELS FAILED COPY$1_LOG COPY$1_BAD CHANNELS COMPLETED 5 COPY$2_LOG COPY$2_BAD
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.
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
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.
Create SH Tables in your Autonomous Transaction Processing Database
After you have connected SQL Developer to your Autonomous Transaction Processing database, use a SQL Developer worksheet to define CREATE TABLE statements to create the SH tables (sales history tables from an Oracle sample schema) in the atpc_user schema. In the next tutorial, you will load data into these tables from an object store.
Now that you have created the SH tables, take a moment to examine them. In the next tutorial, you will load data into these tables from an object store.
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.
The Database Connection dialog opens for downloading client credentials. For wallet type, selectInstance 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. ClickDownload Wallet. Description of the illustration database_connection_dialog
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.
Open SQL Developer on your local computer. In the Connections panel, right-clickConnectionsand selectNew Connection. Note: Depending on your version of SQL Developer, donotright-clickCloud ConnectionorDatabase 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
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 theadminuser's password that you or your Autonomous Transaction Processing administrator specified when creating the service instance.
Connection Type - SelectCloud Wallet.
Configuration File - ClickBrowse, and select theClient Credentialszip 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.
ClickTest. Status: Success displays at the left-most bottom of the New/Select Database Connection dialog.
ClickConnect. 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 acreate userstatement to create the useratpc_user. In the next tutorial, you will create sales history tables in theatpc_userschema and load data into these tables from an object store.
Open a SQL Developer worksheet and run the following SQL statements to create the useratpc_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 namedDWROLE. 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 ONdirectoryDATA_PUMP_DIR, EXECUTEprivilege on the PL/SQL packageDBMS_CLOUD
In the next tutorial, "Connecting SQL Developer to Autonomous Transaction Processing", you will connect SQL Developer to your Autonomous Transaction Processing database as useratpc_user, and defineSHtables(sales history tables from an Oracle sample schema) for that user. Later, you will load data into those tables from an Object Store.