How to create a JOB in ORACLE for backup?

0

Good afternoon guys!

I'm still new to the subject when it comes to sql, I'd like to know how to create a JOB (or another operation that does the same) that performs a data extraction from a table to a .sql file in a directory I set .

If it is possible, it should do this automatically every day in a time interval that I determine.

NOTE: My DB is local and is in Oracle 11g Express

Is it possible?

Thank you in advance!

    
asked by anonymous 17.01.2018 / 14:55

1 answer

0

You do have a backup, you can make a DUMP from your bank. In the oracle server installation folder there is a folder called "bin" where you have several executables and we will use "expdp".

Create a file to run the batch command (.bat) and use the following command line:

EMP, DEPT directory = TEST_DIR dumpfile = EMP_DEPT.dmp logfile = expdpEMP_DEPT.log

You can see more details at: link

With .bat created in the same folder as the "expdp" executable you will generate a .dump file with your bank's data.

Important information: The command line has a parameter called "directory" and this parameter is not where you put the folder url wherever the file (DUMP) of your backup is stored. It is an "alias" as if it were a nickname for the actual location. This "alias" is referring to a real path in the table: DBA_DIRECTORIES

You can see more details at: link

Legal, the command is configured and the file going to the folder you want. Now for you to automate this by having the DUMP done every day at a certain time, you can create a scheduled task in Windows, but be sure to leave it enabled to run the task with admin rights if it does not work.

I hope I have helped!

So long!

    
27.01.2018 / 22:19