Tag Info

New answers tagged

2

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 | ...


0

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.


1

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.


1

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


3

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