connecting as SYSDBA using roundhouse - roundhouse

I want to connect as sysdba using roundhouse, already tried
conn.ConnectionString = "Driver={Microsoft ODBC for Oracle};SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521))(CON
NECT_DATA=(SERVICE_NAME=orcl)));uid=scott;pwd=tiger**;as sysdba**"
gut got this exception
RoundhousE encountered an error.
System.ArgumentException: Format of the initialization string does not conform t
o specification starting at index 202.
at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionSt
also tried
conn.ConnectionString = "Driver={Microsoft ODBC for Oracle};SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521))(CON
NECT_DATA=(SERVICE_NAME=orcl)));uid=scott;pwd=tiger;**DBA Privilege=SYSDBA;"**
but then the exception was
RoundhousE encountered an error.
System.ArgumentException: Keyword not supported: 'dba privilege'.
Any suggestions?
Thanks in advance

You can use the ConnectionStringAdmin setting of the <Roundhouse> element to set the administration connection string. I tried using the System user but ran into different issues. I've asked the question on Stackoverflow here and on the project page here.
My issue was more related to creating a new database though, but the configuration settings that I have specified there might work for you.

Related

Not able to access the Database

I have database and webpages related to it are uploaded on server but not able to access the database from server but when run on local machine through VS2010 i was able to access it.
Asked Server Admin also about the problem but they told that everything is fine from server side there is problem in code they are saying.
The following error i'm getting:
Server Error in '/' Application.
Invalid object name 'Login'.
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: Invalid object name 'Login'.
Source Error:
Line 20: SqlCommand com = new SqlCommand("select Password from Login where Username='" + Uname_txt.Text.Trim() + "'", con);
Line 21: con.Open();
Line 22: SqlDataReader dr = com.ExecuteReader();
Line 23: try
Line 24: {
If everything is working locally, then problem is definitely in how you've setup connecting to the database on the server.
So, look at connection string in web.config and make sure that it is setup properly (if using Integrated Security make sure appropriate APP POOL is allowed to access database).
Also, make sure Login table is indeed created in the database.
Once you do all that you have lots of things to follow up with:
Stop using reserved keywords in SQL expressions (Password, Login, etc) or at least wrap them in brackets like [Password].
Try to get in habit of referencing schema when working with tables (dbo.Login instead of just Login)
Extract queries like that in Stored procedures so that you are not vulnerable to SQL Injection
You have not posted the connection String, I suspect, you have not supplied the INITIAL CATALOG in connection string, because of which it is directly connected to Master Database and of course your table not exists in Master.
INITIAL CATALOG = should be added in your connection string. I hope this will help you.
Note: You can also use DATABASE = in connection string.

Failure to connect to odbc database in R

I've been trying to connect my company's DMS to R using the odbcConnect command, but get the following message:
myConn <-odbcConnect("NZSQL", uid="cejacobson", pwd="password")
Warning messages:
1: In odbcDriverConnect("DSN=NZSQL;UID=cejacobson;PWD=password") :
[RODBC] ERROR: state IM002, code 0, message [unixODBC][Driver Manager]Data source name not found, and no default driver specified
2: In odbcDriverConnect("DSN=NZSQL;UID=cejacobson;PWD=password") :
ODBC connection failed
The thing is, I'm positive the Data source name is NZSQL and my uid and password are correct as well. Any insight as to why R may not be finding my data source / driver (the driver is, by the way, specified and working).
How can I fix this?
I ran across this same problem when I was first trying to connect to an Oracle database. In the end what worked for me was using odbcDriverConnect and a connection string instead of odbcConnect.
myConn <-odbcDriverConnect("Driver={Oracle in OraClient11g_home1};Dbq=NZSQL;Uid=cejacobson;Pwd=password;")
You can check on https://www.connectionstrings.com/ for your specific connection string for your database. Mine happened to be this one.
Hope this helps.
This is IM02 error which means name of the DSN is incorrect.
GO to ODBC and check the USER/System DSN that you should be using. Once your name of DSN is correct, you might get IM014 state error which is archtecture mismatch. In that case,
The simpler solution is
IN r studio - go to tools and change the version of R to 32 bit.
It should be ready to work
I was trying to access SQL Server database and got the same error. After using the correct format of db connection, I got access to my sql server database.
dbhandle <- odbcDriverConnect("Driver={SQL Server};Server=mydbhost;Database=mydbname;Trusted_Connection=Yes")
I know this is old but also make sure that you remove the spaces around the '=' sign. That was my problem.
What worked for me was a 32 bit connection instead of a 64 bit connection.
I just spent days on this. If you are using a Microsoft Access database you have to use the full path to the database, it won't even find the file in the same folder.
So from the above question,
myConn <-odbcConnect("NZSQL", uid="cejacobson", pwd="password")
Would need to be something like
myConn <-odbcConnect("c:\\NZSQL", uid="cejacobson", pwd="password")
Phil's link really helped:
https://www.connectionstrings.com/
I had the same problem, what helped me was to add the driver manually:
Search for ODBC Data Source Administrator and click the 64 bit option
Click on "dBASE Files" and then "Add"
Double click on "Oracle in XE"
Fill Data Source Name (NZSQL in your example) and TNS Service Name fields.
Click on Ok.
After that you may go to RStudio again and you will be able to connect using odbcConnect().
I just used R x64 (64-bit) instead of R i386 (32-bit) and it worked

SQL Connection Forcibly Closed

I'm having difficulty with an SQL query against Server 2008 from IIS7. I have a VB.NET class library which runs an update statement. The underlying code used to create the connection hasn't changed, but suddenly the query is failing in our testing and development environments. It does, however, still work against the same server/database using the slightly older code in our production environment.
I've tried setting the connection timeout in the web.config and I'm at a loss to explain the cause.
The basic structure of the query is:
Dim conn = New SqlConnection()
conn.ConnectionString = "Data Source=someserver\sqlexpress2008;Initial Catalog=DatabaseName;User ID=sa;Password=pass"
conn.Open()
Using cmd As SqlCommand = conn.CreateCommand()
cmd.CommandText = "UPDATE ..."
cmd.Parameters.AddWithValue("#UName", user.name)
cmd.ExecuteNonQuery() 'fails with error
End Using
The error is:
A transport-level error has occurred when sending the request to the
server. (provider: TCP Provider, error: 0 - An existing connection was
forcibly closed by the remote host.)
I've tried restarting IIS and the SQL server and I'm totally out of ideas. I just need a fix
You need to open the connection before calling SqlCommand.ExecuteNonQuery(). You do this by calling SqlConnection.Open().
Dim conn = New SqlConnection()
conn.ConnectionString = "Data Source=someserver\sqlexpress2008;Initial Catalog=DatabaseName;User ID=sa;Password=pass"
Using cmd As SqlCommand = conn.CreateCommand()
cmd.CommandText = "UPDATE ..."
cmd.Parameters.AddWithValue("#UName", user.name)
conn.Open()
cmd.ExecuteNonQuery() 'fails with error
conn.Close()
End Using
Also, ensure you database isn't in single user mode.
This helped another person who was stuck recently. You could examine the problem from the database server by setting up a SQL Server Profiler.
You can find lots of info about SQL Profiler by just googling around. Here's a site with a video that might help you get started. For starters, you would be able to see if the request is even reaching the database server.
This was a nightmare to track down. It turned out to be cause by a horrible quirk in VB.NET. Nullable datetimes seem to be coerced to DateTime.MinValue, which resulted in a DateTime.MinValue being inserted into an sql datetime. The fix was to check for either !property.HasValue && property.Value != DateTime.MinValue when setting the parameters for the command.
This is a network-level error. The database server is killing the connection for some reason. In order to troubleshoot this, I would open a connection using SSMS to the DEV and TEST servers and make sure that I can run simple queries w/o problems. It's unlikely that the issue is your library since you would be getting timeout or some other kind of errors.
as Lcarus, said, database server is killing the connection for unknown reason.
you can check the logs, to verfiy. Log path will be C:\Program Files\Microsoft SQL Server\<your instance>\MSSQL\LOG
from MSDN Blog MSDN Blog
this will occur when A connection is taken from the connection pool,
the application does not know that the physical connection is gone, an
attempt to use it is done under the assumption that the physical
connection is still there.

Provider error '80004005' Unspecified error

I know this question has been asked before but i can't seem to see from the other posts what this could be i don't know asp i have just been uploading images and changing the database and re uploading via FTP but now i have come across a error
Provider error '80004005'
Unspecified error
/Includes/DB/DatabaseConnect.asp, line 8
<%
Dim espostiDB
Set espostiDB = Server.CreateObject("ADODB.Connection")
'espostiDB.ConnectionString = "DSN=esposti.dsn"
'espostiDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("db\esposti1.mdb")
espostiDB.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db\esposti.mdb") ')e:\inetpub\wwwroot\esposti\esposti.mdb"
'espostiDB.ConnectionString = "DSN=esposti.dsn"
espostiDB.Open
%>
line 8 is espostiDB.open
Database is Access 2000
Help Much appreciated
Jack
This is how I solved this problem, the exact same error. Went to Control Panel - Administrative Tools - Internet information Services. On the right click View Application Pools and for both "Classic NET AppPool" and "DefaultAppPool" set v4.0 network framework version. If it's set to v2.0 the error above will show up.
Working with your code above, you could use this:
<%
Set espostiDB = Server.CreateObject("ADODB.Connection")
connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("~\db\esposti.mdb")
espostiDB.Open connStr
%>
The info here will also give you some pointers of how to work Server.MapPath (in case your mdb file is not in the root of your website).
80004005 errors can be numerous things, one thing to check is that the database is not currently in an open state and therefore locked, so every time you open a connection you need to make sure that you close it. An easy way to check this is to check if there is an Access lock file (.ldb) file in the same folder as the database.
Check that you've not inadvertently changed the path so it's now incorrect (a Response.Write(Server.MapPath("db\esposti.mdb"))) should print the full path.
Also, worth recycling the IIS app pool, sometimes connections remain open in IIS and the database becomes unresponsive, this can be a sign you're not closing connections properly.
The cause of this conflicts looks to be 32 Bit Application running on the 64 Bit. Please make sure that the ODBC connection is described at C:\Windows\SysWOW64\odbcad32.exe

What connection string do I use for Classic ASP and Oracle 10g?

I have Oracle 10g and have installed ODBC via the instant client. I am able to use the ODBC administrator and set up a DSN and test successfully, and whenever I use Microsoft Access I can connect to my database no problem. I can also use Visual Web Developer to traverse the data.
But, when I try and use Classic ASP with:
myConn.Open "DSN=oracle10g;" & _
"Uid=myOracleUsername;" & "Pwd=myOraclePassword"
I get:
-2147467259Specified driver could not be loaded due to system error 5 (Oracle in instantclient10_2).
An error occurred while trying to create Server Object.
I have searched various places but nothing seems to work. All ORACLE_HOME, TNSnames, IUSR_X security, all is correct. I am thinking it is a DSN connection string problem.
Anyone know?
Try using the following DSN-less connection string:
myConn.Open "Provider=MSDAORA;Data Source=instance_name;User ID=myOracleUsername;Password=myOraclePassword"
I've used this exact connection string for older version of Oracle client, but can't see any reason why it won't work for your version as well.
try this :
provider=OraOLEDB.Oracle

Resources