For example:
SET SQLPROMPT "_USER'@'_CONNECT_IDENTIFIER SQL>" SET LINESIZE 200 SET PAGSEIZE 200On Production servers, you may consider adding a colored prompt, for example red:
SET SQLPROMPT "'^[[41m'_USER'@'_CONNECT_IDENTIFIER'^[[0m' SQL> "
Minimalistic Oracle contains a collection of practical examples from my encounters with Oracle technologies. When relevant, I also write about other technologies, like Linux or PostgreSQL. Many of the posts starts with "how to" since they derive directly from my own personal experience. My goal is to provide simple examples, so that they can be easily adapted to other situations.
SET SQLPROMPT "_USER'@'_CONNECT_IDENTIFIER SQL>" SET LINESIZE 200 SET PAGSEIZE 200On Production servers, you may consider adding a colored prompt, for example red:
SET SQLPROMPT "'^[[41m'_USER'@'_CONNECT_IDENTIFIER'^[[0m' SQL> "
Patch description: "Database Patch Set Update : 11.2.0.4.2 (18031668)" Sub-patch 17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)" Patch description: "Database Patch Set Update : 11.2.0.3.7 (16619892)" Sub-patch 16056266; "Database Patch Set Update : 11.2.0.3.6 (16056266)" Sub-patch 14727310; "Database Patch Set Update : 11.2.0.3.5 (14727310)" Sub-patch 14275605; "Database Patch Set Update : 11.2.0.3.4 (14275605)" Sub-patch 13923374; "Database Patch Set Update : 11.2.0.3.3 (13923374)" Sub-patch 13696216; "Database Patch Set Update : 11.2.0.3.2 (13696216)" Sub-patch 13343438; "Database Patch Set Update : 11.2.0.3.1 (13343438)"
SQL> show parameter nls_ NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ nls_comp string BINARY nls_language string AMERICAN nls_length_semantics string BYTE nls_nchar_conv_excp string FALSE nls_territory string AMERICA SQL> SELECT * FROM NLS_INSTANCE_PARAMETERS WHERE value IS NOT NULL; PARAMETER VALUE ------------------------------ ---------------------------------------- NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_COMP BINARY NLS_LENGTH_SEMANTICS BYTE NLS_NCHAR_CONV_EXCP FALSE 5 rows selected.
CREATE OR REPLACE FUNCTION LIST_FILES( p_directory IN VARCHAR2, p_file_pattern IN VARCHAR2 default null) RETURN file_array pipelined AS l_path VARCHAR2(1024); l_dummy VARCHAR2(1024); BEGIN SELECT directory_path INTO l_path FROM all_directories WHERE directory_name = p_directory; sys.DBMS_BACKUP_RESTORE.SEARCHFILES(l_path, l_dummy); FOR file_list IN (SELECT FNAME_KRBMSFT AS file_name FROM X$KRBMSFT WHERE FNAME_KRBMSFT LIKE '%'|| NVL(p_file_pattern, FNAME_KRBMSFT)||'%' ) LOOP PIPE ROW(file_list.file_name); END LOOP; END; /
SELECT * FROM TABLE(LIST_FILES('MY_DIR','%*.dmp%'));