Define Editor
SQL> ed
Wrote file
afiedt.buf
114
q + enter
to exit
shift + q
+ enter to exit
sql>
define_editor=vi
sql>
ed
prompt vi
ok
SQLPROMPT
SQL> set sqlprompt “_user'@'_connect_identifier>”
$ORACLE_HOME/sqlplus/admin/glogin.sql
SQLPROMPT
SQL> set sqlprompt “_user'@'_connect_identifier>”
$ORACLE_HOME/sqlplus/admin/glogin.sql
For normal Database
set sqlprompt “_user'@'_connect_identifier>”
For Pluggable Database
define gname=idle
column global_name new_value gname
set heading off
set termout off
col global_name noprint
select upper(sys_context ('userenv', 'con_name') || '@' || sys_context('userenv', 'db_name')) global_name from dual;
set sqlprompt '&gname> '
set heading on
set termout on
show format all
show all
Format numeric column
col sal format $999,99,999.99
set numformat "999,99,999.99"
Format date column
alter session set nls_date_format='dd-Mon-yyyy hh:mi:sspm';
to call SQL*Plus passing the actual SQL script I want to run as an argument:
sqlplus -S user/password@database @dump.sql my_real_query.sql
sqlplus -S scott/tiger@rman @table_all.sql
To print
set serveroutput on
var oracle_home clob;
exec dbms_system.get_env('ORACLE_HOME', :oracle_home);
print oracle_home
show format all
show all
Format numeric column
col sal format $999,99,999.99
set numformat "999,99,999.99"
Format date column
alter session set nls_date_format='dd-Mon-yyyy hh:mi:sspm';
to call SQL*Plus passing the actual SQL script I want to run as an argument:
sqlplus -S user/password@database @dump.sql my_real_query.sql
sqlplus -S scott/tiger@rman @table_all.sql
To print
set serveroutput on
var oracle_home clob;
exec dbms_system.get_env('ORACLE_HOME', :oracle_home);
print oracle_home