Recent Notes
Displaying keyword search results 1 - 10
Created by Dr. Xi on February 06, 2012 12:14:11
Last update: February 07, 2012 15:39:35
Oracle sqlplus command line tools does not support command line editing out-of-the-box. But on Linux there's a handy utility that enables command line editing with any command line tool: rlwrap - readline wrapper.
Install rlwrap:
$ sudo apt-get install rlwrap
Create a keywords file .sql.dict (optional, but convenient):
false null true
access add as asc begin by chec...
It would be nice to add the tables names also.
Create an alias for sqlplus (put it in .bashrc ):
alias sqlplus='rlwrap -f $HOME/.sql.dict sqlplus'
Created by Dr. Xi on February 06, 2012 09:19:27
Last update: February 06, 2012 09:19:27
These are the steps to install the Oracle sqlplus command line utility on Ubuntu Linux:
Get Oracle instant client packages from Oracle (you'll need basic or basiclite + sqlplus).
Install the RPM files with alien :
$ sudo alien -i oracle-instantclient11.2-basic-11....
Install Oracle shared libraries: create file /etc/ld.so.conf.d/oracle.conf and add this line:
/usr/lib/oracle/11.2/client/lib
then run
sudo ldconfig
Created by Dr. Xi on January 07, 2010 23:40:28
Last update: February 09, 2010 03:24:35
This is a utility to generate SQL insert statements for Oracle for one table, or a set of tables. It doesn't cover all possibilities but should be good enough for most cases.
import java.io.*;
import java.sql.*;
import ...
To generate insert statements for multiple tables, simply put the table names in a file, one per line, and use the -f switch.
Created by Dr. Xi on February 06, 2010 00:25:00
Last update: February 06, 2010 00:26:50
Solution:
grant unlimited tablespace to <user>
or
alter user <user_name> quota 250m on <tablespace_n...
Example:
SQL> create table customer (
2 id number(9),...
Created by Dr. Xi on February 03, 2010 03:48:00
Last update: February 03, 2010 03:48:00
The ORA-06512 code is not the actual error. It merely indicates on which line the error occurred. The real error precedes ORA-06512 . For example:
ERROR at line 1:
ORA-29400: data cartridge e...
Created by Dr. Xi on August 20, 2009 04:03:07
Last update: August 20, 2009 04:03:07
Use alter package to recompile a PL/SQL package.
SQL> alter package UTIL compile;
Warning: P...
Created by Dr. Xi on August 20, 2009 03:24:25
Last update: August 20, 2009 03:25:55
I get this error using PL/SQL to enqueue a JMS message in Oracle XE:
Oracle: PLS-00302: component 'CONSTRUCT' must be declared .
Following an advice I found on the web , I ran the script "$ORACLE_HOME/rdbms/admin/prvtaqal.plb" as SYS in sqlplus. That worked even though I got a bunch of errors running the script:
Warning: Package created with compilation errors.
...
Created by Dr. Xi on March 14, 2009 19:27:47
Last update: March 14, 2009 19:27:47
This tip was mentioned in a previous note . It is repeated here for better searchability.
SELECT type, name, line
FROM user_source
W...
Created by Dr. Xi on September 09, 2008 23:13:27
Last update: March 09, 2009 15:48:47
Oracle provides two versions of SQLPlus: a command line version ( sqlplus.exe ) and a windows version ( sqlplusw.exe ). The windows version is rather primitive (ever used Windows 3.1?), but it moved many commands/options to the menus. So it may still be easier to get started with it then the command line version. However, you may be better off with the command line version after you get somewhat familiar with SQLPlus. In SQL*Plus you can enter: SQL*Plus commands. For a list of commands enter help index at the SQL prompt SQL commands - SQL statements sent to the database. These statements are terminated by semicolon unless you change it PL/SQL blocks - Blocks of PL/SQL code. When you enter a SQL command or PL/SQL...
Created by Dr. Xi on September 10, 2008 15:51:42
Last update: November 26, 2008 21:14:46
Variable Description SET AUTO [COMMIT] {ON | OFF | IMM [EDIATE] | n} Controls when Oracle Database commits pending changes to the database. SET CMDS [EP] {; | c | ON | OFF} Sets the non-alphanumeric character used to separate multiple SQL*Plus commands entered on one line to c. SET CON [CAT] {. | c | ON | OFF} Sets the character you can use to terminate a substitution variable reference if you wish to immediately follow the variable with a character that SQL*Plus would otherwise interpret as a part of the substitution variable name. SET ECHO {ON | OFF} Controls whether the START (@) command lists each command in a script as the command is executed. SET EDITF [ILE] file_name[.ext] Sets the default filename...