Navicat access for Heroku database - heroku

I'm having troubling accessing a free Heroku database (Dev plan) through Navicat.
When I connect I can see a long list of databases, much like here http://twitter.com/bazscott/status/290780256221147136, but I cannot find my particular database in the list, neither can I connect to any of the others.
Is this because I'm using a free database plan, and only paid plans allow Navicat access?
PS. I have no problem accessing my database through heroku pg:psql.

Related

Database Link - Test connection does not work

I have two databases that have tables with identical schema. I want to compare the two tables. I learned that cross DB queries need a Database Link.
I use SQL developer and here are the properties of the connection that works
Connection Name: MyConn
UserName:SomeUser
password:SomePassword
Connection Type: Basic
Role: default
Host Name: 12.12.12.12
port:2521
SID: xe
I tired this command to create Database link
CREATE DATABASE LINK MyDBLink
CONNECT TO SomeUser
IDENTIFIED BY "SomePassword"
USING '(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=12.12.12.12)(PORT=2521))
(CONNECT_DATA=(SID=xe)))';
The command creates a link but when I try to test the link, the connection does not work. The connection times out in 60s.
Am I missing something ?
The Database-Link is between the two databases and not "outgoing" from your local sqldeveloper/client.
So even if you can reach the remote database from your local client, the remote database-server where you created the link might (and in this case indeed does) not reach the target of the database link.
The database link itself is created no matter if the remote database is reachable, or the credentials are incorrect, etc.
If you have the possibility you should directly log on the database server of the database where you created the link and check the network connection to the database server you want to reach from there. Using telnet might help you.
The best solution is to look at the network or operating system and open a path between the two servers, and then the database link should work. If that's not possible, you can use your desktop PC as a proxy.
The official way to route around network issues is to use Oracle Connection Manager. But in my experience that program is a bit hard to configure.
Another option is to create a database on your desktop, and create two database links to each server. If this desktop database is only used for linking to others, then the free Express Edition should be good enough. If you go down this route, be careful of performance problems when involving 3 databases. You'll probably want to compare hashes instead of actual data, to avoid network problems.

heroku postgresql wih multiple users and permissions

For security reasons i have a heroku project that should access a heroku postgresql database but user can only access some tables.
How can i do this on heroku postgresql?
The only way i can think of doing this is:
creating a web project with a postgresql dev addon. this will create a new db in a HEROKU_COLOR_X url;
creating another web project with another postgresql dev addon multiple times so that this HEROKU_COLOR_* is same as previous HEROKU_COLOR_X;
login in HEROKU_COLOR_X with user_2 (admin) create some tables as user_2 and grant access to user_1 for some tables only.
this will result in same db host (HEROKU_COLOR_X) and 2 user/pass (user_1 for web project access and user_2 for db full access).
.. but is there any better solution?
best,
I'm not sure about your theory but unfortunately, the Heroku Postgres docs state:
You cannot create or modify databases and roles on Heroku Postgres.
The SQL below is for reference only.
I'd love it if this restriction could be changed or worked around as granular permissions are a security essential.
gerryster's answer is no longer accurate as Heroku have now released support for multiple roles https://devcenter.heroku.com/articles/heroku-postgresql-credentials This should cover the OP's use case of restricting access to certain tables.

Oracle database, moving changes between databases

We have application where all logic is implemented in oracle database using pl/sql.
We have different oracle databases for development and production.
When developer make changes in development database after testing we move changes from development database to production database using schema compare tool of toad. Problem here is that developer must have password of production database. We want only admin to know this password.
Can somebody advice me better way of moving changes between databases without need of having production database password, what is best practice for this ?
I posted this question on oracle OTN forums and got some advices there. Maybe it will be interesting for somebody.
Her is a link
I do not recommend to use comparison tools for generating of database migration scripts.
Development and production databases (and also test databases) must be identical except for current changes made by developers in development databases. Generally speaking this assertion is not correct, because there are many kinds of differencies between development and production databases, e.g. partitioned objects, additional objects for audit (triggers, tables), replication-based objects (snapshots), different tablespaces etc.
Every developer must know, what changes were made by him and applied to development database.
If developer was able to change schema and data in developer database, then he/she must be able to create programs for these DDL and DML changes.
To delegate the same developer an ability to run these migration programs on production database is a bad idea. But if you don't have a better way of database migration, then you can use one of following:
1. Configure Oracle authentication by OS. OS authentication allows Oracle to pass
control of user authentication to the operating system.
2. TOAD can save passwords without disclose them. DBA will insert required password
to local TOAD installation at developer PC (if developers use PC).

Heroku psql lists hundreds of weird databases

So when I go into "heroku pg:psql" and type \l I get this:
What's the deal with that?
On dev and basic plans, your postgresql database is shared with others on the server.
Therefore, you are not the only one on this server, there are other users.
These databases you're seeing are the other users' databases.
You can't access them. But you can know they are here.

Can't use PSQL with a Heroku shared database

I'm developing an application and hosting it on Heroku. For now, I want to use the free shared database solution.
My problem is that I can't access the database.
$ heroku pg:psql
! Cannot ingress to a shared database
I've read elsewhere that I can't connect to shared databases via psql.
I can't seem to find any information on that on Heroku's Dev Center, so this leaves me with the question - how can I edit or change or do anything with my database?
If you're happy to use a beta addon then there is the Heroku Shared PostgreSQL 9.1 addon (https://addons.heroku.com/heroku-shared-postgresql) which will permit you to ingress to your database.
However, any changes to your database are usually best done with scripted migrations (in the Ruby on Rails world) rather than connecting to your database to make changes.
If you're more familiar with mySQL then there are a number of mySQL addons which permit direct access also with normal mySQL tools.

Resources