Bo's Oracle Station

查看: 2335|回复: 0

课程第22次:2020-03-21星期六

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2020-3-21 19:47:14 | 显示全部楼层 |阅读模式
1 以GRID用户CREATE第二个磁盘组
1.1 图形界面asmca
SERVER2-2020-03-21-20-12-55.png

SERVER2-2020-03-21-20-18-06.png


2 以ORACLE用户CREATE RAC数据库

腾讯课堂图片20200321221009.jpg

  1. [oracle@server4 ~]$ ps aux |grep ora_smon
  2. oracle    13165  0.0  1.9 2161696 134340 ?      Ss   21:48   0:00 ora_smon_racdb_2
  3. oracle    15195  0.0  0.0  12108  1028 pts/0    R+   22:14   0:00 grep --color=auto ora_smon
  4. [oracle@server4 ~]$ vim .bash_profile
  5. # .bash_profile

  6. # Get the aliases and functions
  7. if [ -f ~/.bashrc ]; then
  8.         . ~/.bashrc
  9. fi

  10. # User specific environment and startup programs
  11. export ORACLE_BASE=/u01/app/oracle
  12. export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1
  13. export PATH=$ORACLE_HOME/bin:$PATH
  14. export LANG=en_US.UTF-8
  15. export ORACLE_SID=racdb_2
  16. ~
  17. ~
  18. ~
  19. ~
  20. ~
  21. ~
  22. ~
  23. [oracle@server4 ~]$ . .bash_profile
  24. [oracle@server4 ~]$ sqlplus /nolog

  25. SQL*Plus: Release 12.1.0.2.0 Production on Sat Mar 21 22:15:06 2020

  26. Copyright (c) 1982, 2014, Oracle.  All rights reserved.

  27. SQL> conn  / as sysdba
  28. Connected.
  29. SQL> alter user sys identified by oracle_4U;

  30. User altered.

  31. SQL> alter user hr identified by oracle_4U account unlock;

  32. User altered.

  33. SQL> exit
  34. Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  35. With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
  36. Advanced Analytics and Real Application Testing options
  37. [oracle@server4 ~]$ exit
  38. logout
  39. [root@server4 ~]# crs_stat -t
  40. Name           Type           Target    State     Host        
  41. ------------------------------------------------------------
  42. ora.DATA.dg    ora....up.type ONLINE    ONLINE    server4     
  43. ora.FRA.dg     ora....up.type ONLINE    ONLINE    server4     
  44. ora....ER.lsnr ora....er.type ONLINE    ONLINE    server4     
  45. ora....N1.lsnr ora....er.type ONLINE    ONLINE    server5     
  46. ora....N2.lsnr ora....er.type ONLINE    ONLINE    server4     
  47. ora....N3.lsnr ora....er.type ONLINE    ONLINE    server4     
  48. ora.MGMTLSNR   ora....nr.type ONLINE    ONLINE    server4     
  49. ora.asm        ora.asm.type   ONLINE    ONLINE    server4     
  50. ora.cvu        ora.cvu.type   ONLINE    ONLINE    server4     
  51. ora.mgmtdb     ora....db.type ONLINE    ONLINE    server4     
  52. ora....network ora....rk.type ONLINE    ONLINE    server4     
  53. ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    server4     
  54. ora.ons        ora.ons.type   ONLINE    ONLINE    server4     
  55. ora.racdb.db   ora....se.type ONLINE    ONLINE    server5     
  56. ora.scan1.vip  ora....ip.type ONLINE    ONLINE    server5     
  57. ora.scan2.vip  ora....ip.type ONLINE    ONLINE    server4     
  58. ora.scan3.vip  ora....ip.type ONLINE    ONLINE    server4     
  59. ora....SM1.asm application    ONLINE    ONLINE    server4     
  60. ora....R4.lsnr application    ONLINE    ONLINE    server4     
  61. ora....er4.ons application    ONLINE    ONLINE    server4     
  62. ora....er4.vip ora....t1.type ONLINE    ONLINE    server4     
  63. ora....SM2.asm application    ONLINE    ONLINE    server5     
  64. ora....R5.lsnr application    ONLINE    ONLINE    server5     
  65. ora....er5.ons application    ONLINE    ONLINE    server5     
  66. ora....er5.vip ora....t1.type ONLINE    ONLINE    server5     
  67. [root@server4 ~]# su - oracle
  68. Last login: Sat Mar 21 22:13:59 CST 2020 on pts/0
  69. [oracle@server4 ~]$ sqlplus /nolog

  70. SQL*Plus: Release 12.1.0.2.0 Production on Sat Mar 21 22:20:45 2020

  71. Copyright (c) 1982, 2014, Oracle.  All rights reserved.

  72. SQL> conn / as sysdba
  73. Connected.
  74. SQL> create table hr.t_objects as select  * from dba_objects;

  75. Table created.

  76. SQL> con hr/oracle_4U
  77. SP2-0734: unknown command beginning "con hr/ora..." - rest of line ignored.
  78. SQL> conn hr/oracle_4U
  79. Connected.
  80. SQL> select count(*) from t_objects;

  81.   COUNT(*)
  82. ----------
  83.      91596

  84. SQL>
复制代码

tns串:
  1. /u01/app/oracle/product/12.1.0/dbhome_1/network/admin
复制代码
  1. C:\app\Apple\product\11.2.0\dbhome_1\NETWORK\ADMIN
复制代码

3 ACL 组属性上的RWX指的是 ACL, 最好不要用chmod去改这三位,而要用setfacl
3.1
  1. [root@classroom pub]# chmod o-r file.html
  2. [root@classroom pub]# ls -l file.html
  3. -rw-r----- 1 root root 12 Mar 22 05:21 file.html
  4. [root@classroom pub]# getfacl file.html
  5. # file: file.html
  6. # owner: root
  7. # group: root
  8. user::rw-
  9. group::r--
  10. other::---

  11. [root@classroom pub]# setfacl -m u:apache:r file.html
  12. [root@classroom pub]# ls -l file.html
  13. -rw-r-----+ 1 root root 12 Mar 22 05:21 file.html
  14. [root@classroom pub]# getfacl file.html
  15. # file: file.html
  16. # owner: root
  17. # group: root
  18. user::rw-
  19. user:apache:r--
  20. group::r--
  21. mask::r--
  22. other::---
复制代码



回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-21 19:52 , Processed in 0.035571 second(s), 27 queries .

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