LINUX下SQLPLUS等工具的歷史記錄功能

leon830216發表於2014-02-23
儲存歷史記錄(rlwrap)
vim ~/.bashrc
------------------------------------------------------
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias lsnrctl='rlwrap lsnrctl'

vim $oracle_home$\sqlplus\admin\glogin.sql
------------------------------------------------------
define _editor=vim
define gname=idle
set arraysize 1000
set auto off
set line 80
set linesize 120
set feedback on
set pagesize 9999
set newpage none
set long 5000
set trimspool on
-- set timing on
-- set time on
set auto off
set serveroutput on size 1000000 format wrapped
--alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
--alter session set nls_language=American;
column global_name new_value gname
set termout off
select lower(user)||'@'||substr(global_name,1,
decode(dot,0,length(global_name),dot-1)) global_name
from (select global_name,instr(global_name,'.') dot from global_name);
set sqlprompt '&gname> '
set termout on
column tablespace_name format a15 heading tablespace|name;
column ts_name format a15;
column table_name format a15;
column name format a40;
column owner format a10;
column file_name format a40;
column segment_name format a15;
column segment_type format a15;
column status format a15;
column username format a15;
column user_name format a15;
column program format a40;
column member format a40;
column type format a15;
column object_name format a30;
column grantee format a12;
column granted_role format a20;
column parameter format a35;
column value format a40;
column object_type format a20;
column tablespace_name format a15;
column ts_name format a15;
column table_name format a15;
column name format a40;
column owner format a10;
column file_name format a40;
column segment_name format a15;
column segment_type format a15;
column status format a15;
column username format a15;
column user_name format a15;
column program format a30;
column machine format a30
column member format a40;
column type format a15;
column object_name format a30;
column grantee format a12;
column granted_role format a20;
column parameter format a35;
column value format a40;
column object_type format a20;
column sql_text format a60;
column directory_path format a60;
column directory_name format a30;
column column_name format a30;
column cluster_name format a30;
column clu_column_name format a30;
column tab_column_name format a30;
column dest_name format a20;
column destination format a60;
column database_role format a20;
column switcover_status format a20;
column db_unique_name format a20;
column protection_level format a20;
column recovery_mode format a20; 
column platform_name format a40; 
column role format a20; 
column privilege format a20;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22558114/viewspace-1086379/,如需轉載,請註明出處,否則將追究法律責任。

相關文章