标签:order where lin printing connect 定义 ecif spec master
sqlplus
工具使用技巧/*
set timing on; // 设置显示“已用时间:XXXX”
set autotrace on; // 设置允许对执行的sql进行分析
set linesize 80; // 输出一行字符个数,缺省为80
set numwidth 12; // 输出number类型域长度,缺省为10
set serveroutput on; // 设置允许显示输出类似dbms_output
set verify off // 可以关闭和打开提示确认信息old 1和new 1的显示.
set MARKUP HTML ON // 控制输出的标记语言类型,MARKUP将HTML定义为标记语言
set colsep ‘ ‘; // 域输出分隔符
set echo off; // 显示start启动的脚本中的每个sql命令,缺省为on
set feedback off; // 回显本次sql命令处理的记录条数,缺省为on
set heading off; // 输出域标题,缺省为on
set pagesize 0; // 输出每页行数,缺省为24,为了避免分页,可设定为0。
set termout off; // 显示脚本中的命令的执行结果,缺省为on
set trimout on; // 去除标准输出每行的拖尾空格,缺省为off
set trimspool on; // 去除重定向(spool)输出每行的拖尾空格,缺省为off
*/
# 1. 配置全局环境示例 -- 登录配置
cat >> ${ORACLE_HOME}/sqlplus/admin/glogin.sql <<EOF
-- 显示当前SQL语句查询或修改的行数
set feedback on
-- 设置编辑器为VI
define _editor=vi
-- 显示用dbms_output.put_line包进行输出的信息
set serveroutput on size 1000000
-- 把输出内容每行后面多余的空格去掉
set trimspool on
-- 缓冲区用于显示long的字节数
set long 9000
-- 设置一行可用容纳的字符数
set linesize 200
-- 设置一页有9999行
set pagesize 9999
-- 设置列的长度
column plan_plus_exp format a80
-- 设置列的新名称
column global_name new_value gname
-- 屏幕上不显示所输出的信息
set termout off
define gname=idle
define uniqname=idle
column db_unique_name new_value uniqname noprint
select value db_unique_name from v$parameter where name = ‘db_unique_name‘;
alter session set nls_date_format=‘yyyy-mm-dd hh24:mi:ss‘;
SET SQLPROMPT "&_USER.@&_CONNECT_IDENTIFIER‘@‘&uniqname‘@‘_DATE> "
set termout on
EOF
break
使用-- 帮助信息
HELP|? [topic]
SQL> ? break
BREAK
-----
Specifies where changes occur in a report and the formatting
action to perform, such as:
- suppressing display of duplicate values for a given column
- skipping a line each time a given column value changes
- printing computed figures each time a given column value
changes or at the end of the report.
Enter BREAK with no clauses to list the current BREAK definition.
BRE[AK] [ON report_element [action [action]]] ...
where report_element has the following syntax:
{column | expression | ROW | REPORT}
and where action has the following syntax:
[SKI[P] n | [SKI[P]] PAGE] [NODUP[LICATES] | DUP[LICATES]]
SQL>
-- 示例
break on grantee on account_status skip 1;
SELECT r.grantee, r.granted_role, r.admin_option, u.account_status
FROM dba_role_privs r, dba_users u
WHERE r.grantee = u.username
and u.username = ‘AWREPO‘
ORDER BY r.grantee, r.granted_role;
标签:order where lin printing connect 定义 ecif spec master
原文地址:https://www.cnblogs.com/binliubiao/p/12881869.html