It looks like the agent cannot find sqlplus. Make sure you load the environment settings of the oracle user at the beginning of your script.
are you trying to run sql against only the bladelogic db?
yes im trying to get some value from Bladelogic database , like ip and hostname ,..etc
you should be using the blcli, you should not be running sql queries directly against the db.
what specific information are you trying to get?
am trying to get the 3 things :
1- the ip address of vm
2- OS type
3- crq id
if i have other db in other server , how can i run this sql queries in NSH script
1 of 1 people found this helpful
What is a ‘crq id’ ?
There other 2 should be handled by:
Blcli Server printPropertyByName servername IP_ADDRESS
Blcli Server printPropertyByName servername OS
we have a server provisning process and useing bladlogic script we run scripts to the provisining server , as last step I have to access the BL database and get more than 6 parameter to send it to QA server,
AD windows or ALDP linux
crq id "the process provisining number "
i have to use the NSH script to get all parameter from DB, i run my script direct in the aplication server and i got the result , should i change the path or add sql commant to bladelogic consol.
you should not use the sql script to get this information. you should be using the blcli. all of the above information can be obtained using the blcli.
Having to rebuild a BladeLogic environment from scratch because you corrupted the database isn't fun. Just use the CLI. If you need access to Java or Python commands in your scripts there's always Jython.
Hi all ,
I get the soluation for this problem, we have to insert the sql path and insert the sql souers in the code , so we can use the NSH job to get any thing from Database
thank you all
please use the blcli to get this information. you should not ever use direct sql queries against the bladelogic database. you run the risk of corrupting the database, or at the best case pulling incorrect data because you do not understand the data model correctly.
why do you have resistance to using the blcli ?
Baha, you are not going to get support to do an expressly unsupported activity via this, the vendor’s, website. I would suggest that since you do not know how to use NSH to run sql queries against a database, that you also do not fully understand the ramifications of directly modifying the data of that same system (which is several order of magnitude more complex). If Bill or I do not modify the database directly, I would reconsider your approach.
I wouldn't ever try to modify the database directly, but I have considered running simple SELECT queries against it. Would that really cause many problems? In many cases (not this one of course) the CLI is limited and Jython examples are sparse at best.
In many cases, running simple queries against the database has been helpful to me in figuring out the undocumented CLI commands.
You should look at the unreleased blcli – there are many more commands you can run there to do things. There’s a ‘document’ on the scripting community about those.
Running selects won’t cause problems – the only issue is that you might not get back the correct data, depending on what you are trying to query for – most of the objects in blade are versioned so you may run a query and pull information about the wrong object. also trying to pull property values from an object (for example) is not straightforward.