Database Backup script
Hi Team,
we have two instances. Each instance 30 databases available.
Now i want to take all the database backups at a time could you guys please help me to writing a script for this.
Thanks in advance.
subu
Hi,
Checkout my PowerShell script:
https://github.com/janikvonrotz/Powershell-Profile/blob/master/functions/SQLServer/Backup-AllSQLDBs.ps1
Run this script with scheduled Job. To handle the backup file retention you can use this snippet:
https://gist.github.com/janikvonrotz/5749452/raw/fffdec7417eb14f5bc62f1e02dc8b871ed259d18/KeepNumberOfFiles.ps1
It's part of my PowerShell Profile project:
https://github.com/janikvonrotz/Powershell-Profile
Here's an example of how I backup a SharePoint Installation with this Project:
https://gist.github.com/janikvonrotz/6936914/raw/4fa02a69a37363b5330c0d63b6d1cfc5a05ffebd/Backup-SharePointStandalone.ps1
Similar Messages
-
Need a Script to check Database backup chain for revovery
Dear All,
any having a handy script to check database backup chain ,
Database A --> Full backup -- Diff -- log1 --Log 2 ...... and scan through the files to validate if we can recover the database using the avaiable backups.
Regards
Sufian
Mohd Sufian www.sqlship.wordpress.com Please mark the post as Answered if it helped.You can use below TSQL
set nocount on
go
if exists ( select name from tempdb..sysobjects where name like '#DatabasesBackupsStatus%')
drop table #DatabasesBackupsStatus
GO
create table #DatabasesBackupsStatus
ServerName varchar(100) null,
DBName varchar(100) null,
RecoveryModel varchar(100) null,
LastFullbackup datetime null,
days_since_Lastfullbackup int null,
days_since_Lastdiffbackup int null,
HOURS_since_LastLogbackup int,
DBStatus varchar (100) null,
FullBackupLocation varchar(1000) null,
MEDIASET INT,
JobOwner varchar(100) null
Go
insert into #DatabasesBackupsStatus(ServerName,DBName)
select convert(varchar,serverproperty('ServerName')),a.name
from master.dbo.sysdatabases a
where a.name <> 'tempdb'
update #DatabasesBackupsStatus
set LastFullbackup=b.backup_start_date,
days_since_Lastfullbackup=datediff(dd,b.backup_start_date,getdate()),
MEDIASET=b.media_set_id
from #DatabasesBackupsStatus a,(select database_name,MAX(media_set_id)media_set_id,max(backup_start_date) backup_start_date
from msdb..backupset where type='D' group by database_name)b
where a.DBName=b.database_name
update #DatabasesBackupsStatus
set RecoveryModel=convert(sysname,DatabasePropertyEx(DBName,'Recovery'))
update #DatabasesBackupsStatus
set DBStatus=convert(sysname,DatabasePropertyEx(DBName,'Status'))
update d
set d.FullBackupLocation=b.physical_device_name
from #DatabasesBackupsStatus d , msdb..backupmediafamily b
where d.MEDIASET =b.media_set_id
update d
set d.days_since_Lastdiffbackup=datediff(dd,b.backup_finish_date,getdate())
from #DatabasesBackupsStatus d , (select database_name,max(backup_finish_date) backup_finish_date
from msdb..backupset where type ='I' group by database_name) b
where d.DBName = b.database_name
update d
set d.JobOwner=b.[user_name]
from #DatabasesBackupsStatus d , msdb..backupset b
where d.MEDIASET = b.media_set_id
update d
set d.HOURS_since_LastLogbackup=datediff(hh,b.backup_finish_date,getdate())
from #DatabasesBackupsStatus d , (select database_name,max(backup_finish_date) backup_finish_date
from msdb..backupset where type ='L' group by database_name) b
where d.DBName = b.database_name
AND d.RecoveryModel != 'SIMPLE'
Go
select * from #DatabasesBackupsStatus
Go
drop table #DatabasesBackupsStatus
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Thanks,
Shashikant -
Running same backup script on two different Databases
Hello All,
I am running same backup script on two different Databases.
But output is different.
Please give me your feedback.
1) Database 1:
OS: AIX
DB: 10.1.0.4.0
Script:
export ORACLE_SID=sid1
cd $ORACLE_HOME/bin
./rman nocatalog << EOF
connect target
ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE disk;
configure controlfile autobackup on;
backup as compressed backupset database plus archivelog delete input;
delete noprompt obsolete;
exit
EOF
6 Files created:
-rw-r----- 1 oracle dba 4140032 Jun 19 00:00 uvhlvjs8_1_1
-rw-r----- 1 oracle dba 38029824 Jun 19 00:00 backup_uuhlvjs8_1_1
-rw-r----- 1 oracle dba 781287424 Jun 19 00:20 v1hlvjsk_1_1
-rw-r----- 1 oracle dba 578027520 Jun 19 00:23 backup_v0hlvjsk_1_1
-rw-r----- 1 oracle dba 1222656 Jun 19 00:23 backup_v2hlvl7r_1_1
-rw-r----- 1 oracle dba 4259840 Jun 19 00:23 c-1052429639-20060619-00
-rw-r----- 1 oracle dba 4177920 Jun 19 00:23 SNAPCF_ATHENA.F
2. Databse 2:
OS: Linux (SLES 8)
DB: 10.1.0.5.0
Log Archive Filename Format: %t_%s_%r.dbf
2 files created:
1_17804_535674251.dbf 1_17837_535674251.dbf SID_2chlmrrl_1_1.1
1_17805_535674251.dbf 1_17838_535674251.dbf SID_2dhlms8c_1_1.1
I am also getting dbf file every one hour as below:
1_17868_535674251.dbf
DNwaiting for reply
-
RMAN Backup script for RAC Database..please suggest
Hi All,
I am currently working on backup policy for RAC Database for my client.The client requirement is to backup while database is shutdown(mount state).I have made below script and could any one please suggest what further things should I need to add with below rman script.
echo "Shutdown Database";date
srvctl stop database -d PROD
srvctl status database -d PROD
echo "Database shutdown on";date
echo "Mount Database ";date
srvctl start instance -d PROD -i "PROD1" -o mount
srvctl status database -d PROD
echo "Start Full Database Backup on";date
$ORACLE_HOME/bin/rman target / nocatalog <<EOF
configure controlfile autobackup on;
configure controlfile autobackup format for device type disk to '/BACKUP/PRODBKP/%F';
run{
allocate channel c1 device type disk connect 'sys/******@node1-vip:1521/PROD';
allocate channel c2 device type disk connect 'sys/*****@node2-vip:1521/PROD';
backup format '/BACKUP/PRODBKP/PROD_df_%t_%s_%p.bak'(database);
backup format '/BACKUP/PRODBKP/archive_%t_%s_%p.bak' archivelog all;
copy current controlfile to '/BACKUP/PRODBKP/PROD.ctl';
delete noprompt obsolete;
release channel c1;
release channel c2;
exit
EOF
echo "RMAN Backup Finished on";date
echo "Shutdown Database";date
srvctl stop database -d PROD
echo "Start Database";date
srvctl start database -d PROD
srvctl status database -d PROD
Please share your experiences.
RegardsHi,
Some tweaks for your script.
echo "Shutdown Database";date
srvctl stop database -d PROD
srvctl status database -d PROD
echo "Database shutdown on";date
echo "Mount Database ";date
srvctl start instance -d PROD -i "PROD1" -o mount1. If you database does not shutdown properly , does your script stops the execution of next step?
2. configure controlfile autobackup on;
configure controlfile autobackup format for device type disk to '/BACKUP/PRODBKP/%F';(Why you need to configure this every time) ?
It's persistent at db level one time setting (until some other script changes the settings by other dba - else remove that - set the configuration at db level once for all)
- Pavan Kumar N
3. -
Hello,
I'm trying to backup script (*.ICMS) with schedule task, do you now if it's possible?
I find the manual export in script editor but do it one by one ...
I need your help
Thanks a lotYou cannot "back up" an individual .icms file.
If you back up the logger (xxxx_sideA) database, that will include all the Scripts (along with all your other configuration).
iow - the Scripts are part of the ICM database, not a separate entity. -
Report and alerts for Exchange Server database backup
Hi
i am trying to use the Get-DailyBackupAlerts.ps1
to check the exchange database backup state every day by email
and i am using this scripts its working fine but I have problem with sending email
here below the Error
04/16/2015 09:46:53 Alert email will be sent
04/16/2015 09:46:53 Report summary: Alerts 23, OK 0
04/16/2015 09:46:53 Sending email report
04/16/2015 09:46:53 Cannot validate argument on parameter 'From'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again.
04/16/2015 09:46:53 Finished.
my setting the in the file Settings.xml as below
<EmailSettings>
<SMTPServer>webmail.domain.com</SMTPServer>
<SMTPPort>25</SMTPPort>
<MailFrom>[email protected]</MailFrom>
<MailTo>[email protected]</MailTo>
</EmailSettings>
any one can help ?
MahmoudDear Mahmoud,
In the SMTP server settings below you need to replace with your HUB server FQDN if its 2010 or Mailbox server FQDN if its 2013 and after that i think it should work.
<SMTPServer>webmail.domain.com</SMTPServer>
Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you Check out my latest blog posts on http://exchangequery.com Thanks Sathish
(MVP) -
Daily database backup runnig on RAC 10.2.0.3 with two Solaris nodes & ASM
Hello,
I'm confused about making daily incremental RMAN backup of a database runnig on Oracle RAC 10.2.0.3 on two Solaris nodes and ASM.
Databases cannot be stopped for backup and point in time recovery is needed.
Please correct me if I am doing wrong:
1) Backup must be Weekly database Level 0 and Daily database Level 1 is appropriate.
2) Is best to use a Flash Recovery Area (FRA) - I've setup one on a separate ASM volume. I have enough space to do the backup on FRA.
3) I am confused about the number channels I need to use. Do I need to use separate RMAN backup channels for each node or I can just leave the default:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
4) Below are the RMAN scripts I plan to use for
- Weekly database backup Level 0:
#!/usr/bin/ksh
echo BACKUP FULL: $ORACLE_HOME/bin/rman target / nocatalog log ${LOGFILE} append
$ORACLE_HOME/bin/rman target / nocatalog log ${LOGFILE} append << eof
run {
backup incremental level 0 database TAG bkp_level0_200906010;
SQL 'alter system archive log current';
backup archivelog all;
delete noprompt obsolete;
exit;
eof
- Daily database backup Level 1:
#!/usr/bin/ksh
echo BACKUP INCREMENTAL: $ORACLE_HOME/bin/rman target / nocatalog log ${LOGFILE} append
$ORACLE_HOME/bin/rman target / nocatalog log ${LOGFILE} append << eof
run {
backup incremental level 1 database TAG bkp_level1_20090611;
SQL 'alter system archive log current';
backup archivelog all;
delete noprompt obsolete;
exit;
eof
I'm I doing things wrong?Show also the parameter I have set for RMAN:
node1:oracle$ rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Tue Jun 9 23:46:05 2009
connected to target database: ORCL (DBID=1198388159)
RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 7;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/oracle/product/10gr2/db/dbs/snapcf_orcl1.f'; # default
Showing some instance parameters on node1:
SQL> show parameter recovery;
NAME TYPE VALUE
db_recovery_file_dest string DGFRA+
db_recovery_file_dest_size big integer 300G
recovery_parallelism integer 0
SQL> show parameter archive;
NAME TYPE VALUE
archive_lag_target integer 0
log_archive_config string
log_archive_dest string
log_archive_dest_1 string
log_archive_dest_10 string location=use_db_recovery_file_
dest
log_archive_dest_2 string
log_archive_dest_3 string
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
NAME TYPE VALUE
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string enable
log_archive_dest_state_10 string enable
log_archive_dest_state_2 string enable
log_archive_dest_state_3 string enable
log_archive_dest_state_4 string enable
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
NAME TYPE VALUE
log_archive_dest_state_8 string enable
log_archive_dest_state_9 string enable
log_archive_duplex_dest string
log_archive_format string %t_%s_%r.dbf
log_archive_local_first boolean TRUE
log_archive_max_processes integer 2
log_archive_min_succeed_dest integer 1
log_archive_start boolean FALSE
log_archive_trace integer 0
remote_archive_enable string true
standby_archive_dest string ?/dbs/arch -
Oracle version : 11G release 2
Platform : AIX
After going through various OTN posts, i wrote the below Cold backup script (Untested). If there are any unnecessary stuff or enhancements required, please let me know
$ rman target /
RMAN>
run
allocate channel c1 type disk format '/u05/rmanbkp/%d_COLD_DB_%u';
sql 'alter system archive log current';
shutdown immediate;
startup mount;
backup database including current controlfile tag='mydbname_full_bkp';
backup spfile tag = 'mydbname_SPFILE';
release channel c1;
}Hi T.Boyd
What do you guys think of the backup script? Any room for improvement? I found in a small percentage of the shutdown immediate commands issued, the instance hangs (specially when the machine is very busy).
I have modified my rman coldbackup the procedure to:
shutdown abort;
host 'sleep 3';
startup restrict;
shutdown immediate;
startup mount;Maybe you can add more channels to improve performance. You can use more resources as there are no users on the database anyway....
Regards,
Tycho -
Not putting SYS password in a backup script
I have a small database to backup and I plan to use a simple unix script to do it. For example,
expdp system full=y content=all dumpfile=$dfile 2>&1 | tee $efile
mv $dfile .
bzip2 -9 $dfile $efile
# Copy files to remote server
scp -pq ${dfile}.bz2 ${efile}.bz2 $scpremotepath || (echo Backup - scp copy of backup files failed ; exit 1)
I want to add the script to cron job so that it can run automatically.
A question I have is how can I avoid putting the database password in the script? Is it possible to put the password in an Oralce "wallet" ?
Thanks.Nobody is suggesting you are doing wrong. You asked for a way to avoid writing a password for the user at the shell script, and you were suggested to use OS authentication.
Now I understand you want an evaluation of the way you perform the backup. It is important to have a backup and you should assess if this backup meets the recoverability goals of your company. A logical backup, such as exp or expdp will allow you to recover data up to the time the backup was performed, but you won't be able to recover beyond that point, does it work for your company? Otherwise, if you are concerned about a mechanism to recover data up to the time of failure, then you should consider a physical backup with a database configured in archivelog mode, that is what recovery manager is for.
IMO not knowing how to use recovery manager doesn't justify not using it, you should go to the backup and recover manual and learn about it. Since you mentioned you are using expdp I assume you are currently working with a 10g database, you can enter the Enterprise Manager Control and schedule a backup procedure from it. It can schedule a recovery manager managed backup for you, meanwhile you can start learning how to manually use recovery manager.
You can start here --> Oracle® Database Backup and Recovery Basics
10g Release 2 (10.2)
Part Number B14192-03
~ Madrid
http://hrivera99.blogspot.com/ -
Rman hot backup script gives error in R12.
hi experts
i m facing following prob when run the backup script. 1 day before the same script runs correctily but now it gives me error at the allocatioion of channel rest of command run correctly.
[root@testerp rman_log]# cat UAT_daily_rman_hot_bkp_01-11-14_140301.log
-bash: /root/.bash_profile: Permission denied
Recovery Manager: Release 11.1.0.7.0 - Production on Sat Jan 11 14:03:01 2014
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: UAT (DBID=2855851979)
connected to recovery catalog database
RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "end-of-file": expecting one of: "allocate, alter, advise, backup, beginline, blockrecover, catalog, change, copy, convert, crosscheck, configure, duplicate, debug, delete, execute, endinline, flashback, host, mount, open, plsql, recover, release, replicate, report, restore, resync, repair, }, set, setlimit, sql, switch, startup, shutdown, send, show, transport, validate"
RMAN-01007: at line 12 column 1 file: standard input
RMAN>
RMAN>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "for"
RMAN-01008: the bad identifier was: c2
RMAN-01007: at line 1 column 18 file: standard input
RMAN>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "for"
RMAN-01008: the bad identifier was: c3
RMAN-01007: at line 1 column 18 file: standard input
RMAN>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "for"
RMAN-01008: the bad identifier was: c4
RMAN-01007: at line 1 column 18 file: standard input
RMAN>
Starting backup at 11-JAN-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=362 device type=DISK
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00021 name=/d06/UAT/proddata/a_txn_data06.dbf
input datafile file number=00392 name=/d06/UAT/db/apps_st/data/a_txn_data01.dbf
input datafile file number=00401 name=/d06/UAT/db/apps_st/data/a_txn_data02.dbf
input datafile file number=00402 name=/d06/UAT/db/apps_st/data/a_txn_data03.dbf
input datafile file number=00022 name=/d06/UAT/proddata/a_txn_data07.dbf
input datafile file number=00014 name=/d06/UAT/db/apps_st/data/a_txn_data04.dbf
input datafile file number=00020 name=/d06/UAT/proddata/a_txn_data05.dbf
input datafile file number=00011 name=/d06/UAT/db/apps_st/data/sysaux01.dbf
input datafile file number=00018 name=/d06/UAT/db/apps_st/data/sysaux02.dbf
input datafile file number=00023 name=/d06/UAT/proddata/a_txn_data08.dbf
input datafile file number=00379 name=/d06/UAT/db/apps_st/data/undo01.dbf
input datafile file number=00024 name=/d06/UAT/proddata/sysaux03.dbf
input datafile file number=00025 name=/d06/UAT/proddata/sysaux04.dbf
input datafile file number=00033 name=/d06/UAT/proddata/a_txn_ind11.dbf
input datafile file number=00029 name=/d06/UAT/proddata/a_txn_ind09.dbf
input datafile file number=00030 name=/d06/UAT/proddata/a_txn_ind10.dbf
input datafile file number=00015 name=/d06/UAT/db/apps_st/data/a_txn_ind06.dbf
input datafile file number=00026 name=/d06/UAT/db/apps_st/data/a_txn_ind07.dbf
input datafile file number=00028 name=/d06/UAT/db/apps_st/data/a_txn_ind08.dbf
input datafile file number=00393 name=/d06/UAT/db/apps_st/data/a_txn_ind01.dbf
input datafile file number=00403 name=/d06/UAT/db/apps_st/data/a_txn_ind02.dbf
input datafile file number=00404 name=/d06/UAT/db/apps_st/data/a_txn_ind03.dbf
input datafile file number=00405 name=/d06/UAT/db/apps_st/data/a_txn_ind04.dbf
input datafile file number=00406 name=/d06/UAT/db/apps_st/data/a_txn_ind05.dbf
input datafile file number=00400 name=/d06/UAT/db/apps_st/data/a_media01.dbf
input datafile file number=00353 name=/d06/UAT/db/apps_st/data/system08.dbf
input datafile file number=00013 name=/d06/UAT/db/apps_st/data/system12.dbf
input datafile file number=00352 name=/d06/UAT/db/apps_st/data/system09.dbf
input datafile file number=00394 name=/d06/UAT/db/apps_st/data/a_ref01.dbf
input datafile file number=00407 name=/d06/UAT/db/apps_st/data/a_ref02.dbf
input datafile file number=00396 name=/d06/UAT/db/apps_st/data/a_summ01.dbf
input datafile file number=00395 name=/d06/UAT/db/apps_st/data/a_int01.dbf
input datafile file number=00008 name=/d06/UAT/db/apps_st/data/a_queue02.dbf
input datafile file number=00027 name=/d06/UAT/db/apps_st/data/a_queue03.dbf
input datafile file number=00031 name=/d06/UAT/db/apps_st/data/a_queue04.dbf
input datafile file number=00399 name=/d06/UAT/db/apps_st/data/a_queue01.dbf
input datafile file number=00001 name=/d06/UAT/db/apps_st/data/system01.dbf
input datafile file number=00002 name=/d06/UAT/db/apps_st/data/system02.dbf
input datafile file number=00003 name=/d06/UAT/db/apps_st/data/system03.dbf
input datafile file number=00004 name=/d06/UAT/db/apps_st/data/system04.dbf
input datafile file number=00005 name=/d06/UAT/db/apps_st/data/system05.dbf
input datafile file number=00398 name=/d06/UAT/db/apps_st/data/a_archive01.dbf
input datafile file number=00295 name=/d06/UAT/db/apps_st/data/system06.dbf
input datafile file number=00351 name=/d06/UAT/db/apps_st/data/system07.dbf
input datafile file number=00354 name=/d06/UAT/db/apps_st/data/system11.dbf
input datafile file number=00288 name=/d06/UAT/db/apps_st/data/system10.dbf
input datafile file number=00012 name=/d06/UAT/db/apps_st/data/apps_ts_tools01.dbf
input datafile file number=00016 name=/d06/UAT/db/apps_st/data/a_ref03.dbf
input datafile file number=00019 name=/d06/UAT/db/apps_st/data/MLSEIGL01.dbf
input datafile file number=00032 name=/d06/UAT/db/apps_st/data/RMAN01.dbf
input datafile file number=00397 name=/d06/UAT/db/apps_st/data/a_nolog01.dbf
input datafile file number=00314 name=/d06/UAT/db/apps_st/data/portal01.dbf
input datafile file number=00017 name=/d06/UAT/db/apps_st/data/a_int02.dbf
input datafile file number=00006 name=/d06/UAT/db/apps_st/data/ctxd01.dbf
input datafile file number=00010 name=/d06/UAT/db/apps_st/data/olap.dbf
input datafile file number=00009 name=/d06/UAT/db/apps_st/data/odm.dbf
input datafile file number=00007 name=/d06/UAT/db/apps_st/data/owad01.dbf
channel ORA_DISK_1: starting piece 1 at 11-JAN-14
[root@testerp rman_log]#
backup script is below:
in this script it returns error only at the channel allocaition rest of all backup command i run manually or with scirpt it runs correctly.4
i m not able to know why it returns error only at challnel allocation 1 day before it runs correctly.
[orauat@testerp rman_script]$ cat rman_backup.sh
#!/bin/sh
#ORACLE_SID=UAT
#BACKUP_START_TIME='date +"%y""%m""%d"_"%H""%M""%S"'
#ORACLE_HOME=/d06/UAT/db/tech_st/11.1.0
#PATH=$PATH:${ORACLE_HOME}:${ORACLE_HOME}/bin
#export ORACLE_SID
#export ORACLE_HOME
#export PATH
/d06/UAT/db/tech_st/11.1.0/bin/rman catalog rman/rman007 target sys/sysuat <<EOF
run
allocate channel c1 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_Arch_%c_%U';
sql 'alter system switch logfile';
sql 'alter system switch logfile';
sql 'alter system archive log current';
delete expired archivelog all;
crosscheck archivelog all;
backup archivelog all;
delete noprompt archivelog all completed before 'sysdate-4' backed up 1 times to disk;
allocate channel c2 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
allocate channel c3 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
allocate channel c4 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
backup incremental level 1 database;
delete expired backup device type disk;
delete obsolete device type disk;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
exit
EOF
regards
pritesh ranjanyes the script is edited
i have add some command line and edit it for take the full backup level=0 on the same directory with different formant name but location is same.
can i take full backup level 0 and incremental backup level 1 in the same directory with the different format name.
for exp:
allocate channel c2 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
allocate channel c3 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
allocate channel c4 device type disk format '/d06/UAT/rman_hot_backup/Daily_backup%d_DB_%c_%U';
i allocate these three channel for incremental level 1 backup;
the backup is done successfully without any error.
after that i have change
allocate channel c2 device type disk format '/d06/UAT/rman_hot_backup/Weekly_backup%d_DB_%c_%U';
allocate channel c3 device type disk format '/d06/UAT/rman_hot_backup/Weekly_backup%d_DB_%c_%U';
allocate channel c4 device type disk format '/d06/UAT/rman_hot_backup/Weekly_backup%d_DB_%c_%U';
backup database incremental level 0
after doing the above changes it get the error. with the channel location.
i have to schedule daily incremental backup level 1 and weekly full backup level 0.
plz suggest me i have to take incremental 1 and full incremental level 0 backup on seperate directory for different format name.
regards
pritesh ranjan -
I want to format my hard disk. but i want to take a copy of my oracle database
so anyone can please give me the solution for how to take a back up and again how to reload to my new oracle database? if it succeeded is it possible to retain all the schemas of my old database?One way to do this is to take a cole backup
and restore with backup controlfile.
1. alter database backup controlfile to trace
2. find this trace and backup it to another drive
3. shutdown immediate
4. Backup you database files - if you don't know them (issue when db is open select name from v$session) on another drive5. format you r drive
6. restore your files from backup
7. Open trace file and creater a script from it yous copy and paste one of two cases
8. if it is win nt. make an instance oradi,m -NEW -SID db
9. sqlplus /nolog
10. conn / as sysdba
11. startup nomount
12. execute script created in point 7
For more detail instructions please refer to User Managed Backup and Recovery Guide
Best Regards
Krystian Zieja / mob -
Hi,
I have script bellow. I want to run in one script on linux as shell script: how can i do that. i have very limited knowledge about it:
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';
sql 'ALTER DATABASE BACKUP CONTROLFILE TO TRACE';
release channel t1;
}user12020966 wrote:
Hi,
I have script bellow. I want to run in one script on linux as shell script: how can i do that. i have very limited knowledge about it:
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 mountWhy the shutdown? are you running in norachivelog mode?
# Allocate channel. Important: This must be done after
# database has been mounted!!!
allocate channel t1 DEVICE TYPE DISK FORMAT '/backuplocation/DB1RMAN/%U' ;Above not needed if you set it as part of the rman config:
oracle> rman target /
rman> CONFIGURE DEFAULT DEVICE TYPE TO DISK FORMAT '/backuplocation/DB1RMAN/%U';
# Perform full database backup
backup Database format '/backuplocation/DB1RMAN/%d_FULL_%U.bck';Your use of "format" is redundant with your channel allocation.
# Open database after backup complete
sql 'alter database open';
sql 'ALTER DATABASE BACKUP CONTROLFILE TO TRACE';No need to shell out to sql. those commands are accepted directly by rman.
RMAN> startup mount;
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 285212672 bytes
Fixed Size 1267068 bytes
Variable Size 146803332 bytes
Database Buffers 134217728 bytes
Redo Buffers 2924544 bytes
RMAN> alter database open;
database opened
RMAN>
release channel t1;
}I'd strongly suggest you go to amazon.com and look up the books on rman backup and recovery by Hart and Freeman. You are making waaay too much work for yourself. -
Can't do ALTER DATABASE BACKUP CONTROLFILE
when I do:
ALTER DATABASE BACKUP CONTROLFILE TO '/export/home/user1/contrlfilesdbb';
i got error messages:
ERROR at line 1:
ORA-01580: error creating control backup file /export/home/user1/contrlfilesdbb
ORA-27038: created file already exists
Additional information: 1
why there is such problem?
Help, please!
thank you.
Message was edited by:
user482717no, you should not change the permission on the actual controlfile! i was re-reading through your post and you are trying to backup your controlfile to a directory name and not a file name. you need to specify the filename you want to backup to, not just the directory.
for example:
alter database backup controlfile to '/export/home/user1/ctrlfilesdbb/bkupctrl.ctl' reuse;
you do know that this is not just a copy of the current control file but a series of scripts that based on your recovery needs can be edited to create a new control file, right? -
New database create script using DBCA
Hi,
I'm trying to generate a database create script using DBCA. I have another database running on the same physical server(HP-UX and oracle 10g R2). When I run the DBCA, it is creating scripts to Clone DB and Clone RMAN restore. Why it is not generating to create a new database instead of cloning the DB.
ThanksRock2 wrote:
Hi,
I'm trying to generate a database create script using DBCA. I have another database running on the same physical server(HP-UX and oracle 10g R2). When I run the DBCA, it is creating scripts to Clone DB and Clone RMAN restore. Why it is not generating to create a new database instead of cloning the DB.
ThanksWhen you launch dbca, you need to select to create a 'custom' database, not one of the pre-canned templates. The templates will all result in a script that does an rman restore from a backup that comes with the product. Selecting 'custom' database will result in scripts built around the CREATE DATABASE sql statement. -
Parrallelization of RMAN Full Database Backup Confusion
Hi,
I am running Oracle 10gR2 on Solaris 5.10 on sparc machine having 16 CPUs.
I am using following RMAN script to take full database backup:
#!/bin/bash
ORACLE_HOME=/u01/app/oracle/product/10g
PATH=$ORACLE_HOME/bin:$PATH
ORACLE_SID=mtcedwp
export ORACLE_HOME ORACLE_SID PATH
rman target / <<EOF
run
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 8;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
ALLOCATE CHANNEL d1 DEVICE TYPE DISK;
ALLOCATE CHANNEL d2 DEVICE TYPE DISK;
ALLOCATE CHANNEL d3 DEVICE TYPE DISK;
ALLOCATE CHANNEL d4 DEVICE TYPE DISK;
ALLOCATE CHANNEL d5 DEVICE TYPE DISK;
ALLOCATE CHANNEL d6 DEVICE TYPE DISK;
ALLOCATE CHANNEL d7 DEVICE TYPE DISK;
ALLOCATE CHANNEL d8 DEVICE TYPE DISK;
BACKUP TAG ATHEER_FULL_DB DATABASE FORMAT '/u01/BACKUPS/WEEKLY_DB_BACKUP/backup_%U';
CROSSCHECK BACKUPSET;
CROSSCHECK BACKUP;
DELETE NOPROMPT OBSOLETE;
RELEASE CHANNEL d1;
RELEASE CHANNEL d2;
RELEASE CHANNEL d3;
RELEASE CHANNEL d4;
RELEASE CHANNEL d5;
RELEASE CHANNEL d6;
RELEASE CHANNEL d7;
RELEASE CHANNEL d8;
EOFWill the above script take the 8-way parrallel backup? or do I need to configure location for every channel separately?
regardsThis channel can be allocated manually or can be pre-configured by using
automatic channel allocation.
The number of allocated channels determines the maximum degree of
parallelism that is used during backup restore or recovery. For example if
you allocate 8 channels for a backup operation 8 background processes for the
operation can run concurrently.
Parallelism of backup sets allocates multiple channels and assigns
files to specific channels. You can configure parallel backups by setting a
PARALLELISM option of the CONFIGURE command to a value greater than 1 or by
manually allocating multiple channels.
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmconc1.htm#i1012864
Maybe you are looking for
-
Firefox keeps crashing, and I think it might be virus-related.
I had a nasty virus about a month ago, but after running a couple antivirus programs, it seemed to be gone for good. One of the problems it caused was that it caused Firefox to crash when i had several tabs/windows open at once. But even though the v
-
Images coming up as question marks when scanned?
Since I've upgraded to Yosemite, my images can't be scanned. The printer/scanner/copier shows up fine and connects to the computer fine, my problem is that -- once scanned -- the image shows up in the "Image Garden" as a grey field with a question ma
-
I am trying to set up our Apple TV but we cannot activate Home Sharing. We keep getting error 2146893032. Please don't post the tutorial or troubleshooting guide. Been there already. We have also checked our virus software. Like another person who po
-
Usb keyboard adn mouse compatability
I have a Logitech G7 laser mouse and a Logitech G15 keyboard. Im gunna pick up a mac mini but i dont wanna but a new mouse and keyboard set thatll clutter up my desk. Can i use my mouse and keyboard? oh crap, wrong section. Delete this!
-
Color of item selected in JMenu
Hi All, I want to change the default highlight color whenever i select any item in JMenu. By default whenever i select any item in JMenu, it gets highlighted in blue color .i want to override this behavior to set my own highlight color Pls advise