I am a complete newbie to Oracle SQL Developer and I'm trying to make my database accessible remotely. I have a virtualbox setup with my database and I can access it in My Sql Developer through my OS and through my linux image but having trouble getting others to. I think I may not have it configured correctly to allow other users to access it. I have created usernames and passwords but the hostname and port information I either don't have setup correctly or I have the wrong information. Hostname is telling me is localhost.localdomain which doesn't seem right. Any help would be greatly appreciated. Thanks!
The host port needs to be forwarded to the VM's port. Here's the VBoxManage command to do that.
$VBoxManage modifyvm "Oracle Developer Days" --natpf1 "tns,tcp,127.0.0.1,1521,,1521"
Then 'localhost' will work from the host
$ sqlplus system/oracle#//**<<<<hostip address>>>**:1521/orcl
SQL*Plus: Release 10.2.0.4.0 - Production on Fri Sep 24 11:29:03 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select 1 from dual;
1
----------
1
Then it's up to your machine's firewall settings to allow other machines to connect to your host on that port.
Related
I have been using this connection string with no problem on a number of databases and MS operating systems. Windows Server 2003, 2008 R2 and 2012 R2 Eval, all Express versions.
I am now trying to deploy to a new Windows Server 2012 R2 installation and I am getting some errors. I have the SQL Server 2008 R2 installation on the Windows Server 2012 R2 machine.
My con string:
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\myDB.mdf;Integrated Security=True;User Instance=False" ProviderName="System.Data.SqlClient"
I think this must have something to do with the installation sequence of the components on the new server.
I have in the past been able to simply copy myDB.mdf to basically any web server and open or access the DB tables. This DB includes an ASP membership for the web site that it is tied to.
Here is the error:
CREATE DATABASE permission denied in database 'master'. An attempt to
attach an auto-named database for file
C:\inetpub\techTran\App_Data\myDB.mdf failed. A database with
the same name exists, or specified file cannot be opened, or it is
located on UNC share.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: CREATE
DATABASE permission denied in database 'master'.
I thought I understood what this error was. I have checked permissions and they match the other servers where this database has been deployed. My SQL Server installations are basically all the same. The only difference here is that this is Windows Server 2012 R2 on a VM. Or I did not install the SQL Server 2008 R2 the same way I have done in the past 5 servers I have set up. (Which I am guessing is probably the case.)
UPDATE: Uninstalled and reinstalled SQL Server and SSMS.
I know there is only one database name on the server called myDB.mdf, so I don't believe the "same name" portion of error. I have added security to the db so that it can be opened and I even installed Visual Studio 2012 on the server to be certain that the db could be opened. I can run the full app on the localhost (server 2012) but I can not access it over a web connection.
I believe the specific error message relating to
CREATE DATABASE permission denied in database 'master'
is the issue.
I have never seen this error before.
I typically assign NETWORK SERVICE account to the database to allow access and this is how this one is set up as well. I also thought this might be a connection string issue. But this same string has worked on 4 different servers now with no changes. Server 2003, 2008 R2, and 2012 (demo platform)(all Express versions), now in production this is failing.
The home page loads and then the login throws the above error.
Your connection string says AttachDbFilename=|DataDirectory|\myDB.mdf. Well, your path must have changed in one place (SQL Server) and not the other (app configuration). AttachDbFilename will try to create a new DB if it can't find that file. That's probably your error.
As an aside, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, and Windows Server 2012 R2 all have differences, especially with security and in particular with how SQL Server behaves, but you keep using them interchangeably. That makes it very confusing to tell what's going on. Also, your connection string says Data Source=.\SQLEXPRESS. Is this SQL Server Express? Because that has important differences with most other editions of SQL Server, too. More recent editions are very similar to Standard edition, but the older the edition, the more quirks it has. They're generally considered different beasts.
SOLVED: I am not sure how this happened or perhaps why it didn't happen. But for some reason the installation of SQL did not add the NETWORK SERVICE account to the sysadmin Server Role. I cross referenced this with the SERVER 2003 installation where SQL 2008 R2 is also running, and discovered that the sysadmin SQL Server Role included NETWORK SERVICE in my correctly functioning environment. So once I added the user account to this role, everything came up fine.
I believe this might have been an issue during the installation of SQL 2008 R2. I did specify NETWORK SERVICE, but for some reason it was not provided the role.
I want to connect to a remote SQL Server 2008 R2 instance installed on a remote Windows Web Server 2008, using SQL Server Management Studio Express. Can someone provide me all the necessary steps? I read some answers here, but nothing seems to work. I'm confused as to where (locally or remotely) to enable the SQL Browser, set TCP/IP ON, specify port 1499 etc.
enable SQLBrowser
open 1433 default port (in your case it may be different but 1433 is default)
enable SQL Server authentication for your instance
restart your SQL Server instance
Make sure your domain (sql server instance) is publicly/remotely accessible
From SSMS enter your SQL Server instance url/IP address
enter your credentials
this should be all.
I tried connecting to a running sphinx instance and it connects normal:
XXX#XXX:~$ mysql -P 9306
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 52
Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
But no SELECT could be executed. I got "database not selected" error. Then I tried to kill sphinxd and after killing it I could not connect to port 9306, so I assumed, that I connected normaly...
Why can't I do select data from index? I confirmed many times and the index is present and is searchable.
I found the reason. If you looked carefuly at the server version you will see:
Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu)
So I connected to Mysql instead of sphinx. Why? Because I did not specify the host and it used mysql socket at '/var/run/mysqld/mysqld.sock'. You need to specify the host correctly:
XXX#XXX:~$ mysql -P 9306 -h 127.0.0.1
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 2.0.5-id64-release (r3308)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
I am trying to setup PostgreSQL and allow only certain Windows users to access the data from the database. Setting up Windows Authentication is Quite easy with MS SQL, but I can't figure out how to set it up in PostgreSQL.
I have gone through the documentation at http://www.postgresql.org/docs/current/static/auth-methods.html
and edited the pg_hba file. But after doing so, the PostgreSQL service fails to start.
Is the Postgresql server running on Windows as well as the clients then you might test with this to see if this works:
host all all 0.0.0.0/0 sspi
Magnus Hagander, a Postgresql developer, elaborates on this:
"All users connecting from the local machine, your domain, or a trusted domain will be automatically authenticated using the SSPI configured authentication (you can enable/disable things like NTLMv2 or LM using Group Policy - it's a Windows configuration, not a PostgreSQL one). You still need to create the login role in PostgreSQL, but that's it. Note that the domain is not verified at all, only the username. So the user Administrator in your primary and a trusted domain will be considered the same user if they try to connect to PostgreSQL. Note that this method is not compatible with Unix clients."
If you mix Unix-Windows then you have to resort to kerberos using GSSAPI which means you have to do some configuration. This article on deploying Pg in Windows environments may perhaps lead you in the right path.
If anyone else encouters this like I did so starting from 9.5 you wil need to add an optional parameter both to the ipv4 and ipv6 in order for this to work
include_realm=0
so the whole thing will look like
host all your_username 127.0.0.1/32 sspi include_realm=0
I'm working on a legacy software and sundenly it became a requirement to run interbase server (Interbase 2007) logged with a restricted user.
We tried this here (not me) but no client is able to connect to the server, including IBConsole, like no Interbase server were instaled. Even whether both running in the same computer.
Is it possible to run Interbase 2007 server with a windows user with restricted access?
The client can connect as a restricted user, but the server is a Windows service, and you need to be the Administrator to install that. You should configure InterBase to start automatically.