Symptoms

The following errors are reported in the Export log file:

EXP-00008: ORACLE error 4063 encountered
ORA-04063: package body "WMSYS.LT_EXPORT_PKG" has errors
ORA-06508: PL/SQL: could not find program unit being called: "WMSYS.LT_EXPORT_PKG"
ORA-06512: at line 1
EXP-00083: The previous problem occurred when calling
                     WMSYS.LT_EXPORT_PKG.schema_info_exp

Recent Changes to this Environment:
    Revoked the execute privilege on UTL_FILE package from Public.

Cause

The issue is caused by the revoke of the execute privilege on UTL_FILE package from Public.

Oracle Workspace Manager and some other database components (which are not installed in the
database) need the privilege to execute procedure SYS.UTL_FILE.

During the creation of a default Database, the Workspace Manager gets installed by default.

The WMSYS user becomes intertwined with the export process and must be valid or at least the major parts for an export to complete properly as the export process looks for any "version-enabled" tables that
Workspace Manager may be using.

Solution

To implement the solution, please execute the following steps:

1. if it's necessary to keep the "Revoke execute" on UTL_FILE package, it's available the following
    workaround:

    - Grant execute on SYS.UTL_FILE to WMSYS
    - Lock account WMSYS (if it is not done before)
    - Run script $ORACLE_HOME/rdbms/admin/utlrp.sql

   As this workaround is different from the default settings, there is no guarantees that it works all the time.


2. check for:
    - invalid objects in the WMSYS schema with the statement
       SQL> select object_name,object_type,owner,status from dba_objects where status='INVALID' and
                  owner='WMSYS';

    - errors on the export

Posted by pat98

2008. 11. 9. 16:15 오라클

ORA-1591 해결 방법


DISTRIBUTED TRANSACTION TROUBLESHOOTING (ORA-1591해결 방법)
==========================================================

다른 database를 이용하지 않는 local transaction이, 비정상 종료시 자동으로
rollback되는 것과는 달리, 분산 트랜잭션의 경우 2 phase commit수행 단계중에
fail이 발생하게 되면 관여된 일부 database에서는 rollback 혹은 commit이 되고,
일부는 distributed lock이 걸린 상태로 계속 지속될 수 있다.
이렇게 pending된 transaction에 대해서는 기본적으로 Oracle의 background
process인 RECO process가 자동으로 정리하여 주나, 경우에 따라 자동으로 정리가
되지 못하는 상황이 발생할 수 있다.

이렇게 정리가 되지 않아, distributed lock이 걸린 경우에는, 이후 관계된
table을 조회나 변경시 ora-1591 오류가 발생할 수 있으므로, distributed
transaction이 실패한 경우 db admin이 관여하여 pending된 transaction을
정리하여 줄 필요가 있다.

distributed transaction이 오류가 발생하거나, 혹은 이후에 ora-1591이 발생하는
경우, 조치 방법을 9단계의 STEP으로 정리하였다.

*** distributed transaction의 2 phase commit에 대한 개념 및 자세한 절차는
<korean bulletin:12185>를 참조한다.

[참고 1] 문서의 이해를 위해서 분산 환경에 포함된 node를 V817LOC와 V817REM으로
예를 들고, V817LOC node에서 transaction을 수행하였다고 가정한다.

[참고 2] 아래에 언급되는 dbms_transaction package는 기본적으로 catproc.sql
script에 의해 생성되나 만약 존재하지 않는다면,
cd $ORACLE_HOME/rdbms/admin directory의 dbmsutil.sql, prvtutil.plb
script를 sys user에서 수행하도록 한다.
(svrmgrl에서 connect internal에서 수행하는것이 일반적)

그리고 이 package는 항상 transaction의 맨 처음에 수행되어야 한다.
즉, 새로 session을 연결하여 수행하거나, 혹은 앞에 dml에 있었다면,
commit이나 rollback을 수행 후 이 package를 수행하여야 한다.

아래의 STEP중 STEP 1 ~ 3까지는 문제 해결을 위해 필수적인 단계는 아니므로 바로
문제를 시급히 해결해야 하는 경우 4번부터 확인하도록 한다.

STEP 1: alert.log file을 check한다.

bdump directory의 alert.log에는 분산 트랜잭션 fail시 관계된 오류 메시지등
log가 항상 남게 된다. 예를 들면 다음과 같은 형태인데, rollback/commit되었
는지, in-doubt 상태인지와 그 외에 transaction id등 정보를 확인할 수 있다.

Tue Dec 12 16:23:25 2000
ORA-02054: transaction 1.8.238 in-doubt
ORA-02063: preceding line from V817REM
Tue Dec 12 16:23:25 2000
DISTRIB TRAN V817LOC.WORLD.89f6eafb.1.8.238
is local tran 1.8.238 (hex=01.08.ee)
insert pending prepared tran, scn=194671 (hex=0.0002f86f)


STEP 2: network 환경을 확인한다.

listener가 떠 있는지, database link가 모두 정상적인지 확인해 본다.

STEP 3: RECO process가 떠 있는지 확인한다.

os상에서 RECO process가 떠 있는지 확인하려면 다음과 같이 한다.

os> ps -ef | grep reco

RECO process는 db가 startup되면서 자동으로 구동되는 background process로
distributed recovery를 disable시키면 사라지게 된다. distributed recovery를
enable/disable시키는 방법은 아래와 같다.

SQL>alter system enable distributed recovery;
SQL>alter system disable distributed recovery;

아래의 조치사항 중에서 STEP 9번을 제외하고는 기본적으로 RECO process가
자동으로 처리하는 작업과 동일하다. 그러나 여러가지 문제로 인해 RECO가
자동으로 정리하지 못한 경우 이 문서의 방법대로 manual하게 정리하여 주어야
한다.

STEP 4: DBA_2PC_PENDING을 조회해 본다.

sqlplus system/manager
SQL>select local_tran_id, global_tran_id, state, mixed, host, commit#
from dba_2pc_pending;

다음과 같은 결과가 return된다.

LOCAL_TRAN_ID|GLOBAL_TRAN_ID |STATE |MIX|HOST |COMMIT#
-------------|----------------------|--------|---|----------|--------
1.8.238 |V817LOC.WORLD.89f6eafb|prepared|no |SUP_SERVER|194671
|.1.8.238 | | |\eykim |


이 조회로 인해 여러개의 row가 나오는 경우 ora-1591이나 distributed fail에
관련된 오류시 나타나는 local transaction id값과 return된 LOCAL_TRAN_ID값을
비교하여 일치하는 row를 확인하면 된다. 이때 LOCAL_TRAN_ID 값과
GLOBAL_TRAN_ID의 뒷부분의 숫자가 동일하다면 이것은 이 node가 global
coordinator임을 의미한다.

STEP 5: DBA_2PC_NEIGHBORS view를 조회해 본다.

sqlplus system/manager
SQL>select local_id, in_out, database, dbuser_owner, interface
from dba_2pc_neighbors;

LOCAL_TRAN_ID|IN_OUT|DATABASE |DBUSER_OWNER |INT
-------------|------|-------------------------|---------------|---
1.8.238 |in | |SCOTT |N
1.8.238 |out |V817REM.WORLD |SCOTT |C

여기에 나타난 row들이 해당 분산 트랜잭션에 관여한 database 정보이다. 이때
DATABASE column 부분이 null로 나타나는 것은 현재 조회하고 있는 local
database를 의미하며, IN_OUT이 OUT으로 나타나는 경우 참조하는 node정보인데,
DATABASE 컬럼의 값이 해당 database를 가리키는 database link name이 된다.
이 database link name을 이용하여 다음과 같이 remote db의 DBA_2PC_PENDING을
다시 조사하여 관계된 node들의 상태를 확인할 수 있다.

SQL>select local_tran_id, global_tran_id, state, mixed, host, commit#
from dba_2pc_pending@v817rem;

각 node의 DBA_2PC_PENDING의 return된 row들이 같은 분산 트랜잭션에 포함된
정보인지는 GLOBAL_TRAN_ID 값을 이용하여 확인할 수 있다.

STEP 6: commit point site를 확인한다.

commit point site에 대해서는 <korean bulletin:12185>을 참조한다.
이 예의 경우 COMMIT_POINT_STRENGTH를 지정하지 않았기 때문에 default로
global coordinator가 아닌 V817REM이 commit point site가 된다. 일반적으로
commit point site는 global coordinator의 DBA_2PC_NEIGHBORS의 IN_OUT
field가 OUT으로 나타나고 INTERFACE 부분이 C로 나타나게 된다.

commit point site가 중요한 이유는 이 node의 local transaction부분은
prepared상태를 거치지 않아 in-doubt 상태가 되는 일이 없고, 그러므로
distributed lock에 의해 조회나 DML시 오류가 발생하는 없게 된다.
이러한 이유로 제일 중요한 data를 포함하는 중심이 되는 node를 commit point
site로 지정하는 것이 바람직하다.

STEP 7: DBA_2PC_PENDING의 MIXED column을 확인한다.

- MIXED값이 NO인 경우 : STEP 8 수행
- MIXED값이 YES인 경우: STEP 9 수행

DBA_2PC_PENDING에서 MIXED column을 YES나 NO의 값으로 지정하는 것은 RECO
process가 결정하여 변경하게 된다. MIXED가 YES가 되는 대표적인 경우는,
commit point site가 이미 commit을 수행한 상태에서 분산 트랜잭션이 fail된
경우, non-commit point site에서 prepared 상태의 transaction을 rollback
force시켜 분산 트랜잭션의 consistency가 깨진 상태이다.
(STATE column의 경우 commit point site는 COMMITTED로 non-commit point
site는 FORCED ROLLBACK으로 나타난다)

[참고] commit point site가 아직 commit을 수행하기 전에 분산 트랜잭션이
fail되어 commit point site가 rollback된 경우, non-commit point
site에서 prepared 상태의 transaction을 commit force 하면 이것도
논리적으로는 consistency가 지켜지지 않은 것은 동일하나 이때는
MIXED column이 no인 상태가 된다. 그 이유는 commit point site가
rollback되어 DBA_2PC_PENDING view에 entry가 남지 않기 때문에
RECO가 명시적으로 mixed 상태로 인식하는 것이 불가능하기 때문으로
파악된다.

STEP 8: DBA_2PC_PENDING의 STATE column의 값을 확인한다.

CASE 8-1: STATE field값이 COMMITTED인 경우

만약 STATE가 COMMITTED인 경우는 이 local database(V817LOC)에서는
transaction이 성공적으로 commit 되었음을 나타내므로, 이 node에서는 어떠한
작업도 수행할 필요가 없다. 이 entry는 RECO process에 의해 자동으로 지워질
것이며, 만약 RECO가 어떠한 이유로 이 row를 지우지 못했다면 다음과 같이
db admin이 직접 지워도 된다. 괄호 안의 값은 local_tran_id값이다.

sqlplus sys/manager (반드시 sys로 접속한다)
SQL>exec dbms_transaction.purge_lost_db_entry('1.8.238');

이렇게 V817LOC의 STATE부분이 COMMITTED인 경우는, 이미 commit point site인
V817REM은 commit된 후임을 나타낸다. 그러므로 V817REM은 STATE가 COMMITTED로
나타나거나 아니면 commit후 이미 정보가 지워져 DBA_2PC_PENDING에 정보가
나타나지 않을 수 있다. 그러므로 V817REM에 대해서는 필요한 경우 V817LOC의
앞의 조치 방법과 동일하게 DBA_2PC_PENDING의 내용만 정리하여 주면 된다.

만약 V817REM이 아닌 별도의 다른 node가 분산 트랜잭션에 관여했다고 가정하고
V817LOC가 COMMITTED인 상태에서 그 node의 STATE가 PREPARED로 나타난다면
그 node에 대해서는 아래의 CASE 8-2를 참조하여 해결하도록 한다.

CASE 8-2: STATE field값이 PREPARED인 경우

STATE값이 PREPARED인 경우는 이 node(V817LOC)에서 변경된 data가 속한 block
에 distributed lock이 걸린 상태이며, 이런 경우 변경된 data가 있는 block에
대한 모든 read/write가 ora-1591을 발생시키므로 trouble shooting에서 제일
중요한 부분이라 할 수 있다.

먼저 STEP 4와 STEP 5를 참조하여 관계된 모든 node들의 DBA_2PC_PENDING view
를 조회하여 본다. 이때 다른 node(V817REM)의 DBA_2PC_PENDING에 정보가 없다
면 V817REM이 commit point site이고 이미 data는 rollback되었음을 나타낸다.
이때는 V817LOC의 prepared 상태의 transaction을 다음과 rollback force 시켜
준다.

즉, V817LOC에서,

SQL>rollback force '1.8.238';

만약 V817REM node에 해당 정보가 있고 상태가 COMMITTED라면 V817LOC도
다음과 같이 commit을 해 주어야 한다.

SQL>commit force '1.8.238';

이때 local_tran_id 뒤에 SCN을 지정할 수 있는데 이것은 관여된 node 중 제일
큰 SCN을 지정하도록 한다. 이 SCN 값은 DBA_2PC_PENDING의 COMMIT# field에서
값을 확인할 수 있으며 이렇게 하는 이유는 이후 분산 database중 한 database
에서 incomplete recovery가 필요한 경우, 다른 database 들도 일관성을
맞추기 위해 incomplete recovery를 이용할 수 있게 하기 위한 것이다.

SQL>commit force '1.8.238', '194671'

CASE 8-3: STATE field값이 COLLECTING인 경우

STATE field가 collecting인 경우는 아직 distributed lock을 걸기 전단계에서
transaction이 비정상 종료됨을 나타내며, 이 단계에서는 distributed lock이
걸리기 전이어서 변경된 data는 이미 rollback된 상태이다. 이 경우는
DBA_2PC_PENDING에서 해당 entry를 지워 주면 된다.

sqlplus sys/manager (반드시 sys로 접속한다)
SQL>exec dbms_transaction.purge_lost_db_entry('1.8.238');

CASE 8-4: STATE field값이 FORCED ROLLBACK/FORCED COMMIT 인 경우

이미 RECO나 db admin이 rollback force나 commit force 명령을 시도하여
STATE가 FORCED ROLLBACK이나 FORCED COMMIT으로 변경된 경우는 추가적으로
수행할 작업은 없으며, RECO가 자동으로 이 entry를 지워 줄 것이다. 그러나
RECO가 작업하기를 기다리지 않고 다음과 같이 직접 삭제할 수 있다.

sqlplus sys/manager (반드시 sys로 접속한다)
SQL>exec dbms_transaction.purge_lost_db_entry('1.8.238');

STEP 9: 불일치 사항을 파악하고 DBA_2PC_PENDING을 정리한다.

어떠한 경우에 DBA_2PC_PENDING의 MIXED column이 YES가 되는지는 이미 STEP 7
에서 설명하였다. 이렇게 잘못된 조치에 의해 STEP 7에서 설명한 것과 같은
분산 데이타베이스간의 불일치가 발생한 경우는 간단한 operation을 통해
일치성을 맞추는 것은 불가능하다.
분산 트랜잭션의 consistency가 무엇보다 중요한 경우라면 관계된 node의
database를 모두 문제의 분산 트랜잭션이 수행되기 이전 상태로, incomplete
recovery를 수행하거나 할 수 있다. 분산 데이타베이스간의 일관성을 위한
incomplete recovery에 대해서는 여기에서는 다루지 않는다. 한가지 언급한
말한 것은 앞에서 설명한 분산 트랜잭션의 commit시 이용하는 commit SCN을
관계된 모든 node들의 최대 SCN으로 이용하는 것이 바로 이러한 recovery를
위한 것이다. 이렇게 일부 database에서 SCN값이 이전 SCN에서 1씩 증가하는
것이 아니라 큰 값으로 건너뛰어 다른 database와 같은 SCN을 유지하게
함으로써, 이후에 incomplete recovery시에 관계된 node들이 서로 동일한
SCN으로 recovery를 수행하면, 모두 분산 트랜잭션 적용 이전이 되거나 혹은
모두 이후가 되어 일관성을 유지할 수 있도록 해준다.

MIXED가 YES인 상태에서, inconsistency를 받아들이고 DBA_2PC_PENDING view를
정리하려면 다음과 같이 수행한다.

sqlplus sys/manager (반드시 sys user로 수행한다)
SQL>exec dbms_transaction.purge_mixed('1.8.238');

참고 : Note 290405.1
Automatic Undo mode에선 DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY 사용전에
"_smu_debug_mode"를 기술해 주어야 한다.

1.) alter session set "_smu_debug_mode" = 4;
2.) execute DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('local_tran_id');

Posted by pat98

RAC(OPS) 환경하에서 양쪽 Node의 archived log file을 RMAN을 사용하여 동시에 BACKUP 받는 방법
======================================================================================

ORACLE 9i 이전 버전
-------------------

Oracle 8i까지는 다음과 같은 Script를 통하여 Backup을 받을 수 있었습니다.

1) Script Name: arch_backup.rcv

run{
allocate channel node_1 type disk connect 'system/manager@v92hp1';
allocate channel node_2 type disk connect 'system/manager@v92hp2';

backup filesperset 1
(archivelog until time 'SYSDATE' thread 1 channel node_1)
(archivelog until time 'SYSDATE' thread 2 channel node_2);

release channel node_1;
release channel node_2;

}

2) 수행 방법

$ rman target=system/manager catalog=rman_user/rmanpw cmdfile='arch_backup.rcv' log='arch_backup.log'


ORACLE 9i 이후 버전
-------------------

그러나 Oracle9i 이상부터는 Archived file backup전에 다음과 같은 설정을 먼저
해 주셔야만 합니다.

1) Configuration 설정

$ rman target=system/manager catalog=rman_user/rmanpw
RMAN> Show all;
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
RMAN> configure default device type to disk;
RMAN> configure channel 1 device type disk connect 'system/manager@v92hp1';
RMAN> configure channel 2 device type disk connect 'system/manager@v92hp2';

위 설정은 backup을 Disk에 받는 경우로 가정하고 device type을 모두 disk로 설정하였습니다.
만일 backup solution을 사용하여 tape에 받는다면 device type을 'sbt_tape'으로 변경해 주시면 됩니다

몇개의 Channel을 설정할 것인가에 따라 PARALLELISM의 값을 반드시맞춰 주어야 합니다.
이것을 맞춰주지 않으면 다음과 같은 형태의 Error가 발생하면서 다른 Node의 archive file들을 인식하지
못하게 됩니다.(실제로 Archived file들은 정상적으로 존재합니다)

RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
ORA-19625: error identifying file /u01/64bit/app/oracle/product/9.2.0/admin/V92HP/arch/arch1_146.dbf
ORA-27037: unable to obtain file status
HP-UX Error: 2: No such file or directory
Additional information: 3

위 설정은 한번만 수행해 주시면 됩니다.
만일 CHANNEL을 잘못 설정하였으면 다음과 같은 명령으로 Clear 해 주시면 됩니다.

RMAN> configure channel 1 device type disk clear;


2)Archived file을 Backup 받습니다.

RMAN> run { backup
format='/u01/64bit/app/oracle/product/9.2.0/admin/V92HP/arch/%U'
archivelog all delete input;
}


ADDITIONAL INFORMATION(1)
-------------------------
RAC 환경 하에서 일부 Archived file들이 OS에서 삭제 되었을 경우 다음과 같은 명령을 통하여
validation check를 수행한 후에 backup을 수행하여 주십시요

RMAN> allocate channel for maintenance type disk connect 'system/manager@v92hp1';
RMAN> allocate channel for maintenance type disk connect 'system/manager@v92hp2';
RMAN> crosscheck archivelog all;

만약에 Configuration에서 이미 Channel을 설정해 주었다면
Channel allocation 없이 바로 crosscheck명령어를 수행해 주시면 됩니다.


ADDITIONAL INFORMATION(2)
-------------------------
Channel Configuration 설정시에 Backup FORMAT을 함께 설정하려면 다음과 같은 형태로 수행합니다.

RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
RMAN> configure default device type to disk;
RMAN> configure channel 1 device type disk connect 'system/manager@v92hp1' FORMAT '/arch/bkup%t_s%s_s%p';
RMAN> configure channel 2 device type disk connect 'system/manager@v92hp2' FORMAT '/arch/bkup%t_s%s_s%p';


ADDITIONAL INFORMATION(3)
-------------------------
Tape device를 사용할 경우 device type은 'sbt_tape'을 사용합니다.

RMAN> CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 2;
RMAN> configure default device type to 'sbt_tape';
RMAN> configure channel 1 device type 'sbt_tape' connect 'system/manager@v92hp1' FORMAT 'bkup%t_s%s_s%p';
RMAN> configure channel 2 device type 'sbt_tape' connect 'system/manager@v92hp2' FORMAT 'bkup%t_s%s_s%p';

Posted by pat98

Applies to:

Oracle Server - Enterprise Edition - Version: 8.0.3.0 to 11.1.0.7
Information in this document applies to any platform.

Purpose

About this Document

This document mainly discusses few generic concepts on sysdba authentication and corresponding troubleshooting steps , which will be helpful in resolving the error ORA-1031 insufficient privileges, if not at least in isolating the cause.

This document also includes few troubleshooting steps helpful in resolving this error if faced by non sysdba users.

Most of the oracle components like RMAN, Enterprise Manager, ASM connects to the database as sysdba , The concepts and troubleshooting steps discussed in this documents also applies in such scenarios in which If any of these components are failing with ORA-1031.

The documentation is subject to further modifications and enhancements.

Last Review Date

August 20, 2008

Instructions for the Reader

A Troubleshooting Guide is provided to assist in debugging a specific issue. When possible, diagnostic tools are included in the document to assist in troubleshooting.

Troubleshooting Details

Generic Concepts

1. A local user can connect to the database as sysdba using either OS authentication or by using password file authentication.

2. A user from a remote machine can connect to the database as sysdba using password file authentication .
From 11g a remote user can also connect to the database as sysdba using kerberos

For more details on remote sysdba authentication using kerberos please refer to 11g New Features Guide.


Facts About Operating System Authentication

1. The following syntax is used while OS Authentication

sqlplus / as sysdba

2. A SQLNET.AUTHENTICATION_SERVICES controls the operation system authentication.

On unix platforms setting the value of this parameter to " ALL " or removing this parameter from SQLNET.ORA will allow the Operating system users to authenticate to the database with out specifying the password in other case[setting the value to NONE] the authentication will fail with ORA- 1031.

eg : SQLNET.AUTHENTICATION_SERVICES=(ALL) will allow the OS authentication

SQLNET.AUTHENTICATION_SERVICES=(NONE) will fail the OS authentication

 " Connect internal " is not supported now , instead of which one should use " connect / as sysdba " to authenticated to the database .

3. The Operating system user should belong to OSDBA group in order to login as sysdba and the user    should belong to OSOPER in order to login a sysoper.

On unix based platforms these groups by default would be DBA, OPER and in windows these would be ORA_DBA ,ORA_OPER.

Please refer to the operating system specific Oracle documentation for information about creating the OSDBA and OSOPER groups

Facts About Password File Authentication


1. Remote sysdba connections attempted with a user name and password uses password file authentication

2. The following syntax is used while using a password file authentication

sqlplus <sysdba user>/<password> as sysdba

The following syntax is used while using a password file authentication connecting to the database as remote user

sqlplus <sysdba user>/<password>@<NET SERVICE NAME> as sysdba


2. Password file authentication is enabled by setting the database parameter remote_login_password file to "shared" or "exclusive".

SQL> alter system set remote_login_password file=exclusive scope=spfile;


3. On unix based platforms a password file is created by default during database installation with an entry of sys under directory $ORACLE_HOME/dbs/ and on windows the file is created under                        %ORACLE_HOME%\database\

4. Granting each database user a sysdba or sysoper privilege adds the user to the password file in the background.

For more information on password file setup and maintenance please refer the following oracle documentation

" Creating and Maintaining a Password File " section of " Chapter 1 " of " Oracle Database Administrator's Guide "

OS Authentication Overrides Password File  

When both OS authentication and password file authentication is enabled than OS Authentication overrides password file authentication.

i.e sysdba can be logged with any user name and password, only the operating system user will be verified.

sqlplus harry/harry as sysdba will be able to login to the database though harry is not a database user.

Troubleshooting ORA-1031 with OS Authentication

1. Check whether the OS user is part of DBA group and OPER group if not add the user to these groups.

2. Check the SQLNET.AUTHENTICATION_SERVICES parameter in the SQLNET.ORA .

On unix based platforms either this parameter should not be present or should be set to ALL.

On windows this parameter should be set to NTS.

3. If the OS user is a domain user in the windows domain than check whether the database service is started with a domain user , if not start the database service with the
domain user.

Check whether the domain is added to the ORA_DBA or ORA_<SID>_DBA group.

Check if a non domain[Local] user can able to login to the database. If so there could be problem with the domain settings ,contact the system administrator and the network
administrator reporting the same.

If the local user is also failing to login than follow the remaining steps specified in this troubleshooting document.

4. If a scheduled script on windows is causing the error than the user calling the script must be a privileged user.The AT command, by default, runs as the NT SYSTEM
account.The SYSTEM account is not a privileged Oracle user.

The Task Scheduler and the AT command are not the same thing.They work with each other.The Task Scheduler service must be started for any AT tasks to run.

When specifying the user account to use for tasks scheduled by AT, this must be set in the "Scheduled Tasks" folder and not through the Task Scheduler service in the
service control panel.

Do this to set the AT service logon account in the "Scheduled Tasks" folder

1) Open "Control Panel"
2) Click on "Scheduled Tasks"
3) On the tool bar, click on "Advanced"
4) Click on "AT Service Account"
5) Choose "This Account:"
6) Specify a Windows account name and password that is part of the ORA_DBA.

5. There are chances that a confusion in windows service might me causing this issue, so to isolate the cause create a new windows service for the instance in any of the
failing machine and check if this fails by following the below steps :

Delete the SID and services:

You MUST be logged into the Windows NT system as the user Administrator -OR- a user within the Windows NT Administrative Group with full
administrative rights to perform the following steps.


1). Open a Command Prompt window:
- Click on the START button.
- Click on RUN.
- Type in: command
- Press OK.

2). Type in the following command: ORADIMxx -DELETE -SID <sid>
where: xx stands for the Oracle release (i.e., 73 or 80)
<sid> is the sid name of your database (i.e., ORCL)
In 8i and 9i, the command is just "oradim" (i.e., no xx)

3). Recreate the sid and services: ORADIMxx -NEW -SID sid -INTPWD password
-STARTMODE AUTO -PFILE <full path to initsid.ora>

6. There is a Chance that improper SGA might be causing the issue,if the size of the SGA was too large for the amount of physical memory than reducing the size of the SGA
eliminates the errors.

so please perform the below checks to troubleshoot the same :

Review the INIT.ORA file. You will find that there are some large entries affecting the size of memory used. Lower those parameters.

The SGA items to look at are:

SORT_AREA_SIZE
DB_BLOCK_BUFFERS
SHARED_POOL_SIZE
LOG_BUFFER.

7. If the failing user is the root user on UNIX platforms than check the userid and primary group to which  the user belongs to by using the operating system command " id " . 

     In general a Unix root user will not have its primary group as DBA and more over the id of the root user would be 0, changing the id of the root user is not recommended as it may effect other application, so modify the root user inorder to make the primary group as dba.


8. If the issue is happening only on HP UX platforms than you may be hitting a know issue which is discussed in the below metalink document
Note 308151.1 Connect / AS SYSDBA Results In Ora-01031

9. There are cases where though a user name is manually added to the ORA_DBA group and is visible in the ORA_DBA group , a underlying windows interpretation of the username might
be different for unknown reasons .

But this can be verified by using a Microsoft API " NetUserGetLocalGroups " Function. by using this API we can be able to check if the username failing is actually a part of
the ORA_DBA group with respect to the underlying OS.

The following Microsoft knowledge base document speaks about this API :

http://msdn.microsoft.com/en-us/library/aa370655(VS.85).aspx

Please ask you system administrators to use the sample code specified in the document to validate the user by running the code on the failing machine as well as on the
domain controller.

The API returns all the groups the user belongs to , and if it is found that the appropriate groups [ like DBA ] is not reflected in the output than the corresponding
subscription has to be reissued and if the problem persists than you may have to contact the Microsoft support team.

10. On Unix based platforms a diagnostic C program will help in retrieving all the groups a user belongs to, the following metalink document contains the diagnostic program :

Note 67984.1 UNIX: Diagnostic C program for ORA-1031

Troubleshooting ORA-1031 with password file authentication

If a local or remote sysdba connection fails with ORA-01031 than consider following factors :

1. The database parameter remote_login_passwordfile has to be set to either EXCLUSIVE or SHARED .

SQL> ALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE SCOPE=SPFILE;

restart the database for the change to take effect.

2. A password file is created in $ORACLE_HOME/dbs with option " nosysdba=n " . In general the name of the file would be in the format orapw<SID> .

In case of uncertainity recreate the password file using the below syntax :

$ > orapwd file=$ORACLE_HOME/dbs/orapw<sid> password=<password> force=y nosysdba=n

 restart the database .


The path to the password file %ORACLE_HOME%\database\PWD%ORACLE_SID%.ORA on a Microsoft Windows machine.


3. The connecting user needs to have sysdba privilege in the target database . The same can be confirmed by querying V$PWFILE_USERS

Troubleshooting ORA-1031 as non sysdba user


1. A database user
2. An external user
3. A global user
4. A user authenticated by middle tier

For more details please refer to Chapter10 of Oracle Database Security Guide , which can be accessed by using the following link :

http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/admnauth.htm#i1006738

If a non sysdba user is failing to authenticate to the database with ORA-01031 than :

1. Check whether the user has a "CONNECT" role or "CREATE SESSION" system privilege granted by using the following SQL statements
If not granted to the user than ask the DBA to grant the same

2. If a datavault is installed and the user is trying to access a realm protected schema than check whether the user is the participant of the realm , if not add the user as realm participant .

The below link explains the steps to add a participant to a realm.

http://download.oracle.com/docs/cd/B19306_01/server.102/b25166/cfrealms.htm#CHDFGFJJ

3. In case of a remote database user check whether the target database is the appropriate one. In most of the case in an environment hosting multiple databases there are chances that the NET SERVICE NAME used may resolve to inappropriate database resulting in ORA-1031 .

Use command line tools like TNSPING, ipconfig and nslookup to check the hostname name and the ip resolved corresponding to the hostname. Take the help of network administrator if necessary.

4. In case of an external user authenticated by an operating system check whether the following database parameter is set to true :

SQL> show parameter remote_OS_authent.

If set to false than set the same to true by using the following SQL statement

SQL>Alter system set remote_os_authent=true scope=spfile;

restart the database.

Setting REMOTE_OS_AUTHENT to TRUE can cause a security exposure, because it lets someone using a non-secure protocol, such as TCP, perform an operating system-authorized login .

REMOTE_OS_AUTHENT is a depriciated parameter from 11g



Apart from the above parameter also check whether the SQLNET.ORA parameter SQLNET.AUTHENTICATION_SERVICES is set to the appropriate value as discussed earlier in this document

Discussion on Network Authenticated external users, Proxy users, Global users is out of the scope of this document.

SELECT * FROM USER_ROLE_PRIVS ;
SELECT * FROM USER_SYS_PRIVS ;

Troubleshooting ORA-1031 while or after upgrading the database

If ORA-1031 is seen while or after upgrading database than performs the below checks :

a). Check the groups to which the user belongs to .

SQL> select * from V$PWFILE_USERS;

USERNAME SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS TRUE TRUE FALSE
SCOTT TRUE FALSE FALSE

b). Check the actual names of the ORDBA group in $ORACLE_HOME/rdbms/lib/config.s [ the file can be config.c in some operating systems]

If the ORADBA group in the config.s/config.c is not reflected in the groups list to which the usr belongs to than add the user to the group seen in config.s/config.c

Remove and move the CONFIG.O and relink the oracle, using the following steps :

1. Shutdown the database and other processes related to the ORACLE_HOME
2. Navigate to $ORACLE_HOME/rdbms/lib
3. Take a backup of the current CONFIG.O and delete it :
mv config.o to config.o.bkp
4. Check the config.s or config.c to verify whether the name of the 'dba' and 'oper' groups are appropriate, if not correct them accordingly
5. MAke a new CONFIG.O by using the below command :
make -f ins_rdbms.mk config.o ioracle
6. Relink oracle

Troubleshooting ORA-1031 while executing a DDL statement:

1. Check whether the user has appropriate privilege to execute the failing SQL statement by using the following SQL statement:

SQL> select * from session_privs;

If any of the required privilege is missing than request your DBA to grant the same.

For example in order to create a table a user needs to create table or create any table privilege.

2. If a DDL statement like create table is failing with ORA-1031 than check the following :

sql>select guard_status from v$database;

guard_status
-------
ALL

The DDLs fail if the above parameter is set to ALL, the solution is to set this to NONE by executing the following statement

sql>alter database guard none;

Though guard_status is a Data guard related parameter setting this to ALL will also affect a stand alone database.

Troubleshooting ORA-1031 while executing a Explain Plan on a query

If an explain plan on a query is failing with ORA-1031 than :

SQL>conn test/test
SQL>explain plan for select * from scott.emp;
ORA-1031 Insufficient Privilege

1. Check whether the user issuing the explain plan  has a select privilege on the objects used if not grant a select privilege

SQL>conn sys/<pwd> as sysdba

SQL>SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE='<user name>';

SQL>SELECT * FROM DBA_TAB_PRIVS WHERE GRANTEE='<user name>';

2. Check whether the user has  appropriate privileges on PLAN_TABLE if not grant the same

SQL>conn sys/<pwd> as sysdba

SQL>grant all on PLAN_TABLE to <user>;

3. If the above steps did not help than create a plan table in the user schema

SQL> conn <user>/<pwd>
SQL>@?/rdbms/admin/utxplan.sql
Posted by pat98



Windows 2008 server에서 oracle10g 설치 시 에러날 때 간단 조치방법입니다.


사용자 삽입 이미지


2008/9/4 현재 위에 Oracle 호환 Matrix를 보면 아무 문제없이 실행되는 것으로 나와 있으나, 실제로 setup.exe 파일을 실행해보면 “알수 없는 에러입니다” 하면서 진행이 안됩니다. 조치 방법은 너무 간단합니다. ^^

사용자 삽입 이미지

사용자 삽입 이미지

이 화면이 2003 에서 capture한 거라 지금 메뉴엔 없지만 2008에서 맨 마지막 메뉴에 Windows 2003 (SP1) 이 있으니 그걸 선택하고 작업을 진행하면 됩니다.

Posted by pat98

Applies to:
Oracle Server - Enterprise Edition - Version: 10.1.0.2 to 11.1.0.6
This problem can occur on any platform.

Symptoms
- Getting ORA-4031 that is reported in the shared pool.
- Using auto SGA.
- Shared pool and SGA are set to appropriate values.
- Opening the ORA-4031 trace file, you can see a lot of space allocated to "Free Space" field.
- Running the following queries will return values less than 10


select a.ksppinm "Parameter",
b.ksppstvl "Session Value",
c.ksppstvl "Instance Value"
from sys.x$ksppi a, sys.x$ksppcv b, sys.x$ksppsv c
where a.indx = b.indx and a.indx = c.indx
and a.ksppinm = '_shared_pool_reserved_pct';


Parameter                      Session Value          Instance Value
------------------------------------------------------------------------------

_shared_pool_reserved_pct         5                        5

Cause
The issue is Shared Pool fragmentation. This fragmentation is caused because the shared pool reserved size is set to less than 10% of the shared pool size (5% in the above example). It is always recommended that shared pool reserved size is 10% of the shared pool size to avoid fragmentation.
Modifying the shared pool in Auto-SGA is done only using a hidden parameter as below.
Solution
SQL> alter system set "_shared_pool_reserved_pct"=10 scope=spfile
or set it in init.ora
"_shared_pool_reserved_pct"=10

And restart the instance.

Posted by pat98

2008. 7. 14. 16:01 오라클

XPT 서비스 멈추기


참고 metalink Bug 4632635 or 문서 ID 339940.1

10,2 를 깔면 셋팅도 안했는데 자동적으로 listener에 SID_XPT라는 서비스가 등록이 됩니다.

서비스에 전혀 영향을 주지 않으나 없애 버리고 싶으면 아래와 같이 해 버리면 됩니다.

XPT는 Data Guard 환경에서 쓰이기 위해 생기는 것이라고 함.

================================================

1. init_ora 화일에 __dg_broker_service_names=''    
    or
2. alter system set "__dg_broker_service_names" = ' scope=spfile;
Posted by pat98



RAC 환경에서 patch 후 한쪽 노드가 올라오지 않을때.
alert.log 나 udump, cdump 등에도 특별한 로그는 남지 않음. 올리면 아래와 같이 나오기만 하고 난감함.

ORA-00469: CKPT process terminated with error
ORA-07445: exception encountered: core dump [] [] [] [] [] []

9i or 10g 상관없이 에러 발생함.

잘 찾아보면 1번 노드에는 $ORACLE_HOME/rdbms/lib/libknlopt.a 화일이 있으나 2번에는 없음.

수동으로 동일한 위치에 copy 해주고 (DB 내리고 할것) 다시 relink 해주면 한방에 올라옴.

요로코롬 해결하면 됨. 자세한 방법은 아래의 metalink 문서 참조.

==================================================================================================

Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 10.2.0.2
This problem can occur on any platform.
After installing any One-off patch in RAC nodes, one of those nodes may fail to start the instance.


NOTE: We did observe the similar problem on 10.2.0.2 RAC installations where certain libraries are not copied from the installing node to other RAC nodes. For such type of problem while performing installation, please refer to the following note.

Note 363840.1 - 10.2.0.2 RAC: ORA-7445 in KKXSYN or KKXCMS ON ALL NODES BUT INSTALL NODE

Symptoms

Oracle Instance does not startup on one of RAC the nodes after installing any One-off Patch.

If you see the alert and trace log files, you may see the following errors:

ORA-00469: CKPT process terminated with error

ORA-07445: exception encountered: core dump [] [] [] [] [] []

Cause

It was noted that the resulting 'Oracle' binaries on different nodes were not the same. Running a cksum on all involved libraries in lib/ and rdbms/lib/, it was evident that libknlopt.a was different across nodes. The object modules that get into libknlopt.a however are identical, so it clearly appears that libknlopt.a isn't relinked on nodes other than the installation one.

Solution

Copy the good library in the faulty node and manually re-link the Oracle again.

Ensure all instances are shut down !

Manually copy good $ORACLE_HOME/rdbms/lib/libknlopt.a from the local node to all remote faulty nodes and relink Oracle again on all faulty nodes.

eg: cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk ioracle

Posted by pat98


====================================================================================================

- DEAD LOCK이 발생했을때 발생시킨 유저와 SQL문을 찾아주는 SQL
 
 : 데드락이 발생할 경우 LOCKING 된 유저와 SQL문을 보여준다.

SELECT A.SERIAL#, A.SID, A.USERNAME, B.ID1, C.SQL_TEXT
FROM V$SESSION A, V$LOCK B, V$SQLTEXT C
WHERE B.ID1 IN( SELECT DISTINCT E.ID1 FROM V$SESSION D, V$LOCK E
WHERE D.LOCKWAIT = E.KADDR)
AND A.SID = B.SID
AND C.HASH_VALUE = A.SQL_HASH_VALUE
AND B.REQUEST = 0;

:  데드락이 발생한 유저를 KILL 하려면.
 
   ALTER SYSTEM KILL SESSION '{SERIAL#},{SID}';


Posted by pat98

Applies to:

Oracle Server - Enterprise Edition - Version: 10G
Microsoft Windows Server 2003

Goal

How to use Very Large Memory, higher than 4Gb on Windows 2003 32 bit
VLM and AWE are for 32-bit Windows environments only

Solution

We can make use of more than 4 GB of RAM on Windows using the AWE(Advanced Windowing Extentions).

The Steps we need to do are

1- Enabling support at the OS level
AWE can be enabled at the OS by adding the /PAE switch to the boot.ini as such:

multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Advanced Server" /PAE

2- Enabling AWE Support at the Database/Instance Level:

To enable the AWE implementation on Oracle, you must set the following parameter in the
init file (or spfile) used to start the instance:

USE_INDIRECT_DATA_BUFFERS=TRUE
buffer cache MUST be defined using the parameter DB_BLOCK_BUFFERS

3- In order to take advantage of the additional memory afforded through PAE,the operating system
user account which is used to start the OracleService must be granted the 'Lock Pages in Memory'
system privilege at the operating system level. By default, the OracleService starts as the
LocalSystem account. The LocalSystem account has the privilege to Lock Pages in Memory granted to
it by default.
Posted by pat98

05-15 13:12
Flag Counter
Yesterday
Today
Total

글 보관함

최근에 올라온 글

달력

 « |  » 2024.5
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

최근에 달린 댓글