Bo's Oracle Station

查看: 1920|回复: 0

课程第14次(2017-08-07星期一)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-8-7 20:19:21 | 显示全部楼层 |阅读模式
上完1Z0-052第6章网络
1Z0-05219章(上完6章),1Z0-05321章(上完2章)和1Z0-063多租户部分共9章(上完0章)
总共上完全部49章中的8


共享服务器:

  1. select  * from v$circuit;

  2. select  * from v$session s where s.saddr='00000001EC922828';

  3. select * from v_$dispatcher  s where s.PADDR='00000001EC73FDE0';

  4. alter system kill session '76,4839' immediate;
复制代码

公共数据库链和普通数据库链:
  1. [oracle@station90 admin]$ sqlplus /nolog

  2. SQL*Plus: Release 11.2.0.1.0 Production on Mon Aug 7 20:25:29 2017

  3. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  4. SQL> conn hr/hr@utforcl199
  5. ERROR:
  6. ORA-28002: 7 天之后口令将过期


  7. Connected.
  8. SQL> select  salary from employees where employee_id=100;

  9.     SALARY
  10. ----------
  11.      99999

  12. SQL> exit
  13. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
  14. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  15. [oracle@station90 admin]$ sqlplus /nolog

  16. SQL*Plus: Release 11.2.0.1.0 Production on Mon Aug 7 20:25:55 2017

  17. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  18. SQL> conn hr/oracle_4U
  19. ERROR:
  20. ORA-15000: command disallowed by current instance type


  21. SQL> exit
  22. [oracle@station90 admin]$ . oraenv
  23. ORACLE_SID = [+ASM] ? orcl
  24. The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is /u01/app/oracle
  25. [oracle@station90 admin]$ sqlplus /nolog

  26. SQL*Plus: Release 11.2.0.1.0 Production on Mon Aug 7 20:26:13 2017

  27. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  28. SQL> conn hr/oracle_4U
  29. Connected.
  30. SQL> select  salary from employees where employee_id=100;

  31.     SALARY
  32. ----------
  33.      24000

  34. SQL> create database link dblink1
  35.   2   connect to hr identified by hr
  36.   3   using 'utforcl199';

  37. Database link created.

  38. SQL> select  salary from employees@dblink1 where employee_id=100;


  39.     SALARY
  40. ----------
  41.      99999

  42. SQL> SQL> select  salary from employees where employee_id=100;

  43.     SALARY
  44. ----------
  45.      24000

  46. SQL> update employees@dblink1 set salary=88888 where employee_id=100;

  47. 1 row updated.

  48. SQL> commit;

  49. Commit complete.

  50. SQL> conn / as sysdba
  51. Connected.
  52. SQL> alter user sh identified by oracle_4U account unlock;

  53. User altered.

  54. SQL> select  salary from employees@dblink1 where employee_id=100;
  55. select        salary from employees@dblink1 where employee_id=100
  56.                               *
  57. ERROR at line 1:
  58. ORA-02019: connection description for remote database not found


  59. SQL> select  salary from hr.employees@dblink1 where employee_id=100;
  60. select        salary from hr.employees@dblink1 where employee_id=100
  61.                                  *
  62. ERROR at line 1:
  63. ORA-02019: connection description for remote database not found


  64. SQL> conn hr/oracle_4U
  65. Connected.
  66. SQL> grant execute on dblink1 to sh;
  67. grant execute on dblink1 to sh
  68.                  *
  69. ERROR at line 1:
  70. ORA-04042: procedure, function, package, or package body does not exist


  71. SQL> grant select  on dblink1 to sh;
  72. grant select  on dblink1 to sh
  73.                  *
  74. ERROR at line 1:
  75. ORA-00942: table or view does not exist


  76. SQL> create public  database link dblink1
  77.   2  connect to hr identified by hr
  78.   3  using 'utforcl199';
  79. create public  database link dblink1
  80.                              *
  81. ERROR at line 1:
  82. ORA-01031: insufficient privileges


  83. SQL> /

  84. Database link created.

  85. SQL> conm sh/oracle_4U
  86. SP2-0734: unknown command beginning "conm sh/or..." - rest of line ignored.
  87. SQL> conn sh/oracle_4U
  88. Connected.
  89. SQL> select  salary from employees@dblink1 where employee_id=100;

  90.     SALARY
  91. ----------
  92.      88888

  93. SQL> update employees@dblink1  set salary=77777 where employee_id=100;

  94. 1 row updated.

  95. SQL> commit;

  96. Commit complete.

  97. SQL>
复制代码

锁竞争:
  1. select  * from v$session where sid in (
  2. select  s.BLOCKING_SESSION
  3. from v_$session s where s.BLOCKING_SESSION is not null);

  4. select  * from v_$lock l
  5. where l.SID in ( 130,131)
  6.   and type <> 'AE';
复制代码

Screenshot-1.png

Screenshot.png

Screenshot-2.png
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-25 13:56 , Processed in 0.047471 second(s), 27 queries .

快速回复 返回顶部 返回列表