Oracle Sharding 在deploy 时可能会报如下错误:
[dave@www.cndba.cn ~]$ gdsctl
GDSCTL: Version 18.0.0.0.0 - Production on Wed Oct 17 17:19:40 CST 2018
Copyright (c) 2011, 2018, Oracle. All rights reserved.
Welcome to GDSCTL, type "help" for information.
Current GSM is set to SHARDDIRECTOR
GDSCTL>
GDSCTL> deploy
deploy: examining configuration...
deploy: deploying primary shard 'sh1' ...
deploy: network listener configuration successful at destination 'shard1'
deploy: starting DBCA at destination 'shard1' to create primary shard 'sh1' ...
Remote job failed with error:
EXTERNAL_LOG_ID="job_74066_135",
USERNAME="oracle"
For more details:
select destination, output from all_scheduler_job_run_details
where job_name='SHARD_SH1_DBCREATE'
deploy: DBCA primary creation job failed at destination 'shard1' for shard 'sh1'
Deployment has terminated due to previous errors.
The operation completed successfully
GDSCTL> deploy
deploy: examining configuration...
deploy: deploying primary shard 'sh1' ...
Remote job failed with error:
EXTERNAL_LOG_ID="job_74064_140",
USERNAME="oracle"
For more details:
select destination, output from all_scheduler_job_run_details
where job_name='SHARD_SH1_NETCA'
deploy: NETCA failed at destination 'shard1'
Deployment has terminated due to previous errors.
The operation completed successfully
从输入让我们直接查询SQL语句来查看具体的错误信息:
[dave@www.cndba.cn ~]$ sqlplus / as sysdba
SQL*Plus: Release 18.0.0.0.0 - Production on Wed Oct 17 17:19:10 2018
Version 18.3.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0
SQL> select destination, output from all_scheduler_job_run_details where job_name='SHARD_SH1_DBCREATE';
DESTINATION
--------------------------------------------------------------------------------
OUTPUT
--------------------------------------------------------------------------------
SHARD1
[WARNING] [DBT-10328] Specified GDB Name (sh1) may have a potential conflict wit
h an already existing database on the system.
ACTION: Specify a different GDB Name that does not conflict with existing dat
abases on the system.
[FATAL] [DBT-10317] Specified SID Name (sh1) already exists.
ACTION: Specify a different SID Name that does not already exist.
SHARD1
DESTINATION
--------------------------------------------------------------------------------
OUTPUT
--------------------------------------------------------------------------------
[WARNING] [DBT-10328] Specified GDB Name (sh1) may have a potential conflict wit
h an already existing database on the system.
ACTION: Specify a different GDB Name that does not conflict with existing dat
abases on the system.
[FATAL] [DBT-10317] Specified SID Name (sh1) already exists.
ACTION: Specify a different SID Name that does not already exist.
SQL> select destination, output from all_scheduler_job_run_details where job_name='SHARD_SH1_NETCA';
DESTINATION
--------------------------------------------------------------------------------
OUTPUT
--------------------------------------------------------------------------------
SHARD1
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /u01/app/oracle/product/18.3.0/dbhome_1/shard_sh1
_netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Configuring Listener:LISTENER_sh1
DESTINATION
--------------------------------------------------------------------------------
OUTPUT
--------------------------------------------------------------------------------
Listener configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/u01/app/oracle/product/18.3.0/dbhome_1/bin/lsnrctl start LISTENER_sh1
Listener Control complete.
Listener started successfully.
Profile configuration complete.
Oracle Net Services configuration successful. The exit code is 0
DESTINATION
--------------------------------------------------------------------------------
OUTPUT
--------------------------------------------------------------------------------
SHARD1
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /u01/app/oracle/product/18.3.0/dbhome_1/shard_sh1
_netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Listener "LISTENER_SH1" already exists.
Profile configuration complete.
DESTINATION
--------------------------------------------------------------------------------
OUTPUT
--------------------------------------------------------------------------------
Check the trace file for details: /u01/app/oracle/cfgtoollogs/netca/trace_OraDB1
8Home1-1810174PM5624.log
Oracle Net Services configuration failed. The exit code is 1
SHARD1
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /u01/app/oracle/product/18.3.0/dbhome_1/shard_sh1
_netca.rsp
DESTINATION
--------------------------------------------------------------------------------
OUTPUT
--------------------------------------------------------------------------------
Done parsing command line arguments.
Oracle Net Services Configuration:
Listener "LISTENER_SH1" already exists.
Profile configuration complete.
Check the trace file for details: /u01/app/oracle/cfgtoollogs/netca/trace_OraDB1
8Home1-1810175PM0759.log
Oracle Net Services configuration failed. The exit code is 1
SHARD1
DESTINATION
--------------------------------------------------------------------------------
OUTPUT
--------------------------------------------------------------------------------
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /u01/app/oracle/product/18.3.0/dbhome_1/shard_sh1
_netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Configuring Listener:LISTENER_sh1
Listener configuration complete.
DESTINATION
--------------------------------------------------------------------------------
OUTPUT
--------------------------------------------------------------------------------
Oracle Net Listener Startup:
Running Listener Control:
/u01/app/oracle/product/18.3.0/dbhome_1/bin/lsnrctl start LISTENER_sh1
Listener Control complete.
Listener started successfully.
Profile configuration complete.
Oracle Net Services configuration successful. The exit code is 0
SHARD1
DESTINATION
--------------------------------------------------------------------------------
OUTPUT
--------------------------------------------------------------------------------
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /u01/app/oracle/product/18.3.0/dbhome_1/shard_sh1
_netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Listener "LISTENER_SH1" already exists.
Profile configuration complete.
Check the trace file for details: /u01/app/oracle/cfgtoollogs/netca/trace_OraDB1
DESTINATION
--------------------------------------------------------------------------------
OUTPUT
--------------------------------------------------------------------------------
8Home1-1810175PM1138.log
Oracle Net Services configuration failed. The exit code is 1
我们这里有两种错误,一种是监听已经存在,一种是数据库实例已经存在。
Listener "LISTENER_SH1" already exists.
[FATAL] [DBT-10317] Specified SID Name (sh1) already exists.
解决方法就是删除相关的信息,实例从/etec/oratab中删除,监听从listener.ora文件中删除:
[dave@www.cndba.cn admin]$ cat /etc/oratab
#
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
sh1:/u01/app/oracle/product/18.3.0/dbhome_1:N
[dave@www.cndba.cn admin]$ pwd
/u01/app/oracle/product/18.3.0/dbhome_1/network/admin
[dave@www.cndba.cn admin]$ ls
listener.ora sqlnet.ora tnsnames.ora
[dave@www.cndba.cn admin]$
确保相关数据库进程已经kill,数据文件已经删除:
[dave@www.cndba.cn admin]$ ps -ef|grep smon
oracle 5329 2060 0 20:38 pts/0 00:00:00 grep --color=auto smon
oracle 25485 1 0 20:27 ? 00:00:00 ora_smon_sh1
[dave@www.cndba.cn admin]$ kill -9 25485
[dave@www.cndba.cn admin]$ ps -ef|grep smon
oracle 5483 2060 0 20:39 pts/0 00:00:00 grep --color=auto smon
[dave@www.cndba.cn admin]$ lsnrctl stop
LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 17-OCT-2018 20:39:15
Copyright (c) 1991, 2018, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully
[oracle@shard1 admin]$
在deploy就正常进行了。
版权声明:本文为博主原创文章,未经博主允许不得转载。