I want to login to a database by running an SQL file from a unix script without supplying username and password (as root)....is this possible?
Database is oracle
feedback
|
|
You can define your database users as being OS Authenticated. Tim Hall's Oracle_Base site has a good primer on how to do this. You don't need to allow folks to log in with SYSDBA privileges, a recipe for disaster. | |||||||
feedback
|
|
If your user is in the oracle group, he can connect as SYSDBA. Example on a Unix env:
That might be something of an overkill for a batch (besides the fact that you have all privileges to screw up your db). However AFAIK, that's the only option. UPDATE Given DCookie's answer, this is not the only way. And as I already mentioned and underlined by DCookie this is a very risky path. | ||||
feedback
|
|
If using PostgreSQL then you can specify the "trust" method for your localhost network in the "pg_hba.conf" file. For MySQL there may be something similar, I'm not sure (hopefully someone here who's familiar with whatever database you're using can help with this if it's not PostgreSQL). | |||
|
feedback
|