0% found this document useful (0 votes)
2 views

SQL_COMMENDS

The document provides step-by-step instructions for creating and managing a user account in SQL. It details how to connect as SYSDBA, create a user named 'scott', grant privileges, run specific SQL scripts, and connect as 'scott'. Additionally, it explains how to unlock the account and change the password for the user.

Uploaded by

ANEESH J
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

SQL_COMMENDS

The document provides step-by-step instructions for creating and managing a user account in SQL. It details how to connect as SYSDBA, create a user named 'scott', grant privileges, run specific SQL scripts, and connect as 'scott'. Additionally, it explains how to unlock the account and change the password for the user.

Uploaded by

ANEESH J
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Commands:-

1. For that go to SQL command line and connect by using username: as sysdba ......password:
tiger

EX:

CONNECT ----> PRESS ENTER

ENTER USER NAME : AS SYSDBA


ENTER USER NAME : AS SYSDBA

2. then create user scott by command :


--------------------------------------

CREATE USER scott IDENTIFIED BY tiger;

3. Then grant all privileges to scott by command :


---------------------------------------------------

GRANT ALL PRIVILEGES TO scott;

4. When connected run the command given below line by line (second line may give an error
but it is fine)

*second command is most important*

SQL> @ ?/rdbms/admin/scott.sql

SQL> @ ?/sqlplus/demo/demobld.sql

SQL> @ ?/rdbms/admin/utlsampl.sql

After the third command the SQL command line will automatically close

5.- Restart the sql command line:- Connect with Scott and tiger ..
and run query - select * from tab;

6. Then connect to scott/tiger using 'scott' as username and 'tiger' as password.

*****************************************************************************

How to unlock the account


--------------------------

ALTER USER USER_NAME ACCOUNT UNLOCK ;

EX:

ALTER USER SCOTT ACCOUNT UNLOCK ;

******************************************************************************

How to Change the password


--------------------------

ALTER USER USER_NAME IDENTIFIED BY PASSWORD ;

EX:

ALTER USER SCOTT IDENTIFIED BY tiger ;

You might also like