简体   繁体   中英

Connecting to database using Oracle SQL Developer

I installed Oracle SQL Developer and exemplary database - Nothwind .

How to connect to this database? What is username, password, hostname? Is it possible? I found only instructions for other programs and there is written: "write these parameters", without giving them.

I am looking at codeplex to see if any sample logins and/or users are created.

http://sqlserversamples.codeplex.com/releases/view/72278

If not, I will post a snippet to create a login/user with data_reader / data_writer privileges.

Run this script on the SQL Server database using SSMS. You then can use the [ADW_ADMIN] account that has db_owner privileges for testing. The password is listed below.

-- Which database to use.
USE [master]
GO


-- Delete existing login.
IF  EXISTS (SELECT * FROM sys.server_principals WHERE name = N'ADW_ADMIN')
DROP LOGIN [ADW_ADMIN]
GO

-- Add new login.
CREATE LOGIN [ADW_ADMIN] WITH PASSWORD=N'M0a2r0c9h11$', DEFAULT_DATABASE=[AdventureWorks2012]
GO

-- Which database to use.
USE [AdventureWorks2012]
GO

-- Delete existing user.
IF  EXISTS (SELECT * FROM sys.database_principals WHERE name = N'ADW_ADMIN')
DROP USER [ADW_ADMIN]
GO

-- Add new user.
CREATE USER [ADW_ADMIN] FOR LOGIN [ADW_ADMIN] WITH DEFAULT_SCHEMA=[dbo]
GO



-- Which database to use.
USE [AdventureWorks2012]
GO

-- Add to database owner role 
EXEC sp_addrolemember 'db_owner', 'ADW_ADMIN'
GO

-- Add to database read / write roles
--EXEC sp_addrolemember 'db_datareader', 'ADW_USER'
--EXEC sp_addrolemember 'db_datawriter', 'ADW_USER'
GO

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM