- 浏览: 697501 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
yzs5273:
没什么用。都试过了
WIN7下CS不能全屏的解决方法 -
di1984HIT:
不错,学习了
读取本地计算机中的安装程序列表 -
ffedu:
[flash=200,200][url][img][list] ...
linux/unix中如何用find命令详解,非常详细的介绍,比man find强100倍(转) -
lintghi:
...
Log4j使用相对路径指定log文件及使用总结 -
nick.s.ni:
唉,Java中引用的包没有介绍啊,如果数据库用UTF-8的格式 ...
Oracle 中Java 对象与PL/SQL类型的映射及使用(转)
Syntax:
SET option value
SHO[W] option
Options: most of the options listed below have an abbreviated and a long form
e.g. APPINFO or APPI will do the same thing
APPI[NFO] {ON|OFF|text}
Application info for performance monitor (see DBMS_APPLICATION_INFO)
ARRAY[SIZE] {15|n}
Fetch size (1 to 5000) the number of rows that will be retrieved in one go.
AUTO[COMMIT] {OFF|ON|IMM[EDIATE]|n}
Autocommit commits after each SQL command or PL/SQL block
AUTOP[RINT] {OFF|ON}
Automatic PRINTing of bind variables.(see PRINT)
AUTORECOVERY [ON|OFF]
Configure the RECOVER command to automatically apply
archived redo log files during recovery - without any user confirmation.
AUTOT[RACE] {OFF|ON|TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]]
Display a trace report for SELECT, INSERT, UPDATE or DELETE statements
EXPLAIN shows the query execution path by performing an EXPLAIN PLAN.
STATISTICS displays SQL statement statistics.
Using ON or TRACEONLY with no explicit options defaults to EXPLAIN STATISTICS
BLO[CKTERMINATOR] {.|c|OFF|ON}
Set the non-alphanumeric character used to end PL/SQL blocks to c
CMDS[EP] {;|c|OFF|ON}
Change or enable command separator - default is a semicolon (;)
COLSEP { |text}
The text to be printed between SELECTed columns normally a space.
COM[PATIBILITY] {V5|V6|V7|V8|NATIVE}
Version of oracle - see also init.ora COMPATIBILITY=
You can set this back by up to 2 major versions e.g. Ora 9 supports 8 and 7
CON[CAT] {.|c|OFF|ON}
termination character for substitution variable reference
default is a period.
COPYC[OMMIT] {0|n}
The COPY command will fetch n batches of data between commits.
(n= 0 to 5000) the size of each fetch=ARRAYSIZE.
If COPYCOMMIT = 0, COPY will commit just once - at the end.
COPYTYPECHECK {OFF|ON}
Suppres the comparison of datatypes while inserting or appending to DB2
DEF[INE] {&|c|OFF|ON}
c = the char used to prefix substitution variables.
ON or OFF controls whether to replace substitution variables with their values.
(this overrides SET SCAN)
DESCRIBE [DEPTH {1|n|ALL}][LINENUM {ON|OFF}][INDENT {ON|OFF}]
Sets the depth of the level to which you can recursively describe an object
(1 to 50) see the DESCRIBE command
ECHO {OFF|ON}
Display commands as they are executed
EMB[EDDED] {OFF|ON}
OFF = report printing will start at the top of a new page.
ON = report printing may begin anywhere on a page.
ESC[APE] {\|c|OFF|ON}
Defines the escape character. OFF undefines. ON enables.
FEED[BACK] {6|n|OFF|ON}
Display the number of records returned (when rows >= n )
OFF (or n=0) will turn the display off
ON will set n=1
FLAGGER {OFF|ENTRY|INTERMED[IATE]|FULL}
Checks to make sure that SQL statements conform to the ANSI/ISO SQL92 standard.
non-standard constructs are flagged as errors and displayed
See also ALTER SESSION SET FLAGGER.
FLU[SH] {OFF|ON}
Buffer display output (OS)
(no longer used in Oracle 9)
HEA[DING] {OFF|ON}
print column headings
HEADS[EP] {||c|OFF|ON}
Define the heading separator character (used to divide a column heading onto > one line.)
OFF will actually print the heading separator char
see also: COLUMN command
INSTANCE [instance_path|LOCAL]
Change the default instance for your session, this command may only be issued when
not already connected and requires Net8
LIN[ESIZE] {150|n}
Width of a line (before wrapping to the next line)
Earlier versions default to 80, Oracle 9 is 150
LOBOF[FSET] {n|1}
Starting position from which CLOB and NCLOB data is retrieved and displayed
LOGSOURCE [pathname]
Change the location from which archive logs are retrieved during recovery
normally taken from LOG_ARCHIVE_DEST
LONG {80|n}
Set the maximum width (in chars) for displaying and copying LONG values.
LONGC[HUNKSIZE] {80|n}
Set the fetch size (in chars) for retrieving LONG values.
MARK[UP] HTML [ON|OFF]
[HEAD text] [BODY text] [TABLE text]
[ENTMAP {ON|OFF}][SPOOL {ON|OFF}]
[PRE[FORMAT] {ON|OFF}]
Output HTML text, which is the output used by iSQL*Plus.
NEWP[AGE] {1|n}
The number of blank lines between the top of each page and the top title.
0 = a formfeed between pages.
NULL text
Replace a null value with 'text'
The NULL clause of the COLUMN command will override this for a given column.
NUMF[ORMAT] format
The default number format.
see COLUMN FORMAT.
NUM[WIDTH] {10|n}
The default width for displaying numbers.
PAGES[IZE] {14|n}
The height of the page - number of lines.
0 will suppress all headings, page breaks, titles
PAU[SE] {OFF|ON|text}
press [Return] after each page
enclose 'text' in single quotes
RECSEP {WR[APPED]|EA[CH]|OFF}
Print a single line of the RECSEPCHAR between each record.
WRAPPED = print only for wrapped lines
EACH=print for every row
RECSEPCHAR {_|c}
Define the RECSEPCHAR character, default= ' '
SCAN {OFF|ON}
OFF = disable substitution variables and parameters
SERVEROUT[PUT] {OFF|ON} [SIZE n] [FOR[MAT] {WRA[PPED]|WOR[D_WRAPPED]|TRU[NCATED]}]
whether to display the output of stored procedures (or PL/SQL blocks)
i.e., DBMS_OUTPUT.PUT_LINE
SIZE = buffer size (2000-1,000,000) bytes
SHOW[MODE] {OFF|ON}
Display old and new settings of a system variable
SPA[CE] {1|n}
The number of spaces between columns in output (1-10)
SQLBL[ANKLINES] {ON|OFF}
Allow blank lines within an SQL command. reverts to OFF after the curent command/block.
SQLC[ASE] {MIX[ED]|LO[WER]|UP[PER]}
Convert the case of SQL commands and PL/SQL blocks
(but not the SQL buffer itself)
SQLPLUSCOMPAT[IBILITY] {x.y[.z]}
Set the behavior or output format of VARIABLE to that of the
release or version specified by x.y[.z].
SQLCO[NTINUE] {> |text}
Continuation prompt (used when a command is continued on an additional line using a hyphen -)
SQLN[UMBER] {OFF|ON}
Set the prompt for the second and subsequent lines of a command or PL/SQL block.
ON = set the SQL prompt = the line number.
OFF = set the SQL prompt = SQLPROMPT.
SQLPRE[FIX] {#|c}
set a non-alphanumeric prefix char for immediately executing one line of SQL (#)
SQLP[ROMPT] {SQL>|text}
Set the command prompt.
SQLT[ERMINATOR] {;|c|OFF|ON}|
Set the char used to end and execute SQL commands to c.
OFF disables the command terminator - use an empty line instead.
ON resets the terminator to the default semicolon (;).
SUF[FIX] {SQL|text}
Default file extension for SQL scripts
TAB {OFF|ON}
Format white space in terminal output.
OFF = use spaces to format white space.
ON = use the TAB char.
Note this does not apply to spooled output files.
The default is system-dependent. Enter SHOW TAB to see the default value.
TERM[OUT] {OFF|ON}
OFF suppresses the display of output from a command file
ON displays the output.
TERMOUT OFF does not affect the output from commands entered interactively.
TI[ME] {OFF|ON}
Display the time at the command prompt.
TIMI[NG] {OFF|ON}
ON = display timing statistics for each SQL command or PL/SQL block run.
OFF = suppress timing statistics
TRIM[OUT] {OFF|ON}
Display trailing blanks at the end of each line.
ON = remove blanks, improving performance
OFF = display blanks.
This does not affect spooled output.
SQL*Plus ignores TRIMOUT ON unless you set TAB ON.
TRIMS[POOL] {ON|OFF}
Allows trailing blanks at the end of each spooled line.
This does not affect terminal output.
UND[ERLINE] {-|c|ON|OFF}
Set the char used to underline column headings to c.
VER[IFY] {OFF|ON}
ON = list the text of a command before and after replacing substitution variables with values.
OFF = dont display the command.
WRA[P] {OFF|ON}
Controls whether to truncate or wrap the display of long lines.
OFF = truncate
ON = wrap to the next line
The COLUMN command (WRAPPED and TRUNCATED clause) can override this for specific columns.
The items in Gray on this page are deprecated from Oracle 9 onwards - also note that several of the options above have 'gone missing' from the official documentation set - HELP SET is a more accurate reference.
Get a list of these SET options in sql*plus with the command:
SQLPLUS> HELP SET
发表评论
-
Mongo vs. Couchbase
2017-07-05 22:21 0https://www.couchbase.com/com ... -
Backup DDL on Oracle DB
2016-03-01 10:31 778set trimspool on lines 500 pa ... -
Identifying Relationship vs. Non-identifying Relationship
2015-10-20 23:49 1246Identifying vs non-identifying ... -
Re-post: DBMS_XPLAN : Display Oracle Execution Plans
2014-07-23 16:14 1041DBMS_XPLAN : Display Oracle Ex ... -
Optimistic Locking with Concurrency in Oracle
2014-04-16 11:37 679A very good document about opti ... -
Get DDL via SQLPLUS
2012-10-24 19:36 976set pagesize 0 -- The height of ... -
Oracle 子程序参数模式,IN,OUT,NOCOPY ( 转)
2012-03-06 14:54 1872Oracle 子程序参数模式主 ... -
TNSNAMES配置中空格导致的bug(转)
2011-12-29 21:55 1180发现一个很有趣的bug ... -
Oracle 中Java 对象与PL/SQL类型的映射及使用(转)
2011-11-05 23:45 4731一、Jpublisher概述 Oracle JPu ... -
Refresh statistics for all tables
2011-11-03 14:10 958select 'analyze table '||tab ... -
What's blocking my lock?(Reposted)
2011-10-31 13:44 1012If you've ever gotten a phone c ... -
Oracle exp direct(Reposted)
2011-06-15 14:55 2187使用直接导出模式 direct=y exp 比传统模式导 ... -
九大Oracle性能优化基本方法详解(转)
2011-05-12 18:18 1081Oracle性能优化基本方法包括一下几个步骤,包括: 1)设 ... -
深入了解oracle的高水位(HWM)
2011-05-12 09:23 1152转自http://tolywang.itpub.net ... -
Oracle 聚簇(收集)
2011-05-11 22:02 19181. 什么是聚簇 聚簇是 ... -
怎样正确显示oracle异常行数(转)
2011-01-20 16:17 2611在oracle中的存储过程中,使用的EXCEPTION并用 ... -
Oracle function translate(Reposted)
2011-01-08 22:51 1660一、语法: TRANSLATE(string,f ... -
Oracle用Start with...Connect By子句递归查询(转)
2011-01-07 11:39 4254一、语法 大致写法:sel ... -
Spool和SQLLDR--Oracle数据导出导入(传)
2010-12-02 14:58 4495对于SPOOL数据的SQL,最好要自己定义格式,以方便程序直 ... -
TNS:listener could not find instance with matching protocol stack
2010-09-27 15:41 1413When the listener believes the ...
相关推荐
- 在 SQL*Plus 中启用 AUTOTRACE:`SET AUTOTRACE ON`。 - 运行 SQL 语句,SQL*Plus 将自动显示执行计划和统计信息。 **使用技巧**: - 使用 `SET AUTOTRACE TRACEONLY` 来仅显示执行计划而不显示结果集。 - 使用 `...
- **SQL*Plus**: 当在SQL*Plus环境中执行SQL语句时出错。 - **PL/SQL Developer**: 在PL/SQL Developer等开发工具中运行脚本时出现错误。 - **应用程序**: 在基于Oracle的应用程序中,当执行数据库操作失败时可能会...
- 在SQL Plus中使用`SET TRACE`来获取执行计划与统计信息: ```sql SET AUTOTRACE ON; ``` **2. 查看 SQL 执行计划** - **方法:** - 使用`EXPLAIN PLAN`命令,结合`PLAN_TABLE`表来查看执行计划。 - 在SQL ...
OCCI使得程序员能够直接使用C++代码执行SQL语句和管理数据库连接,而无需通过SQL*Plus或其他中间层。以下是对OCCI编程核心知识点的详细说明: 1. **环境(Environment)的创建与终结**: - `Environment`类是OCCI...
- 你可以通过修改会话的初始化参数或者在SQL*Plus中使用`ALTER SESSION SET EVENTS`命令来启用Statement Tracer。 - 例如,`ALTER SESSION SET EVENTS '10046 trace name context forever, level 12'`将开启10046...
2. **使用SQL\*PLUS的`SET AUTOTRACE`命令** - `SET AUTOTRACE ON EXPLAIN`: 显示执行计划。 - `SET AUTOTRACE ON STATISTICS`: 显示执行统计信息。 - `SET AUTOTRACE ON`: 同时显示执行计划和执行统计信息。 - ...
#### SQL Plus 命令行工具 - 可以通过 `sqlplus username/password` 登录到Oracle数据库,并执行SQL命令或批处理文件。 ### 表的操作 #### 创建表 - 基本语法为:`CREATE TABLE tableName (col1 type1 [NOT NULL] ...
#### 方法二:在 SQL*Plus 中使用 `SET AUTOTRACE ON` ```sql SET AUTOTRACE ON; ``` - **解释**: - 这条命令开启了 SQL*Plus 的自动跟踪功能,当执行 SQL 语句后,会自动显示执行计划和统计信息。 ### 2. 如何...
- **使用EXPLAIN PLAN**:针对特定SQL语句,使用`EXPLAIN PLAN SET STATEMENT_ID = '标识符' INTO PLAN_TABLE`。 - **查看Explain Plan**:通过运行`utlxplp.sql`或`utlxpls.sql`查看生成的Explain Plan。 #### ...
SQL> EXPLAIN PLAN SET statement_id = 'QUERY_ID' FOR <your_sql_query>; ``` 3. **查询计划表**:通过查询`plan_table`来获取具体的执行计划细节。 ##### 3. **优化器与执行计划比较** - **优化器的作用**:...
AUTOTRACE只能在SQL*PLUS环境下使用,通过简单的命令即可开启AUTOTRACE功能: ```sql SQL> set autotrace on ``` 或者指定具体的选项来控制AUTOTRACE的行为,例如只显示执行计划而不显示查询结果,可以使用: ```...
SQL*Plus中的`SET TRACE` - **命令**: ```sql SET TIMING ON SET AUTOTRACE ON -- 执行SQL语句 ``` - **解释**: `SET AUTOTRACE ON`命令会在执行SQL后自动显示执行计划和统计信息。 通过以上方法,可以在...
SQL*Plus 是 Oracle 提供的一个命令行工具,用于执行 SQL 命令、查看结果以及管理数据库。 - **启动**:可以通过命令行输入 `sqlplus` 启动。 - **连接数据库**:使用 `sqlplus username/password@database` 连接到...
- `SQL> set linesize n`设定每行最大字符数,如`SQL> set linesize 200`。 - `SQL> spool filename`可以实现假脱机输出,将查询结果保存到文件,`SQL> spool off`停止假脱机输出。 最后,Java连接Oracle数据库通常...
Delve into the internal architecture of T-SQL—and unveil the power of set-based querying—with comprehensive reference and advice from a highly regarded T-SQL expert and members of Microsoft's SQL ...
#### ORA-00088: Unable to execute SQL statement - **解释**: 无法执行SQL语句。 - **解决方案**: 检查SQL语句语法和表结构。 #### ORA-00089: ORADEBUG not enabled - **解释**: ORADEBUG未启用。 - **解决...
SQL/Plus是Oracle提供的一款命令行工具,用于执行SQL语句和脚本。通过SQL/Plus,用户可以方便地对SQL语句进行调试和分析。 **2. 创建追踪角色(Role)** 为了更好地追踪SQL语句的执行情况,可以通过创建一个特殊的...