Monday, November 30, 2020
dbametrix
More
    Home Oracle DBA Tips Daily backup of Schema Scheduling

    Daily backup of Schema Scheduling

    The article explains how to schedule the daily export backup of schema with date and time in the dump file.

    Daily Backup Schema using an Export utility

    Till now I used to take my backups using EXP utility on a scheduled basis.

    But the main issue was when the backup script executes it to overwrite existing backups and this way I have only last backup available. If I need the backups before the last backup then I have to manually copy my DMP file to some other place before backup script overwrite the last backup.

    - Advertisement -
    dbametrix

    To solve this issue I did a little trick I have windows 2003 server on my server.

    I made a .bat file in which I write my EXP command and put it into the scheduler of oracle 10g.

    set gog=%date%
    set gog2=%gog: =-%
    set gog=%gog2%
    set gog2=%gog:/=-%
    set gog=%gog2%
    Exp test/test FILE=C:\3AMNEO”%gog%”.DMP LOG=C:\3AMNEO”%gog%”.LOG

    This script will generate.DMP file like

    - Advertisement -
    dbametrix

    3AMNEOWed-10-08-2008.DMP

    and

    log file like

    3AMNEOWed-10-08-2008.LOG

    i.e. data and day is appended with the .DMP and .LOG file every day.

    this solves the overwrite issue.

    Let’s understand how this works.

    C:\Documents and Settings\dbametrix>echo %date%
    Wed 10/08/2008

    C:\Documents and Settings\dbametrix>set gog=%date%

    C:\Documents and Settings\dbametrix>echo %gog%
    Wed 10/08/2008

    C:\Documents and Settings\dbametrix>set gog2= %gog: =-%

    C:\Documents and Settings\dbametrix>echo %gog2%
    Wed-10/08/2008

    C:\Documents and Settings\dbametrix>set gog=%gog2:/=-%

    C:\Documents and Settings\dbametrix>echo %gog%
    Wed-10-08-2008

    Now the question is why i use this trick can we work like ?

    Exp test/test FILE=C:\3AMNEO”%date%”.DMP LOG=C:\3AMNEO”%date%”.LOG

    The answer is NO

    Reason:

    When the date appends with dump file space after a day like Wed 10/08/2008 is treated as a new parameter and it doesn’t work so I need to do this work.

    When you want to make a strong Oracle DBA career then you should be aware of database services and other database technology. Without having knowledge of Oracle internals, Oracle performance tuning, and skill of Oracle database troubleshooting you can’t be an Oracle DBA expert. This expert DBA Team club blog always provides you latest technology news and database news to keep yourself up to date. You should need to be aware of Cloud database technology like DBaaS. These all Oracle DBA tips are available in a single unique resource at our orageek. Meanwhile, we are also providing some sql tutorials for Oracle DBA. This is the part of Dbametrix Group and you would enjoy more advanced topics from our partner resource.

    Consider Reading to these articles:

    - Advertisement -
    dbametrix
    - Advertisment -
    dbametrix

    Most Popular

    Oracle Scheduler Jobs Example

    Blog post explains how to configure job scheduler in Oracle by example with how to manage, delete, drop, disable and enable jobs with how to check history of job if broken and enable.

    Identifying important information in Big Data

    The way in which Big Data technologies have evolved in the real word enterprise goes on to show that even technologists and scientists who might have disparaged the word (Big Data) previously

    Five Reasons Why Database Outsourcing

    The blog post explains why database outsourcing and remote dba support becomes most popular during present time of Covid-19 Pandemic.

    Hardware of Database Server

    The blog post explains how to choose best hardware of your database server for getting high performance and security.

    Recent Comments