cancel
Showing results for 
Search instead for 
Did you mean: 

How could I execute the "SQL Command" In Brtools and schedule via Cron.

Former Member
0 Kudos

How could I execute the "SQL Command" In Brtools and schedule via Cron. I am using EP so I can not do that from DB13

Accepted Solutions (1)

Accepted Solutions (1)

JPReyes
Active Contributor
0 Kudos

Is not an SQL command... when you use brtools you get a field called "command line" like for example when using brtools for a backup you can find the command line prior execution...

BRBACKUP command line (command) ... [-p init<SID>.sap -d tape -t offline -m all -k no -e 0 -l E]

Then you can use the command line to call br* directly from command prompt, without using the menus, for example

brbackup -p init<SID>.sap -d tape -t offline -m all -k no -e 0 -l E

You can use that command line to create a script and then schedule the script via CRON

Hope is clear now

Regards

Juan

PS: I edited you past [thread|; to correct it.

Answers (1)

Answers (1)

Former Member
0 Kudos

I don't think that you can execute custom SQL commands via BR*TOOLS.

You can execute SQL Commands using SQLPLUS and schedule them via Cron. For example,

Create a file named test.sql with following content ... do using ora<sid> user (not mandatory but recommended)

select * from v$instance;
quit;

now u can execute it using this command ... you can also use user/password combo

sqlplus "/ as sysdba" @test.sql

For scheduling using Cron, you can refer your OS specific steps ... generally it's added using

crontab -e

.. also you need to use output redirection.