|
- select s.USERNAME, s.MACHINE, s.RESOURCE_CONSUMER_GROUP
- from v_$session s
- where s.USERNAME='HR' ;
复制代码
| USERNAME | MACHINE | RESOURCE_CONSUMER_GROUP | 1 | HR | station90.example.com | GROUP1 |
- select * from dba_rsrc_group_mappings;
- BEGIN
- dbms_resource_manager.clear_pending_area();
- dbms_resource_manager.create_pending_area();
- dbms_resource_manager.set_consumer_group_mapping(
- dbms_resource_manager.client_machine,
- 'station90.example.com',
- 'GROUP2'
- );
- dbms_resource_manager.submit_pending_area();
- END;
- select * from dba_rsrc_mapping_priority;
- BEGIN
- dbms_resource_manager.clear_pending_area();
- dbms_resource_manager.create_pending_area();
- dbms_resource_manager.set_consumer_group_mapping_pri(
- EXPLICIT => 1, CLIENT_MACHINE => 2,
- SERVICE_MODULE_ACTION => 3,
- SERVICE_MODULE => 4,
- MODULE_NAME_ACTION => 5,
- MODULE_NAME => 6,
- SERVICE_NAME => 7,
- ORACLE_USER => 8,
- CLIENT_PROGRAM => 9,
- CLIENT_OS_USER => 10
- );
- dbms_resource_manager.submit_pending_area();
- END;
- select s.USERNAME, s.MACHINE, s.RESOURCE_CONSUMER_GROUP
- from v_$session s
- where s.USERNAME='HR' ;
复制代码 | USERNAME | MACHINE | RESOURCE_CONSUMER_GROUP | 1 | HR | station90.example.com | GROUP2 |
- select sid ,username, terminal from v$session where sid in (select s.BLOCKING_SESSION
- from v_$session s
- where s.BLOCKING_SESSION is not null ) ;
复制代码
-----------------------------
- select sid ,username, terminal from v$session where sid in (select s.BLOCKING_SESSION
- from v_$session s
- where s.BLOCKING_SESSION is not null ) ;
-
- select * from v_$lock l
- where l.SID in (14,203);
-
复制代码
表级共享锁,行级独占锁:
| ADDR | KADDR | SID | TYPE | ID1 | ID2 | LMODE | REQUEST | CTIME | BLOCK | 1 | 00000001EECD78A8 | 00000001EECD7900 | 203 | TX | 196612 | 1545 | 0 | 6 | 569 | 0 | 2 | 00000001EECD8408 | 00000001EECD8460 | 203 | AE | 100 | 0 | 4 | 0 | 674 | 0 | 3 | 00000001EECD8500 | 00000001EECD8558 | 14 | AE | 100 | 0 | 4 | 0 | 683 | 0 | 4 | 00007F487F3D3FF0 | 00007F487F3D4050 | 203 | TM | 73953 | 0 | 3 | 0 | 569 | 0 | 5 | 00007F487F3D3FF0 | 00007F487F3D4050 | 14 | TM | 73953 | 0 | 3 | 0 | 659 | 0 | 6 | 00000001EAEEC6A8 | 00000001EAEEC720 | 14 | TX | 196612 | 1545 | 6 | 0 | 660 | 1 |
- SQL> rollback;
- Rollback complete.
- SQL> select salary from employees where employee_id=100 for update nowait;
- SALARY
- ----------
- 24000
- SQL> update employees set salary=salary+1 where employee_id=100;
- 1 row updated.
- SQL> commit;
- Commit complete.
- SQL> update employees set salary=salary+1 where employee_id=100;
复制代码- select * from dba_rollback_segs;
- select * from v$transaction;
- select * from dba_tablespaces;
- select * from dba_data_files;
- alter tablespace undotbs1 retention noguarantee;
- select * from v$undostat;
- select * from v$fixed_table where name like 'V%UNDO%'
- or name like 'V%ROLL%';
-
- select * from v$rollstat;
复制代码
上完1Z0-053 第16章 Resource Manager (9/40)
上完1Z0-052 第9章 锁 (10/40)
上完1Z0-052第10章 undo (11/40)
|
|