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 ');