-
rman backup script suggestion
Hi all,
Bellow i have backup script but i want to know how can i run in one script?
setenv TNS_ADMIN "/location/network/admin"
setenv ORACLE_HOME "/location/db1"
setenv TWO_TASK "DB1"
setenv ORACLE_SID "DB1"
rman run {
# Shutdown database for backups and put into MOUNT mode
shutdown immediate
startup mount
# Allocate channel. Important: This must be done after
# database has been mounted!!!
allocate channel t1 DEVICE TYPE DISK FORMAT '/backuplocation/DB1RMAN/%U' ;
# Perform full database backup
backup Database format '/backuplocation/DB1RMAN/%d_FULL_%U.bck';
# Open database after backup complete
sql 'alter database open';
backup current controlfile;
sql 'ALTER DATABASE BACKUP CONTROLFILE TO TRACE';
release channel t1;
}
-
You mean like put it in a shell script?
-
-
Here is your script. This backs up the DB GOLD_PRI and I keep the catalog
in GOLD_CAT. You will need to change to suit your needs.
Not sure as to why your shutting down and starting up your DB. One of the
major advantages is that RMAN allows you to back up the DB, while still
running.
#!/bin/ksh
rman <
connect target sys/sys@GOLD_PRI
connect catalog rman/rman@GOLD_CAT
CROSSCHECK BACKUP DEVICE TYPE DISK;
CROSSCHECK ARCHIVELOG ALL;
run {
SQL 'alter system switch logfile';
backup tag='FullBkup' FULL DATABASE
FILESPERSET 2 DATABASE
INCLUDE CURRENT CONTROLFILE
PLUS ARCHIVELOG DELETE INPUT;
}
DELETE NOPROMPT EXPIRED BACKUP;
DELETE NOPROMPT OBSOLETE;
EOF
Good Luck
-
You should start by not using tcsh for scripting. you should probably use bash instead of korn shell. However, at a glance it seems that your script has all of the minimum requirements of doing a warm backup of a database that is not in archive log mode. You should verify that you have the following parameter set appropriately for you environment.
"configure retention policy to recovery window of ${RETENTION} days;"
-
does this script run as oracle or root?
can it backup oracle 8i database?
how do you set the SID? i have 4 of them.
then how do you do a restore to 11gr1?
-
Originally Posted by fbifido
does this script run as oracle or root?
can it backup oracle 8i database?
how do you set the SID? i have 4 of them.
then how do you do a restore to 11gr1?
You cannot use 8i backup to restore to 11g database.
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
-
i was told that exp is not a backup, but rman can be use to do a backup.
so how about this, from example above:
export ORACLE_HOME=/u01/app/oracle/product/8.1.7/db_1
export TNS_ADMIN=$ORACLE_HOME/network/admin
export TWO_TASK=DCTEST # <- i don't know this one
export ORACLE_SID=DCTEST
export BACKUP_DEST=/u02/oradata/backup/$ORACLE_SID
rman run {
allocate channel t1 DEVICE TYPE DISK FORMAT '$BACKUP_DEST/%U' ;
# Perform a full backup
backup [ALL or FULL] format '$BACKUP_DEST/%d_FULL_%U.bck';
release channel t1;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|