2016. 5. 17. 16:42 오라클

RAC DB_NAME 변경


테스트 환경      : Oracle 12.1.0.2 RAC
db_name         : RAC
instance_name  : RAC1,RAC2

 

RAC DB의 INSTSNCE_NAME 및 DB_NAME 을 변경해 보자.

 

Single 과 크게 다를것은 없다. nid 를 이용하여 변경하면 되고 cluter_database=false 후 parameter 재설정 작업만 해주면 된다. 그외 리소스 삭제후 추가작업

 

-- 먼저 INSTANCE 이름을 바꾸어 본다.

 

현재 RAC1,RAC2 를 TEST1,TEST2 로 바꾸자

 

1. 현재 parameter file 확인

------------------------------------ ---------------------- ------------------------------
spfile                               string                 +DATA/RAC/PARAMETERFILE/spfile
                                                            .270.910889297
2. 현재 Instance 이름 확인

sys@RAC1> show parameter instance_name

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
instance_name                        string                 RAC1


sys@RAC1> alter system set instance_name=TEST1 scope=spfile sid='RAC1';

System altered.

Elapsed: 00:00:00.16

 

3. 재기동 한후 확인, 별거없다. 바뀌었다.

sys@RAC1> show parameter instance_name

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
instance_name                        string                 TEST1

sys@RAC1> show parameter db_name

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
db_name                              string                 RAC
sys@RAC1> show parameter db_unique

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
db_unique_name                       string                 RAC

sys@RAC1> SELECT instance FROM v$thread;

INSTANCE
-------------------------------------------------------------------------------------------
RAC1
RAC2

 

2번 노드도 동일하게 작업한다.

sys@RAC2> alter system set instance_name=TEST2 scope=spfile sid='RAC2';

.....

작업후 변경확인..잘된다.


-- 이제 DB_NAME 도 바꾸어 보겠다.


1. pfile 생성 후 내용수정

SQL> create pfile from spfile ;

생성된 pfile 을 수정해서 RAC1,RAC2 로 된 부분을 모두 TEST1,2 로 변경한다.


RAC1]oracle@rac1:/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs# vi initTEST1.ora
TEST1.__data_transfer_cache_size=0
TEST2.__data_transfer_cache_size=0
TEST1.__db_cache_size=83886080
TEST2.__db_cache_size=130023424
TEST1.__java_pool_size=4194304
TEST2.__java_pool_size=4194304
TEST1.__large_pool_size=4194304
TEST2.__large_pool_size=4194304
TEST1.__oracle_base='/u01/app/oracle'#OTESTLE_BASE set from environment
TEST2.__oracle_base='/u01/app/oracle'#OTESTLE_BASE set from environment
TEST1.__pga_aggregate_target=104857600
TEST2.__pga_aggregate_target=104857600
TEST1.__sga_target=419430400
TEST2.__sga_target=419430400
TEST1.__shared_io_pool_size=8388608
TEST2.__shared_io_pool_size=12582912
TEST1.__shared_pool_size=310378496
TEST2.__shared_pool_size=260046848
TEST1.__streams_pool_size=0
TEST2.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/TEST/adump'
*.audit_sys_operations=FALSE
*.audit_trail='NONE'
*.cluster_database=true
*.compatible='12.1.0'
*.control_files='+DATA/rac/controlfile/current.256.907339295','+RECO/rac/controlfile/current.256.907339297'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_name='TEST'
*.db_recovery_file_dest='+RECO'
*.db_recovery_file_dest_size=6005194752
*.diagnostic_dest='/u01/app/oracle'
TEST2.instance_number=2
TEST1.instance_number=1
*.open_cursors=300
*.pga_aggregate_target=104857600
*.processes=150
*.remote_listener='rac-scan:1521'
*.remote_login_passwordfile='exclusive'
*.sec_case_sensitive_logon=FALSE
*.sga_target=419430400
TEST2.thread=2
TEST1.thread=1
TEST2.undo_tablespace='UNDOTBS2'
TEST1.undo_tablespace='UNDOTBS1'

2. password 화일 복사, adump directory 생성, 기존 initRAC1 화일 백업

[RAC1]oracle@rac1:/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs# mkdir -p /u01/app/oracle/admin/TEST/adump
[RAC1]oracle@rac1:/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs# cp orapwRAC1 orapwTEST1
[RAC1]oracle@rac1:/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs# cp initRAC1.ora  initRAC1.ora.old

 

3. 양쪽 모두 내린다.

srvctl stop database -d RAC

 

4. exclusive 로 1번 startup

idle> startup mount exclusive pfile='/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs/initRAC1.ora

ORACLE instance started.

Total System Global Area  419430400 bytes
Fixed Size                  2925120 bytes
Variable Size             318770624 bytes
Database Buffers           92274688 bytes
Redo Buffers                5459968 bytes
Database mounted.

 

5. nid 로 변경

[RAC1]oracle@rac1:/home/oracle# nid target=sys/oracle dbname=TEST setname=yes

DBNEWID: Release 12.1.0.2.0 - Production on Tue May 17 10:56:34 2016

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

Connected to database RAC (DBID=2495321304)

Connected to server version 12.1.0

Control Files in database:
    +DATA/rac/controlfile/current.256.907339295
    +RECO/rac/controlfile/current.256.907339297

Change database name of database RAC to TEST? (Y/[N]) => y

Proceeding with operation
Changing database name from RAC to TEST
    Control File +DATA/rac/controlfile/current.256.907339295 - modified
    Control File +RECO/rac/controlfile/current.256.907339297 - modified
    Datafile +DATA/rac/datafile/system.259.90733933 - wrote new name
    Datafile +DATA/rac/datafile/sysaux.260.90733937 - wrote new name
    Datafile +DATA/rac/datafile/undotbs1.261.90733940 - wrote new name
    Datafile +DATA/rac/datafile/undotbs2.263.90733943 - wrote new name
    Datafile +DATA/rac/datafile/users.264.90733943 - wrote new name
    Datafile +DATA/rac/tempfile/temp.262.90733941 - wrote new name
    Control File +DATA/rac/controlfile/current.256.907339295 - wrote new name
    Control File +RECO/rac/controlfile/current.256.907339297 - wrote new name
    Instance shut down

Database name changed to TEST.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID - Completed succesfully.

 

6. profile의 환경변수 TEST로 변경, cluster_database=false 로 하고 pfile로 기동,

*.cluster_database=false
 
idle> startup pfile=/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs/initTEST1.ora;
ORACLE instance started.

Total System Global Area  419430400 bytes
Fixed Size                  2925120 bytes
Variable Size             318770624 bytes
Database Buffers           92274688 bytes
Redo Buffers                5459968 bytes
Database mounted.
Database opened.


7. spfile 을 맹글어 준다.

idle> create spfile='+DATA' from pfile;

File created.

asmcmd -p 로 +ASM1 접속, 화일 확인

Type           Redund  Striped  Time             Sys  Name
PARAMETERFILE  UNPROT  COARSE   MAY 17 11:00:00  Y    none => spfile.271.912078483
PARAMETERFILE  UNPROT  COARSE   MAY 17 11:00:00  Y    none => spfile.272.912079201
PARAMETERFILE  UNPROT  COARSE   MAY 17 11:00:00  Y    none => spfile.273.912080113

 

8. pfile에 spfile 경로를 적어준다.


[TEST1]oracle@rac1:/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs# vi initTEST1.ora
SPFILE='+DATA/TEST/PARAMETERFILE/spfile.273.912080113'

7. startup 한후에 다시 내린다.

idle> startup
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area  419430400 bytes
Fixed Size                  2925120 bytes
Variable Size             318770624 bytes
Database Buffers           92274688 bytes
Redo Buffers                5459968 bytes
Database mounted.
Database opened.

 

9. 2번 노드도 nid 실행하는거 빼고 나머지 절차를 동일하게 진행한다. 잘된다.

 

10. cluster_database=true 로 변경후 재기동

SQL> alter system set cluster_database=true scope=spfile sid='*';

 

11. CRS RESOURCE에서 바뀐 INSTANCE 를 인식못하니 기존것 삭제후 새로 등록한다.


ora.rac.db
      1        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                             ABLE
      2        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                             ABLE
12. 기존꺼 삭제 (쫄지 말자, 이건 DB에 아무런 영향을 주지 않는다)

[TEST1]oracle@rac1:/home/oracle# srvctl remove instance -d RAC -i RAC1
Remove instance from the database RAC? (y/[n]) y
[TEST1]oracle@rac1:/home/oracle# srvctl remove instance -d RAC -i RAC2
Remove instance from the database RAC? (y/[n]) y
[TEST1]oracle@rac1:/home/oracle# srvctl remove database -d RAC
Remove the database RAC? (y/[n]) y

 

13. 새로운거 추가

[TEST1]oracle@rac1:/home/oracle# srvctl add database -d TEST -o /u01/app/oracle/product/12.1.0.2/dbhome_1

[TEST1]oracle@rac1:/home/oracle# srvctl add instance -d TEST -i TEST1 -n rac1
[TEST1]oracle@rac1:/home/oracle# srvctl add instance -d TEST -i TEST2 -n rac2


14. RESOURCE에서 바로 인식 못할수 있으니 깔끔하게 crsctl stop crs 해서 다시 start 해준다.

 

15. 정상 등록 확인

ora.test.db
      1        ONLINE  ONLINE       rac1                     Open,STABLE
      2        ONLINE  ONLINE       rac2                     Open,STABLE

 

16. 적용된 값들 확인

sys@TEST1> show parameter instance_name

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
instance_name                        string                 TEST1
sys@TEST1> show parameter db_name

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
db_name                              string                 TEST
sys@TEST1> show parameter db_unique

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
db_unique_name                       string                 TEST

 

17. 작업후기

RAC 도 별거 없이 잘 바뀌며, 작업시 parameter 백업, cluster_database=true,false 만 manage 잘하면 하면 OK ~~

SEVICE_NAME 등에 변경내역 반영, 접속 확인할 것.

Posted by pat98

1. TNSNAMES.ORA 반영


EXA =

   (DESCRIPTION =

     (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.20.3)(PORT = 1521))

     (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.20.4)(PORT = 1521))

     (LOAD_BALANCE = yes)

     (CONNECT_DATA =

       (SERVER = DEDICATED)

       (SERVICE_NAME = EXA)

     )

   )


2. test.sh 작성


vi test.sh


#!/bin/sh

count=0

while [ $count -lt 5 ]                                           # 5번 수행하겠다.

do                                                               # loop 시작

    count=`expr $count + 1`                                   # 카운터 증가 

    sqlplus -S system/welcome1@EXA @test.sql 

done


3. test.sql 작성


col "Instance" format a20

col "Host" format a20

col "Service Name" format a20

select sys_context('userenv', 'instance_name') "Instance",

       sys_context('userenv', 'server_host') "Host",

       sys_context('userenv', 'service_name') "Service Name"

from dual

/

exit;


4. sh test.sh 실행

[EXA1]oracle@exa1:/home/oracle# sh loop.sh


Instance             Host                 Service Name

-------------------- -------------------- --------------------

EXA2                 exa2                 EXA


Instance             Host                 Service Name

-------------------- -------------------- --------------------

EXA1                 exa1                 EXA


Instance             Host                 Service Name

-------------------- -------------------- --------------------

EXA1                 exa1                 EXA


Instance             Host                 Service Name

-------------------- -------------------- --------------------

EXA2                 exa2                 EXA


Instance             Host                 Service Name

-------------------- -------------------- --------------------

EXA1                 exa1                 EXA


RAC cluster 에서 로드밸런스가 잘 되고 있음을 확인할수 있다.

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

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
이전버튼 1 이전버튼

04-27 15:27
Flag Counter
Yesterday
Today
Total

글 보관함

최근에 올라온 글

달력

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

최근에 달린 댓글