Unlocking SCOTT user in oracle 19c - oracle

Trying to unlock SCOTT in oracle 19c.
alter user scott account unlock identified by tiger;
ERROR Message:
ORA-01918: user 'SCOTT' does not exist

From documentation:
Starting from Oracle 12cR2, only HR schema is provided via installation. All other sample schema scripts are available on GitHub at https://github.com/oracle/db-sample-schemas/releases/latest
SCOTT schema is no longer provided in the sample schemas, you could manually create it using the scripts from older Oracle versions or use the HR and other sample schemas.
Once you install the sample schemas manually in PDB, you could then unlock them and use. See Oracle Multi-tenant DB Post Installation Mandatory Steps

In ORACLE 19C How TO CHANGE sysdba password.

Related

Can't create HR schema on Oracle 21c (SP2-0310)

I'm new to Oracle and i'm trying to install HR schema but error occurs.
SP2-0310: unable to open file "SUB__CWD/human_resources/hr_cre.sql" connecting and granting seems work but this error occurs and i can't create hr schema..
I searched and tried many ways, but I couldn't find the right solution.
I'm using oracle 21c version and my OS is windows10.
I entered like this
sys as sysdba
alter session set "_ORACLE_SCRIPT"=true;
#?/demo/schema/human_resources/hr_main.sql hr users temp {password} $ORACLE_HOME/demo/schema/log/ localhost:1521/XE
I tried Installing Sample Schemas like this and installation of the sample schemas like this but it didn't work.
Thanks in advance

How do I install a demo schema like SCOTT / TIGER on Oracle Database 21c XE?

How can I install a demo schema like SCOTT / TIGER on Oracle Database 21c XE if there are no files in my [ORACLE_HOME]/sqlplus/demo directory?
The SCOTT schema is available from Oracle's Github account (rather than third parties) in the "dotnet-db-samples" repository.
I'm not sure I'm allowed to post the script itself (as I don't own the copyright), but - follow this link, copy code you find there and run it in SCOTT schema you previously created in your database.

oracle 11g not able to connect with scott user, showing: invalid username/password; logon denied

whenever I'm trying to connect with scott it is showing invalid username/password,
tried this:
alter user scott account unlock;
SP2-0640: Not connected
alter user scott identified by tiger;
SP2-0640: Not connected
Go to the Installing path of the Oracle 11g In default it is present C: Drive, then move to C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin
here you can find a file named scott.sql
Open the SQL Command Line and login as conn system/ (password set during the installation of oracle 11g)
Run the Below script (Note: File name is appended at the end)
# C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\scott.sql
Now you can query the SELECT * FROM all_users; to see the scott schema created
Alternatively you can do this by using SQL developer by creating a connection to SYSTEM and run the above script
After the creation the default username : SCOTT password: TIGER
In the comment part i especially asked for querying
select count(1) from dba_users where username = 'SCOTT';. I'd like to learn if user exists.
For the message you get ORA-01017,
the First possible reason is what message tells us(invalid
username/password).
Secondly, you may not have an account named SCOTT. i.e. the above
query gives 0(zero).
In this case :
you should create mentioned user ( when you're connected to system ):
SQL> conn system/pwd
Connected.
SQL> create user scott identified by tiger;
and grant related privileges :
SQL> grant connect to scott;
SQL> grant resource to scott;
and then you can connect by issuing :
SQL> conn scott/tiger
Connected.
Connect with a DBA Account and Issue an Alter User Command
The error you are seeing indicates you are no longer connected to the database. You were logged in as system#db, but when you tried to connect as scott#db, you no longer have a database connection.
Here I replicate your experience:
SYSTEM#db>conn system#db as sysdba
Enter password:
Connected.
SYS#db>conn scott#db
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
#>alter user account scott unlock;
SP2-0640: Not connected
#>alter user scott identified by tiger;
SP2-0640: Not connected
Here I reconnect and then issue an alter user command to unlock the user account and set a new password.
#>conn system#db as sysdba
Enter password:
Connected.
SYS#db>ALTER USER scott IDENTIFIED BY tiger ACCOUNT UNLOCK;
User altered.
SYS#db>conn scott/tiger#db
Connected.
Addendum
My steps provided assumed you had the scott schema installed. If the scott schema does not exist, it would be good to see if the default 11g database sample schemas exist.
The schema account scott is no longer a default schema in the 11g database. The 11g documentation states:
"Oracle used the schema SCOTT with its two prominent tables EMP and
DEPT for many years. With advances in Oracle Database technology,
these tables have become inadequate to show even the most basic
features of Oracle Database and other Oracle products. "
I would recommend reviewing to see if the other default sample schemas are installed. The hr account is most similar to the scott schema.
Here is a list of common sample schema usernames:
username IN (
'HR',
'OE',
'PM',
'SH',
'IX'
)
Check to see if the person whom performed the installation used the database configuration assistant and opted to install the sample schemas.
If the schemas were not created at the time of installation, the document, "Oracle® Database Sample Schemas 11g Release 1 (11.1) B28328-03", describes the steps to do this in chapter 2, Installation.
Open Oracle sql developer.
In the sql developer paste the path of scott.sql file(C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\scott.sql) with '#' infront of it.
# C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\scott.sql
Run script
Script Output -> Connection created by CONNECT script command disconnected
Connect using SQL Command Line
conn scott/TIGER;

New to Oracle SQL developer

I installed Oracle SQL developer on my personal computer.
I want to create my own tables in it and work on them.
But, when I try to make the basic connection, it gives an error below
"network adapter could not make the connection".
Can someone please give a detailed explanation about how can I create my own tables and what I should do to connect to some database?
You have to install Oracle database to create your own tables. You can download Oracle XE from this link.
For a detailed explanation about how to connect to a database, this tutorial comes first when you google it.
This answer is for windows user. And assume that you have installed oracle database, as answered.
Open cmd: (win+r, input cmd, enter).
run command:
sqlplus / as sysdba
create a tablespace:
create tablespace <tablespace-name>
create user:
Create user <username> identified by <password> default tablespace <tablespace-name> quota unlimited on <tablespace-name>;
open oracle sql developer, and add a link with the information in step 4. Link type should be set as local! Link type should be set as local! This may be the direct answer to your question.
Now you could run sql shell in sql developer.

How to recover passwords for all database schemas

I have installed Oracle 11g Express Edition and am using using SQL Developer.
I have created two schemas but forgotten the password - is there any way to unlock them?
quite straightforward question....login as sysdba
sql>connect / AS sysdba
sql>alter user <use_name> identified by <Password>
ex:alter user xyz identified by stackover --don't enclose by quatos

Resources