I would like to know how to do this: Environment: UNIX I would like to write a script which can be scheduled to run on a remote machine. It would read the DB details (which is residing on another machine) from a config file which looks like this:
user=
pass=
product1_SID=
product2_SID=
...
开发者_如何学运维Each product has its own database files. So the script should retrieve the details like this:
1. Connect to the remote DB.
2. foreach(SID_in_config_file){
retrieve details from dba_data_files
send Resultset to log
}
3. Close connection
If you want to Automate the Remote DB Monitoring...which it seems to be....why don't you use TNS entries for each database rather than Product_SIDs. You could easily connect to the databases remotely using TNS entries (all you have to do is put the TNS entries on your source box TNS file).
精彩评论