SQL Plus
SQL PlusSQL Plus는 기본 명령줄 인터페이스를 갖춘 가장 기본적인 Oracle Database 유틸리티로, 사용자, 관리자 및 프로그래머가 일반적으로 사용합니다.
명령어 타입
SQL Plus는 다음 5가지 카테고리의 텍스트를 [1]이해하고 있습니다.
- SQL 문
- PL/SQL 블록
- SQL Plus 내부 명령:
- SET 등의 환경 제어 명령어
- SHOW와 같은 환경 모니터링 명령어
- 평.
- ! char가 붙은 외부 명령어
스크립트에는 이러한 컴포넌트가 모두 포함될 수 있습니다.
적절하게 구성된 소프트웨어 환경의 오라클 프로그래머는 다음과 같이 입력하여 SQL Plus를 시작할 수 있습니다.
sqlplus scott/1900달러
여기서 Oracle 사용자는scott
패스워드를 가지고 있다tiger
. SQL Plus는 다음 기본 형식의 프롬프트를 표시합니다.
SQL >
그런 다음 SQL 문(세미콜론으로 끝남), PL/SQL 블록 또는 다른 명령을 입력하여 대화형 사용을 시작할 수 있습니다.예를 들어 다음과 같습니다.
SQL> 선택한다. 'Hello world' ~하듯이 예 부터 이중의; 예 -------------------------------- 안녕 세계
역사
SQL Plus의 첫 번째 버전은 UFI(User Friendly Interface)라고 불렸습니다.UFI는 버전 4 이전 Oracle 데이터베이스 릴리스에서 사용되었습니다.
오라클 프로그래머가 UFI에 새로운 기능을 추가한 후, 그 이름은 Advanced UFI가 되었습니다.Oracle 버전 5가 출시되면서 "Advanced [2]UFI"라는 이름이 "SQL Plus"로 변경되었습니다.
사용.
Oracle 또는 타사 그래픽 인터페이스로 인해 SQL Plus 환경에 의존하는 Oracle 데이터베이스 최종 사용자의 비율이 감소했습니다.Oracle 상점에서는 일반적으로 배치 업데이트 또는 단순 [citation needed]보고서에 SQL Plus 스크립트를 계속 사용합니다.
Oracle Corporation의 SQL Plus용 래퍼/gui-factions/대체 제품에는 다음이 포함됩니다.
- Oracle[3] SQL Plus 워크시트, OEM 컴포넌트
- iSQL Plus 또는 iSQLPlus, 웹 기반[4] 유틸리티
- SQL 워크시트,[5] Oracle SQL Developer 컴포넌트
- SQL 워크숍(Oracle Application Express [6]일부)
Oracle 11g
Oracle 데이터베이스 11g부터는 iSqlplus(웹 기반) 및 sqlplus GUI가 Oracle 데이터베이스 [7]소프트웨어와 함께 제공되지 않습니다.명령줄 SQL Plus 인터페이스는 주로 비대화식 스크립팅 또는 관리 목적으로 계속 사용됩니다[citation needed].Server Manager 명령줄(SQL*DBA 대체)은 더 이상 사용되지 않으며 SQL Plus 8i 이후에는 다음과 같은 명령어를 발행할 수 있습니다.SYSDBA로 접속되어 있는 경우는, 기동과 셧다운이 됩니다.Server Manager 7.1에서는 다음 명령어가 도입되었습니다.CONNECT / AS SYSDBA
교체하다CONNECT INTERNAL
.[8] SQL Plus 8i 이후로는 CONNECT / AS SYSDBA 사용 가능
호환성.
다른 벤더는 자사의 소프트웨어가 SQL Plus 스크립트 명령과 어느 정도 호환되도록 하거나 SQL Plus 운영 모드를 제공하고 있습니다.관련 제품에는 Quest [9]Software의 TOAD가 포함되어 있습니다.
통합
![]() | 이 섹션은 확장해야 합니다.추가함으로써 도움이 될 수 있습니다. (2009년 7월) |
변수
SQL Plus 세션 내에서 액세스할 수 있는 SQL Plus 내부 변수는 다음과 같습니다.
- 사용자 변수, 에서 표시 가능
DEFINE
명령어로 프레픽스 문자(디폴트 프레픽스: '&' 및 '&')를 1개 또는 2개 사용하여 참조할 수 있습니다.Oracle Corporation은 이러한 변수를 "대체 변수"라고 부릅니다.프로그래머는 SQL 또는 PL/SQL 문 또는 SQL Plus 명령으로 어디에서나 사용할 수 있습니다.다음 명령어를 사용하여 리터럴로 입력할 수 있습니다.DEFINE
또는 데이터베이스로부터column
명령어를 입력합니다. - 바인드 변수(앞에 콜론(':')이 붙으며 PL/SQL 환경과 상호 작용할 수 있습니다.VARILE 및 PRINT[12] 명령으로 표시 가능
에러 트래핑
그WHENEVER
command는 후속 SQL Plus 명령 실행 중 시스템에서 SQL[13] 오류 또는 운영 체제 오류가[14] 검출되었을 때 수행할 액션을 지정합니다.
보조 소프트웨어
- SQL Assistant SQL Assistant 추가 기능 for SQL Plus Windows 버전은 SQL 자동 단어 완성, 인라인 Oracle SQL Reference, 데이터 내보내기/가져오기, 코드 유닛 테스트, 데이터 브라우징 및 코드 개발 기능을 통해 SQL Plus를 확장합니다.
- rlwrap rlwrap은 UNIX 및 Linux에서 SQL Plus에 대해 GNU Readline과 같은 명령어를 완료합니다.
「 」를 참조해 주세요.
레퍼런스
- ^ "SQL Plus at orafaq.com". Archived from the original on 2007-11-09. Retrieved 2007-11-26.
- ^ Millsap, Cary; Kolk, Anjo; McDonald, Connor; Gorman, Tim; Hailey, Kyle; Ensor, David; Lewis, Jonathan; Vaidyanatha, Gaja Krishna; Ruthven, David; Morle, James (2004). Oracle Insights (1st ed.). p. 35. ISBN 978-1590593875. Retrieved March 18, 2014.
- ^ Evans, Robert (2008-10-01). "The SQL Plus Worksheet". Cardiff University. Archived from the original on 2008-12-01. Retrieved 2008-11-21.
Oracle's SQL Plus Worksheet is a straight-forward, easy-to-use, graphical user interface for SQL.
- ^ "ISQLPlus". Oracle FAQ. 2008-02-29. Retrieved 2008-11-21.
iSQLPlus (iSQL Plus) is a web-based utility similar to the SQL Plus command line utility for executing SQL and PL/SQL commands (available up to Oracle 10gR2).
- ^ "Oracle SQL Developer 1.5: Feature List". Oracle Corporation. Archived from the original on 2008-07-24. Retrieved 2008-11-21.
The SQL Plus commands supported by Oracle SQL Developer SQL Worksheet are listed [...]
- ^ "Oracle Application Express". Oracle Corporation. Archived from the original on 2006-10-21. Retrieved 2008-11-21.
SQL Workshop provides tools to enable you to view and manage database objects from a Web browser. Use SQL Commands to run SQL and PL/SQL statements. ...
- ^ Oracle Database 11g Release 1(11.1)에서 사용되지 않는 컴포넌트, 2009년6월 25일까지 취득
- ^ [1] Oracle 7 문서, 1994
- ^ Hotka, Dan; Scalzo, Bert (2003-04-18). TOAD SQL Editor.
- ^ Alapati, Sam R. (2008). "4". Expert Oracle Database 11g Administration. Apress. pp. 118–119. ISBN 978-1-4302-1015-3. Retrieved 2009-07-29.
- ^ Roshak, Natalka (2005-11-06). "Spice up your SQL Scripts with Variables". Oracle FAQ. Retrieved 2009-07-29.
& and && indicate substitution variables in SQL Plus scripts or commands.
- ^ Nyffenegger, René. "Using bind variables in SQL Plus". René Nyffenegger's collection of things on the web. Retrieved 2009-07-29.
In SQL Plus, a bind variable is declared with
variable
[...] The value of the bind variable can then be printed withprint
- ^ Watt, Simon. "SQL Plus User's Guide and Reference". Oracle Help Center. Oracle Database Online Documentation, 10g Release 2 (10.2) / Administration. Oracle. p. 74. Retrieved 2015-11-04.
WHENEVER SQLERROR [...] [d]irects SQL Plus to perform the specified action as soon as it detects a SQL command or PL/SQL block error (but after printing the error message).
- ^ Watt, Simon. "SQL Plus User's Guide and Reference". Oracle Help Center. Oracle Database Online Documentation, 10g Release 2 (10.2) / Administration. Oracle. p. 73. Retrieved 2015-11-04.
WHENEVER OSERROR [...] [d]irects SQL Plus to perform the specified action as soon as an operating system error is detected.