Can't login to Oracle SQL Command Line - sql

I tried to find answer to this question but I didn't find any.
I just installed Oracle 11g XE2 on Windows 8.1 PC.
then, I could login to Application express at http://127.0.0.1:8080/apex/apex_admin with username: ADMIN and password given at time of installation.
But when I try to use same username/password to login to SQL command line through start menu (from same local computer) it gives me
ORA-01017: invalid username/password; logon denied
Failed attempts
So, I created a new workspace. while creating workspace it let me create new schema and administrator user for schema.
Then, I again tried to login to SQL command line using following command and new user credentials but still can't login.
CONNECT username/password
I tried to create new user form Application express home->workspace Task->create user with Account privileges as
Workspace INTERNAL
Default Schema APEX_040000
User is an administrator: No
User is a developer: Yes
Application Builder Access Yes
SQL Workshop Access Yes
Team Development Access Yes
Account Availability Unlocked
but I still can't login to sql command line with new user and same command
CONNECT username/password
this is the first time I am trying to install a database. Please help me.
Thanks.

Related

sqlplus ORA-01017: invalid username/password; logon denied

on my windows 10 system every time I attempt to login I see the following error.
ORA-01017: invalid username/password; logon denied
During the install process I was not asked to create any users. I do seem to recall that I was asked to enter 'Oracle_1' as the admin password but I was not asked to enter an admin userid. I could not login with that id.
I was able to start a sqlplus session by executing "sqlplus /nolog". However, once in the session I really could not do anything, even a help command failed because I was not connected to a database.
On windows 10 how do I create a user that will enable me to successfully login and manipulate database tables ?
In Eclipse on a Tomcat server, the config file is under Overview>Open Launch Configuration> Arguments Tab> VM arguments. Make sure the keys for -Ddb.user and -Ddb.password are correct. Also check the information in c:\users\\config\customProperties\startup\application.properties. Perhaps someone more experienced may chime in based on your current set-up.

Microsoft SQL Server Management Studio dbcreator permission

RE: Permissions
Program - Microsoft SQL Server Management Studio v.17.1
When attempting to create a new database through Object Explorer, I get the following error:
Screenshot #1
To fix this, I did the following and got another error:
Screenshot #2
I have searched the internet and all posts and articles say that I need to log in as administrator or SA. I am logged in as administrator and still can not gain permission to create a database.
How do I assign permission to the SA account to create a new database?
Problem here is that you are logged in with the local Windows Administrator account. You have two logins for your SQL Server instance as can be seen in your Image #2. One is SA (SQL Admin). The other is BUILTIN\USERS. That is a default group which every user that logs into the machine will be a part of. But unless you give that group permissions, or create other logins (I recommend this), you will be very limited to what you can do.
As you have found, that user group cannot modify permissions, especially for the SA user. The SA user is special, you cannot modify SA permissions at all. This is why you are receiving errors (partly because you don't have permissions to change them with the user you are logged in as, and partly because SA permissions cannot be modified).
The resolution to your issue is to login with the SA account. You will need to choose "SQL Login" at the login screen, as opposed to Windows login. SSMS will prompt you for a password. This password was configured by the person who installed the SQL instance. If the person who installed SQL Server did not specify a password, it will be most likely be a blank password or "Password123".
Once you are logged into the SA account, you can create new SQL or Windows Authentication logins and and provision them permissions as needed.

How to add username and password in sqllocaldb

I am going to start work on new Desktop application. There is I want to use light weight and standalone database so that I am going use SQL LocalDB but I want to add authentication. There I need username and password before accessing database but authentication not applied there please help me how can I do it.
If we cannot add username add password in SQL LocalDB then please suggest me any another database that will best for me and also I can use entity framework with that.
Thanks in advance
To add your new DB user to your MSSQLLocalDB you need to connect to it and execute this:
CREATE LOGIN your_user WITH PASSWORD = 'your_password';
CREATE USER your_user FOR LOGIN your_user;
EXEC sp_addrolemember 'db_owner', 'your_user'
Then you will be able to connect to MSSQLLocalDB database engine with SQL Server Authentication using these credentials.
Server name: (LocalDB)\MSSQLLocalDB
Authentication: SQL Server Authentication
User: your_user
Password: your_password
Or you can use instance pipe name instead of (LocalDB)\MSSQLLocalDB as a Server name (see below where to get it).
Initial connection to your local DB from SQL Server Management Studio (SSMS)
Initially to run the SQL command above you need to connect to your MSSQLLocalDB with Windows Authentication. You can do it in two ways (try the second if the first one won't work by default).
Using instance name
Server name: (LocalDB)\MSSQLLocalDB
Authentication: Windows Authentication
Using instance pipe name
From the command line go to C:\Program Files\Microsoft SQL Server\130\Tools\Binn\ (you might need to use other versions and replace \130\ with your folder name) and run SqlLocalDB.exe to find the local DB instances you have:
SqlLocalDB.exe i
Make sure you have MSSQLLocalDB listed. Then run this command to see the MSSQLLocalDB status (the first line) and start if it's stopped (the second line):
SqlLocalDB.exe i MSSQLLocalDB
SqlLocalDB.exe start MSSQLLocalDB
Then you can execute SqlLocalDB.exe i MSSQLLocalDB again to see the the instance pipe name. Something like this np:\\.\pipe\LOCALDB#D7900618\tsql\query
To connect in SSMS you need to enter:
Server name: np:\\.\pipe\LOCALDB#D7900618\tsql\query
Authentication: Windows Authentication
just want to add you need sysadmin role so you can create databases
using this code
ALTER SERVER ROLE sysadmin ADD MEMBER your_user;
GO
use this :
SqlConnection con = new SqlConnection("Server= localhost, Authentication=Windows Authentication, Database= employeedetails");
con.Open();
if you want sql server authentication than read this :
http://msdn.microsoft.com/en-us/library/ms162132.aspx

Error accessing the database DSN

I have an issue with logging a Support user into an Application that has a SQL Server backend.
When configuring the application itself, the SQL set-up asked me to assign whether the Security to access the Application would be Windows Authentication or SQL: server Authentication, I chose Windows Authentication, and as I was using a login called
'LabUser1' I have been able to login to the application fine.
However, when I logon to the server using a different windows login, this time 'Support', SQL keeps giving me the error:
Error accessing the database DSN
Now I know the reason is because the install of SQL happened using the 'Labuser1' profile, but how can I create a script that will allow me to add the 'Support' user to the 'Allowed Logins' so that I can logon to the app server and at least open the Application? (I have seperate logins for when I see the applicatiojn login window, so please don't confuse the matter by thinking it is a simple case of creating a login for Support....I am talking about logging into the server)
The current batch file I am trying to run is:
sqlcmd -S localhost\OCDBB01 -i createSupportlogin.sql
Then I run this batch file after having created the following SQL script:
CREATE LOGIN OCDMW1\Support FROM WINDOWS
GO
Your description of the situation is a bit confusing to me however it appears that the "SQL setup" that is part of the application configuration created a ODBC DSN that uses the credentials of person logging into the machine as the login for SQL Server.
Simply creating a new (correct) login to the SQL instance may not resolve this issue since that does nothing to modify the DSN. If you are tied to using Window Authentication for SQL access it might be necessary to create multiple DSNs for the application to use and find a way to have the correct DSN associated to the right login for the application to use.

Taking ownership for SQL Server Management Studio

I'm new to SQL Server 2008. I just installed SQL Server Express. I'm having trouble creating a new database, and I think I don't have permission.
I login like this, please see this screenshot:
Then I tried to create a new database and I got this:
I tried to search for some solution and this what I've got:
http://blogs.msdn.com/b/sqlexpress/archive/2010/02/23/how-to-take-ownership-of-your-local-sql-server-2008-express.aspx
But I can't download the script and the page says:
An error occurred while processing your request.
Please help. Kind regards
I resolved my problem with the following steps:
Set the instance of the SQL Service to single-user mode:
Open SQL Server Configuration Manager. Double click SQL Server Services.
Stop all SQL Server services
Right click SQL service and click Properties, in the Advanced tab, look for 'Startup Parameters'
Insert '-m;' at the beginning of the Startup Parameters value
Start the SQL service
Open SQL Server Management Studio and login with Windows authentication, you can now add user or change password of different users.
Hope this helps!
Try logging in with the sa account and grant permissions to your Windows account.
If you do not know the sa password use sqlcmd and execute the following commands:
Use Master
Go
ALTER LOGIN [sa] WITH PASSWORD=N'NewPassword'
Go
Login with the sa account and GRANT permission to the account.
USE Master;
GRANT CREATE DATABASE TO Jommel;