New answers tagged privileges
Export all the views of the database <DB>: mysql -BNe "SELECT TABLE_NAME FROM TABLES WHERE TABLE_SCHEMA = '<DB>' AND TABLE_TYPE = 'VIEW'" \ information_schema | xargs mysqldump --single-transaction --no-data <DB> >views.sql or: mysql -BNe "SELECT TABLE_NAME FROM VIEWS WHERE TABLE_SCHEMA = '<DB>'" \ information_schema | ...
If you have the admin option over a role you can drop that role, even if you don't possess the drop role privilege or "own" the role, as in, you didn't create the role.
You might want to look at roles here Paul...
Get all privileges from AAA SELECT DBMS_METADATA.GET_GRANTED_DDL('ROLE_GRANT','AAA') FROM DUAL; SELECT DBMS_METADATA.GET_GRANTED_DDL('SYSTEM_GRANT','AAA') FROM DUAL; SELECT DBMS_METADATA.GET_GRANTED_DDL('OBJECT_GRANT','AAA') FROM DUAL; Change the DDL commands with the user 'BBB' and execute.
expdp userid=system directory=DATA_PUMP_DIR dumpfile=AAA.dmp schemas=AAA impdp userid=system directory=DATA_PUMP_DIR dumpfile=AAA.dmp remap_schema=AAA:BBB or make use of dbms_metadata user_ddl.sql
You could use the session information function inet_client_addr(), with limited reach. It reports the IP the server is receiving the current connection from. This is only useful with direct connections to the database, though. As proof of concept: SELECT CASE WHEN inet_client_addr() << '192.168.1.32/30'::inet THEN 'foo' ELSE 'bar' ...
Top 50 recent answers are included