oracle集群RAC管理-密码文件管理-ASM

在12c中,Oracle ASM通过将密码文件存储在磁盘组里面

ASM密码文件默认存储在OCR磁盘组中,DB密码文件存储在数据文件所在磁盘组,可以通过手动修改密码文件所在磁盘组

[root@rac1 ~]# /u01/app/12.2.0/grid/bin/srvctl modify asm -pwfile '+DATA/orapwASM'
2.3 创建密码文件

  • ASM 密码文件
    orapwd file=’+data/ASM/orapwasm’ asm=y
  • 数据库密码文件
    orapwd file=’+data/ORCL/orapwdb’ dbuniquename=‘cndba’
  • 通过之前版本的密码文件,在磁盘组中创建新的密码文件
    orapwd input_file=’/oraclegrid/dbs/orapwasm’ file=’+data/ASM/orapwasm’ asm=y

检查主库节点1的dbs下没有密码文件,所以需先从asm中拷贝出来:

/oracle/app/oracle/product/19c/dbhome_1/dbs/

注意密码文件格式orapwcisdb1

从主库节点1拷贝密码文件到备库节点1的db home的dbs目录下:

 [root@rac1 ~]# su - grid

Last login: Tue Nov 19 11:55:37 CST 2019

[grid@rac1 ~]$ asmcmd

ASMCMD> pwcopy pwdcisdb.256.1024323395 /oracle/app/grid/orapwcisdb1

copying +data/cisdb/PASSWORD/pwdcisdb.256.1024323395 -> /oracle/app/grid/orapwcisdb1

[root@rac1 ~]# cp /oracle/app/grid/pwdcisdb /oracle/app/oracle/product/19c/dbhome_1/dbs/orapwcisdb1

[root@rac1 ~]# chown oracle:oinstall /oracle/app/oracle/product/19c/dbhome_1/dbs/orapwcisdb1

[root@rac1 ~]# su - oracle

Last login: Tue Nov 19 11:02:12 CST 2019 on pts/0

[oracle@rac1 ~]$ scp /oracle/app/oracle/product/19c/dbhome_1/dbs/orapwcisdb1 dgrac1:/oracle/app/oracle/product/19c/dbhome_1/dbs/

The authenticity of host 'dgrac1 (192.168.52.160)' can't be established.

ECDSA key fingerprint is SHA256:xpJNeZwdOi6mRKZkQOaAL0N+tViUh1GuZlBDhnLYelg.

ECDSA key fingerprint is MD5:9c:74:bd:93:4b:26:f6:dc:6d:69:a0:2e:c6:2a:23:be.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'dgrac1,192.168.52.160' (ECDSA) to the list of known hosts.

oracle@dgrac1's password:

Permission denied, please try again.

oracle@dgrac1's password:

orapwcisdb1   

再拷贝一份到备库节点2:

scp /oracle/app/oracle/product/19c/dbhome_1/dbs/orapwcisdb1 dgrac1:/oracle/app/oracle/product/19c/dbhome_1/dbs/orapwcisdb2

注意:如果密码文件没有,或格式不对,那么测试联通性的时候报错如下:

[oracle@dgrac1 dbs]$ sqlplus sys/oracle@std as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Nov 19 12:00:29 2019

Version 19.5.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

ERROR:

ORA-01017: ???/????; ?????

Enter user-name: ^C

 

拷贝密码文件到asm中管理:

[root@dgrac1 ~]# su - grid

Last login: Tue Nov 19 13:48:06 CST 2019

[grid@dgrac1 ~]$ asmcmd

ASMCMD> mkdir password

ASMCMD> pwcopy /oracle/app/oracle/product/19c/dbhome_1/dbs/orapwcisdb1 +data/cisdb/password/orapwcisdb

copying /oracle/app/oracle/product/19c/dbhome_1/dbs/orapwcisdb1 -> +data/cisdb/password/orapwcisdb

ASMCMD> cd password

ASMCMD> ls

orapwcisdb

ASMCMD> ls -l

Type      Redund  Striped  Time             Sys  Name

PASSWORD  UNPROT  COARSE   NOV 19 13:00:00  N    orapwcisdb => +DATA/DB_UNKNOWN/PASSWORD/pwddb_unknown.275.1024753997

ASMCMD> pwcopy /oracle/app/oracle/product/19c/dbhome_1/dbs/orapwcisdb1 +data/cisdb/password/pwdcisdb

copying /oracle/app/oracle/product/19c/dbhome_1/dbs/orapwcisdb1 -> +data/cisdb/password/pwdcisdb

ASMCMD> ls -l

Type      Redund  Striped  Time             Sys  Name

PASSWORD  UNPROT  COARSE   NOV 19 13:00:00  N    orapwcisdb => +DATA/DB_UNKNOWN/PASSWORD/pwddb_unknown.275.1024753997

PASSWORD  UNPROT  COARSE   NOV 19 13:00:00  N    pwdcisdb => +DATA/DB_UNKNOWN/PASSWORD/pwddb_unknown.276.1024754077

ASMCMD> rm +data/cisdb/password/pwdcisdb

在备库节点1使用oracle用户操作:

[oracle@dgrac1 ~]$ srvctl add database -db cisdbdg -dbname cisdb -oraclehome /oracle/app/oracle/product/19c/dbhome_1 -dbtype RAC -role PHYSICAL_STANDBY

[oracle@dgrac1 ~]$

[oracle@dgrac1 ~]$ srvctl add instance -db cisdbdg -instance cisdb1 -node dgrac1

[oracle@dgrac1 ~]$ srvctl add instance -db cisdbdg -instance cisdb2 -node dgrac2

[oracle@dgrac1 ~]$ srvctl modify database -db cisdbdg -spfile '+data/cisdb/PARAMETERFILE/spfile.274.1024752989' -pwfile '+data/cisdb/password/orapwcisdb'

[oracle@dgrac1 ~]$ srvctl modify database -db cisdb -diskgroup DATA

如果多个磁盘组,用逗号隔开。
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值