We deploy a number of oracle databases every year and a good percentage of them require a dataguard configuration.

I've developed a script which is able to perform the database synchronization very well:

  1. modify init.ora / generate spfile
  2. generate listener.ora
  3. generate tnsnames.ora
  4. create standby control file
  5. create standby redo log
  6. gather all files in a tar ball ready to be shipped to the standby server.

On the standby server another script:

  1. Dispatch the files different data files, control files, redo logs to where they must be
  2. Modifies the init.ora and generate the spfile
  3. generate listener.ora
  4. generate tnsnames.ora
  5. run the recover managed standby database command

Then I hit a wall on data guard manager :( How can I automate its configuration.

It would be really great if I could do something like this:

dgmgrl sys/manager -e "create configuration broker1 as primary database is 'primary' connect identifier is to_primary;"

I haven't seen anything like that.

Anybody has an idea of what could be done to perform this automatically?

  • You can use something like dgmgrl user/pass@db <<EOF show configuration exit EOF
    – user33532
    Commented Jan 29, 2014 at 14:18

1 Answer 1


Actually, never mind, I've just found the answer ^^

I just had to google the right thing! http://docs.oracle.com/cd/B19306_01/server.102/b14230/dgmgrl.htm

8.1.1 DGMGRL Optional Parameters

DGMGRL sys/knl_test7@primary "show database 'North_Sales'"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.