Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

automated backup

Posted on 2011-04-29
7
Medium Priority
?
331 Views
Last Modified: 2012-05-11
if the dba wants perform and automated backup when he is not physically there..
how to create a stored script..

RUN {EXECUTE SCRIPT NightBackup;}

where should the dba give this in if there is RMAN
..
0
Comment
Question by:nobleit
7 Comments
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 35495512
You can take several approches (set it up in Enterprise Manager where there is a specific place for automated backup, write your own RMAN script and schedule that via the cron or other OS scheduler, or store it in the Recovery Catalog as you have asked.

If you want to store a script as you listed above, you need to have a Recovery Catalog setup. Do you have that?

If so, here is the doc for RMAN script management: http://download.oracle.com/docs/cd/B28359_01/backup.111/b28270/rcmcatdb.htm#CHDDCIFE

0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35495749
- we've setup rman to execute from a batch file on command prompt and sets windows scheduler to run the batch at specific time on daily basis.
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35495763
- i would share my rman script but currently i'm outstation, here some link on similiar approach of running rman as scheduled backup using script and windows scheduler.

http://www.oracle-base.com/articles/misc/OracleShellScripting.php
http://www.dba-oracle.com/t_windows_rman_backup_bat_file.htm

0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 

Author Comment

by:nobleit
ID: 35498780
This is what i did based on the informations.

C:\emp.sql
The following information is saved in the file..
CONNECT scott/tiger
SPOOL C:\emp.lst
SET LINESIZE 100
SET PAGESIZE 50
SELECT *
FROM emp;
SPOOL OFF
EXIT;

now..
I created
C:\get_emp.bat
sqlplus /nolog @C:\emp.sql
and saved..

and now
C:\cmdfile.txt

RUN {
  ALLOCATE CHANNEL ch1 TYPE
    DISK FORMAT 'C:\oracle\backup\orcl%d_DB_%u_%s_%p';
  BACKUP DATABASE PLUS ARCHIVELOG;
  RELEASE CHANNEL ch1;
}
EXIT;

now C:\backup.bat
rman target=/ @cmdfile.txt


Also I know
Start > Programs > Accessories > System Tools > Scheduled Tasks

How schedule task can be implemented..

in this situation..

0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35498791
I'm not sure what emp.bat is supposed to accomplish since it just executes a sql script and has nothing to do with rman.

To do the rman backup just schedule backup.bat at whatever schedule you want.
0
 
LVL 23

Accepted Solution

by:
OP_Zaharin earned 2000 total points
ID: 35498841
-i schedule only the .bat to run from the scheduler on daily basis at 2am. but i can't really remember the syntax that i run from the .bat file. from my memory, the batch will run sqlplus and execute the .sql file.. the sql file contain execution of the rman syntax in that txt file (what you set for the .sql above is not right. it suppose contain syntax to run the rman.

-if you can wait until Tuesday when i'm back to the office, i will share the exact syntax. if other experts willing to share the steps, is also welcome to do so :)

0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35509632
hi nobleit,
- as i've mention last week, these are my rman setup to run on daily basis using windows scheduler:

- the following image is how i've scheduled it on window scheduler. you need to setup the task to run daily at the schedule tab, check the 'wake the computer' on the settings tab and at the security tab add OS admin  (with 'Log on as a batch job' privileged). to add the privilege to OS admin, use Local Security Settings from the Administrative Tool, under Local Policies-User Rights Assignment treeview:

[embed=image 449922]


- in the backup.bat file contain the following script to run sqlplus:
[code]set ORACLE_SID=YourDB
sqlplus/nolog @YourDB_Backup.sql

Open in new window


- in the YourDB_Backup.sql contain the following code to execute rman:
connect sys/syspassword as sysdba;
alter system switch logfile;
alter system archive log current;
$Rman target sys/syspassword CMDFILE YourDB.rcv LOG YourDB_outfile.txt;

Open in new window


- in the YourDB.rcv contain the following. you can change the rman script using your own setup:
RUN {     
  backup database format='D:\Ora_Backup\YourDB\%U_%I_%T.bkp' tag="full_bkup"
  plus archivelog format='D:\Ora_Backup\YourDB\Arch%U_%I_%T.arc' tag="arcbkp";
  backup current controlfile;
  restore database validate;
  crosscheck backup;
  crosscheck archivelog all;
   }
  
exit

Open in new window


- make sure you have all the folder in place. because i have several database to backup, i have the following:
"D:\Ora_Backup\Script\YourDB\" - my script location for YourDB
"D:\Ora_Backup\YourDB\" - my backup file location for YourDB
hope this helps :)


backup1.jpg
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question