博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[摘] SQLPLUS Syntax
阅读量:6209 次
发布时间:2019-06-21

本文共 4325 字,大约阅读时间需要 14 分钟。

You use the SQLPLUS command at the operating system prompt to start

command-line SQL*Plus:
SQLPLUS [ [Options] [Logon] [Start] ]

Options has the following syntax:

[-H[ELP]|-V[ERSION] [-C[OMPATIBILITY]] [-F[AILOVER]] [-L[OGON]] [-M[ARKUP] markup_option] [-R[ESTRICT] {1|2|3}] [-S[ILENT]]]

MARKUP option:

HTML [ON|OFF] [HEAD text] [BODY text] [TABLE text] [ENTMAP {ON|OFF}] [SPOOL {ON|OFF}] [PRE[FORMAT] {ON|OFF}]

Logon has the following syntax:

{username[/password][@connect_identifier]| / } [AS {SYSOPER|SYSDBA|SYSASM}]|/NOLOG

HELP Option

-H[ELP]
Displays the usage and syntax for the SQLPLUS command, and then returns control to the operating system.

VERSION Option

-V[ERSION]
Displays the current version and level number for SQL*Plus, and then returns control to the operating system.

COMPATIBILITY Option

-C[OMPATIBILITY] {x.y[.z]
Sets the value of the SQLPLUSCOMPATIBILITY system variable to the SQL*Plus release specified by x.y[.z]. Where x is the version number, y is the release number, and z is the update number. For example, 9.0.1 or 10.2. For more information, see the SET

FAILOVER Option

-F[AILOVER]
Enables SQL*Plus to receive FAN events when connected to a Real Application Cluster (RAC) database. In this mode a service or instance failure is transparently handled with transaction status messages if applicable.

LOGON Option

-L[OGON]
Specifies not to reprompt for username or password if the initial connection does not succeed. This can be useful in operating system scripts that must either succeed or fail and you don't want to be reprompted for connection details if the database server is not running.

MARKUP Options

-M[ARKUP]
You can use the MARKUP option to generate a complete stand alone web page from your query or script.

HTML [ON|OFF]

HTML is a mandatory MARKUP argument which specifies that the type of output to be generated is HTML. The optional HTML arguments, ON and OFF, specify whether or not to generate HTML output. The default is OFF.

MARKUP HTML ON generates HTML output using the specified MARKUP options. You can turn HTML output ON and OFF as required during a session. The default is OFF.

RESTRICT Option

-R[ESTRICT] {1|2|3}
Enables you to disable certain commands that interact with the operating system.
(EDIT,GET,HOST,SAVE,SPOOL,START, @, @@,STORE)

SILENT Option

-S[ILENT]
Suppresses all SQL*Plus information and prompt messages, including the command prompt, the echoing of commands, and the banner normally displayed when you start SQL*Plus. If you omit username or password, SQL*Plus prompts for them, but the prompts are not visible! Use SILENT to invoke SQL*Plus within another program so that the use of SQL*Plus is invisible to the user. SILENT is a useful mode for creating reports for the web using the SQLPLUS -MARKUP command inside a CGI script or operating system script. The SQL*Plus banner and prompts are suppressed and do not appear in reports created using the SILENT option.

Logon

username[/password]
Represent the username and password with which you wish to start SQL*Plus and connect to Oracle Database.
Warning: Including your password in plain text is a security risk. You can avoid this risk by omitting the password, and entering it only when the system prompts for it.

/

Represents a default logon using operating system authentication. You cannot enter a connect identifier if you use a default logon. In a default logon, SQL*Plus typically attempts to log you in using the username OPS$name, where name is your operating system username. Note that the prefix "OPS$" can be set to any other string of text. For example, you may wish to change the settings in your INIT.ORA parameters file to LOGONname or USERIDname. See the Oracle Database Administrator's Guide for information about operating system authentication.

AS {SYSOPER|SYSDBA|SYSASM}

The AS clause enables privileged connections by users who have been granted SYSOPER, SYSDBA or SYSASM system privileges.

/NOLOG

Establishes no initial connection to Oracle Database. Before issuing any SQL commands, you must issue a CONNECT command to establish a valid logon. Use /NOLOG when you want to have a SQL*Plus script prompt for the username, password, or database specification. The first line of this script is not assumed to contain a logon.

 

 

转载于:https://www.cnblogs.com/toughhou/p/3778787.html

你可能感兴趣的文章
<<深入浅出nodeJS>>读书笔记--<二>
查看>>
回收ImageView占用的图像内存
查看>>
Linux Kconfig及Makefile学习
查看>>
java之jvm学习笔记六(实践写自己的安全管理器)
查看>>
【评分】第二次作业-数独-第一次测试成绩
查看>>
基础排序算法,java实现(快速,冒泡,选择,堆排序,插入)
查看>>
struts请求源码的跟踪
查看>>
在jquery的ajax中添加自定义的header信息
查看>>
echarts3.0之关系图详解
查看>>
一步步学Qt,第四天-Qt程序发布问题
查看>>
每天一个小算法(Shell sort5)
查看>>
Tomcat 部署项目的三种方法(转)
查看>>
Python3.x和Python2.x的区别
查看>>
Python列表
查看>>
cenOS-telnet refused问题
查看>>
CNKI知网如何批量下载论文
查看>>
Linux C下变量和常量的存储的本质
查看>>
要学的
查看>>
【sqlserver】批量插入10万数据
查看>>
javaWeb:什么叫监听器
查看>>