Home » Infrastructure » Unix » exp directly to tape
exp directly to tape [message #97492] Fri, 21 June 2002 11:26 Go to next message
Toyn
Messages: 36
Registered: April 2001
Member
I found this syntax on this site:

exp userid/password file=/dev/rmt0 table=emp volsize=1.2G

I just started hitting the Unix 2GB limit on my export files. Rather than up the limits for particular users, or create separate files, I'd like to use exp directly to tape. Here are some examples of the syntax I've tried:

exp rad_dev/rad_dev file=/dev/rmt/0 buffer=1000000 volsize=4G full=y

Export: Release 8.0.5.1.0 - Production on Fri Jun 21 15:6:40 2002

(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connected to: Oracle8 Enterprise Edition Release 8.0.5.1.0 - Production
PL/SQL Release 8.0.5.1.0 - Production
EXP-00000: Export terminated unsuccessfully

exp rad_dev/rad_dev file=/dev/rmt0 buffer=1000000 volsize=4G full=y

Export: Release 8.0.5.1.0 - Production on Fri Jun 21 15:7:50 2002

(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connected to: Oracle8 Enterprise Edition Release 8.0.5.1.0 - Production
PL/SQL Release 8.0.5.1.0 - Production
EXP-00028: failed to open /dev/rmt0.dmp for write
EXP-00222:
System error message 13
Export file: expdat.dmp > expdat.dmp

Export done in US7ASCII character set and US7ASCII NCHAR character set

About to export the entire database ...
. exporting tablespace definitions
EXP-00002: error in writing to export file
EXP-00222:
System error message 28
EXP-00000: Export terminated unsuccessfully

What am I doing wrong here?? I tried creating expdat.dmp and tar'd it onto the tape, but that didn't help either. Thanks!
Re: exp directly to tape [message #97493 is a reply to message #97492] Fri, 21 June 2002 11:44 Go to previous messageGo to next message
Grant
Messages: 578
Registered: January 2002
Senior Member
The volume size is a number ending with a "m", "k", or "b" (M, K, or B). The default is bytes.

exp userid/password file=/dev/rmt0 table=emp volsize=1.2M

I compress on the fly. Modify this to your site:

PROD scrip:
#!/bin/ksh
echo ""
## echo "USAGE: . prod"
echo ""

export ORACLE_SID="prod"
# get ORACLE_HOME from /var/opt/oracle/oratab
export ORACLE_HOME=`grep ^$ORACLE_SID: /var/opt/oracle/oratab | cut -d: -f2`
## export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS' # This fixes ORA-01861 when importing
export ORACLE_BASE="/oradb/kham/u1/app/oracle/product"
export LD_LIBRARY_PATH="$ORACLE_HOME/lib:/usr/lib"
export SHLIB_PATH="$ORACLE_HOME/lib"
export NLS_LANG="AMERICAN_AMERICA.WE8ISO8859P1"
# export NLS_LANG="AMERICAN_AMERICA.US7ASCII"
export PATH=$ORACLE_HOME/bin:/usr/bin:/etc:/usr/ccs/bin:/usr/openwin/bin:/usr/ucb:/usr/sbin:/usr/loc
al/bin:.
export TNS_ADMIN="/var/opt/oracle"
## export TNS_ADMIN="$ORACLE_HOME/network/admin"

echo "Be sure to check the ORA environment variables..."
echo "================================================="
echo ""
env &#124grep ORA
echo ""

Export Script:
#!/bin/ksh
#===============================================================================
# exp_$ORASID_full - glh - Feb 27th, 1999
#
# Purpose : Perform full database export.
#
ORASID="prod"
DBA="oracle"
HOSTN=`uname -n`
ORALSNR=`ps -ef | grep tnslsnr | grep LISTENER-khamdb`
if [[ -z "$ORALSNR" ]]; then
## echo . | mailx -s "Listener for $ORASID is Not Running on $HOSTN" $DBA
:
fi
ORAUP=`ps -ef | grep -v grep | grep ora_pmon_$ORASID | awk '$NF ~ /pmon/ {print $NF}'`
if [[ -z "$ORAUP" ]]; then
## echo . | mailx -s "Database $ORASID is Not Running on $HOSTN" $DBA
exit
fi
#
# Set up environment variables for database export
. $HOME/$ORASID;
TODAY=$(date +%d%m%y-%H:%M )
EXPDEST="/oradb/OraBackups"
## EXPDEST="$HOME/exports/backups"
EXPDIR="$HOME/exports"
PARMFILE="$EXPDIR/exp_full.par"
EXPFILE="$EXPDEST/exp_${ORASID}_full_${TODAY}.dmp.Z"
EXPLOG="$EXPDIR/exp_${ORASID}_full_${TODAY}.log"
PSWD=`cat $HOME/passwd/system`
export TODAY EXPDEST EXPDIR PARMFILE EXPFILE EXPLOG PSWD
/usr/sbin/mknod $EXPDEST/exp_${ORASID}_pipe.dmp p
cat $EXPDEST/exp_${ORASID}_pipe.dmp &#124compress > $EXPFILE &
exp parfile=$PARMFILE userid=system/$PSWD log=$EXPLOG file=$EXPDEST/exp_${ORASID}_pipe.dmp
if [[ $? != 0 ]]
then
tail -5 $EXPLOG > $ORASID.tmp
mailx -s "Export for $ORACLE_SID Failed at $TODAY on $HOSTN" $DBA < $ORASID.tmp
else
tail -5 $EXPLOG > $ORASID.tmp
mailx -s "Export for $ORACLE_SID Successful at $TODAY on $HOSTN" $DBA < $ORASID.tmp
fi

rm $ORASID.tmp
rm $EXPDEST/exp_${ORASID}_pipe.dmp
Re: exp directly to tape [message #97508 is a reply to message #97492] Mon, 01 July 2002 12:52 Go to previous messageGo to next message
Toyn
Messages: 36
Registered: April 2001
Member
exp password/username file=/dev/rmt0 log=/tmp/explog buffer=1000000 volsize=4294967296b full=y

Even with the suggested syntax, I still get this error:

EXP-00028: failed to open /dev/rmt0.dmp for write
EXP-00222:
System error message 13
Export file: expdat.dmp >
EXP-00002: error in writing to export file
EXP-00222:
System error message 28
EXP-00000: Export terminated unsuccessfully

I've tried creating the expdat.dmp file on the tape, but the exp utility does not find it...do I have to pre-create the file for exp to work? Thanks.
Re: exp directly to tape [message #97511 is a reply to message #97492] Tue, 02 July 2002 07:16 Go to previous message
Grant
Messages: 578
Registered: January 2002
Senior Member
Have you verified you have access to the tape drive? Have you looked on MetaLink? I use veritas with RMAN so I won't be much help. I did have to use their library to talk to the tape.
Previous Topic: Getting File Status (UNIX)
Next Topic: Re: 8.1.7 installation on Redhat 7.2
Goto Forum:
  


Current Time: Wed Jan 27 13:24:30 CST 2021