- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Databse backup automated through Crontab
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2005 04:09 PM
тАО09-22-2005 04:09 PM
I want to make this automated using the crontab, but i'm not sure how to create a script to run this databse backup daily through crontab.
Can someone assist me on how to create this script???
pleaseeee.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2005 04:30 PM
тАО09-22-2005 04:30 PM
Re: Databse backup automated through Crontab
Put all your database related commands in
# crontab -e
# Will execute the
15 1 * * *
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2005 04:33 PM
тАО09-22-2005 04:33 PM
Re: Databse backup automated through Crontab
logged in as root, run
crontab -e
and add this line
00 02 * * * /oracle/backup_database.sh
and save and exit.
this line will let your system run the /oracle/backup_database.sh script every day at 2:00 AM in the morning.
the hard part of the question answer is what will be inside the /oracle/backup_database.sh script ?
The answer is : it all depends. Depends on what ? Well, first it depends on how your database container(s) are structured ? Is it a filesystem structure or raw disk ? Do you have any backup software to use (like veritas netbackup or HP Data Protector) ? Or you would like to use fbackup ?
If you can tell more details, I am sure you will get better tailored answers.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2005 06:02 PM
тАО09-22-2005 06:02 PM
Re: Databse backup automated through Crontab
Can you tell us what your environment looks like (Unix version, Database software and version)?
Cheers,
Renarios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2005 06:06 PM
тАО09-22-2005 06:06 PM
Re: Databse backup automated through Crontab
Make a script to use configuration for database name, date of backup. Based on that backup, you can start executing backup script with cron tab.
First create your user configuration file that will get user entry for data. Read that configuration file from your script as,
.
in the backup script. Execute cron based on your need.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2005 06:52 PM
тАО09-22-2005 06:52 PM
Re: Databse backup automated through Crontab
According to Mel's solution,yes I know that the command for crontab is crontab -e.
What I don't know is what to put in the /oracle/backup_database.sh script .
Information about my system:-
-It is a Unix server
-Oracle database
-I log in into the server
-I come to a page where I have a few options
-From the options I choose database backup
-A user prompt comes out asking me what is the database name for backup....so I key in the database name
-Another user prompt comes out asking me for table name for backup...so I key in table name
-Backup will be in process...and is stored in a directory cd /u01/backup/exp
I don't know how to create the script...
Please help...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2005 08:00 PM
тАО09-22-2005 08:00 PM
Re: Databse backup automated through Crontab
Since you are running Oracle Database, you should be using RMAN for backup. This is the easiest way.
see the url below on how you would go about configuring rman (if you have not already done so, of course):
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96566/toc.htm
the rest is to create the script to do the backup then schedule the script as described above.
if you need any further help, do let us know.
regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2005 08:54 PM
тАО09-22-2005 08:54 PM
Re: Databse backup automated through Crontab
a typical backup script for your full database backup would be:
#!/bin/sh
##############################################################################
#Script name: rman_full.sh
#Description: RMAN full backup script
#last Modified: Yogeeraj-10/01/2003
##############################################################################
messagelog="/backup/rman/logfiles/rman_full-`date +%d%m%y-%H%M`"
rman target xxx/xxx@mydb rcvcat rman/rman@catalog msglog $message
log </dev/null
run {
allocate channel fs1 type disk format '/backup/rman/full/fs1/df_%u_%s_$t.%p';
allocate channel fs2 type disk format '/backup/rman/full/fs2/df_%u_%s_$t.%p';
set limit channel fs1 kbytes=750000;
set limit channel fs2 kbytes=750000;
#Backup the whole database
backup
tag Whole_database_hot
database;
#Switch out of the current logfile
sql 'alter system archive log current';
#Backup the archived logs
backup
archivelog all
format '/backup/rman/full/fs1/al_%u.%p';
#Backup a copy of the controlfile that contains records for the
#other backups just made
backup
current controlfile
tag = cf1
format '/backup/rman/full/fs1/cf_%u.%p';
}
exit;
EOF
#end of script
hope this helps too!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2005 09:02 PM
тАО09-22-2005 09:02 PM
Re: Databse backup automated through Crontab
sorry for the corrupted output!
script attached.
let us know it it helps!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2005 09:46 PM
тАО09-22-2005 09:46 PM
Re: Databse backup automated through Crontab
I am actually only doing a backup on a table in a database.So, i'm not sure if using the option "full databse" in RMAN will be a good choice....Can you let me know of that...
The script you sent me..I don't entirely understand it...is there any simpler code or something...
Thanks