Oracle登录脚本

Oracle登录脚本



点击(此处)折叠或打开

  1. REM turn off the terminal output - make it so SQLPlus does not
  2. REM print out anything when we log in
  3. set termout off
  4.   
  5. REM default your editor here. SQLPlus has many individual settings
  6. REM This is one of the most important ones
  7. define _editor=vi
  8.   
  9. REM serveroutput controls whether your DBMS_OUTPUT.PUT_LINE calls
  10. REM go into the bit bucket (serveroutput off) or get displayed
  11. REM on screen. I always want serveroutput set on and as big
  12. REM as possible - this does that. The format wrapped elements
  13. REM causes SQLPlus to preserve leading whitespace - very useful
  14. set serveroutput on size 1000000 format wrapped
  15.   
  16. REM Here I set some default column widths for commonly queried
  17. REM columns - columns I find myself setting frequently, day after day
  18. column object_name format a30
  19. column segment_name format a30
  20. column file_name format a40
  21. column name format a30
  22. column file_name format a30
  23. column what format a30 word_wrapped
  24. column plan_plus_exp format a100
  25.   
  26. REM by default, a spool file is a fixed width file with lots of
  27. REM trailing blanks. Trimspool removes these trailing blanks
  28. REM making the spool file significantly smaller
  29. set trimspool on
  30.   
  31. REM LONG controls how much of a LONG or CLOB sqlplus displays
  32. REM by default. It defaults to 80 characters which in general
  33. REM is far too small. I use the first 5000 characters by default
  34. Set long 5000
  35.   
  36. REM This sets the default width at which sqlplus wraps output.
  37. REM I use a telnet client that can go upto 200 characters wide -
  38. REM hence this is my preferred setting.
  39. set linesize 200
  40.   
  41. REM SQLplus will print column headings every N lines of output
  42. REM this defaults to 14 lines. I find that they just clutter my
  43. REM screen so this setting effectively disables them for all
  44. REM intents and purposes - except for the first page of course
  45. set pagesize 9999
  46.   
  47. REM MY SQL_NAME , it different from tom ,it prefer to hostname/username@database
  48. REM here is how I set my signature prompt in sqlplus to
  49. REM username@database> I use the NEW_VALUE concept to format
  50. REM a nice prompt string that defaults to IDLE (useful for those
  51. REM of you that use sqlplus to startup their databases - the
  52. REM prompt will default to idle> if your database isn\'t started)
  53. define gname=idle
  54. column global_name new_value gname
  55. select sys_context(\'userenv\', \'host\')||\'/\'||lower(user) || \'@\' ||
  56.        substr( global_name, 1, decode( dot,
  57.                                        0, length(global_name),
  58.                                           dot-1) ) global_name
  59.   from (select global_name, instr(global_name,\'.\') dot
  60.           from global_name );
  61. set sqlprompt \'&gname> \'
  62. REM and lastly, we\'ll put termout back on so sqlplus prints
  63. REM to the screen
  64. set termout on

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29500582/viewspace-1403179/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29500582/viewspace-1403179/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值