Variables from SQLPLUS to UNIX [message #276915] |
Fri, 26 October 2007 15:39 |
seethem
Messages: 41 Registered: September 2007
|
Member |
|
|
So how do I retrieve that SCN number back into a SQL Script?
I want to do the following:
sqlplus -s $user/$pass <<EOF
select current_scn from v$database;
exit
EOF
expdp $user/$pass@$db flashback_scn=$current_scn full=y
How do I extract that current_scn?
Thanks in advance,
Phillip
|
|
|
|
Re: Variables from SQLPLUS to UNIX [message #278491 is a reply to message #276918] |
Sun, 04 November 2007 13:55 |
seethem
Messages: 41 Registered: September 2007
|
Member |
|
|
Hi Ana,
Thanks...
Here is my script...
-------------------------------------
export VIEW="v\$database"
EXPORT=`sqlplus -s ${USERNAME}/${PASSWORD}@${ORACLE_SID} <<EOF
set feed off head off timing off linesize 250
spool /home/oracle/result.out
select 'exp ${USERNAME}/${PASSWORD}@${ORACLE_SID} file=${BACKUP_PATH}/${TAG}.DMP log=${EXPLOG}/EXP_${TAG}.LOG buffer=100000 statistics=none flashback_scn='||current_scn||' full=y' from ${VIEW};
spool off
exit
EOF`
-------------------------------------
Question:
===========
If I am kicking this script off of a client machine, using Oracle 10g client tools, how can I make this script run server side?
Considering that when I use RMAN from the client side, I am able get the backed up files stored on the server side. Which is what I want.
Is it that I need to use datapump or can binary exports do the trick for me.
|
|
|
|
|