How to define username and password in a sql session
I have a text file like this
C:
cd C:\password\test
set conn_str=abc/abc
sqlplus %conn_str%@mydb
Column a new_val dbname
Column b new_val currdate
Select upper(sys_context('userenv','db_name')) a,
to_char(sysdate, 'yyyymmdd.hh24miss') b
from dual;
Spool &dbname..&currdate..log
ALTER SESSION SET NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS';
set timing on
set serveroutput on
set define off
set linesize 100 pagesize 100
column owner format a30
column Object_Type format a30
column Object_Name format a30
select owner || '.' || object_type || '.' || Object_Name
from dba_objects