Adding a date to an export filename
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Adding a date to an export filename

  1. #1
    Join Date
    Dec 2004
    Location
    Memphis, TN.
    Posts
    2

    Question Adding a date to an export filename

    I've just inherited an Oracle database, and I don't have the first clue as to how to write code for it. I do however know how to search on the web, and have come up with this script.
    **********************************************************************
    f:
    cd Oracle_Backup

    REM Column instnc new_value v_instnc noprint
    REM column instdate new_value v_instdate noprint
    REM SELECT name instnc
    REM FROM v$database;
    REM SELECT TO_DATE(sysdate,'DDMMYYHH') instdate
    REM FROM dual;

    exp system/manager@swp
    REM file=swp_full&&v_instexp&&v_inst_exp&&v_instdate..dmp
    REM log=swp_full&&v_instexp&&v_inst_exp&&v_instdate..log

    full=y
    **********************************************************************

    The REM lines are what I gleaned off another site, and the file and log commands originally looked like:

    file=swp_full.dmp
    log=swp_full.log

    But were changed to this per the borrowed script:

    swp_full&&v_instexp&&v_inst_exp&&v_instdate..dmp
    swp_full&&v_instexp&&v_inst_exp&&v_instdate..log

    So, I can almost follow what is being done in the script, but since I have ZERO Oracle experience, I need help. If you can help me please contact me. I would greatly appreciate it.

  2. #2
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    3,999
    What are you trying to do with export? Hopefully you aren't using export as a backup method. If you need to read this. Maybe even start with quick start to rman.
    this space intentionally left blank

  3. #3
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333

    Re: Adding a date to an export filename

    Originally posted by OracleNewb7731
    I've just inherited an Oracle database, and I don't have the first clue as to how to write code for it. I do however know how to search on the web, and have come up with this script.
    **********************************************************************
    f:
    cd Oracle_Backup

    REM Column instnc new_value v_instnc noprint
    REM column instdate new_value v_instdate noprint
    REM SELECT name instnc
    REM FROM v$database;
    REM SELECT TO_DATE(sysdate,'DDMMYYHH') instdate
    REM FROM dual;

    exp system/manager@swp
    REM file=swp_full&&v_instexp&&v_inst_exp&&v_instdate..dmp
    REM log=swp_full&&v_instexp&&v_inst_exp&&v_instdate..log

    full=y
    **********************************************************************

    The REM lines are what I gleaned off another site, and the file and log commands originally looked like:

    file=swp_full.dmp
    log=swp_full.log

    But were changed to this per the borrowed script:

    swp_full&&v_instexp&&v_inst_exp&&v_instdate..dmp
    swp_full&&v_instexp&&v_inst_exp&&v_instdate..log

    So, I can almost follow what is being done in the script, but since I have ZERO Oracle experience, I need help. If you can help me please contact me. I would greatly appreciate it.
    what do you actually want to do? take an export of the database? or are you trying to understand what this does?

    There are much easier ways than that

  4. #4
    Join Date
    Dec 2004
    Location
    Memphis, TN.
    Posts
    2

    Total newbie

    Like I indicated, I know absolutely squat when it comes to Oracle. This is how they are backing up their Oracle database, and I haven't had time to learn anything to bring myself up to speed. Probably won't have time for a while either. This network is a mess, and I've been brought in after the fact to help clean it up.

  5. #5
    Join Date
    Jan 2001
    Posts
    3,131
    Is this windoze?

    What I do in windoze is have the scheduled export put the .dmp and .log files into a dir, let's say D:\export
    From there I have a script that compresses (via winzip) the .dmp files and timestamps them using sqlplus. It is a little involved but very reliable and effective.
    I remember when this place was cool.

  6. #6
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Mr.H's idea sounds good. You can rename the files at the OS level with something like this: http://www.dbasupport.com/forums/sho...threadid=40159 should be easier than using sqlplus.

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