[MySQL] viewing user permissions and grant usage
View User Permissions
Show grants for your users
For example:Show grants for root @ 'localhost ';
Grant usage
Grant usage on *. * To 'discuz' @ 'localhost' identified by password' * c242ddd213be9c6f8da28d4245bf69fc79a86eb ';
In oracle, how does one view the permissions granted to a role ?, Oracle Grant
In oracle, how does one view the permissions granted to a role?
Select * from dba_role_privs; grant roles to users and other roles
Select * from dba_s
he has read-only permissions to the DB database (for example, Select), but he can perform an update operation on the name and email columns of the users table. The command is as follows:Mysql> GRANT Select on db.*-to [email protected]%.host.net-Identified by "Jessrules";Mysql> GRANT Update (name,email) on DB. Users-to
In Oracle databases, user permissions are divided into two types (here we do not discuss the permissions of dba or role, but only the permissions of common users ), system Privilege System permission and User Table Privilege User data Table permission.
1. First, create a user. The following commands can be used to create a user, provided that you must Log On As a dba (if you are not a DBA, do not check it ):
Create user DB_USER identified by DB_USER_PW 'create user DB_USER with the password DB_U
Oracle creates a view and opens permissions to users. To improve query efficiency, you can consider opening a view for users in other companies. www.2cto.com 1. create or replace view test_table_v as select t1, t2, t3, t4, t5 from test_table 2. create the user SQL code to access this
:; || User:; |+---------------------------------------+Rows in Set (0.01 sec)
To view the permissions of a specific user in a database
The code is as follows
Copy Code
Mysql> Show grants for;+-------------------------------------------------------------------------------------------------------------- -----+| Grants for |+-------------------------------------------------------------------------------------------
Show user;Select Sys_context (' Userenv ', ' Session_user ') from dual;Select User from Dual; To view all logged-on users, you must be a DBA User:Select username from v$session;SYS, system, and other DBA users view objects (tables) in other users (test):Sql> select * from Te
permissions of the User:Select * from user_sys_privs; 4. System Privilege list PRIVILEGE NAME PROPERTY-------------------------------------------------------------228 administer database trigger 0-227 administer resource manager 1-161 alter profile 0-189 create any library 0-201 create any operator 0-224 create any outline 0-141 create any procedure 0-120 create public database link 0-90 create view 0-50 delete any table 0-220 dequeue any queue 1-6
How does DB2 view the current user mode and switch users?
1. connect to the database: db2 connect to study
2. query the current user mode: select current schema from sysibm. sysdummy1 or select current schema from sysibm. dual
3. Switch user mode: set current schema toms
DB2 view, sequence, constraints, foreign key exercise testSimple View:Db2 => create view myview1 as select * from t1 where empno The DB20000I SQL command is successfully completed.Db2 => select * from myview1EMPNO NAME SEQNO--------------------------------10 wan qi 130 xu xi
Overview
Programmers often refer to DB2 for I database directory data to access data related to their DB2 objects. The DB2 database directory makes it easier and better for programmers to understand databases. The database directory provides answers to database-related questions, such as how many columns in a database use a particular data type, how many columns
refresh table statement.
The MQT maintained by the system, whether it is refresh deferred or refresh immediate, cannot be inserted, updated, or deleted. However, for the refresh immediate-type MQT maintained by the system, you can update it by modifying the underlying table (that is, the insert, update, or delete operation.
The following section shows an example of creating an MQT maintained by a refresh immediate system. The table name is EMP, which is based on the underlying tables of the SAM
The following articles mainly describe the correct use of the MQT materialized query table in the materialized view of the DB2 database. If you encounter the application of the MQT materialized query table in the materialized view of the DB2 database in actual operations, however, you do not know how to solve the probl
The following articles mainly introduce the correct use of MQT materialized query tables in the materialized views of DB2 databases, if you are a beginner in the practical application of the correct use of the MQT materialized query table in the materialized view of DB2 database, you can have a better understanding through the following articles.
Use MQT to Mate
), COL4 VARCHAR(128), COL5 VARCHAR(128), PRIMARY KEY (ID)) ORGANIZE BY ROW;
Create an MQT table
CREATE TABLE T_MQT ( ID, COL1, COL2, COL3 ) AS ( select ID, COL1, COL2, COL3 from T ) DATA INITIALLY DEFERRED REFRESH IMMEDIATE MAINTAINED BY SYSTEM;SET INTEGRITY FOR T_MQT IMMEDIATE CHECKED FULL ACCESS;
Write Data to the original table
insert into T(ID, COL1, COL2, COL3, COL4, COL5) values (1, 'col1', 'col2', 'col3', '
),
COL3 VARCHAR (128),
COL4 VARCHAR (128),
COL5 VARCHAR (128),
PRIMARY KEY (ID)
ORGANIZE by ROW;
Create an MQT table
CREATE TABLE t_mqt (ID, COL1, COL2, COL3)
as (select ID, COL1, COL2, COL3 from T)
DATA initially Deferr ED REFRESH IMMEDIATE maintained by SYSTEM;
SET INTEGRITY for T_MQT IMMEDIATE CHECKED full ACCESS;
Write data to the original table
Insert into T (ID, COL1, COL2, COL3, COL4,
information, Jessie can focus on queries that represent some of the largest resource users when doing SQL tuning work.To identify the most frequently-run dynamic SQL statement, Jessie issues the following statement:Connect to Shopmart;SELECT * from Top_dynamic_sql ORDER by num_executionsDESC FETCH first 5 rows only;This statement returns all execution times, sort executions, and statement text details for the 5 dynamic SQL statements that perform the
Tags: Lin class oat border cell order rom char maxsizeDB2 table Space Practical information is stored in the view "Sysibmadm.tbsp_utilization". DBA authority is required to execute. SQL is as follows:
select tbsp_id, varchar(tbsp_name,30), tbsp_used_size_kb/1024as"usedsize(MB)", tbsp_max_size/1024/1024as"maxsize(MB)", dec(cast(tbsp_used_size_kbasfloat)*1024/tbsp_max_size*100,15,3) from sys
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.