caboのIT系Tipsの情報まとめ

インフラエンジニアなのでそれに関連したIT関連の記事や技術情報をメインに扱います。また、趣味のアウトドアや写真(主に風景)が好きなのでそちらもネタがあれば載せようと思います。

Shareplex9.2のora_setup<OCIStmtExecute: Oracle error ORA-01940>

既知の不具合のようですが、正常終了せずに少し手を加えています。
一連の作業内容は以下の通り。

  • DBのインスタンス登録

BEQUEATHで接続設定するのでoratabを編集してインスタンス登録

[telnet]

# vi /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 filed 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.
#
#
orasp21:/opt/oracle/app/oracle/product/11.2.0/dbhome_2:N

 

 

  • ora_setup実行

実施でエラーが。。よくわからない。なぜDropするんだろう。新規作成なのにとおもいつつ対応。
環境変数はインストレーションのものを利用。

 

www.cabo-surf.com

 

[telnet]

# /opt/splex/proddir/bin/ora_setup


Welcome to the Oracle SharePlex setup process for port 11000.
This process creates tables and user accounts needed to run
Oracle SharePlex replication.

Will the SharePlex install be using a BEQUEATH connection? (Entering 'n' implies a SQL*net connection) [y] :<改行>
Please note the following:
** In response to prompts, a carriage return will choose the default
given in brackets. If there is no default, a reply must be entered.

** To exit the program while the program is waiting for input, use the
CTRL-C key sequence.
This sequences can be entered by holding down the CONTROL key and
pressing the C key.


Enter the Oracle SID for which SharePlex should be installed [orasp21] :<改行>


In order to create the SharePlex tables and user account, we must
connect to the database as a DBA user

Enter a DBA user for orasp21 : system

Enter password for the DBA account, which will not echo <systemユーザのパスワード>

connecting--This may take a few seconds.

validating user name and password. . . This may take a few seconds.
SharePlex objects will need to be created under a special
account. You can pick an existing user or create a new one.
Would you like to create a new SharePlex user ? [y] :<改行>
Enter username for new user [splex/splex] : splex11000/splex11000

Warning: This user is now being granted unlimited tablespace.
This privilege will remain in effect until it is explicitly changed.
SPLEX_ROLE_BOTH already exists; continuing setup . . .

Do you want to enable replication of tables with TDE? [n] :<改行>

To enable replication of tables with TDE in the future, please rerun ora_setup.

Setup will now install SharePlex objects.

These are the existing tablespaces.

SYSTEM SYSAUX UNDOTBS1 TEMP USERS

Enter the default tablespace for use by SharePlex [USERS] :<改行>

Enter the temporary tablespace for use by SharePlex [TEMP] :<改行>
Enter the index tablespace for use by SharePlex [ ] : USERS

Creating SharePlex objects [Installation type: Fresh]. . .

Creating SharePlex Oracle-timezone-region map . . . Done.

Creating Conflict Resolution Package . . . Done.

Creating SharePlex Dataequator package . . .

Loading Compare Package from "/opt/splex/proddir/util/sp_deq_pkg.plb"...Done.

Note: The SharePlex object that supports replication of SDO_GEOMETRY cannot be installed
because the Oracle Spatial and Graph feature is not installed.

Do you want to continue with the setup without support for SDO_GEOMETRY? [n] :<改行>
Exiting Setup.

/opt/splex/proddir/.app-modules/ora_setup:
SQL> DROP USER splex11000 CASCADE

OCIStmtExecute: Oracle error ORA-01940: cannot drop a user that is currently connected

 

 

  • ora_setupでのORA-01940の対処

以下の公開情報をもとに対処。

support.quest.com

でも、そもそもsplexのユーザにConnect権限もついてないし、以下を設定。

 

[telnet]

# sqlplus system/admin

SQL*Plus: Release 11.2.0.4.0 Production on Sun Jan 6 00:48:34 2019

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters and Automatic Storage Management options


SQL> grant connect,dba to splex11000;

Grant succeeded.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters and Automatic Storage Management options
# sqlplus splex11000/splex11000

SQL*Plus: Release 11.2.0.4.0 Production on Sun Jan 6 00:49:15 2019

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters and Automatic Storage Management options

SQL> @/opt/splex/proddir/util/sp_deq_pkg.plb

Package created.


Package body created.

SQL> show error
No errors.
SQL> select object_name, object_type, owner from dba_objects where object_name='DBMS_LOB';

OBJECT_NAME
--------------------------------------------------------------------------------
OBJECT_TYPE OWNER
------------------- ------------------------------
DBMS_LOB
PACKAGE SYS

DBMS_LOB
PACKAGE BODY SYS

DBMS_LOB
SYNONYM PUBLIC


SQL> grant execute any procedure to splex11000;

Grant succeeded.

SQL> exit

  • ora_setup再実行

特にエラーなく実施完了。

[telnet]

# /opt/splex/proddir/bin/ora_setup

 

Welcome to the Oracle SharePlex setup process for port 11000.
This process creates tables and user accounts needed to run
Oracle SharePlex replication.

Will the SharePlex install be using a BEQUEATH connection? (Entering 'n' implies a SQL*net connection) [y] :<改行>
Please note the following:
** In response to prompts, a carriage return will choose the default
given in brackets. If there is no default, a reply must be entered.

** To exit the program while the program is waiting for input, use the
CTRL-C key sequence.
This sequences can be entered by holding down the CONTROL key and
pressing the C key.


Enter the Oracle SID for which SharePlex should be installed [orasp21] :<改行>


In order to create the SharePlex tables and user account, we must
connect to the database as a DBA user

Enter a DBA user for orasp21 : system

Enter password for the DBA account, which will not echo :<systemのパスワード>

connecting--This may take a few seconds.

validating user name and password. . . This may take a few seconds.
SharePlex objects will need to be created under a special
account. You can pick an existing user or create a new one.
Would you like to create a new SharePlex user ? [y] : n
Enter username of an existing user : splex11000

Enter user password for splex11000 :splex11000
validating user name and password. . . This may take a few seconds.

Warning: This user is now being granted unlimited tablespace.
This privilege will remain in effect until it is explicitly changed.
SPLEX_ROLE_BOTH already exists; continuing setup . . .

Do you want to enable replication of tables with TDE? [n] :<改行>

To enable replication of tables with TDE in the future, please rerun ora_setup.

Setup will now install SharePlex objects.

These are the existing tablespaces.

SYSTEM SYSAUX UNDOTBS1 TEMP USERS

Enter the default tablespace for use by SharePlex [USERS] :<改行>

Enter the temporary tablespace for use by SharePlex [TEMP] :<改行>
Enter the index tablespace for use by SharePlex [ ] : USERS

The current index tablespace for user splex11000 is TOOLS.
Do you want to change to USERS? [y] : n

Creating SharePlex objects [Installation type: Upgrade]. . .
SPLEX11000.SHAREPLEX_CONF_LOG already exists; continuing setup . . .
SPLEX11000.SHAREPLEX_CONF_LOG_SEQ already exists; continuing setup . . .
SPLEX11000.SHAREPLEX_DATAEQUATOR_INS_TEMP already exists; continuing setup . . .
SPLEX11000.SHAREPLEX_DATAEQUATOR_UPD_TEMP already exists; continuing setup . . .
SPLEX11000.SHAREPLEX_DATAEQUATOR_DEL_TEMP already exists; continuing setup . . .
SPLEX11000.SHAREPLEX_RECOVERY already exists; continuing setup . . .
SPLEX11000.SHAREPLEX_RECOVERY_OP_SEQ already exists; continuing setup . . .
SPLEX11000.SHAREPLEX_ANALYZE already exists; continuing setup . . .

Creating SharePlex Oracle-timezone-region map . . . Done.

Creating Conflict Resolution Package . . . Done.

Creating SharePlex Dataequator package . . .
drop package:sp_deq_pkg

Loading Compare Package from "/opt/splex/proddir/util/sp_deq_pkg.plb"...Done.

Note: The SharePlex object that supports replication of SDO_GEOMETRY cannot be installed
because the Oracle Spatial and Graph feature is not installed.

Do you want to continue with the setup without support for SDO_GEOMETRY? [n] :<改行>
Exiting Setup.

/opt/splex/proddir/.app-modules/ora_setup: