useful_aliases
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| useful_aliases [2018/12/06 21:05] – created 91.177.234.129 | useful_aliases [2019/01/30 11:32] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Useful_aliases ====== | ||
| - | |||
| A small collection of my most used aliases. | A small collection of my most used aliases. | ||
| - | ======Unix====== | + | ===== Unix ===== |
| - | =====Quickly get into a database===== | + | ==== Quickly get into a database ==== |
| Set these in the .(bash_)profile of the oracle account | Set these in the .(bash_)profile of the oracle account | ||
| + | < | ||
| alias dba=' | alias dba=' | ||
| - | This will only work if a database has already been selected using ". oraenv" | + | </ |
| + | This will only work if a database has already been selected using ". oraenv" | ||
| When I work out how to use multi-line in an alias, this can be made better with something like: | When I work out how to use multi-line in an alias, this can be made better with something like: | ||
| + | < | ||
| alias dba=' | alias dba=' | ||
| + | </ | ||
| Then it could be used like so | Then it could be used like so | ||
| + | < | ||
| dba dev02 | dba dev02 | ||
| + | </ | ||
| - | =====Set the SQL prompt so you can see what database you are on===== | + | ==== Set the SQL prompt so you can see what database you are on ==== |
| In the file $ORACLE_HOME/ | In the file $ORACLE_HOME/ | ||
| + | < | ||
| set sqlprompt " | set sqlprompt " | ||
| + | </ | ||
| Might be useful to add some other often used settings: | Might be useful to add some other often used settings: | ||
| + | < | ||
| set linesize 200 | set linesize 200 | ||
| set pagesize 200 | set pagesize 200 | ||
| + | </ | ||
| Very useful as of 10g is that this file is re-read after a connect from inside SQL*Plus | Very useful as of 10g is that this file is re-read after a connect from inside SQL*Plus | ||
| There is also a login.sql file that will be read (if it exists) which can either be in the current directory or in an environment variable $SQLPATH | There is also a login.sql file that will be read (if it exists) which can either be in the current directory or in an environment variable $SQLPATH | ||
| - | ======Windows====== | + | ===== Windows ===== |
| - | =====Quickly get into a database===== | + | ==== Quickly get into a database ==== |
| Create a file dba.bat that contains: | Create a file dba.bat that contains: | ||
| + | < | ||
| @echo off | @echo off | ||
| set ORACLE_SID=%1 | set ORACLE_SID=%1 | ||
| | | ||
| + | </ | ||
| Then this file will either have to be put somewhere on the %PATH%, the %PATH% modified to include the script dir or cd to the script dir before calling it. | Then this file will either have to be put somewhere on the %PATH%, the %PATH% modified to include the script dir or cd to the script dir before calling it. | ||
| + | |||
useful_aliases.1544130327.txt.gz · Last modified: 2018/12/06 21:05 by 91.177.234.129
