For large output which is not able to fit in a single window, scrolling the results can skip data while it looks messy as well. to get rid of scrolling, you can use the command “set pause on”. With pause ON, the output will come in small chunks and will continue only when you press enter. It’s output resembles that of a more command which we use in unix.
SQL> set pause on
SQL>
SQL> select * from SMON_SCN_TIME
2 ;
THREAD TIME_MP TIME_DP SCN_WRP SCN_BAS
———- ———- ——— ———- ———-
1 1301818161 03-APR-11 0 3498484333
1 1301818565 03-APR-11 0 3498484683
1 1301818967 03-APR-11 0 3498485031
1 1301819370 03-APR-11 0 3498485383
1 1301819772 03-APR-11 0 3498485730
1 1301820173 03-APR-11 0 3498486079
1 1301820574 03-APR-11 0 3498486430
1 1301820977 03-APR-11 0 3498486780
1 1301821379 03-APR-11 0 3498487132
1 1301821785 03-APR-11 0 3498487482
1 1301822187 03-APR-11 0 3498487851
[waiting for user to press enter]
Tags: long sql output, set pause off, set pause on
This post will guide you how you can play with SQL using the interactive variable values inside the statement. To begin with, suppose we even don’t know which table we want to query from. To check all the tables inside the logged in database, you can query the TABLE_NAME from user_tables. To get all the columns and the type of values they can store, you can use “desc table_name”.
SQL> desc user_tables
Name Null? Type
—————————————– ——– —————————-
TABLE_NAME NOT NULL VARCHAR2(30)
TABLESPACE_NAME VARCHAR2(30)
CLUSTER_NAME VARCHAR2(30)
IOT_NAME VARCHAR2(30)
PCT_FREE NUMBER
PCT_USED NUMBER
INI_TRANS NUMBER
MAX_TRANS NUMBER
INITIAL_EXTENT NUMBER
NEXT_EXTENT NUMBER
MIN_EXTENTS NUMBER
MAX_EXTENTS NUMBER
PCT_INCREASE NUMBER
FREELISTS NUMBER
FREELIST_GROUPS NUMBER
[cut]
Tags: input variable, undefine, user_tables
This is one of the most commonly observed error in Oracle database. The exact error description is as follows:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SUN OS Error: 2: No such file or directory
Due to this error, the DBA is unable to login to the SQL prompt. This error is usually caused because of the restricted permission of tnslsnr file in the Oracle DB. While this error is being encountered, the file permissions look as follows:
mms1% ls -l tnslsnr
-rwxr-x–x 1 oracle dba 2791568 Feb 6 2005 tnslsnr
mms1%
Tags: No such file or directory, ORA-01034, ORA-27101, shared memory realm does not exist, tnslsnr