How to create a user in Oracle SQL developer - oracle

I am newbie to oracle sql developer 3.1.07.42, and have just installed it on my machine. I want to make a new connection, but it requires a user and a password which I do not know. I have been googling about it since many days, and have learned that there are some commands to create user, but I do not know where should I run those commands, because I cannot run queries/commands until the connection is created.
Would anyone let me know what should I do?

Steps for creating new user :
1)Open Sql Developer, make new connection.
2)Login with System username and password(made during installation).
3)Once you connect, expand the System user (under Connections, in the left pane) and scroll down to Other users. Then right click users and add new user.
4)Give its username and password & select appropriate system privilege.
5)You are done now, check by making new connection.

Use this below simple commands to create an user
-- Create a user
CREATE USER youruser IDENTIFIED BY yourpassword;
--Grant permissions
GRANT CONNECT, RESOURCE, DBA TO demo;

you should install database software in your local pc/laptop then create user in the database and you can connect the database via sql developer by key in username and password that already created.If you want to connect to other database same step like the previous step but before that you need to point to the remote database.

I thinks you should use "Database Configuration Assistant" to create new database and U can set user name and password and use it in oracle SQL Developer!!!

Related

how to grant select, different servers, same username/password different schema

I'm not a DB expert, my boss has retired and it's up to me now. He created a production database, and a test database on another server with same username/password and schema name test_SameAsOtherDB. I'm trying to pull the live data from the production table, into the test DB table, but there are no privileges for me to do so.
I tried by logging into my production DB and "grant select on mytable_name to testDB.mytable_name;" but it gives me the error "ORA-00933: SQL command not properly ended".
I've tried all the combinations of user/password/schema that I could think of, but none work.
Everything I've researched says use "GRANT select on tablename to USER" but the user is the same on each DB.
Hope I made sense, any help would be appreciated.
Thanks,
John
You access a database on another server through a DATABASE LINK, not with the syntax to access an object in another schema on the same server.
You must create the DBLINK using the "CONNECT TO user IDENTIFIED BY password" syntax. (And the user used to execute "CREATE DATABASE LINK" must have the privilege to do...)
Then you will be able to "SELECT ... FROM mytable_name#DBLINK_TESTDB" assuming you named the DBLINK "DBLINK_TESTDB" with the same rights the user used in the "CONNECT TO" statement has in the target DB.
(And change that policy having the same passwords in all environment...)

DB User account Password Reset from oracle apex

Iam creating an app to change the password of selected Db user account.When an user select a particular db name and user of the db then click submit button i should call procedures that changes the password of the db user.So guide me how to connect to selected db from oracle Apex and do it.
As far as I can tell, there are two ways to change someone's password:
connect as that user
connect as a privileged user (such a SYS)
and run such a command:
alter user scott identified by tiger;
As you'd want to do that for any database you have a access to, as well as every user in those databases, I doubt that you know their passwords so I guess that you'll connect as a privileged user to all those databases. Of course, you have to know their passwords.
One option would be to
create the same stored procedure (which will modify someone's password) in every database
it'll accept username and its new password
as alter table is DDL, you'll have to use dynamic SQL (execute immediate)
create database links to those databases in a schema you use to connect to your Apex application
depending on database you choose, call appropriate procedure via database link and pass chosen username and its new password. This might also require some kind of dynamic SQL, if you want to use different DB link name
I don't know which database version you use, but - have a look at 11g's Accessing and Modifying Information in Multiple Databases, especially "Running a Stored Procedure in a Remote Oracle Database" chapter for more info.

Oracle Database 11g: How to enable/create a user?

I just downloaded the Oracle Database 11g and I can't select,create,update or do anything. Every command that I entered and run only results to "ORA-01435: user does not exist"
What are the things that i need to do in order to enable creating and running some commands?
Here is a picture of ORA-01435: user does not exist
Please look at right upper corner SCHEMA:XS$NULL:
From Securing Oracle Database User Accounts
XS$NULL
An internal account that represents the absence of a user in a session. Because XS$NULL is not a user, this account can only be accessed by the Oracle Database instance. XS$NULL has no privileges and no one can authenticate as XS$NULL, nor can authentication credentials ever be assigned to XS$NULL.
Expired and locked
You need to change it to some specific schema.

Oracle 12c default pluggable DB in sqlplus

I have a pluggable database in Oracle 12c named PDBORCL.
After a server restart something changed in how to connect to it.
I created a user in that pluggable DB, for the example the user is PETER and the password is also PETER. Before the restart I used to be able to open a Command Prompt, run sqlplus, which would in turn ask for my username and then its password, and it would sign in. Now this does not work, it says invalid username/password. When I log in with SYS and check:
SELECT * FROM dba_users WHERE username = 'PETER';
I get no results.
However, if I sign in using the following from a command prompt, it works:
sqlplus PETER/PETER#PDBORCL
So, the DB is up and running, but it seems to be connecting by default to the wrong pluggable DB. I need to change it to the way it was before the restart, so that it connects by default to that specific pluggable DB.
How can I achieve this?
I found the solution. Change or create the environment variable LOCAL (in Windows) to PDBORCL. I think I read in linux the variable is TWO_TASK. After changing it, the following works:
sqlplus PETER/PETER
Also, just calling sqlplus and waiting to be prompted for username and password works.
You have created a user in pluggableDB and this user is not visible beyond the pluggable DB hence the reason you dont see user PETER when running the above query as sys..
If you want to connect to your pluggable DB directly what you have done above is right else you to connect to sys and the use CONNECT command.

Pl-Sql User Connection

I've been starting oracle on my job. But i've been using MS all the time. Now i have problem on User-Shema structure. I tryed a create table with sql query, but table had been created in somewhere else then i wanted. (I've already created a user named LPA) I just wrote the query, and table is in the (GeneralDatabase) Tablespaces->Users->(Here). I want to create a table in LPA schema, under the table folder. I've been searching for it but i could'nt get it. So need some help please.
PS:I found that i need to connect with user, than write to query with TS_LPA(Thats my tablespace). But i also cant connect with the user LPA.(We can say this is my first problem)
In Oracle there is no "dbo" or default schema, in case that is what you are looking for. You must specify the target user account when you connect (log in) to the database, and that account will be used as the default schema for all of your subsequent actions. (This is similar to a home directory in Linux, where if I log in as williamr and create a file, it will belong to williamr and not some generic default account.)
In your case I suspect you are connecting as SYS or similar, in which case your table now belongs to SYS (or whoever you are connected as). You'll need to drop it and try again.
If you don't want to post the connect string you used to connect initially for some reason, then execute the following query to see your current schema:
select user, sys_context('userenv','current_schema') from dual;
(Normally user and sys_context('userenv','current_schema') will be the same, but worth double-checking.)
In PL/SQL Developer you can only issue connect commands from a Command window (not a SQL window). Alternatively you can use the 'log on' menu tool, or Session > Set Main Connection from the menu, or (best if you want to reuse it later) Tools > Define Connections, which has a 'Test...' button to validate a new connection. You'll need the username, password and database service name (not just username and password).
connect with LPA user.
specify the schema name before table name.
create table LPA.tbl_name(col1 datatype1,....);

Resources