Applies to:

Oracle Server - Enterprise Edition - Version: 11.1.0.6 to 11.2.0.2 - Release: 11.1 to 11.2
Information in this document applies to any platform.
Oracle Server Enterprise Edition - Version: 11.1 to 11.1
***Checked for relevance on 14-Jan-2011***

Goal

The purpose of this document is to provide information about the Copy the asm files between remote instances and local instances using ASMCMD.

Solution

11g new feature,you can use asmcmd to copy files between remote instances
Enables you to copy files between ASM disk groups on local instances and remote instances. You can also use this command to copy files from ASM disk groups to the operating system.

cp -ifr <source file name> <user_name>@<host_name>.<Port Number>.<SID>:<targer path>/<target file name>

user_name@host_name.<Port Number>.<SID>

The user_name, host_name, and SID are required. The default port number is 1521.


Example :-

asmcmd>cp -ifr +DATA/RAC/PARAMETERFILE/spfile.257.678975489 sys@stgrac1.1521.+ASM2:+FRA/RAC/ARCHIVELOG/spfile



Troubleshooting-ASMCMD remote copy

asmcmd remote copy works through listener connection.

ASMCMD remote connection can fail with below generic error.

ASMCMD-08202: internal error: [asmcmdshare_error_msg_05] [8201]

[8201] means unable to connect remote ASM Instance.

It could be due to following reason.

* not able to reach remote host.
* Remote host listener is down.
* Remote ASM Instance is not registered with listener and running non-default port.
* sysasm remote connection does not work.
* Incorrect password given for sys user.
* Remote ASM Instance password file missing.


We need to enable additional tracing for asmcmd connection to get a exact failure message.

++ set DBI_TRACE environment variable for asmcmd perl tracing.

export DBI_TRACE=1

++ Now connect using asmcmd and re-produce the issue.

Example 1:-

asmcmd>cp +data/spfileorcl.ora.289.686235413 sys@stgrac1.1521.+ASM1:+test

-> DBI->connect(dbi:Oracle:host=stgrac1;port=1521;sid=+ASM1, sys, ****, HASH (0x8b2b044))
connect using '(DESCRIPTION=(ADDRESS=(HOST=stgrac1)(PROTOCOL=tcp)(PORT=1521))(CONNECT_DATA=(SID=+ASM1)))'
ERROR: '1031' 'ORA-01031: insufficient privileges

(DBD ERROR: OCISessionBegin)'
<- DESTROY= undef at DBI.pm line 591
DBI connect('host=stgrac1;port=1521;sid=+ASM1','sys',...) failed: ORA-01031: insufficient privileges (DBD ERROR: OCISessionBegin)
KK FROM HERE A
ASMCMD-08202: internal error: [asmcmdshare_error_msg_05] [8201]


Here we can see that asmcmd copy failed due to ORA-01031.

ASMCMD uses SYSASM by default if -a option is not used.

Here the problem is sysasm privelege was not given to sys user on remote ASM Instance.

Given the SYSASM privilege to SYS ( or the user trying to connect ). When you grant a system privilege, the password file is updated.


SQL> grant sysasm to sys;
Grant succeeded.

SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS TRUE TRUE TRUE

Now the remote asmcmd copy works fine

For more detals,please go through the below notes

Note.730067.1 - Troubleshooting ORA-1031 Insufficient Privilege
Note.578796.1 - ORA-01031 While Connecting as SYSASM

Example 2:-

ASMCMD> cp -ifr thread_2_seq_5.264.678983423 sys@bderac2-vip.1521.+ASM2:+FRA/RAC/ARCHIVELOG/
Enter password: ***
ASMCMD-08016: copy source->'+FRA/RAC/ARCHIVELOG/2009_02_16/thread_2_seq_5.264.678983423' and target->'+FRA/RAC/ARCHIVELOG/thread_2_seq_5.264.678983423' failed
ORA-17628: Oracle error 19505 returned by remote Oracle server
ORA-06512: at "SYS.X$DBMS_DISKGROUP", line 258
ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute)
ASMCMD>


Solution:-

The cp command failed because the target ASM file name was not specified  or File name should not contain the file number/incarnation.We can not copy OMF form files without specifying file name

cp -ifr thread_2_seq_5.264.678983423 sys@bderac2-vip.1521.+ASM2:+FRA/RAC/ARCHIVELOG/thread_2_seq_5

The file number/incarnation will be created automatically during the copy.

Posted by pat98


In this Document
  Purpose
  Scope and Application
  11gR2 RAC TAF Configuration for Admin and Policy Managed Databases
     Concepts & Overview
     Administrator-managed Database
     Policy-managed Database
  References


Applies to:

Oracle Net Services - Version: 11.2.0.1 to 11.2.0.2 - Release: 11.2 to 11.2
Oracle Server - Enterprise Edition - Version: 11.2.0.1 to 11.2.0.2   [Release: 11.2 to 11.2]
Information in this document applies to any platform.

Purpose


This article discussed about Transparent Application Failover (TAF) and its configuration details for 11gR2 cluster database.

Scope and Application


This article is intended for Oracle Cluster Administrators who would like more details about TAF. Basic understanding of Oracle Clusterware Database is assumed.

11gR2 RAC TAF Configuration for Admin and Policy Managed Databases


Concepts & Overview


TAF allows Oracle clients to reconnect to surviving instance in the event of a failure of the current instance to which it connected. There are two types of TAF available, SESSION and SELECT.

SESSION: Session Failover re-creates the connections and sessions to the surviving instance.
SELECT:  In addition to recreating the session, Select Failover also replays the queries that were in progress.


There are two method in which TAF estabilishes the faiover connection, BASIC and PRECONNECT.

BASIC: The second connection is re-established only after the first connection to the instance failed.
PRECONNECT: Two connections are established when first login to database. A login to database will create two connection at the same time. For this to work clusterware actually starts two service. One main service and another shadow service.


TAF can be configured at the Oracle Client side in tnsnames.ora or at the Database Server side using srvctl. Configuring it at the server is preferred as it is convenient to put the configuration in one place i.e. on the server. This article focuses on configuration at the server using srvctl. TAF configuration is associated with the database service. Creating the service with TAF related options is all about configuring TAF.

1. Create service with srvctl
srvctl defines services in OCR which is accessible across nodes. The service configuration details can be viewed with srvctl config service command.

2. Start the Service with srvctl
When the service is started with srvctl, it actually creates a service in the database i.e. RDBMS. The service name and the configuration details of the service created at the database can be viwed with DBA_SERVICES view. Then the SERVICE_NAMES database parameter is set, which allows PMON to register this service with the listener. Hence connections can be established through listener to the database.

NOTE:
The clusterware automatically starts/stops and manages the services in the database according to the configuration of the service.
manually setting the SERVICE_NAMES parameter in RAC is not allowed as clusterware manages setting this parameter.


Let's have a look at the srvctl syntax for creating service. Databases in 11gR2 can be Administrator-managed or Policy-managed. Certain options can be used only with certain type of database.

srvctl add service -d <db_unique_name> -s <service_name>
-r "<preferred_list>" [-a "<available_list>"] [-P {BASIC | NONE | PRECONNECT}]
-g <server_pool> [-c {UNIFORM | SINGLETON}]
[-k <net_num>]
[-l [PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]]
[-y {AUTOMATIC | MANUAL}]
[-q {TRUE|FALSE}]
[-x {TRUE|FALSE}]
[-j {SHORT|LONG}]
[-B {NONE|SERVICE_TIME|THROUGHPUT}]
[-e {NONE|SESSION|SELECT}]
[-m {NONE|BASIC}]
[-z <failover_retries>]
[-w <failover_delay>]

Here is the description of the options that we are going to use in configuring TAF.

-r "<preferred_list>" [-a "<available_list>"] [-P {BASIC | NONE | PRECONNECT}]
         This clause is valid only for Administrator-managed database which support PRECONNECT method.
-g <server_pool> [-c {UNIFORM | SINGLETON}]
         This clause is valid only for Policy-managed database where in PRECONNECT method is not available.

The above two options instruct clusterware on how to handle this service.

[-e {NONE|SESSION|SELECT}]
        This defines the type of TAF whether SESSION or SELECT.
[-m {NONE|BASIC}]
        This defines the method of TAF.
[-z <failover_retries>]
        This defines the the number of times to attempt to connect after a failover.
[-w <failover_delay>]
       This defines the amount of time in seconds to wait between connect attempts.

Above four options are passed to database while starting up the service and is viewable in DBA_SERVICES view.


Administrator-managed Database


Basic Method


1. Create Service

Syntax:
          srvctl add service -d <db_unique_name> -s <service_name>
          -r "<preferred_list>" [-a "<available_list>"] [-P {BASIC | NONE | PRECONNECT}]
         [-e {NONE|SESSION|SELECT}]
         [-m {NONE|BASIC}]
         [-z <failover_retries>]
         [-w <failover_delay>]


Example:
         $ srvctl add service -d db112 -s mysrvb -r db1121,db1122 -P basic -e select -m basic -z 10 -w 2

Though this example only uses -r option, you can use both -r and -a option.


2. Start the service
$ srvctl start service -d db112 -s mysrvb

Check if the service is rightly registered with the listener.
$lsnrctl status listener_scan1
. . .
. . .
Service "mysrvb" has 2 instance(s).
  Instance "db1121", status READY, has 1 handler(s) for this service...
  Instance "db1122", status READY, has 1 handler(s) for this service...
. . .
. . .



3. Make a connection.

The client connect string do not require any special TAF parameters. A simple tnsnames.ora entry as shown below will do.
mysrvb =
  (description =
   (address = (protocol=tcp)(host=secrac-scan)(port=1521))
   (connect_data=
    (service_name=mysrvb)
   )
  )


$ sqlplus scott/tiger@mysrvb

Once connectd GV$SESSION view will reflect the connection made is TAF enabled. The FAILOVER_METHOD and FAILOVER_TYPE column reflects it and this confirms the TAF configuration is correct.

SQL> select inst_id,username,service_name,failover_type,failover_method,failed_over from gv$session where username='SCOTT';

INST_ID USERNAME SERVICE_NAME FAILOVER_TYPE FAILOVER_M FAI
------- -------- ------------ ------------- ---------- ---
      1    SCOTT       mysrvb        SELECT      BASIC  NO

Note that this has connected to the instance 1 with BASIC method and SELECT type.


Preconnect Method


1. Create service

Syntax:
           srvctl add service -d <db_unique_name> -s <service_name>
          -r "<preferred_list>" [-a "<available_list>"] [-P {BASIC | NONE | PRECONNECT}]
          [-e {NONE|SESSION|SELECT}]
          [-m {NONE|BASIC}]


Example:
          $ srvctl add service -d db112 -s mysrv -r db1121 -a db1122 -P preconnect

NOTE:
* The -e, -m option should be set to none. Omiting this option actually sets it to none.
* Use both -r and -a option for preconnect, hence a shadow service can be started.


2. Start the service.

$ srvctl start service -d db112 -s mysrv

Preconnect creates an additional shadow service.

$ crsctl stat res -t
. . .
. . .
ora.db112.mysrv.svc
          1 ONLINE ONLINE secrac1
ora.db112.mysrv_preconnect.svc
          1 ONLINE ONLINE secrac3
. . .
. . .


Note that the service 'mysrv' is started on the preferred instance. And the shadow service 'mysrv_preconnect' is started on the available instance. The shadow service is always defined as <servicename>_preconnect.


Check if the service is correctly registered with the listener.
$ lsnrctl status listener_scan1
. . .
. . .
Service "mysrv" has 1 instance(s).
  Instance "db1121", status READY, has 1 handler(s) for this service...
Service "mysrv_preconnect" has 1 instance(s).
  Instance "db1122", status READY, has 1 handler(s) for this service...
. . .
. . .





3. Define TNS entry.

Preconnect requires special parameter at the client side tnsnames.ora file. The TAF Type and the TAF method is actually specified at the client end.

mysrv =
  (description =
   (address = (protocol=tcp)(host=secrac-scan)(port=1521))
   (connect_data=
     (service_name=mysrv)
     (failover_mode=
       (backup=mysrv_preconnect)
       (type=select)
       (method=preconnect)
     )
   )
  )

mysrv_preconnect =
  (description =
   (address = (protocol=tcp)(host=secrac-scan)(port=1521))
   (connect_data=(service_name=mysrv_preconnect))
  )


Connect to the database with this tns entry

$sqlplus scott/tiger@mysrv

SQL> select inst_id,username,service_name,failover_type,failover_method,failed_over from gv$session where username='SCOTT';

INST_ID USERNAME     SERVICE_NAME FAILOVER_TYPE FAILOVER_M FAI
------- -------- ---------------- ------------- ---------- ---
      1    SCOTT            mysrv        SELECT PRECONNECT  NO
      2    SCOTT mysrv_preconnect          NONE       NONE  NO

Note that it has made two connections. The first one is the active main connection with PRECONNECT method and SELECT type. The second one is the shadow connection that will be used when the connection to the first instance fails.


Policy-managed Database


Basic Method


1. Create the service

Syntax:
          srvctl add service -d <db_unique_name> -s <service_name>
          -g <server_pool> [-c {UNIFORM | SINGLETON}]
          [-e {NONE|SESSION|SELECT}]
          [-m {NONE|BASIC}]
          [-z <failover_retries>]
          [-w <failover_delay>]


Example:
         $ srvctl add service -d db1 -s mysrvp -g mysrvpool -c uniform -e select -m basic -z 10 -w 2


2.
Start the service

$ srvctl start service -d db1 -s mysrvp


Check if the service is correctly registered with the listener
$ lsnrctl status listener_scan1
. . .
. . .
Service "mysrvp" has 2 instance(s).
  Instance "db1_1", status READY, has 1 handler(s) for this service...
  Instance "db1_2", status READY, has 1 handler(s) for this service...
. . .
. . .



3. Make a connection.

The client connect string do not require any special TAF parameters. A simple tnsnames.ora entry as shown below will do.

mysrvp =
  (description =
   (address = (protocol=tcp)(host=secrac-scan)(port=1521))
   (connect_data=
     (service_name=mysrvp)
   )
  )

$ sqlplus scott/tiger@mysrvp

SQL> select inst_id,username,service_name,failover_type,failover_method,failed_over from gv$session where username='SCOTT';

INST_ID USERNAME SERVICE_NAME FAILOVER_TYPE FAILOVER_M FAI
------- -------- ------------ ------------- ---------- ---
      1    SCOTT       mysrvp        SELECT      BASIC  NO


Posted by pat98


RAC on HP-UX Highlighted Recommendations


This is a list of the core best practices and references identified by the RAC Assurance Team relevant to HP-UX specific RAC implementations. The rest of this chapter provides additional best practices and references from our team.

  • Hostnames on HP-UX should be 8 characters or less. Refer to Note 469569.1 for more details.
  • Setting streams_sqmax=50000 causes gc cr block lost to be reduced. The default value of the 'streams_sqmax' was 'unlimited' for HP 11.11 or lower version, for HP 11.23 the default was changed to 1000.
  • On HPUX (PA-RISC) and HPUX (Itanium) and RDBMS Versions 11.1.0.6 when the DIAG process is activated to get the call stack for a background process on the instance, under certain situations (corrupt call stack on the target) this can result in the target process for diag being killed. If the target process is a critical background process (such as LMS) this can also result in the instance being terminated.
Workaround: Set the hidden parameter "_ksb_disable_diagpid" = true to prevent diag from taking stack traces from other processes. Note: This may result in insufficient diagnostics to progress a problem should there me an issue needing such information. This is fixed in 11.1.0.7. Reference: Note 6489596.8 and Note:6849769.8
  • Following is for HP-UX (Itanium) only: Implement the workaround mentioned in knowledge document Note 763724.1 RACGMAIN received SIGSEGV on checkresource causing a crash of a resource.
  • For versions 10gR2 and 11gR1, it is a best practice on all platforms to set the CSS diagwait parameter to 13 in order to provide time for dumping diagnostics in case of node evictions. Setting the diagwait above 13 is NOT recommended without explicit instruction from Support. This setting is no longer required in Oracle Clusterware 11g Release 2. Reference Document 559365.1 for more details on diagwait.

=========================
11.2.0.2
=========================

  • NTPQ executable should be in the grid install user's path, if ntp is being used.

RAC on HP-UX Best Practices

Operating System 

  • In order to assure proper Oracle process scheduling priority for HP-UX, review Note:759082.1
  • In HP-UX Itanium, RACGMAIN can cause a crash with a SIGSEGV error - Note:763724.1.  This can occur in 10.2.0.4 and 11.1.0.7. 

Storage

  • Cannot discover Disks in ASM after upgrade to 10.2.0.3 on HP-UX Itanium – Note 433770.1. Apply patch PHCO_35524 or rename /usr/sbin/lvmchk to something else or apply oracle patch 6051728 or upgrade to 10.2.0.4.
  • Shutdown the CRS stack cleanly before trying to unmount the shared filesystem. Most other clustered file systems require you to stop all process holding file descriptors open, before permitting the unmount command to continue. That is not presently the case with HP-UX Veritas Clustered Filesystem. If the clustered filesystem with OCR is unmounted 'cfsumount,' whilst the crs stack is still up and running, the cfsumount kills any holding processes. This terminate the OCSSD process, without warning

Networking

  • Jumbo frames with mtu 9000 cause problems with hp nc7170 drivers.
  • Setting streams_sqmax=50000 causes gc cr block lost to be reduced.  The default value of the 'streams_sqmax' was 'unlimited' for HP 11.11 or lower version, for HP 11.23 the default was changed to 1000.
  • Note: 883801.1 - Ensure Patch PHKL_40208 applied to avoid RAC hangs on HP UX Itanium 

Configuration

  • On HP-UX Itanium platform and bash version 3.2.0(1), the following problem occurs:
    sbin/init.d/init.cssd[995]: 21571 Memory fault
    /sbin/init.d/init.cssd[1001]: 21579 Memory fault
    Workaround:  Use /usr/bin/ksh or bash version 3.0.   Reference Note 734618.1.

Install

Patching


Posted by pat98

2011. 4. 8. 22:50 오라클

oracle pfile/spfile


1. 오라클 환경 : spfile & pfile
  Oracle9i부터 데이타베이스의 Initial Parameter를 저장하는 init<SID>.ora이외에 spfile<SID>.ora이 추가되었다.
  spfile(Server Parameter File)은 "Alter System"을 통해서 운영중인 데이타베이스의 parameter를 수정하고,
  재 가동을 시켜야하는 필요성을 줄였다.
  1) spfile<SID>.ora은 binary 파일이다.
    header에 checksum, meta-data 정보가 저장되어 있어서 텍스트에이터로 수정하면 안된다.
   
  2) spfile<SID>.ora파일이 깨졌다면, 백업한 init<SID>.ora 파일을 읽어서 시작한다.
 
  3) Db Open시 참조한 spfile확인
    sql> show parameter pfile
         NAME              TYPE           VALUE
         --------------------------------------
         spfile            String         $INST/spfile<SID>.ora
 
  4) init<SID>.ora -> spfile<SID>.ora로 변환하기
    spfile을 pfile로 백업을 해서 나중에 다시 복구할 때 사용한다.
    sql> connect system/manager as sysdba
    sql> create pfile='init<SID>.ora' from spfile='spfile<SID>.ora';
    sql> create spfile='<SID>.ora' from pfile='init<SID>.ora';
    파일은 $INST/dbs에 저장된다.
 
  5) Alter system으로 parameter 변경
    spfile은 "alter system"을 통해서 내용을 변경할 수 있다.
    sql> alter system set open_cursors='300' scope=[memory|spfile|both]
    scope = memory : 현재 세션부터 바로 반영
            spfile : 재 가동시 반영
            both   : 둘다
            deferred option 주면 다음 session 들도 적용이 됨.
           
  6) v$parameter와 v$spparameter
    parameter중에는 재 가동을 해야만 반영되는 것들이 있다. 이를 static parameter라고 한다.
   
    sql> select name, issys_modifiable from v$parameter;
    issys_modifiable = false     : static parameter로 재 가동시 반영
                       immediate : 바로 반영
                       deferred  : 다음번 세션부터 반영
    "alter system"을 통해서 parameter를 변경할 때 제대로 반영되었는지 여부는
    "show parameter" or "v$parameter" or "v$spparameter"로 확인한다.
    sql> show parameter open_cursors;
    sql> select name, value from v$parameter where name='open_cursors';
    sql> select name, value from v$spparameter where name='open_cursors';
    v$parameter는 현재 세션의 파라메타정보
    v$spparameter는 재 가동할 때 읽어들이는 파라메타.
    즉, v$spparameter를 읽어서 v$parameter값들을 구성한다.


# 임의의 pfile을 이용해서 startup

SQL> create pfile='/home/oracle/mydevdb.ora' from spfile;
SQL> startup force pfile=/home/oracle/mydevdb.ora


# 임의의 spfile을 이용해서 startup

임의의 pfile을 이용해서 경로를 지정해서는 startup가 되지만 spfile는 그렇게 되지 않는다.

하지만 spfile의 경로를 지정한 파일을 생성하여 해당 파일을 이용한 startup은 가능하다.

 

SQL> create spfile='/home/oracle/spmydevdb.ora' from pfile='/home/oracle/mydevdb.ora';
SQL> startup force spfile=/home/oracle/spmydevdb.ora     --> 에러

SQL> !vi /home/oracle/param.txt

         spfile=/home/oracle/spmydevdb.ora

SQL> startup force pfile=/home/oracle/param.txt

Posted by pat98




 

Server Version

Client Version

11.2.0

11.1.0

10.2.0

10.1.0

9.2.0

9.0.1

8.1.7

8.1.6

8.1.5

8.0.6

8.0.5

7.3.4

11.2.0

Yes

Yes

Yes #6

No

ES #5

No #3

No #3

No #3

No #3

No #3

No #3

No #3

11.1.0

Yes

Yes

Yes #6

ES #6

ES #5

No #3

No #3

No #3

No #3

No #3

No #3

No #3

10.2.0

Yes #6

Yes #6

Yes

ES

ES #5

No

Was

No #3

No #3

No #3

No #3

No #3

10.1.0(#4)

ES #6

ES #6

ES

ES

ES

Was

Was #2

No #3

No #3

No #3

No #3

No #3

9.2.0

ES #5

ES #5

ES #5

ES

ES

Was

Was

No

No

Was

No

No #1

9.0.1

No

No

No

Was

Was

Was

Was

Was

No

Was

No

Was

8.1.7

No

No

Was

Was

Was

Was

Was

Was

Was

Was

Was

Was

8.1.6

No

No

No

No

No

Was

Was

Was

Was

Was

Was

Was

8.1.5

No

No

No

No

No

No

Was

Was

Was

Was

Was

Was

8.0.6

No

No

No

No

Was

Was

Was

Was

Was

Was

Was

Was

8.0.5

No

No

No

No

No

No

Was

Was

Was

Was

Was

Was

7.3.4

No

No

No

No

Was

Was

Was

Was

Was

Was

Was

Was


Yes

Supported

ES

Supported but fixes only possible for customers with Extended Support .

Was

Was a supported combination but one of the releases is no longer covered by any of Premier Support , Primary Error Correct support , Extended Support nor Extended Maintenance Support so fixes are no longer possible.

No

Has never been Supported

Posted by pat98

Windows 2008 R2에 10gR2 설치 방법

아시다시피, windows2008 R2 는 64bit 버전만 출시되었다. 이에 조금 난감한 상황이 발생되는데..

일단 오라클 사이트에서 해당 화일을 다운 받는다.

* 실제로 x64지원용 화일(102010_win64_x64_database)이 있지만 압축풀고 설치하려고 하면 초기화면에서 에러발생후
전혀 진행안됨. (처음부터 기본설치 버튼이 활성화 안되어있고 고급설치 눌러서 Next 누르면 바로발생)
-> 밑에 내용처럼 압축해제된 화일의 디렉토리에 가서 3가지 화일을 수정해도 되지 않는다)

해당화일들의 welcome화일을 열어보면 동일하게 아래와 같이 기술이 되어있기 때문에, 영어가 짧은 한국인들은 혼란을 겪을수 밖에 없다. 친절하게 windows2008 64bit에서는 이 화일을 사용하라. 이런 얘기가 안 나와있다는 말씀..

- 10204_vista_w2k8_x64_production_db.zip
10g Release 2 (10.2) for Microsoft Windows x64

- 102010_win64_x64_database.zip
10g Release 2 (10.2) for Microsoft Windows (x64)

-> Oracle에서는 여전히 해당문제를 해결하여 원본설치화일을 올려 둘 생각이 없는듯 하다.


 결론은, 설치를 vista_w2k8_x86용을 받아서 진행해야 한다.


1. 10204_vista_w2k8_x64_production_db.zip 압축해체

2. 압축해제된 화일의 디렉토리의 화일 수정 (3군데)

\database\install\oraparam.ini
[Certified Versions]
Windows=5.0,5.1,5.2,6.0,6.1 <-- 6.1 추가

\database\stage\prereq\db\refhost.xml
<CERTIFIED_SYSTEMS>
<OPERATING_SYSTEM>
     <VERSION VALUE="6.1"/>
</OPERATING_SYSTEM>

\database\stage\prereq\db_prereqs\db\refhost.xml
<CERTIFIED_SYSTEMS>
<OPERATING_SYSTEM>
     <VERSION VALUE="6.1"/>
</OPERATING_SYSTEM>


3. patch 작업은 p8202632_10205_MSWIN-x86-64.zip 압축해제후 설치

- 본인의 경우 작업후 instance를 올리니  한글메세지가 깨져서 나왔는데, 이때는

  regedit 실행해서 Oracle HOME위치로 가서 NLS_LANG 부분에 KOREAN_KOREA.KO16MSWIN949 추가하면 문제해결

- 기타 tool 등을 이용 접속시 64bit로의 접근이 안되는 경우가 많으니 Client 의 vesion을 32bit로 설치해서

  접속하면 왠만한 경우는 무난히 잘됨

Posted by pat98

10gR2 기준
- 오라클 최대 datafile 생성크기제한 (oracle maximum file size limit)

보통 OS에서 8k 로 생성을 많이 하기 때문에 거기에 따라 만들기 때문에 일반적으로 하나의 datafile Max 사이즈는
32G 가 될것입니다. 이 이상 크게 주고 만들면 사이즈 초과했다면서 에러납니다.

단 BIGFILE 옵션을 주고 만들었을 경우에는 32T까지 가능 합니다.

예 ) CREATE BIGFILE TABLESPACE my_ts '/oradata/bigfile.dbf size 50000M;

Example:
Maximum datafile size for a SmallFile Tablespace based on 10gR2 documentation would be:

Block Size    Maximum Datafile File Size
-----------     ---------------------------
2k                4194303 * 2k     = 8 GB
4k                4194303 * 4k     = 16 GB
8k            4194303 * 8k     = 32 GB
16k              4194303 * 16k   = 64 GB
32k              4194303 * 32k   = 128 GB

Maximum datafile size for a BigFile Tablespace based on 10gR2 documentation would be:

Block Size    Maximum Datafile File Size
-----------     ---------------------------
2k                 4294967295 * 2k     = 8 TB
4k                 4294967295 * 4k     = 16 TB
8k                 4294967295 * 8k     = 32 TB
16k               4294967295 * 16k   = 64 TB
32k               4294967295 * 32k   = 128 TB

Posted by pat98

You created a user (USR001) and granted the roles EXP_FULL_DATABASE and IMP_FULL_DATABASE. This user is needed to perform full database exports/imports. When a full database export is started, this ends with error:

EXP-00023: must be a DBA to do Full Database or Tablespace export


A full database import ends with errors:

IMP-00013: only a DBA can import a file exported by another DBA
IMP-00000: Import terminated unsuccessfully


You verified the privileges and the granted roles are there:


SQL> select * from dba_sys_privs where grantee = 'USR001';

GRANTEE                        PRIVILEGE                                ADM
------------------------------ ---------------------------------------- ---
USR001                         CREATE SESSION                           NO

SQL> select * from dba_role_privs where grantee = 'USR001';

GRANTEE                        GRANTED_ROLE                   ADM DEF
------------------------------ ------------------------------ --- ---
USR001                         EXP_FULL_DATABASE              NO  NO
USR001                         IMP_FULL_DATABASE              NO  NOCause
The granted roles are not activated (DEFAULT_ROLE is NO).
Solution
First activate the roles with:


SQL> alter user usr001 default role all;

Then verify with:


SQL> select * from dba_role_privs where grantee = 'USR001';

GRANTEE                        GRANTED_ROLE                   ADM DEF
------------------------------ ------------------------------ --- ---
USR001                         EXP_FULL_DATABASE              NO  YES
USR001                         IMP_FULL_DATABASE              NO  YES
and re-start export/import, the roles are now activated (DEFAULT_ROLE is YES).

Posted by pat98

여기서는 DBMS의 고가용성(HA)을 보장해주는 여러 제품군들 가운데 Oracle RAC를 살펴보기로 한다. Oracle RAC의 특징 중 하나는 Load Balancing과 FailOver 기능으로, 이중에서도 RAC를 이용하는 가장 큰 이유는 바로 Application FailOver 기능 때문일 것이다. Application FailOver는 하나의 노드에 장애가 발생했을 때 다른 살아 있는 노드에서 이 Application의 서비스를 대신해주는 것으로, 실제 사용자는 서비스 중이던 노드에 장애가 일어났는지를 감지하지 못하고 정상적으로 서비스를 이용할 수 있는 기능을 의미한다.

 Oracle RAC에서 Fail-Over를 가능하게 해주는 것이 Oracle 9i부터 소개된 방법인 CTF(Connection Time Failover)와 TAF(Transparent Application Failover)이다. CTF는 클라이언트가 해당 데이터베이스로 접속을 시도했으나, 해당 서버에 장애가 발생하여 접속하지 못할 경우 살아 있는 다른 서버로 접속할 수 있게 해주는 기능이고 TAF는 클라이언트가 RAC에서 어느 한 노드에 접속하여 작업하던 도중 장애가 발생했을 경우 살아 있는 다른 노드에서 수행 중이던 작업을 계속할 수 있게 해주는 기능이다. 먼저 Oracle RAC의 Load Balancing 기능을 먼저 살펴보자.

 Client-Side Connect-Time Load Balancing

 Client-Side Connect-Time Load Balancing의 특징은 이용 가능한 Listener 리스트 중에서 랜덤(random)하게 접속 요청을 하는 것이다. 이는 클라이언트의 tnsnames.ora에 “LOAD_ BALANCE=ON”을 설정함으로써 가능하다.

-- TNSNAMES.ORA ghlee = (DESCRIPTION = (LOAD_BALANCE=ON) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.18)(PORT = 1521)) #ghlee1 (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.19)(PORT = 1521)) #ghlee2 (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = GHLEE))) -- 첫 번째 접속 시도 [/oracle/product/10.2.0/network/admin> sqlplus scott/tiger@ghlee SCOTT@ghlee1 >@in.sql INSTANCE_NUMBER INSTANCE_NAME HOST_NAME -------------- -------------- -------------- 1 ghlee1 ghlee1 -- 두 번째 접속 시도 [/oracle/product/10.2.0/network/admin> sqlplus scott/tiger@ghlee INSTANCE_NUMBER INSTANCE_NAME HOST_NAME --------------- --------------- -------------- 1 ghlee1 ghlee1 -- 세 번째 접속 시도 [/oracle/product/10.2.0/network/admin> sqlplus scott/tiger@ghlee INSTANCE_NUMBER INSTANCE_NAME HOST_NAME --------------- --------------- -------------- 1 ghlee1 ghlee1 -- 네 번째 접속 시도 [/oracle/product/10.2.0/network/admin> sqlplus scott/tiger@ghlee INSTANCE_NUMBER INSTANCE_NAME HOST_NAME --------------- --------------- -------------- 2 ghlee2 ghlee2 -- 다섯 번째 접속 시도 [/oracle/product/10.2.0/network/admin> sqlplus scott/tiger@ghlee INSTANCE_NUMBER INSTANCE_NAME HOST_NAME --------------- --------------- -------------- 1 ghlee2 ghlee2

 위의 결과에서 볼 수 있는 것처럼 랜덤하게 접속을 시도한다. 만약 “LOAD_BALANCE=OFF”로 설정되어 있다면 List에 명시된 처음 Address (HOST = 192.128.25.18)로 먼저 접속을 시도하고 응답이 없을 경우 TCP TIMEOUT까지 대기한 후 다음 Address list (HOST = 192.128.25.19 )로 접근을 시도한다.

 Server-Side Connect-Time Load Balancing

 Server-Side Connect-Time Load Balancing이라는 것은 서버 측에 설정하는 것으로서 동작 방식은 다음과 같다.

<그림 1> Server-Side Connect-Time Load Balancing

 PMON Process가 Listener에 Performance 정보와 함께 Service를 동적으로 등록한다. <표 1>과 같은 정보들이 주기적으로 기록된다.

<표 1> 주기적으로 기록된 정보

  클라이언트가 Connection을 요청하면, 클라이언트의 tnsnames.ora 파일에 기술된 Protocol address 중에 랜덤으로 하나의 접속에 성공한다. 그 Listener가 ghlee1의 Listener이다. ghlee1의 Listener는 ghlee1과 ghlee2 instance의 load의 양을 비교한다. 여기서는 ghlee2의 load의 양이 더 적으므로 ghlee2를 선택한다.

  Ghlee1의 Listener는 클라이언트에게 ghlee2의 Listener로 connection하도록 redirect 한다.

  클라이언트는 ghlee2의 Listener로 접속한다. Listener는 server process를 생성하고 Listener로부터 connection 요청을 상속받아 이제부터는 Listener를 거치지 않고 바로 클라이언트와 통신한다.

이와 같은 방식으로 실행하기 위해서는 ghlee1의 Listener에 ghlee2의 Node의 상태 정보나, Service의 정보들이 PMON에 의해 Listener에 주기적으로 갱신해줘야 하는데 이를 위해서는 Instance가 Listener에 자동으로 등록되는 방식을 사용해야 한다. 이를 Dynamic Register 방식이라 하고, 이를 위해서는 몇 가지 설정이 필요하다.

 Dynamic Register

 8i 이전까지는 Database Instance의 정보를 listener.ora 파일에 수동으로 기술했지만, 8i 이후부터는 스스로 Listener에 등록할 수 있다. PMON process가 현재의 상태와 Instance의 load 정보를 Listener에게 보내는 방식이다. 8i 이전까지는 아래와 같이 listener.ora 파일에 Instance에 대한 사항을 기술해주었다.

-- LISTENER.ORA LISTENER_GHLEE1 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.18)(PORT = 1521) )#ghlee1_vip (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.30)(PORT = 1521) ) #ghlee1_real ip )) SID_LIST_LISTENER_GHLEE1 = (SID_LIST = (SID_DESC = (SID_NAME = GHLEE1) (ORACLE_HOME = /oracle/product/10.2.0))) -- Parameter들의 값 GHLEE1@SQL> show parameter listener NAME TYPE VALUE ----------------------------------- ----------- local_listener string remote_listener string SQL> show parameter service NAME TYPE VALUE ----------------------------------- ----------- service_names SQL> show parameter db_name NAME TYPE VALUE ----------------------------------- ----------- ------ db_name string GHLEE SQL> show parameter domaine_name &#52091; 설정되어 있지 않음 -- Listener의 Service 상태 정보 [/oracle/product/10.2.0/network/admin> lsnrctl services Service "GHLEE" has 1 instance(s). Instance "GHLEE1", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:6 refused:0 state:ready LOCAL SERVER Service "GHLEE1" has 1 instance(s). Instance "GHLEE1", status UNKNOWN, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 LOCAL SERVER

 위의 정보에서 보면 지금 Listener에는 “GHLEE”와 “GHLEE1”이라는 두 개의 서비스가 등록되어 있고, 각 서비스는 “GHLEE1” Instance에 등록되어 있음을 확인할 수 있다. 그리고 “GHLEE” 서비스는 상태 정보가 “READY”인 반면, “GHLEE1” 서비스의 상태 정보는 “UNKNOWN”임을 확인할 수 있다. “GHLEE”라는 서비스는 동적으로 등록된 서비스이므로 PMON에 의해 상태를 지속적으로 Listener에게 업데이트해줌으로써 상태 정보를 확인할 수 있어 “READY”라고 보이며, GHLEE1이라는 서버는 위의 listener.ora 파일에서 기술한 정보이므로 동적으로 등록되지 않아 상태 정보를 확인할 수 없어 “UNKNOWN”이라고 보이는 것이다. Dynamic Register의 구성 방법은 다음과 같다.

 ● Service Registration 구성
이것은 초기화 파라미터 중 “SERVICE_NAMES” 파라미터에 값을 설정함으로써 가능하다. 이 이름이 바로 Listener에 등록하는 서비스 이름으로 Default 이름은 DB Install 시에 설정한 dbname.domain이다. 여기서는 SERIVCE_NAMES 파라미터를 설정하지 않았어도, dbname.domain에 의해 서비스 이름이 “GHLEE”가 되었다.

 ● Default Local Listener Registration 방법
Default로 PMON process는 TCP/IP Port 1521을 사용하는 local Listener에 자동으로 서비스 정보를 등록한다. 위의 예제에서는 Default Port를 사용하고 dbname.domain에 의해서 “GHLEE”라는 서비스가 자동으로 등록되었다.

 ● NON-Default Listener Registration 방법
PMON에 의해 Local Listener에 등록을 원하고 TCP/IP가 Port 1521을 사용하지 않을 경우는 다음과 같이 LOCAL_ LISTENER PARAMETER를 설정하면 된다.

 LOCAL_LISTENER = <listener_alias> → Parameter file 기술
Listener_alias =
(DESCRIPTION= (ADDRESS=(PROTOCOL=TCP_(HOST= node1_vip)(PORT=1524))
→ 서버의 tnsnames.ora 파일에 기술
or
LOCAL_LISTENER =“(ADDRESS=(PROTOCOL=TCP)(HOST =node1_vip)(PORT=1524))” → Parameter 변경

 ● Remote Listener Registration 방법
PMON process에 의해 remote Listener를 등록하고 싶다면, 다음과 같이 REMOTE_LISTENER 파라미터를 설정해야 한다.

 REMOTE_LISTENER=< listener_alias> → Parameter file 기술
Listener_alias =
(DESCRIPTION= (ADDRESS=(PROTOCOL=TCP_(HOST =node2_vip)(PORT=1521))
or
REMOTE_LISTENER=“(ADDRESS=(PROTOCOL=TCP_(HOST =node2_vip)PORT=1521))”

 위와 같이 등록했을 때 LISTENER SERVICES를 확인하면 다음과 같다.

-- PMON에 의해 자동으로 등록하는 방법을 이용하기 위해 listener.ora 파일에 SID 정보를 기술하지 않는다. GHLEE2에도 다음의 상황처럼 기술한다. LISTENER_GHLEE1 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.18)(PORT = 1521))#ghlee1_vip (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.30)(PORT = 1521))#ghlee1_real ip )) -- service_names에 ghlee, ghlee1 서비스를 설정한다. SQL> alter system set service_names='GHLEE', 'GHLEE1' scope=BOTH sid='GHLEE1'; -- remote_listener에 ghlee2의 vip와 port 등을 설정한다. SQL> alter system set remote_listener='(address= (protocol=tcp)(host=192.128.25.19)(PORT=1521)' scope=BOTH sid='GHLEE1'; -- Listener Service의 정보 확인. 위의 Parameter 값들의 설정으로 인해 PMON에 의해서 자동으로 등록된 것을 확인할 수 있다. [ghlee1@/oracle/product/10.2.0/network/admin> lsnrctl services Service "GHLEE" has 2 instance(s). Instance "GHLEE1", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready LOCAL SERVER Instance "GHLEE2", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=GHLEE2-vip)(PORT=1521)) Service "GHLEE1" has 1 instance(s). Instance "GHLEE1", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready LOCAL SERVER Service "GHLEE2" has 1 instance(s). Instance "GHLEE2", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=GHLEE2-vip)(PORT=1521))

위와 같이 Server에 Dynamic Register 방식으로 구성하게 되면 각 Listener는 Server의 상태 정보를 가지고 있어 좀 더 Idle한 서버에서 클라이언트의 요청을 받을 수 있는 Load Balancing을 구현할 수 있다. 이제부터 Oracle RAC의 강력한 기능인 Fail-Over에 대해 살펴보도록 하겠다.

 Fail-Over

 CTF는 앞에서 언급했던 것처럼, connection할 당시 해당 서버에 장애가 발생했을 경우 이용 가능한 서버로 connection을 요청하는 방법으로 클라이언트의 tnsnames.ora 파일에 아래와 같이 설정하면 된다.

-- 클라이언트의 TNSNAMES.ORA ghlee = (DESCRIPTION = (LOAD_BALANCE=OFF)(LOAD_BALANCE=ON) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.18)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.19)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = GHLEE))) -- 10g RAC부터는 VIP를 사용하는데, 만약 NODE1이 DOWN되면 VIP NODE2가 가지고 감으로써 NODE2의 Listener에서 node1_vip, node2_vip를 둘 다 Listening한다. 그러므로 TCP TIMEOUT까지 대기할 필요가 없다

 TAF는 서버에 접속하여 작업 중일 때 작업 중이던 데이터베이스에 문제가 발생했을 경우에 이용 가능한 다른 Node에서 진행 중이던 작업을 계속 해주는 것으로서, 엔드유저는 이 데이터베이스에 장애를 감지하지 못하는 Fail-Over 방식이다. TAF의 Mode에는 현재 접속 중이던 Session을 Fail-Over시키는 Session 방식과 실행 중이던 Select 문을 다른 Node에서 장애가 발생한 시점 이후부터 다시 Select를 실행해주는 Select 방식이 있다.

 Fail-Over Method에는 Session이 맺어 있던 Node를 이용할 수 없을 경우 Oracle이 자동으로 살아있는 Instance 쪽으로 다시 접속하는 BASIC 방식과 Instance에 미리 Session을 접속해 Fail-Over 시에 세션을 새로 맺는 오버헤드를 줄이는 방식인 Preconnect 방식이 존재한다. 설정 방법은 다음과 같다.

 1. TYPE=SELECT, METHOD=BASIC

-- 클라이언트의 TNSNAMES.ORA test_basic1 = (DESCRIPTION = (FAILOVER=ON) (LOAD_BALANCE=ON) (ADDRESS = (PROTOCOL = TCP)(HOST =192.128.25.18)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST =192.128.25.19)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = GHLEE) (FAILOVER_MODE = (TYPE=SELECT) (METHOD=BASIC)))) -- Session접속 [/oracle/product/10.2.0/network/admin>sqlplus scott/tiger@test_basic1 SQL>@se INST_ID USERNAME SID SERIAL# FAILOVER_M FAILOVER_TYPE FAI SERVICE_NAME ---------- --------------- ------- ---------- ---------- 1 SCOTT 2162 13814 BASIC SELECT NO GHLEE -- 접속한 Session에서 Long Query 실행 SQL> select * from t1; -- instance kill(접속된 Instance인 ghlee1을 Kill한다) [ghlee1@/oracle/product/10.2.0/network/admin>srvctl stop instance -d ghlee -i ghlee1 -o abort Sun Apr 12 10:30:55 KST 2009 -- 위의 접속되어 있는 Session의 상태는 INSTANCE가 죽을 당시 잠시 멈춰 있다가 다시 실행되는 현상을 확인할 수 있다. FAILED_OVER Column의 상태를 보면 “YES”로 되어서 Fail-Over되었음을 알 수 있다. SQL> @se INST_ID USERNAME SID SERIAL# FAILOVER_M FAILOVER_TYPE FAI SERVICE_NAME ---------- --------------- ------- ---------- ---------- 2 SCOTT 2177 10 BASIC SELECT YES GHLEE

 

<표 2> 결과 정보

 2. TYPE=SELECT, METHOD=PRECONNECT

-- 클라이언트의 TNSNAMES.ORA. Preconnect 방식을 이용할 때는 반드시 BACKUP을 명시해야 한다. test_preconn1 = (DESCRIPTION = (FAILOVER=ON) (LOAD_BALANCE=ON) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.18)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.19)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = CAFE4DB) (FAILOVER_MODE = (TYPE=SELECT) (METHOD=PRECONNECT) (BACKUP=PRECONNECT2) ))) PRECONNECT2 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.19)(PORT = 1521)) (CONNECT_DATA = (service_name = GHLEE) (instance_name = GHLEE2) ) ) -- Session 접속 (미리 2개의 Session이 연결되어 있는 것을 확인할 수 있다) [/oracle/product/10.2.0/network/admin>sqlplus scott/tiger@test_preconn1 SQL>@se INST_ID USERNAME SID SERIAL# FAILOVER_M FAILOVER_TYPE FAI SERVICE_NAME ---------- --------------- ------- ---------- ---------- 1 SCOTT 2162 13814 PRECONNECT SELECT NO GHLEE 2 SCOTT 1065 10351 NONE NONE NO GHLEE --접속한 Session에서 Long Query 실행 SQL> select * from t1; -- instance kill(접속된 Instance인 ghlee1을 Kill한다) [ghlee1@/oracle/product/10.2.0/network/admin>srvctl stop instance -d ghlee -i ghlee1 -o abort Sun Apr 12 10:35:25 KST 2009 -- 위의 접속되어 있는 Session의 상태는 INSTANCE가 죽을 당시 잠시 멈춰 있다가 다시 실행되는 현상을 확인할 수 있다. FAILED_OVER Column의 상태를 보면 "YES"로 되어서 Fail-Over되었다는 것을 알 수 있다. SQL> @se INST_ID USERNAME SID SERIAL# FAILOVER_M FAILOVER_TYPE FAI SERVICE_NAME ---------- --------------- ------- ---------- ---------- 2 SCOTT 1065 10351 PRECONNECT YES NO GHLEE

 

<표 3> 결과 정보

 3. TYPE=SESSION, METHOD=BASIC

-- 클라이언트의 TNSNAMES.ORA test_basic2 = (DESCRIPTION = (FAILOVER=ON) (LOAD_BALANCE=ON) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.18)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.19)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = CAFE4DB) (FAILOVER_MODE = (TYPE=SESSION) (METHOD=BASIC)))) -- Session 접속 [/oracle/product/10.2.0/network/admin>sqlplus scott/tiger@test_basic2 SQL>@se INST_ID USERNAME SID SERIAL# FAILOVER_M FAILOVER_TYPE FAI SERVICE_NAME ---------- --------------- ------- ---------- ---------- 1 SCOTT 1050 1822 BASIC NO GHLEE -- 접속한 Session에서 Long Query 실행 SQL> select * from t1; -- instance kill(접속된 Instance인 ghlee1을 Kill한다) [ghlee1@/oracle/product/10.2.0/network/admin>srvctl stop instance -d ghlee -i ghlee1 -o abort Sun Apr 12 10:40:01 KST 2009 -- 이 방식은 Session만 보장하는 방식으로 실행되고 있던 Select는 "ora-25401 : can not continue fetches"라는 Error를 뿌리면서 종료된다. SQL> @se INST_ID USERNAME SID SERIAL# FAILOVER_M FAILOVER_TYPE FAI SERVICE_NAME ---------- --------------- ------- ---------- ---------- 2 SCOTT 1023 10231 BASIC YES GHLEE

 

<표 4> 결과 정보

 4. TYPE=SESSION, METHOD=PRECONNECT

-- 클라이언트의 TNSNAMES.ORA test_preconn2 = (DESCRIPTION = (FAILOVER=ON) (LOAD_BALANCE=ON) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.18)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.19)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = CAFE4DB) (FAILOVER_MODE = (TYPE=SESSION) (METHOD=PRECONNECT) (BACKUP=PRECONNECT2) ))) PRECONNECT2 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.128.25.19)(PORT = 1521)) (CONNECT_DATA = (service_name = GHLEE) (instance_name = GHLEE2))) -- Session 접속 (미리 2개의 Session이 연결되어 있는 것을 확인할 수 있다) [/oracle/product/10.2.0/network/admin>sqlplus scott/tiger@test_preconn2 SQL>@se INST_ID USERNAME SID SERIAL# FAILOVER_M FAILOVER_TYPE FAI SERVICE_NAME ---------- --------------- ------- ---------- ---------- 1 SCOTT 1098 143 PRECONNECT SESSION NO GHLEE 2 SCOTT 1023 159 NONE NONE NO GHLEE -- 접속한 Session에서 Long Query 실행 SQL> select * from t1; -- instance kill(접속된 Instance인 ghlee1을 Kill한다) [ghlee1@/oracle/product/10.2.0/network/admin>srvctl stop instance -d ghlee -i ghlee1 -o abort Sun Apr 12 10:45:23 KST 2009 -- Instance에 장애가 발생함과 동시에 "ora-25401 : can not continue fetches"라는 Error를 뿌리면서 종료된다. SQL> @se INST_ID USERNAME SID SERIAL# FAILOVER_M FAILOVER_TYPE FAI SERVICE_NAME ---------- --------------- ------- ---------- ---------- 2 SCOTT 1023 159 PRECONNECT SESSION YES GHLEE

 

<표 5> 결과 정보

 아쉬운 점은 Instance가 종료된 이후 Node가 다시 정상적으로 이용 가능하다고 하더라도 RAC 내에서 자동으로 Fail-Over된 Session을 다시 원래의 Node로 돌려주는 기능은 아직 구현되어 있지 않다는 것이다. DBA가 원래 Node의 Instance로 돌려주어야 한다.

exec dbms_service.disconnect_session(service_name); or ALTER SYSTEM DISCONNECT SESSION 'sid, serial' POST_TRANSACTION;

본문에 사용한 스크립트

in.sql
col host_name format a15
col INSTANCE_NAME format a15
select INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME from v$instance;

se.sql
col service_name format a15
select instance_id, username, sid, serial#, failover_method, failover_type, failed_over, service_name
from gv$session
where program='sqlplus.exe'

OLTP 환경에서는 수행 시간이 긴 Select 문은 거의 존재하지 않으므로 보통은 Session 방식으로 설정하여 사용하며, DW 환경과 같이 수행시간이 긴 Select 문에서는 Select 방식을 많이 선호한다. 아쉽게도 DML은 아직 지원되고 있지 않다. Preconnect 방식은 오버헤드는 줄여줄 수 있지만 하나의 Session을 맺을 때 미리 하나의 Session을 더 맺어두는 방식으로 한번 연결에 총 두 개의 Session을 맺으므로 시스템에 Idle한 Server Process가 하나 더 생성되는 방식이므로 리소스의 낭비를 초래할 수 있다. 각자의 환경에 맞게 Fail-Over 환경을 구성함으로써 효율적인 HA를 구성해 사용하길 바란다.

참고자료
1. Oracle Net Services Administrator's Guide
2. http://metalink.oracle.com
Posted by pat98

2010. 10. 6. 08:49 오라클

Oracle DBID 변경


rman 의 catalog에서 DBID 등을 check 하는 경우등에 쓰임

DBID 변경 Test 실습
====================================================================================

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  330600448 bytes
Fixed Size                  1336344 bytes
Variable Size             234884072 bytes
Database Buffers           88080384 bytes
Redo Buffers                6299648 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle:/oracle]#sqlplus "sys/manager@ASM as sysdba"

SQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 6 17:36:32 2010

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle:/oracle/product/11g/bin]#ll ni*
-rwxr-x--x 1 oracle dba 64929 Aug 26 17:25 nid
-rwxr-x--- 1 oracle dba     0 Aug 13  2009 nidO

[oracle:/oracle/product/11g/bin]#nid target=sys/manager@ASM

DBNEWID: Release 11.2.0.1.0 - Production on Wed Oct 6 17:37:39 2010

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to database ASM (DBID=3750656068)

Connected to server version 11.2.0

Control Files in database:
    /oracle/base/oradata/control01.ctl
    /oracle/base/oradata/control02.ctl
    /oracle/base/oradata/control03.ctl

Change database ID of database ASM? (Y/[N]) => Y

Proceeding with operation
Changing database ID from 3750656068 to 3750678307
    Control File /oracle/base/oradata/control01.ctl - modified
    Control File /oracle/base/oradata/control02.ctl - modified
    Control File /oracle/base/oradata/control03.ctl - modified
    Datafile /oracle/base/oradata/system01.db - dbid changed
    Datafile /oracle/base/oradata/sysaux01.db - dbid changed
    Datafile /oracle/base/oradata/undotbs01.db - dbid changed
    Datafile /oracle/base/oradata/temp01.db - dbid changed
    Control File /oracle/base/oradata/control01.ctl - dbid changed
    Control File /oracle/base/oradata/control02.ctl - dbid changed
    Control File /oracle/base/oradata/control03.ctl - dbid changed
    Instance shut down

Database ID for database ASM changed to 3750678307.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database ID.
DBNEWID - Completed succesfully.

[oracle:/oracle/product/11g/bin]#ss

SQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 6 17:38:33 2010

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

Connected to an idle instance.

SQL> shutdown immediate

ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory

SQL> exit
Disconnected

[oracle:/oracle/base/diag/rdbms/asm/ASM/trace]#vi alert_ASM.log

Wed Oct 06 17:35:55 2010
SMON started with pid=13, OS id=15300
Wed Oct 06 17:35:55 2010
RECO started with pid=14, OS id=15302
Wed Oct 06 17:35:55 2010
MMON started with pid=15, OS id=15304
Wed Oct 06 17:35:55 2010
MMNL started with pid=16, OS id=15306
ORACLE_BASE from environment = /oracle/base
Wed Oct 06 17:35:56 2010
ALTER DATABASE   MOUNT
Successful mount of redo thread 1, with mount id 3750691004
Database mounted in Exclusive Mode
Lost write protection disabled
Completed: ALTER DATABASE   MOUNT
Wed Oct 06 17:37:53 2010
*** DBNEWID utility started ***
DBID will be changed from 3750656068 to new DBID of 3750678307 for database ASM
Starting datafile conversion
Wed Oct 06 17:35:55 2010
MMAN started with pid=9, OS id=15292
Wed Oct 06 17:35:55 2010
DBW0 started with pid=10, OS id=15294
Wed Oct 06 17:35:55 2010
LGWR started with pid=11, OS id=15296
Wed Oct 06 17:35:55 2010
CKPT started with pid=12, OS id=15298
Wed Oct 06 17:35:55 2010
SMON started with pid=13, OS id=15300
Wed Oct 06 17:35:55 2010
RECO started with pid=14, OS id=15302
Wed Oct 06 17:35:55 2010
MMON started with pid=15, OS id=15304
Wed Oct 06 17:35:55 2010
MMNL started with pid=16, OS id=15306
ORACLE_BASE from environment = /oracle/base
Wed Oct 06 17:35:56 2010
ALTER DATABASE   MOUNT
Successful mount of redo thread 1, with mount id 3750691004
Database mounted in Exclusive Mode
Lost write protection disabled
Completed: ALTER DATABASE   MOUNT
Wed Oct 06 17:37:53 2010
*** DBNEWID utility started ***
DBID will be changed from 3750656068 to new DBID of 3750678307 for database ASM
Starting datafile conversion
Datafile conversion complete
Database ID for database ASM changed to 3750678307.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open with RESETLOGS option.
Succesfully changed database ID.
*** DBNEWID utility finished succesfully ***
Shutting down instance (immediate)
Shutting down instance: further logons disabled
Stopping background process MMNL
Stopping background process MMON
License high water mark = 1
alter database dismount
Completed: alter database dismount
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Wed Oct 06 17:37:54 2010
Stopping background process VKTM:
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Wed Oct 06 17:37:56 2010
Instance shutdown complete


SQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 6 17:42:36 2010

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  330600448 bytes
Fixed Size                  1336344 bytes
Variable Size             234884072 bytes
Database Buffers           88080384 bytes
Redo Buffers                6299648 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs;

Database altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle:/oracle]#rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Oct 6 17:43:20 2010

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ASM (DBID=3750678307)

Posted by pat98

07-22 21:01
Flag Counter
Yesterday
Today
Total

글 보관함

최근에 올라온 글

달력

 « |  » 2025.7
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

최근에 달린 댓글