DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: reduce the size of the file

  1. #1
    Join Date
    Aug 2001
    Location
    chennai,bangalore
    Posts
    840
    Hi friends,
    My database is around 40 GB and i want to do a export of the database,but since i have no sufficient space in my system.Can u please help me how i should go about.
    I am using oracle 8.1.6 on solaris 5.7.

    regards
    anandkl
    anandkl

  2. #2
    Join Date
    Apr 2002
    Location
    Phoenix, AZ
    Posts
    175
    Just an Idea, you'll have to modify this code to pause it from OS, so that you take the piece to offline storage

    ## To export

    mknod exp.dmp p # mkfifo on certain Unix flavours
    split -b2047m exp scott/tiger file=exp.dmp record=n tables=tableX


    ## To Import

    rm exp.dmp
    mknod exp.dmp p
    cat xaa xab xac xad >exp.dmp &
    imp scott/tiger file=exp.dmp commit=y tables=tableX

    Sridhar R Patnam

  3. #3
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    Another option:

    Use multiple dump file feature FILE=$P1/d1.dmp, $P2/d2.dmp,... FILESIZE=1GB

    where P1,P2 are diffrent Paths where you have enough space


    Assuming: You do not have big chunk of space to fit the whole dump on your device
    Reddy,Sam

  4. #4
    Join Date
    Aug 2001
    Location
    chennai,bangalore
    Posts
    840
    Thanks friends,
    can i use something like "compress", a command in unix.
    help me on this command.

    regards
    anandkl
    anandkl

  5. #5
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    You can always use compress/gzip utilities to compress the dump files and make little more space. compress/gzip works unix just like winzip on windows.

    read manual pages on compress..
    $man compress
    Reddy,Sam

  6. #6
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    Code:
    unset TWO_TASK
    
    ORACLE_BASE=/oracle; export ORACLE_BASE
    ORACLE_HOME=/oracle/simp; export ORACLE_HOME
    TNS_ADMIN=/oracle/simp/network/admin
    NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1; export NLS_LANG
    LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export LD_LIBRARY_PATH
    
    PATH=$ORACLE_HOME/bin:$PATH:/usr/lib/java/bin
    CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib:/usr/lib/java/lib
    export CLASSPATH
    
    if [ "$1" = "" ] ; then
      echo "Uso: exportaBD.sh ORACLE_SID"
      exit
    fi
    
    . /oracle2/backup/sh/$1.env
    
    #########################################
    #
    export ORACLE_SID=$1 
    BACKUP_TOP=/oracle2/backup/$ORACLE_SID
    PIPA=$BACKUP_TOP/dmp/export${ORACLE_SID}.pipe
    #########################################
    
    cd $BACKUP_TOP/dmp
    mkdir log 2>/dev/null 
    echo `date`": Backing up instance $1" >> log/exportaBD$1.log
    if [ ! -p $PIPA ]
    then
     mknod $PIPA p 
    fi
    sleep 20
    compress < $PIPA | split -b 2000m - export$1`date +"%Y%m%d"`- &
    time exp ${username}/${password}  compress=n buffer=12000000 file=${PIPA} log=log/$1`date +"%Y%m%d"`.log full=y consistent=y >> log/exportaBD$1.log 2>&1
    splitting and compressing

  7. #7
    Join Date
    Sep 2001
    Location
    Ohio
    Posts
    334
    Here's part of a script that you can use to compress the file while your export runs.

    export PIP=/full_path/exp.pipe
    export PAR=/full_path/parfile

    # Create a pipe
    mknod ${PIP} p

    # Send pipe to dmp with compress #
    nohup cat ${PIP} |compress -f > file_name.dmp.Z &

    # Do the export #
    ${ORACLE_HOME}/bin/exp username/password file=${PIP}parfile=${PAR} 2> /dev/null


    Hope that helps!
    Jodie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width