Home » RDBMS Server » Server Utilities » export problem on HP-UX
export problem on HP-UX [message #146888] Mon, 14 November 2005 08:38 Go to next message
orcl dba
Messages: 68
Registered: August 2005
Member
I want to do a user level export on a HP-UX machine and schedule it using cron. I used to do it on Windows until now and the following is the script I used for the export:
"exp_user1.bat"
@echo off
set oracle_sid=test2
set ORA_OCI_NO_OPTIMIZED_FETCH=1
sqlplus user1/user1@test2
@exp_user1_parfile.sql
exp user1/user1@test2 parfile=user1.par
Given below are the contents of the file "exp_user1_parfile.sql"
set verify off pagesize 0 feedback off linesize 512 trimspool on
spool user1.par
select 'owner=user1' from dual;
select 'rows=y' from dual;
select 'compress=n' from dual;
select 'file=user1'||to_char(sysdate,'YYMMDD')||'.dmp' from dual;
select 'log=user1.log' from dual;
select 'statistics=none' from dual;
spool off
exit

I used the command "'select file=user1'||to_char(sysdate,'YYMMDD')||'.dmp' from dual;" so that I can keep track of the day that the dmp file was generated. My question is, what is the equivalent of the Windows command "@echo off" in HP-UX so that command-echoing can be turned off and the parameter file has only the required parameters.
Re: export problem on HP-UX [message #146894 is a reply to message #146888] Mon, 14 November 2005 08:55 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Even in windows, you are using too much of unwanted code.
All you need to do is, append the system date along with the filename.
You can get any fancy you want( like, checking the logfile for errors, saving only last 3 days of dump locally and moving the rest away /archive etc).

#!/usr/bin/bash
export ORACLE_HOME=/u01/app/oracle/product/9.2.0
export PATH=$ORACLE_HOME/bin:$PATH
export DB=yourdb
export BACKUP_DIR=/backup/dmp
export LOG=/backup/exp/logs
#
d=`date "+%B%d%Y_%H:%M"`
# set your export options here
exp dbauser/password@$DB log=$LOG/$DB$d.log file=$BACKUP_DIR/$DB$d.dmp statistics=none  full=y compress=n consistent=y
#
Re: export problem on HP-UX [message #146900 is a reply to message #146894] Mon, 14 November 2005 09:05 Go to previous message
orcl dba
Messages: 68
Registered: August 2005
Member
Thanks for the reply. Will check it out
Previous Topic: sql*loader_partition_corruption
Next Topic: External tables with DML Error logging feature in 10g
Goto Forum:
  


Current Time: Tue Jul 02 04:59:45 CDT 2024