It is possible in Oracle 8i to directly change the character set of a database. This can only be done, however, if the new character set is a strict superset of the original character set. For instance, according to 8.1.6
How to create trigger audits with Oracle DDL
The script below (a trigger) audits and records information about DDL occurring in the current schema, recording the OS login name, the terminal, the session user, the command issued, the object type involved, and the object name. create table audit_events
How to check users are not trying to change other users passwords
The trigger below will check to see that user George is only changing his own password and not trying to change other peoples passwords. create procedure reset_password (p_username in varchar2, p_password in varchar2) as begin if (USER=’GEORGE’ and p_username in
How to resolve Oracle error ORA-01722 invalid number error
Find the number in error when you get an ORA-01722 invalid number error. select from where trim(translate(, ‘0123456789’, ‘ ‘)) IS NOT NULL This should return the fields that cannot be converted using TO_NUMBER or where text type data won’t
How to find out which Oracle version is installed on Unix
There are actually a couple of ways to do this. For versions prior to 8i, there’s a utility in the $ORACLE_HOME/orainst called ‘inspdver’. This will list each product and version on your server. You can also inspect the file $ORACLE_HOME/orainst/unix.rgs.
How to use BTITLE and TTITLE in Oracle
SQL*Plus isn’t known for its report-writing capabilities. But there are a few tricks you can use to spiff up the output of your PL/SQL queries. One of these tricks is setting automatic titles for your output. This can be done
How to list all tablespace names with information using SQL
The script below lists all tablespace names in the database and their associated information. Run the script using SQL*Plus as user DBA. set echo off column TSNAME format a31; column TYPE format a11; column EXT_MGT format a12; column STATUS format
How to set the SQL prompt to the current directory
Have you ever had a SQL*Plus window open, and did not remember what it’s current directory was? This tip will show a method to set your SQL*Plus prompt to include the current directory. The SET SQLPROMPT command can be used
How to create running totals with SQL
There are applications where the running total for a series of numbers needs to be calculated and displayed. While this might be normally considered something that would be done with 3GL programming techniques, it IS possible to calculate and query
How to order an Oracle varchar column numerically
Have you ever tried to order by a VARCHAR2 column that has numeric information in it? Your query is sorted ALPHABETICALLY instead of numerically. That is, your order is 1,10,2,20,200,3,4… instead of 1,2,3,4,10,20,200. If you try to use TO_NUMBER in
