Oracle user management

Source: Internet
Author: User

1. Create a New tablespace:

Create tablespace newxxt
Datafile
'/Oradata/dduyoung/newxxt1.dbf' size 200 m autoextend on next 10 m maxsize unlimited,
'/Oradata/dduyoung/newxxt2.dbf' size 200 m autoextend on next 10 m maxsize Unlimited
Extent management local
Segment space management auto; 2. Create a user: create user dduyoung identified by psw123
Default tablespace newxxt
Temporary tablespace temp

3. Create a new role and grant it the permission: Create role DDU;
Grant connect, resource to DDU;
Grant DBA to DDU;

4. alter user dduyoung quota unlimited on newxxt -------------------------------------------------------------------------------------- if you allocate a tablespace to the user, however, you cannot modify the table space (such as a new table) without the corresponding quota on the table space ). 5. Modify user attributes: Alter user dduyoung
Identified by pwd456
Default tablespace oldxxt
Temporary tablespace temp
Profile myprof
Quota 50 m on oldxxt; 6. Locked account: Alter user dduyoung account lock;--Lock
Alter user dduyoung account unlock;--Unlock 7. Force user password invalidation: Alter user dduyoung password expire; 8. delete user: -- when the user has no entity
Drop user dduyoung;

-- When you have created entities such as tables and data
Drop user dduyoung cascade;
-- Note: The user currently being connected cannot be deleted. When the cascade option is used,
-- The user and entity are immediately deleted and should be physically deleted again in the data file. 9. Monitoring User: -- Query user session information: (if two users log on with the same user name, they can dynamically Query
Select username, machine, Sid, serial # from V $ session;

-- Delete a session
Alter system kill session 'sid, serial ';

-- View the user's SQL statement
Select user_name, SQL _text from V $ open_cursor where user_name = upper ('dduyoung ');

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.