Rman dataguard script for oracle10g

Dear Friends ,
I am going to configure oracle10g dataguard on oracle wnterprise linux  5.0 . I am trying to do this configuration
using RMAN .
  After succesfully configuration of the PRIMARY End as well as I am going to configure standby end .
n the standby end I have to run the below rman script and got the syntax error :
[oracle@server dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 29 12:59:01 2012
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup nomount pfile=initstan.ora
ORACLE instance started.
Total System Global Area  217157632 bytes
Fixed Size                  2211928 bytes
Variable Size             159387560 bytes
Database Buffers           50331648 bytes
Redo Buffers                5226496 bytes
SQL>
6) Run RMAN and connect to the Standby database and make an auxiliary connection to the Primary database like below :
bash-3.2$ rman target sys@prim
Recovery Manager: Release 11.2.0.3.0 - Production on Fri Mar 24 10:54:37 2000
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database:PRIM (DBID=1247570709)
RMAN> connect auxiliary sys/sys123@stan
connected to auxiliary database: STAN (not mounted)
RMAN
run {
      allocate channel prmy1 type disk;
  allocate channel prmy2 type disk;
  allocate channel prmy3 type disk;
  allocate channel prmy4 type disk;
        allocate channel prmy5 type disk;
  allocate auxiliary channel stby type disk;
  duplicate target database for standby from active database
  spfile
  parameter_value_convert 'prim','stan'
  set db_unique_name='prim'
  set db_file_name_convert='/u01/app/oracle/oradata/prim/','/u01/app/oracle/oradata/stan/'
  set log_file_name_convert='/u01/app/oracle/oradata/prim/','/u01/app/oracle/oradata/stan/'
  set control_files='/u01/app/oracle/oradata/stan/control01.ctl','/u01/app/oracle/oradata/stan/control02.ctl','/u01/app/oracle/oradata/stan/control03.ctl'
  set log_archive_max_processes='5'
  set fal_client='stan'
  set fal_server='prim'
  set standby_file_management='AUTO'
  set log_archive_config='dg_config=(prim,stan)'
  set log_archive_dest_2='service=prim  ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=prim'
  NOFILENAMECHECK
Each and every time when I run the above script  got the below error :
RMAN> 2> 3> 4> 5> 6> 7> 8>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "from": expecting one of: "dorecover, db_file_name_convert, nofilenamecheck, ;"
RMAN-01007: at line 9 column 39 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: "allocate, alter, backup, beginline, blockrecover, catalog, change, connect, copy, convert, create, crosscheck, configure, duplicate, debug, delete, drop, exit, endinline, flashback, host, {, library, list, mount, open, print, quit, recover, register, release, replace, report, renormalize, reset, restore, resync, rman, run, rpctest, set, setlimit, sql, switch, spool, startup, shutdown, send, show, test, transport, upgrade, unregister, validate"
RMAN-01008: the bad identifier was: parameter_value_convert
RMAN-01007: at line 2 column 1 file: standard input
Does anybody please correct the above script for 10g or if there any document for configuring oracle10g dataguard
using RMAN , then please help me .
Thx in advance .. ..

shipon_97 wrote:
Dear Friends ,
I am going to configure oracle10g dataguard on oracle wnterprise linux  5.0 . I am trying to do this configuration
using RMAN .
  After succesfully configuration of the PRIMARY End as well as I am going to configure standby end .
n the standby end I have to run the below rman script and got the syntax error :
You cannot use FROM ACTIVE DATABASE - option, If your database version is 10g .
Regards
Mahir M. Quluzade

Similar Messages

  • A script for oracle10g cold backup on linux

    Hi,
    I have a urgent need to do a cold backup using o/s command. Can anyone please send me a script for this.
    Thanks in advance
    PK

    I ended up writing the script
    define 3 = &backup_directory
    define 4 = &instance_name
    define 5 = &user_dump_directory
    Set Heading Off
    Set Verify Off
    Set FeedBack Off
    Set LineSize 132
    Set PageSize 1000
    set termout off
    Spool cold_back.sql
    select 'connect /as sysdba' from dual;
    Select 'Startup Force' || CHR(10) ||
    'Shutdown Normal' From Dual;
    select '! mkdir '||'&&3'||'/'||to_char(sysdate,'yyyyddmm') from dual
    /* Data Files */
    Select '!cp ' || File_Name || ' &&3'||'/'||to_char(sysdate,'yyyyddmm') || CHR(10) ||'!gzip ' || '&&3' ||'/'||to_char(sysdate,'yyyyddmm')|| '/' || SubStr(File_Name, InStr(File_Name, '/', -1)+1) From Sys.DBA_Data_Files
    /* Redo Log Files */
    Select '!cp ' || Member || ' &&3'||'/'||to_char(sysdate,'yyyyddmm') || CHR(10) || '!gzip ' || '&&3'||'/'||to_char(sysdate,'yyyyddmm') || '/' || SubStr(Member, InStr(Member, '/', -1)+1) From V$LogFile
    /* Control Files */
    Select '!cp ' || name || ' &&3'||'/'||to_char(sysdate,'yyyyddmm') From V$controlfile
    /* Init and Config Files */
    Select '!cp $ORACLE_HOME/dbs/init&&4' || '.ora &&3'||'/'||to_char(sysdate,'yyyyddmm') From Dual
    alter session set tracefile_identifier=coldbackup
    alter database backup controlfile to trace
    select '!mv '||'&&5/*COLDBACKUP*' ||' &&3'||'/'||to_char(sysdate,'yyyyddmm') FROM dual
    Select 'Startup' From Dual;
    Select 'Exit' from dual;
    set termout on
    PROMPT " Run the output cold_back.sql script [sqlplus -s '/as sysdba' @cold_back.sql ]"
    Spool Off
    -----------------------

  • 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.
    Regards

    Hi,
    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.

  • RMAN script for hot backup (looking for code critic) code attached.

    Hello Guru's,
    I have been having soem trouble running a successful hot full rman backup nightly.
    We max our CPU load whenever our RMAN takes too long and conflicts with a Legato tape backup. I have a development server that I attempted to get a consistent backup time duration that is rock solid as to not conflict with the Legato backup time.
    I just found out about duration with RMAN scripts here is my code:
    #!/bin/bash
    #rman backup script for daily hot whole database backup
    at -f /hd1/rman_scripts/rman_backup 0600 tomorrow
    rman target/
    run {
    allocate channel d1 device type disk format '/path/%U';
    backup duration 1:00 partial minimize load database filesperset 1;
    backup as BACKUPSET tag '%TAG' database;
    backup as BACKUPSET tag '%TAG' archivelog all delete all input;
    delete noprompt obsolete;
    release channel d1;
    exit
    It completes the backup, but does not use the 1 hour allocated- it only uses 15 minutes on average and creates many files instead of normally three backup files.
    Here is the results from querying the v$rman_status table for operation,status,start_time:
    RMAN,FAILED, 17-OCT-06 0600
    BACKUP,FAILED,17-OCT-06 0600
    RMAN,FAILED,17-OCT-06 0606
    BACKUP,COMPLETED,17-OCT-06 0606
    BACKUP,COMPLETED,17-OCT-06 0606
    BACKUP,FAILED,17-OCT-06 0615
    RMAN,COMPLETED,17-OCT-06 1513
    REPORT,COMPLETED,17-OCT-06 1513
    DELETE,COMPLETED,17-OCT-06 1513
    However, the timestamps of the backupset files it creates is:
    06:15 and not 1513?????????????
    RMAN appears to have only taken 15 minutes to create the files, why do I have a completed timestamp from v$rman_status of 1513???
    Please advise and comment, I am just learning RMAN.

    Try to remove the DURATION option in your script.
    Here more details about that part.
    http://download-east.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta009.htm#i1010261
    Bye, Aron

  • Shell script for DB backup

    HI,
    i have written some java code Database backup but there are some problems with that so now i need to write shell script for db backup.
    what i was doing in java code i was running command like that
    /usr/local/bin/tar cvzf /export/home/monitor/FILE_20091005.tar.gz FILES/*20091005.*which compress the all *20091005* files (myisam table files)
    but after compression file doesn't extract
    so i have to write shell script for that ..... can any body guide me how can i write that kind of script and put it in cron job.
    thanks

    soundar wrote:
    Hi all,
    I have migrated database from 8i to 10gr2.For Backup in 8i, we used a RMAN shell script (scheduled uding cron tab) to backup the database to Tape.(VERITAS BACKUP).
    I am new to 10G.I checked out the options to backup the database using Oracle Enterprise manager DB console.
    http://www.oracle.com/technology/obe/10gr2_db_single/ha/rman/rman_otn.htm#t1d
    I am planning to take a test backup using the steps mentioned inthe above url.Could any one suggest whcih is the best option for database backup,eiether to use Oracle Enterprise manager DB console or thru RMAN shell script for backup..?
    Edited by: soundar on Mar 9, 2010 10:53 PMDear soudar
    I woudn't suggest you to work with EM if you want to be a professional DBA. Start learning RMAN and use CLI instead of GUI
    Those who live by the GUI, die by the GUI

  • Rman Script with ORacle10g in RHEL5

    Dear Friends ,
    I have to install ORacle10g in RHEL5 . Now I need to take rman backup
    and for this reason I make the following script :
    ============================
    rman target / << !
    run
    allocate channel t1 type disk;
    backup format 'df_%t_%s_%p'
    (database);}
    ==============================
    It works fine and does not prompt for any user name and password . But Now
    I want a situation where this script wants username and password prompt
    when it goes to run , i.e., I need username and password prompt during
    running this script ?
    Can anybdy plz help me ..

    On Linux box i tried following and it's working:
    Recovery Manager: Release 10.2.0.1.0 - Production on Sat Mar 1 03:00:46 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    RMAN> connect target sys
    target database Password:
    connected to target database: CCSDB (DBID=1595737743)
    RMAN>

  • RMAN Scripts for 9i RAC

    We have just recently started to use Oracle 9i RAC on Red Hat linux 2.1. And we are going to use RMAN for backing up the archived logs.
    Currently we have 2 node cluster and the archived logs of respective nodes are on their respective local hard disk. e.g for node1 logs are archived on /arch1 and for node2 on /arch2 individually.
    Can I have some sample RMAN scripts for backing and restoring the logs of this individual nodes.?
    An early guidance is highly appreciated.
    Thanks

    you can use the same scripts as you where running before you upgraded to RAC. The main difference is that to distribute the load you can allocate channels from other nodes. A simple backup could be done as follows:
    #rman
    #connect target /
    #connect catalog rman/cat@cat
    #run{
    #allocate channel ch1 type sbt_tape;
    #allocate channel ch2 type sbt_tape;
    #configure channel 1 device type 'SBT_TAPE' connect = 'node 1'
    #configure channel 2 device type 'SBT_TAPE connect = 'node 2'
    #backup database;
    that will work (he says) but thats the main difference, remember oracle only recommend you allocate the same number of channels as you have devices (EG if you have 2 tape drives you can allocate 2 channels to maximize effiantcy)...
    hope this helps a bit,
    Marky Mark...

  • Shell script for RMAN backup

    Hi,
    on 10G R2 in AIX 6.1
    I'm looking for Shell script for RMAN backup.
    Moreover , if we should connect like this :
    rman nocatalog target sys/password@myDB << EOF
    backup as compressed backupset format '$savdir/ctl_%d_%T_%s_%p' current controlfile;
    exit
    EOFHow to avoid writting password in shell script ?
    Thank you.

    user522961 wrote:
    Can you please tell me in case of having a catalog , how to connect to catalog without writting password in script ? I mean , how to write the following in a way without password :
    #!/usr/bin/ksh
    export ORACLE_SID=myDB
    ORACLE_ENV_ASK=NO
    . /usr/local/bin/oraenv
    export savedir=/backups/myDB
    rman target /  << EOF
    connect catalog rman/password@myrepository
    backup as compressed backupset
        format '$savdir/ctl_%d_%T_%s_%p'
        include current controlfile;
    exit
    EOF:p

  • Write a ms dos script for rman backup

    Hi all,
    i wanna write a dos batch file to take the rman backup..
    i have written one...actually there are 2 files. one is for login purpose...other one is for sql commands
    rman.bat-->
    rman target sys/sysadmin@hnbhrm @'c:\rm.sql'
    ==============================
    rm.sql-->
    configure retention policy to recovery window of 7 days;
    configure controlfile autobackup on;
    run {
    alter system switch logfile;
    crosscheck archivelog all;
    crosscheck backupset;
    backup database plus archivelog;
    DELETE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'sysdate -1';
    DELETE NOPROMPT OBSOLETE REDUNDANCY = 1;
    ========================================
    but i have problem in first file rman.bat. it doesnt run at all. but if i write sqlplus / as sysdba instead of rman thing.. then it works fine.
    can anybody tell me whats happening over there please..? Have i done this correctly? or u have some other simple way to do this...
    both files are located in C drive.. and oracle is installed to E drive... oracle path has set already.
    can anybody please give me a hand to solve this issue please...
    Thanks in Advance,
    Max

    write a ms dos script for rman backupImpossible. rman does not support MS-DOS. It is not a 16bit real mode application that can be run inside the MS-DOS operating system.
    So get your terminology straight - the Windows console is a character based 32bit virtual machine. It is not MS-DOS. It never was MS-DOS. Do not confuse the two simply because of superficial similarities. A stick-it note can be yellow - but because it is yellow does not mean it is a banana.

  • Script for RMAN backup

    kindly send the script for RMAN bacup

    Hi,
    About RMAN backup
    http://dbataj.blogspot.com/2007/01/about-rman-backups.html
    About RMAN architechture
    http://dbataj.blogspot.com/2007/01/recovery-manager-architecture.html
    About RECOVERY CATALOG
    http://dbataj.blogspot.com/2006/12/recovery-catalog.html
    RMAN backup script
    http://dbataj.blogspot.com/2007/01/hotfullrmanbkpscirpt.html
    above is my own work on RMAN you have to edit according you needs.
    regards
    Taj

  • Need Advice on RMAN backup script

    Hi;
    Can any one advice if any error or guide to make RMAN backup proper :
    Backup Policy are:
    1.     0 level backup
    2.     current log file is arvhived before backing up
    3.     backup whole database (datafiles)
    4.     backup separate control file
    5.     backup is done on disk
    6.     control file auto backup ON
    7.     only 7 days archive log are need to be preserve ; old need to be deleted
    ### one time paramters seting
    RMAN> CONFIGURE DEFAULT DEVICE TYPE TO DISK;
    RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
    RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'O:\rman\backup\Auto_Ctrl_weekly_%F';
    RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
    ### Command for weekly 0 level backup
    run {
    allocate channel c1 type disk;
    sql 'alter system archive log current';
    backup incremental level 0 tag = weekly_database format 'o:\rman\backup\full_weekly_%d_%s_%p_%t'(database);
    release channel c1;
    configure controlfile autobackup format for device type disk to 'o:\rman\backup\auto_ctrl_weekly_%f';
    allocate channel c1 type disk;
    backup tag = weekly_arch archivelog until time 'sysdate-7' format 'o:\rman\backup\archive_weekly_%d_%s_%p_%t';
    delete archivelog until time 'sysdate-7';
    release channel c1;
    Regards
    Smith

    Dear Pierre F.;
    Actually, I just added in my backup plan to have daily backup through RMAN, instead of COLD backup.
    I have planned to take cold backup once a week. here is the side of data:
    *** datafile 410
    *** size of database : 86 GM
    *** relog files size : 250MB
    *** daily archive logs are : 250MB * 4(number of files) = 1GM aprox.
    yes, time constraint is there; just because of the size of database. and we r going for 24/7
    Is this script going to run only one per week ?
    Ans: no I this was level 0 backup; i will take level 1 incremental backup with same script daily too.
    Do you have any other RMAN script ?
    ANS: no, I will modify same script for incremental.
    after local copy of backup all backup files (RMAN) will be copy over network to backup server or we can install LTO tape device to copy directly from database server.
    kindly advise me I am new in RMAN.
    regards;
    SMITH

  • Need Help in creating Unix Shell Script for database

    Would be appreciable if some one can help in creating unix shell script for the Oracle DB 10,11g.
    Here is the condition which i want to implement.
    1. Create shell script to create the database with 10GB TB SPACE and 3 groups of redo log file(Each 300MB).
    2. Increase size of redolog file.
    3. Load sample schema.
    4. dump the schema.
    5. Create empty db (Script should check if db already exists and drop it in this case).
    6. Create backup using rman.
    7. restore backup which you have backed up.

    This isn't much of a "code-sharing" site but a "knowledge-sharing" site.  Code posted me may be from a questioner who has a problem / issue / error with his code.   But we don't generally see people writing entire scripts as responses to such questions as yours.  There may be other sites where you can get coding done "for free".
    What you could do is to write some of the code and test it and, if and when it fails / errors, post it for members to make suggestions.
    But the expectation here is for you to write your own code.
    Hemant K Chitale

  • Shell script for archive log transfer

    hi
    I dont want to reinvent the wheel.
    I am looking for shell script for log shipping to provide standby db.
    What I want to do is, get the last applied archived log number from alert.log
    Copy the files from archive destination according to this value.
    Cheers

    If you don't want to re-invent the wheel you use Dataguard, no scripts.
    And your script should use the dictionary, instead of some bs method to read the alert.
    v$archived_log has all information!
    Also as far as I know, the documentation describes manual standby.
    So apparently you not only don't want to reinvent the wheel, but you want the script on a silver plate on your doorstep!
    Typical attitude of most DBAs here. Use OTN for a permanent vacation.
    Sybrand Bakker
    Senior Oracle DBA

  • Shell script for export backup in oracle 11g

    Hi,
    Oracle version 11.2.0..
    O/S-AIX
    How to write shell script for export full backup in oracle 11g and also need to remove 2 days of old backup.
    Regards,
    Raju

    How to write shell script for export full backup in oracle 11g
    Do you mean that export is your backup strategy ? is your database running in noarchivelog mode ? if so, then why ? if not so, then why not RMAN ?
    need to remove 2 days of old backup.
    If that mean remove files older than 2 days, you can use something like this :
    $ find <absolute directory path> -mtime +2 -exec rm {} \;

  • Best pratices for RMAN backup management for many databases

    Dear all,
    We have many 10g databases (>40) hosted on multiple Windows servers which are backup up using RMAN.
    A year ago, all backup's were implemented through Windows Scheduled Tasks using some batch files.
    We have been busy (re)implementing / migrating such backup in Grid Control.
    I personally prefer to maintain the backup management in Grid Control, but a colleague wants now to go back to the batch files.
    What i am looking for here, are advices in the management of RMAN backup for multiple databases: do you guys use Grid Control or any third-party backup management tool or even got your home-made solution?
    One of the discussion topic is the work involved in case that the central backup location changes.
    Well... any real-life advices on best practices / strategies for RMAN backup management for many databases will be appreciated!
    Thanks,
    Thierry

    Hi Thierry,
    Thierry H. wrote:
    Thanks for your reaction.
    So, i understand that Grid Control is for you not used to manage the backups, and as a consequence, you also have no 'direct' overview of the job schedules.
    One of my concern is also to avoid that too many backups are started at the same time to avoid network / storage overload. Such overview is availble in Grid Control's Jobs screen.
    And, based on your strategy, do you recreate a 'one-time' Oracle scheduled job for every backup, or do your scripts create an Oracle job with multiple schedule?
    You're very welcome!
    Well, Grid Control is not an option for us, since each customer is in a separate infrastructure, and with their own licensing. I have no real way (in difference to your situation) to have a centralized point of control, but that on the other hand mean that I don't have to consider network/storage congestion, like you have to.
    The script is run from a "permanent" job within the dba-scheduler, created like this:
    dbms_scheduler.create_job(
            job_name        => 'BACKUP',
            job_type        => 'EXECUTABLE',
            job_action      => '/home/oracle/scripts/rman_backup.sh',
            start_date      => trunc(sysdate)+1+7/48,
            repeat_interval => 'trunc(sysdate)+1+7/48',
            enabled         => true,
            auto_drop       => false,
            comments        => 'execute backup script at 03:30');and then the "master-script", determines which level to use, based on weekday from the OS. The actual job schedule (start date, run interval etc) is set together with the customer IT/IS dept, to avoid congestion on the backup resources.
    I have no overview of the backup status, run times etc, but have made monitoring scripts that will alert me if/when a backup either fails, or runs for too long. This, in addition with scheduled disaster/recovery tests makes me sleep rather well at night.. ;-)
    I realize that there (might be) better ways of doing backup scheduling in your environment, since my requirements are so completely different than yours, but I guess that we all face the same challenges in unifying the environments as much as possible, to minimize the amount of actual work we have to do. :-)
    Good luck!
    //Johan

Maybe you are looking for