Oracle/Migration

[oracle] 19c SE -> EE 전환 및 Migration

beom92 2023. 5. 19.

 

더보기

작업 진행

  1. Database shutdown
  2. Database SE tar로 묶어서 Backup
  • 사용 명령어 : tar cvf oracle_se.tar oraInventory/ product/
  1. Database Backup
  • 사용 명령어 : tar cvf pgwdev.tar pgwdev/ (※ pgwdev/는 작업 환경에 DB File 경로)
  1. dbs Backup ($ORACLE_HOME)
  • tar cvf dbs.tar dbs/
  1. network Backup ($ORACLE_HOME)
  • tar cvf network.tar network/
  1. admin & audit Backup ($ORACLE_BASE)
  • 사용 명령어 : tar cvf admin.tar admin/
  1. Database EE 설치 (기존 환경과 동일한 경로로 Oracle 설치 수행)
  2. Database EE patch 적용
  3. network, dbs, admin 재사용 가능하도록 설정
  4. Database File 경로 맞추고 startup

※ 12c 이상의 버전부터는 catalog.sql과 catproc.sql 두 스크립트를 수행할 필요가 없습니다.

  1. 마지막 banner 확인

 


 

사용중인 Standard Edition 과 Enterprise Edition 릴리즈 번호가 동일한지 확인 합니다.

SQL> select * from v$version;

BANNER                                                                           BANNER_FULL                                                                                                                            BANNER_LEGACY                                                                 CON_ID
-------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------
Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production           Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production                                                                 Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production             0
                                                                                 Version 19.3.0.0.0

 

 

데이터베이스를 정지 시킵니다. 

    a. shutdown immediate

ora11g:utl/ > sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu May 18 17:08:20 2023
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

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

    b. 만약 윈도우 os 라면 OracleServiceSID / Oracle / Service 를 포함한 모든 오라클 서비스를 중지 시켜야 합니다.

 

 

데이터베이스 파일을 모두 백업 합니다.

    a. oracle file Backup : /oracle [/product, /oraInventory]

tar cvf oracle_se.tar /oracle/app
tar cvf oracle_inventory.tar /oracle/oraInventory

    b. data file Backup : /oradata

tar cvf oracle_data.tar /oradata/TESTDB01
tar cvf oracle_arch.tar /oradata/arch (추가)

    c. admin & audit Backup : $ORACLE_BASE/admin

tar cvf oracle_base.tar $ORACLE_BASE/admin

    d. dbs Backup : [linux] $ORACLE_HOME/dbs or [window] $ORACLE_HOME/database

tar cvf oracle_dbs.tar $ORACLE_HOME/dbs

    e. network Backup : $ORACLE_HOME/network/admin

tar cvf oracle_dbs.tar $ORACLE_HOME/dbs

 

 

기존 SE 를 deinstall 합니다.

ora11g:deinstall/ > pwd
/oracle/app/product/19.0/db_1/deinstall
ora11g:deinstall/ > ls
bootstrap.pl  bootstrap_files.lst  deinstall  deinstall.pl  deinstall.xml  jlib  readme.txt  response  sshUserSetup.sh  utl
ora11g:deinstall/ > ./deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /tmp/deinstall2023-05-18_05-21-22PM/logs/

############ ORACLE DECONFIG TOOL START ############


######################### DECONFIG CHECK OPERATION START #########################
## [START] Install check configuration ##


Checking for existence of the Oracle home location /oracle/app/product/19.0/db_1
Oracle Home type selected for deinstall is: Oracle Single Instance Database
Oracle Base selected for deinstall is: /oracle/app
Checking for existence of central inventory location /oracle/oraInventory

## [END] Install check configuration ##


Network Configuration check config START

Network de-configuration trace file location: /tmp/deinstall2023-05-18_05-21-22PM/logs/netdc_check2023-05-18_05-21-30PM.log

Specify all Single Instance listeners that are to be de-configured. Enter .(dot) to deselect all. [LISTENER]:

Network Configuration check config END

Database Check Configuration START

Database de-configuration trace file location: /tmp/deinstall2023-05-18_05-21-22PM/logs/databasedc_check2023-05-18_05-21-30PM.log

Use comma as separator when specifying list of values as input

Specify the list of database names that are configured in this Oracle home [testdb01]:

###### For Database 'testdb01' ######

Single Instance Database
The diagnostic destination location of the database: /oracle/app/diag/rdbms/testdb01
Storage type used by the Database: FS
Database file location: /oradata/TESTDB01
Fast recovery area location: Does not exist
Archive Log mode is Enabled, archive logs will be removed.
database spfile location: /oracle/app/product/19.0/db_1/dbs/spfiletestdb01.ora

The details of database(s) testdb01 have been discovered automatically. Do you still want to modify the details of testdb01 database(s)? [n]:

Database Check Configuration END

######################### DECONFIG CHECK OPERATION END #########################


####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Home selected for deinstall is: /oracle/app/product/19.0/db_1
Inventory Location where the Oracle home registered is: /oracle/oraInventory
Following Single Instance listener(s) will be de-configured: LISTENER
The following databases were selected for de-configuration. The databases will be deleted and will not be useful upon de-configuration : testdb01
Database unique name : testdb01
Storage used : FS
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/tmp/deinstall2023-05-18_05-21-22PM/logs/deinstall_deconfig2023-05-18_05-21-29-PM.out'
Any error messages from this session will be written to: '/tmp/deinstall2023-05-18_05-21-22PM/logs/deinstall_deconfig2023-05-18_05-21-29-PM.err'

######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /tmp/deinstall2023-05-18_05-21-22PM/logs/databasedc_clean2023-05-18_05-21-30PM.log
Database Clean Configuration START testdb01
This operation may take few minutes.
Database Clean Configuration END testdb01

Network Configuration clean config START

Network de-configuration trace file location: /tmp/deinstall2023-05-18_05-21-22PM/logs/netdc_clean2023-05-18_05-21-30PM.log

De-configuring Single Instance listener(s): LISTENER

De-configuring listener: LISTENER
    Stopping listener: LISTENER
    Warning: Failed to stop listener. Listener may not be running.
    Deleting listener: LISTENER
    Listener deleted successfully.
Listener de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END


######################### DECONFIG CLEAN OPERATION END #########################


####################### DECONFIG CLEAN OPERATION SUMMARY #######################
Successfully de-configured the following database instances : testdb01
Following Single Instance listener(s) were de-configured successfully: LISTENER
#######################################################################


############# ORACLE DECONFIG TOOL END #############

Using properties file /tmp/deinstall2023-05-18_05-21-22PM/response/deinstall_2023-05-18_05-21-29-PM.rsp
Location of logs /tmp/deinstall2023-05-18_05-21-22PM/logs/

############ ORACLE DEINSTALL TOOL START ############





####################### DEINSTALL CHECK OPERATION SUMMARY #######################
A log of this session will be written to: '/tmp/deinstall2023-05-18_05-21-22PM/logs/deinstall_deconfig2023-05-18_05-21-29-PM.out'
Any error messages from this session will be written to: '/tmp/deinstall2023-05-18_05-21-22PM/logs/deinstall_deconfig2023-05-18_05-21-29-PM.err'

######################## DEINSTALL CLEAN OPERATION START ########################
## [START] Preparing for Deinstall ##
Setting LOCAL_NODE to ora11g
Setting CRS_HOME to false
Setting oracle.installer.invPtrLoc to /tmp/deinstall2023-05-18_05-21-22PM/oraInst.loc
Setting oracle.installer.local to false

## [END] Preparing for Deinstall ##

Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START

Detach Oracle home '/oracle/app/product/19.0/db_1' from the central inventory on the local node : Done

Delete directory '/oracle/app/product/19.0/db_1' on the local node : Done

Delete directory '/oracle/oraInventory' on the local node : Done

Delete directory '/oracle/app' on the local node : Done

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END


## [START] Oracle install clean ##


## [END] Oracle install clean ##


######################### DEINSTALL CLEAN OPERATION END #########################


####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/oracle/app/product/19.0/db_1' from the central inventory on the local node.
Successfully deleted directory '/oracle/app/product/19.0/db_1' on the local node.
Successfully deleted directory '/oracle/oraInventory' on the local node.
Successfully deleted directory '/oracle/app' on the local node.
Oracle Universal Installer cleanup was successful.


Run 'rm -r /etc/oraInst.loc' as root on node(s) 'ora11g' at the end of the session.

Run 'rm -r /opt/ORCLfmap' as root on node(s) 'ora11g' at the end of the session.
Run 'rm -r /etc/oratab' as root on node(s) 'ora11g' at the end of the session.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################


############# ORACLE DEINSTALL TOOL END #############


--


[root@ora11g ~]# rm -rf /etc/oraInst.loc
[root@ora11g ~]# rm -rf /opt/ORCLfmap
[root@ora11g ~]# rm -rf /etc/oratab

 

 

신규 EE 를 Install 합니다. (기존 환경과 동일한 경로로 Oracle 설치 수행)

unzip LINUX.X64_193000_db_home.zip -d $ORACLE_HOME
cd $ORACLE_HOME
./runInstaller

 

 

Database EE patch 적용합니다. (기존 버전 패치 진행 안되어있으므로 테스트 통과)

none

 

 

network, dbs, admin 재사용 가능하도록 설정 합니다.

ora11g:oradata/ > cd ~
ora11g:oracle/ > ls
cbackup
ora11g:oracle/ > cd cbackup/
ora11g:cbackup/ > ls
oracle_arch.tar  oracle_base.tar  oracle_data.tar  oracle_dbs.tar  oracle_inventory.tar  oracle_network.tar  oracle_se.tar
ora11g:cbackup/ > tar xvf oracle_dbs.tar
oracle/app/product/19.0/db_1/dbs/
oracle/app/product/19.0/db_1/dbs/init.ora
oracle/app/product/19.0/db_1/dbs/orapwtestdb01
oracle/app/product/19.0/db_1/dbs/hc_testdb01.dat
oracle/app/product/19.0/db_1/dbs/lkTESTDB01
oracle/app/product/19.0/db_1/dbs/spfiletestdb01.ora
ora11g:cbackup/ > 
ora11g:cbackup/ > tar xvf oracle_network.tar
oracle/app/product/19.0/db_1/network/admin/
oracle/app/product/19.0/db_1/network/admin/samples/
oracle/app/product/19.0/db_1/network/admin/samples/sqlnet.ora
oracle/app/product/19.0/db_1/network/admin/samples/listener.ora
oracle/app/product/19.0/db_1/network/admin/samples/tnsnames.ora
oracle/app/product/19.0/db_1/network/admin/shrept.lst
oracle/app/product/19.0/db_1/network/admin/listener.ora
oracle/app/product/19.0/db_1/network/admin/sqlnet.ora
oracle/app/product/19.0/db_1/network/admin/tnsnames.ora
ora11g:cbackup/ > 
ora11g:cbackup/ > tar xvf oracle_data.tar
oradata/TESTDB01/
oradata/TESTDB01/control01.ctl
oradata/TESTDB01/control02.ctl
oradata/TESTDB01/redo01.log
oradata/TESTDB01/redo02.log
oradata/TESTDB01/redo03.log
oradata/TESTDB01/redo04.log
oradata/TESTDB01/redo05.log
oradata/TESTDB01/system01.dbf
oradata/TESTDB01/sysaux01.dbf
oradata/TESTDB01/undotbs01.dbf
oradata/TESTDB01/temp01.dbf
oradata/TESTDB01/users01.dbf
ora11g:cbackup/ > 
ora11g:cbackup/ > mv oracle/app/product/19.0/db_1/dbs/* $ORACLE_HOME/dbs
ora11g:cbackup/ > mv oracle/app/product/19.0/db_1/network/admin/*.ora $ORACLE_HOME/network/admin
ora11g:cbackup/ > mv oracle/oradata/TESTDB01/* /oradata/TESTDB01

 

 

Database File 경로 맞추고 startup 합니다.

ora11g:TESTDB01/ > sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu May 18 21:29:01 2023
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 2466249672 bytes
Fixed Size                  8899528 bytes
Variable Size             687865856 bytes
Database Buffers         1761607680 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.
SQL>
SQL> select instance_name, status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
testdb01         OPEN

SQL>
SQL>
SQL> conn hr/hr
Connected.
SQL>
SQL>
SQL> select count(*) from sample_t;

  COUNT(*)
----------
   1000000

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
BANNER_FULL
--------------------------------------------------------------------------------
BANNER_LEGACY
--------------------------------------------------------------------------------
    CON_ID
----------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
         0

 

※ 12c 이상의 버전부터는 catalog.sql과 catproc.sql 두 스크립트를 수행할 필요가 없습니다.

 

 

 

 

'Oracle > Migration' 카테고리의 다른 글

DataPump (impdp) 옵션 정리  (1) 2023.05.19
DataPump (expdp) 옵션 정리  (1) 2023.05.19

댓글