Home » Infrastructure » Linux » How to set backup automatically? (oracle, 12c, oraclelinux)
|
|
|
|
|
|
Re: How to set backup automatically? [message #682741 is a reply to message #682740] |
Fri, 13 November 2020 08:09   |
 |
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
solution wrote on Fri, 13 November 2020 06:24Could you solve this it?
I am very new on linux.
I have to run the script every 02 am or every week.
They've given you all the clues.
First, you don't want to do ANYTHING as the root user, unless you ABSOLUTELY need that elevated level of privilege. You should have an OS user that owns the oracle installation. This user is usually named 'oracle'. Connect as 'oracle' and create your crontab from there.
Your crontab that you show indicates that your script is located in the root directory. Not a good place for it. You should have a directory owned by 'oracle' where you keep your oracle scripts. At the very least, /home/oracle/.
Your script should begin with a directive to indicate which shell (sh, ksh, bash, etc) you want to process your script. I usually use 'sh', so the directive is '#!/bin/sh'.
You said "I have to run the script every 02 am or every week." I *think* you meant "run the script at 02 am on every week." (I'll chalk that up to English not being your first language.) So, what day of the week? I could spoon feed you on that, but you'd learn far more by going back to a good reference on 'cron' and figuring it out. Present your best effort and we'll comment on it to nudge you to self-discovery.
BTW, you mentiond in the title that this is a 'backup' job. But your script is running expdp. I do hope that you are not relying strictly on exports as your only backup strategy. You really need to be using rman for your primary backup mechanism.
|
|
|
|
Re: How to set backup automatically? [message #682749 is a reply to message #682748] |
Sat, 14 November 2020 03:04   |
 |
Michel Cadot
Messages: 68757 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote:I thought "expdp" is full backup of database.
No it is a data and schema backup not a database level backup.
Quote:Should I use 'rman' to do backup full db on everyday?
Yes, no, it depends on your restore and recover requirements but it is sure you should use RMAN to backup.
First read Database Backup and Recovery User's Guide, chapter 1 Introduction to Backup and Recovery.
First of all, are you in ARCHIVELOG mode?
[Updated on: Sat, 14 November 2020 03:21] Report message to a moderator
|
|
|
|
|
|
Re: How to set backup automatically? [message #682759 is a reply to message #682757] |
Mon, 16 November 2020 19:36   |
 |
solution
Messages: 13 Registered: November 2020
|
Junior Member |
|
|
Since I read I have to us RMAN backup job.
The set of BACKUP commands executed within a single RMAN session. For example, assume that you start the RMAN client, execute BACKUP DATABASE, BACKUP ARCHIVELOG, and RECOVER COPY, and then exit the RMAN client. The RMAN backup job consists of the database backup and the archived redo log backup.
Am I right?
[Updated on: Mon, 16 November 2020 19:37] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sun May 04 12:04:57 CDT 2025
|