cancel
Showing results for 
Search instead for 
Did you mean: 

How to create remote server to utility_db

Chris26
Participant
0 Kudos
2,179

Using ASA 16.0.0.2076

I have the following setup:

  • pc1
  • myServer1 (dbsrv16)
    • test1.db
    • ....
    • testN.db
  • pc2
  • myServer2
    • testMain.db

I am trying to create an event on testMain.db in myServer2 that connects to myServer1, calls sa_db_info() and then does something with that information. I have been able to create a remote server that connects to the test1.db on myServer1 and also calls the sa_db_info(). What I would like to do is to connect to the utility_db, instead of connecting to test1.db (as I am not sure test1.db will always be there).

myServer1 is started with "-su sql" so a password for accessing the utility_db is set.

If I create the server like this:

CREATE SERVER "Test1Remote" 
CLASS 'SAODBC' 
USING 'DRIVER=SQL Anywhere Native;UID=dba;PWD=sql;Server=myServer1;DBN=test1;ASTART=No;host=myhost1:2638' 
READ ONLY;


The test connection from Sybase Central works.

If I create the server like this:

CREATE SERVER "Utility_dbRemote" 
CLASS 'SAODBC' 
USING 'DRIVER=SQL Anywhere Native;UID=dba;PWD=sql;Server=myServer1;DBN=utility_db;ASTART=No;host=myhost1:2638' 
READ ONLY;


I am getting an error when I test the connection from Sybase Central:

[Sybase][ODBC Driver][SQL Anywhere]Server 'Utility_dbRemote': [Sybase][ODBC Driver][SQL Anywhere]Permission denied: you do not have permission to execute a statement of this type
SQLCODE: -660
SQLSTATE: HY000
SQL Statement: SELECT FIRST table_name FROM dbo.sp_remote_tables( 'Test1Remote', NULL, NULL, NULL, 1 ) ORDER BY 1


What do I need to do to make this work?

Accepted Solutions (1)

Accepted Solutions (1)

Breck_Carter
Participant

You cannot make it work because SELECT ... FROM is not one of the allowed statements for the utility database.

The underlying reason is this: There is no physical database associated with the "utility database", and without a physical database you don't have any stored procedures or tables.

However, the answer to your question "How to create remote server to utility_db" is this: You have already created the remote server, and it works, otherwise you wouldn't be getting that error message.

Answers (0)