Please help, I need to spool data from a remote server using putty(sqlplus) to a local machine. There are credentials i need to give before accessing the remote databases and i am able to do it..i tired with the below query but the spool file(csv or txt) is not able to create on local machine.
set colsep ,
set pagesize 120
set trimspool on
set headsep off
set linesize 1000
select table_name, tablespace_name from all_tables;
You'll need SQL*Plus on the local machine, instead of doing ssh to the server.
The Spool comand spools to the file system where SQL*Plus is running. If you first putty (ssh) to the server, then your SQL*Plus is running on the server, not on the local machine.