schemacrawler / SchemaCrawler

Free database schema discovery and comprehension tool
http://www.schemacrawler.com/
Other
1.62k stars 200 forks source link

AWS or other SQL Server targets without INSTANCE NAMES will not scan #259

Closed jseaman-idata closed 5 years ago

jseaman-idata commented 5 years ago

Issue

Please explain the issue briefly

When the target SQL server db doesn't use an instance name (as is the case in AWS) the account you are connecting with must have connect access to all the databases in that instance before schemacrawler will work. And when it does work this way, even if you specify a target databaseName in your connection URL, schemacrawler scans ALL the databases in the target instance. So if some of those are forbidden, the whole scan fails.

Many instances in AWS are shared and the database credentials do not bridge DBs. This makes schemacrawler unusable in this case.

  • Provide the steps that you took to reproduce the issue

Connect using any SchemaCrawler version from the last few years including the latest.

  • Provide any steps that you took to solve the issue

no solution

  • Zip and attach the SchemaCrawler debug logs, which can be obtained by running SchemaCrawler with an additional -loglevel=ALL on the command-line argument

Environment

Specify the

  • version of SchemaCrawler that you are using

any released in the last year or so including the latest released 2 days ago.

  • version of Java that you are using

JDK 1.8

  • operating system and version that you are using

windows 10 or 2 different linux distros (forget the version)

  • relational database and version that you are using

sql server in AWS

  • JDBC driver and version that you are using

two different 4.2 drivers

"**" is the name of the db configured in the connection string, and "forbidden" is the name of the db in that instance the account does not have access to.

sql_server_attempt.zip

sualeh commented 5 years ago

Please try again with a command-line option similar to --schemas=notforbidden.dbo, and let me know how far you get. Please send me logs again if you get stuck. Thanks.

sualeh commented 5 years ago

@jseaman-idata - any updates from using --schemas?

jseaman-idata commented 5 years ago

Replacing the "schema_name" with "database_name.schema_name" did work. It must be the jdbc driver that isn't checking the "databaseName" parameter in the connection string when there isn't an instance name. Weird behavior. I do have to adjust my code to parse the database name out of the connection url, which is annoying, but easy enough to do.

Thank you for your help.

On Tue, Aug 20, 2019 at 11:19 PM Sualeh Fatehi notifications@github.com wrote:

@jseaman-idata https://github.com/jseaman-idata - any updates from using --schemas?

ā€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/schemacrawler/SchemaCrawler/issues/259?email_source=notifications&email_token=AEMBLODIWWKYF6CIILKQEI3QFSX2VA5CNFSM4ILU5TRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4YJRUI#issuecomment-523278545, or mute the thread https://github.com/notifications/unsubscribe-auth/AEMBLODI6JWBVRACKPYQCN3QFSX2VANCNFSM4ILU5TRA .

-- Jeff Seaman Senior Software Engineer IData, Inc - http://www.idatainc.com Data Management for Higher Education jseaman@idatainc.com Office: (703) 378-2110 x80 <%28703%29%20378-2110%20x825>4

sualeh commented 5 years ago

šŸ‘