Oracle database Personal Grooming Common table spaces, users, authorization actions

Source: Internet
Author: User
Tags dba

1. Table space-related SQL

--Create a tablespace named Test_tablespace_name with a storage location of D:\db\oradata\orcl\test_tablespace_ NAME.DBF, size 128m, unlimited, after each increase of 10mcreate tablespace test_tablespace_name datafile   " d:\db\oradata\orcl\test_tablespace_name.dbf ' size 128m autoextend on next 10m maxsize Unlimited;  -- select   Span style= "COLOR: #000000" > file_name, Tablespace_name, Bytes, autoextensible from Dba_data_files WHERE tablespace_name  =  " test_tablespace_name";  -- delete table space test_tablespace_namealter tablespace test_tablespace_name offline;  -- Delete the data files on disk together with the drop tablespace test_tablespace_name including contents  and  datafiles; 

2. User-related SQL

--New user Test_user/test_password, specifying a tablespace of Test_tablespace_nameCreate UserTest_user identified byTest_passworddefaultTablespace Test_tablespace_nameTemporaryTablespaceTemp;--Modify User PasswordALTER USERTest_user identified by 123456;--Delete UserDROP USERTest_userCASCADE;--Lock UserAlter Usertest_user account lock;--Unlocking UsersAlter Usertest_user account unlock;--Querying user InformationSelect *  fromall_users;--more detailed user informationSelect *  fromDba_users;

3. Licensing-related SQL

--Grant test_user user dba AuthorityGrantResource, DBA, Connect,Create  any Table,Create  any Index,Create  anySequence, unlimited tablespace toTest_user;--revoke test_user User DBA AuthorityREVOKEResource, DBA, Connect,Create  any Table,Create  any Index,Create  anySequence, unlimited tablespace fromTest_user;--View system permissions for the current userSelect *  fromUser_sys_privs;--View object permissions for the current userSelect *  fromUser_tab_privs;--View all roles for the current userSelect *  fromUser_role_privs;

Yexiangyang

[Email protected]

Oracle database Personal Grooming Common table spaces, users, authorization actions

Related Article

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.