ORACLE RAC19C到单实例ADG DUPLICATE ORA-01017 错误的解决办法
Posted 久违的太阳
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORACLE RAC19C到单实例ADG DUPLICATE ORA-01017 错误的解决办法相关的知识,希望对你有一定的参考价值。
准备搭建一个19C RAC到单实例的ADG.在duplicate的时候报错ORA-01017用户密码错误
contents of Memory Script:
backup as copy reuse
passwordfile auxiliary format '/u01/app/oracle/product/19.3.0/db_1/dbs/orapwrac19c' ;
executing Memory Script
Starting backup at 14-SEP-20
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=285 instance=rac19c2 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 09/14/2020 10:05:46
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 09/14/2020 10:05:46
ORA-17627: ORA-01017: invalid username/password; logon denied
ORA-17629: Cannot connect to the remote database server
RMAN>
这个问题以前是很常见的,一般就是密码文件不对,这里仔细检查了发现都是对的.
然后我们尝试使用orapwd修改密码,然后拷贝密码文件,使用sqlplus在primary端和standby端分别连接对方,发现在standby 使用新的密码连接RAC端报错密码错误.这里我们可以得出,使用orapwd修改后的密码在RAC并没有生效,这是为什么呢?
原来到了19c,RAC的密码文件是保存在ASM中,我们可以使用下面的sql语句查看密码文件:
SQL> select * from v$passwordfile_info;
FILE_NAME
--------------------------------------------------------------------------------
FORMAT IS_AS CON_ID
------ ----- ----------
+DATA/RAC19C/PASSWORD/pwdrac19c.256.1047615941
那么我们怎么解决呢.大概步骤如下:
1.在$ORACLE_HOME/dbs下生成和以前版本一样的密码文件,但是注意文件名和以前不一样,以前版本叫orapwSID,现在直接叫pwdSID了,这里指定了磁盘组:
orapwd file=pwdrac19c asm=data password=Dsg_1234
2.将密码文件拷贝到磁盘组中:
ASMCMD> pwcopy /u01/app/oracle/product/19.3.0.0/db_1/dbs/pwdrac19c .
copying /u01/app/oracle/product/19.3.0.0/db_1/dbs/pwdrac19c -> +DATA/rac19c/password/pwdrac19c
3.修改数据中的密码文件名称
查看当前的密码文件:
[grid@rac19c1 ~]$ srvctl config database -d rac19c -a
Database unique name: rac19c
Database name: rac19c
Oracle home: /u01/app/oracle/product/19.3.0.0/db_1
Oracle user: oracle
Spfile: +DATA/RAC19C/PARAMETERFILE/spfile.272.1047617445
Password file: +DATA/RAC19C/PASSWORD/pwdrac19c.256.1047615941
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
Database is enabled
Database is individually enabled on nodes:
Database is individually disabled on nodes:
OSDBA group: dba
OSOPER group: oper
Database instances: rac19c1,rac19c2
Configured nodes: rac19c1,rac19c2
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services:
Database is administrator managed
可以看到Password file为+DATA/RAC19C/PASSWORD/pwdrac19c.256.1047615941
如何修改密码文件呢,使用srvctl modify,查看一下帮助:
[grid@rac19c1 ~]$ srvctl modify database -d rac19c -h
Modifies the configuration for the database.
Usage: srvctl modify database -db <db_unique_name> [-dbname <db_name>] [-instance <instance_name>] [-oraclehome <oracle_home>] [-user <oracle_user>] [-server "<server_list>"] [-timeout <timeout>] [-domain <domain>] [-spfile <spfile>] [-pwfile <password_file_path>] [-role PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY] [-startoption <start_options>] [-stopoption <stop_options>] [-startconcurrency <start_concurrency>] [-stopconcurrency <stop_concurrency>][-policy AUTOMATIC | MANUAL | NORESTART | USERONLY] [-serverpool "<serverpool_list>" [-node <node_name>]] [-pqpool <pq_server_pools>] [-diskgroup "<diskgroup_list>"|-nodiskgroup] [-acfspath "<acfs_path_list>"] [-css_critical YES | NO] [-cpucount <cpu_count> [-overridepools <overridepool_list>]] [-memorytarget <memory_target>] [-maxmemory <max_memory>] [-defaultnetnum <network_number>] [-disabledreason DECOMMISSIONED] [-force] [-eval] [-verbose]
-db <db_unique_name> Unique name for the database
-dbname <db_name> Database name (DB_NAME), if different from the unique name given by the -db option
-instance <inst_name> Instance name prefix; required for administrator-managed RAC One Node database
-oraclehome <path> Oracle home path
-user <oracle_user> Oracle user
-server "<server_list>" Candidate server list for RAC One Node database
-timeout <timeout> Online relocation timeout in minutes
-domain <domain_name> Domain for database. Must be set if database has DB_DOMAIN set.
-spfile <spfile> Server parameter file path
-pwfile <password_file_path> Password file path
-role <role> Role of the database (PRIMARY, PHYSICAL_STANDBY, LOGICAL_STANDBY, SNAPSHOT_STANDBY)
-startoption <start_options> Startup options for the database. Examples of startup options are OPEN, MOUNT, or "READ ONLY".
-stopoption <stop_options> Stop options for the database. Examples of shutdown options are NORMAL, TRANSACTIONAL, IMMEDIATE, or ABORT.
-policy <dbpolicy> Management policy for the database (AUTOMATIC, MANUAL, NORESTART or USERONLY)
-serverpool "<serverpool_list>" Comma separated list of database server pool names
-pqpool "<pq_pool_list>" Comma separated list of parallel query server pool names
-node <node_name> Node name in specified server pool on which to run single-instance database
-diskgroup "<diskgroup_list>" Comma separated list of disk group names
-nodiskgroup To remove database's dependency upon disk groups
-acfspath "<acfs_path_list>" Comma separated list of ACFS paths where database's dependency will be set
-startconcurrency <start_concurrency> Number of instances to be started simultaneously (or 0 for empty start_concurrency value)
-stopconcurrency <stop_concurrency> Number of instances to be stopped simultaneously (or 0 for empty stop_concurrency value )
-eval Evaluates the effects of event without making any changes to the system
-css_critical YES | NO Define whether the database or service is CSS critical
-cpucount <cpu_count> Number of workload CPUs
-memorytarget <memory_target> Target memory, in MB, used by the resource
-maxmemory <max_memory> Maximum memory, in MB, used by the resource
-defaultnetnum <network_number> Default network number for database services
-overridepools "<overridepool_list>" Comma separated list of override pool names
-disabledreason <reason_disabled> Reason database was disabled (DECOMMISSIONED)
-force Force the modify operation to stop database and service resources on some nodes as necessary, or to change management policy of all service to match new database management policy
-verbose Verbose output
-help Print usage
根据帮助说明,使用-pwdfile选项修改密码文件:
[oracle@rac19c1 ~]$ srvctl modify database -d rac19c -pwfile +DATA/RAC19C/PASSWORD/pwdrac19c
修改完成之后,再在standby端使用sqlplus登录验证:
[oracle@ora19c2 dbs]$ sqlplus sys/Dsg_1234@dsgds as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Sep 14 10:46:23 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
再发起duplicate:
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 14-SEP-20
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/RAC19C/DATAFILE/system.260.1047615955
output file name=/u01/oradata/rac19cdsg/datafile/system.260.1047615955 tag=TAG20200914T105137
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DATA/RAC19C/DATAFILE/sysaux.262.1047615959
output file name=/u01/oradata/rac19cdsg/datafile/sysaux.262.1047615959 tag=TAG20200914T105137
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+DATA/RAC19C/DATAFILE/undotbs1.264.1047615959
output file name=/u01/oradata/rac19cdsg/datafile/undotbs1.264.1047615959 tag=TAG20200914T105137
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
以上是关于ORACLE RAC19C到单实例ADG DUPLICATE ORA-01017 错误的解决办法的主要内容,如果未能解决你的问题,请参考以下文章
Oracle 11g R2 rac通过rman 恢复到单实例数据库
通过RMAN将Oracle 11g R2 RAC数据迁移到单实例数据库
搭建19c Oracle ADG环境(DB_NAME与DB_UNIQUE_NAME不同)