Oracle Database SQL statements, database management, oraclesql

Source: Internet
Author: User

Oracle Database SQL statements, database management, oraclesql

Conn system/12345678

-- Query the status of all users

Select username, account_status from dba_users;

-- Query data files

Select tablespace_name, file_name from dba_data_files;

-- Query all Permissions

Select * from system_privilege_map;

-- Create a user

Create user user1 identified by 123;

-- Grant the database creation permission to connect to the database

Grant connect to user1;

Grant resource to user1;

-- Grant Permissions

Grant create session, create table, create view to user1;

-- Grant the pass-through permission

Grant create session, create table, create view to user1 with admin option;

-- Revoke permissions

Revoke create table, create view from user1;

Conn user1/123

Create table aaa (id int );

-- Database connection permission

Grant create session to user1;

Grant unlimited tablespace to user1; // grant the table space permission to user1.

-- Create Table permission

Grant create table to user1;

-- Delete table Permissions

Grant drop any table to user1;

-- Insert Table permission

Grant insert any table to user1;

-- Modify Table Permissions

Grant update any table to user1;

Grant all to public; // This is important. grant all permissions to all users (public)

Grant select on tablename to user1; // grant the zhangsan user the permission to view the specified table.

Grant drop on tablename to user1; // grant the table deletion permission.

Grant insert on tablename to user1; // grant the insert permission

Grant update on tablename to user1; // grant the table modification permission.

Grant insert (id) on tablename to user1;

Grant update (id) on tablename to user1; // grant the insert and modify permissions to specific fields in the specified table. Note that only insert and update are allowed.

Grant alert all table to user1; // grant permissions to any table of the zhangsan user alert

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.