1. Oracle 페이지 접속
Oracle 소프트웨어 다운로드
클라우드 무료 체험과 소프트웨어 다운로드에서 Oracle의 애플리케이션, 미들웨어, 데이터베이스, Java, 개발자 도구를 확인해 보세요.
www.oracle.com
2. 아래 'Database Express Edition' 에서 해당되는 운영체제에 맞춰 다운로드 *Oracle 계정 로그인 필요
(무료 교육용 버전으로 기능상 제한이 있음)


2-1. 압축파일을 풀어준 뒤 폴더 내 설치 파일 실행




3. 아래 'SQL Developer' 에서 해당되는 운영체제에 맞춰 다운로드(JDK-Java) *Oracle 계정 로그인 필요


3-1. 'sqldeveloper' 파일 실행

3-2. 'SQL Developer' 초기화면 확인

4. 좌측 인터페이스의 'Oracle 접속' 탭을 우클릭하여 새 접속 선택 후 각 필드에 다음과 같이 입력(PW는 초기설정 당시)


5. 명령문 테스트

6. 검색을 활용하여 'sql plus' 파일 검색 후 실행


7. 사용자명 입력에 'sys as sysdba' 입력 / 비밀번호는 초기 설정 비밀번호

8. 특정 유저를 선택 HR 이라는 유저 선택
alter session 명령어에서 set하고 스크립트를 실행해서 스키마를 만들어줘야됨.

alter session set "_ORACLE_SCRIPT"=true;
9. 스크립트를 실행해줘야함 휴먼리소스 hr 샘플 설치 21c 기준
아래 스크립트 실행해주어야함
@?/demo/schema/human_resources/hr_main.sql


아래 깃허브에서 샘플스키마 압축파일 다운로드
Release Oracle Database Sample Schemas 21c · oracle-samples/db-sample-schemas
Use these scripts to create the Oracle Database 21c Sample Schemas referenced in the documentation and examples. The scripts install in Oracle Database 12c and upwards, including Oracle Database Cl...
github.com
아래 경로에 압축 파일 해제

명령어 재입력

--
param1: account name
param2: default tablespace
param3: temp tablespace
param4: SYSTEM password
param5: log path
param6: connect string(localhost:1521/xe)
--

** SP2-0310 Error에 대한 대응:
기존 코드 임시 주석 처리 또는 삭제 후 스키마 Path로 코드 수정 후 저장
--
-- create tables, sequences and constraint
--
-- @__SUB__CWD__/human_resources/hr_cre
-- --
-- -- populate tables
-- --
-- @__SUB__CWD__/human_resources/hr_popul
-- --
-- -- create indexes
-- --
-- @__SUB__CWD__/human_resources/hr_idx
-- --
-- -- create procedural objects
-- --
-- @__SUB__CWD__/human_resources/hr_code
-- --
-- -- add comments to tables and columns
-- --
-- @__SUB__CWD__/human_resources/hr_comnt
-- --
-- -- gather schema statistics
-- --
-- @__SUB__CWD__/human_resources/hr_analz
--
@?/demo/schema/human_resources/hr_cre
-- --
-- -- populate tables
-- --
@?/demo/schema/human_resources/hr_popul
-- --
-- -- create indexes
-- --
@?/demo/schema/human_resources/hr_idx
-- --
-- -- create procedural objects
-- --
@?/demo/schema/human_resources/hr_code
-- --
-- -- add comments to tables and columns
-- --
@?/demo/schema/human_resources/hr_comnt
-- --
-- -- gather schema statistics
-- --
@?/demo/schema/human_resources/hr_analz
- Select 문 이용하여 테스트 진행
SELECT * FROM EMPLOYEES WHERE ROWNUM=1;

- HR 스키마 비밀번호 설정



- Reference:
Database Sample Schemas
Oracle provides the following sample schemas: HR, OE, OC, PM, and SH. You must download the installable zip file from the GitHub repository to use the sample schemas.
docs.oracle.com
'Language > RDBMS' 카테고리의 다른 글
[DML_SELECT] ORDER BY 구문을 활용한 정렬 (0) | 2023.03.02 |
---|---|
[DML_SELECT] WHERE 구문을 활용한 비교, 논리 연산 (0) | 2023.03.02 |
[DML_SELECT] SELECT 조작어를 활용한 데이터 조회 (0) | 2023.03.02 |
관계형 데이터베이스와 SQL (0) | 2023.03.02 |
데이터베이스와 DBMS (0) | 2023.03.02 |