by 구루비스터디 Oracle12c Oracle12c 업그레이드 DBUA [2016.11.19]
"무엇보다 준비가 성공의 열쇠다"
방법 | 설명 | 가능 소스 DB 버전 |
직접 | 수작업 혹은 DBUA로 동일한 플랫폼에서 업그레이드 | 10.2.0.5 이상, 11.1.0.7 이상, 12.2.0.2 이상 |
간접 | 직접 가능 버전으로 업그레이드 후 다시 업그레이드 |
방법 | OS같음(DT30분내) | OS같음(DT30분이상) | OS다름 |
---|---|---|---|
DBUA 업그레이드 | √ | ||
수작업 업그레이드 | √ | ||
Transportable Tablespace | √ | √ | |
Full Transportable Export/Import | √ | √ | |
Oracle Golden Gate | √ | √ | |
DataPump | √ | ||
CTAS | √ |
DBUA 시작 |
---|
DBUA Step 1 |
* Upgrade Oracle Database 선택 |
DBUA Step 2 |
* 업그레이드 대상 Oracle Home 및 Instance 선택 |
DBUA Step 3-1 |
* Pre-Upgrade 유틸리티, Database Upgrade Check 작업 수행 ** 현재 DB의 업그레이드 적합 여부 체크 ** 업그레이드 될 DB의 ORACLE_HOME 찾기 (/etc/oratab) ** ORACLE_HOME 의 OS 유저 OWNERSHIP 체크 ** ASM 호환성 체크 |
DBUA Step 3-2 |
* Pre Upgrade Utility Checks, Database Upgrade Checks 결과 표시 * Fixable 이 Yes 인 경우 Action 선택 가능(Fix - Pre Upgrade, 무시, Revalidate) * Action 컬럼이 비워져 있는 경우 수동 해결 후 "Check Again" 수행 |
DBUA Step 4-1 |
* 업그레이드 옵션 선택 (병렬도, Invalid Object Recompile, Upgrade Timezone Data, Gather Statistics, User Tablespace Read Only) |
DBUA Step 4-2 |
* Custom SQL Script 수행 가능 (업그레이드 전 후 RMAN 백업 등) |
DBUA Step 5 |
* EM Database Express 설정 * EM Cloud Control 설정 |
DBUA Step 6 |
* DBF/FRA 이동 선택 |
DBUA Step 7 |
* 마이그레이션 대상 DB 를 지원하는 리스너 선택/생성 가능 |
DBUA Step 8 |
* 업그레이드 과정에서 백업 수행 방법 선택(새로운 기능) * Flashback Database 사용 가능(Guaranteed Restore Point) : 실패시 Restore Point 시점부터 재시작 가능 * Flashback Database 활성화로 인한 단점보다 DBUA 업그레이드 중 오류 발생시 얻을 수 있는 유연성이 더 큼 |
DBUA Step 9 |
* 전체 작업의 개요 |
DBUA Step 10 |
* DBUA 진행률 (진행 상황 표시) ** 사전 업그레이드 단계(Pre Upgrade Steps) ** 실제 데이터베이스 업그레이드(Database Upgrade Steps) ** 사후 업그레이드 단계(Post Upgrade Steps) * Activity Log 관찰 가능 * Stop 버튼 클릭 시 백업에서 업그레이드된 데이터베이스를 복원 |
DBUA Step 11 |
* 업그레이드 시간은 메모리, CPU, I/O 속도에 의존적 * "Upgrade Results" 버튼 클릭 시 업그레이드 관련 오류/경고/세부 사항이 나오는 결과 페이지 표시 ** 사전 업그레이드 체크 결과 ** 업그레이드 작업 자체에 대한 상세 정보 ** 업그레이드 개별 단계 특정 정보 *** 백업 내용과 복원 방법 *** SPFILE 정보 *** EM Database Express 설정 정보 *** 초기화 파라미터 변경 정보 * "Restore Database" 버튼 클릭 시 복원 됨 * 업그레이드 완료 시 백업 후 어플리케이션 연결 |
[oracle@earth ~]$ . /usr/local/bin/oraenv
ORACLE_SID = [orcl11g] ?
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@earth ~]$ env | grep ORA
ORACLE_SID=orcl11g
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
[root@earth ~]# cat /etc/oratab | grep -v ^#
orcl12c:/u01/app/oracle/product/12.1.0/dbhome_1:N
orcl11g:/u01/app/oracle/product/11.2.0/dbhome_1:N
[root@earth ~]# vi /etc/oratab
[root@earth ~]# cat /etc/oratab | grep -v ^#
orcl12c:/u01/app/oracle/product/12.1.0/dbhome_1:N
orcl11g:/u01/app/oracle/product/11.1.0/dbhome_1:N
[oracle@earth ~]$ . /usr/local/bin/oraenv
ORACLE_SID = [orcl12c] ? orcl11g
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@earth ~]$ env | grep ORA
ORACLE_SID=orcl11g
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
[oracle@earth dbs]$ pwd
/u01/app/oracle/product/12.1.0/dbhome_1/dbs
[oracle@earth dbs]$ ls *11g*
ls: cannot access *11g*: 그런 파일이나 디렉터리가 없습니다
[oracle@earth dbs]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileorcl11g.ora .
[oracle@earth dbs]$ ls *11g*
spfileorcl11g.ora
[oracle@earth dbs]$
[oracle@earth dbs]$ cd $ORACLE_HOME/rdbms/admin
[oracle@earth admin]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Mon Nov 7 16:29:43 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup upgrade
ORACLE instance started.
Total System Global Area 796917760 bytes
Fixed Size 2929448 bytes
Variable Size 515902680 bytes
Database Buffers 272629760 bytes
Redo Buffers 5455872 bytes
Database mounted.
Database opened.
SQL>
-- 병렬로 수행 됨 (기본값)
[oracle@earth admin]$ $ORACLE_HOME/perl/bin/perl catctl.pl catupgrd.sql
Argument list for [catctl.pl]
SQL Process Count n = 0
SQL PDB Process Count N = 0
Input Directory d = 0
Phase Logging Table t = 0
Log Dir l = 0
Script s = 0
Serial Run S = 0
Upgrade Mode active M = 0
Start Phase p = 0
End Phase P = 0
Log Id i = 0
Run in c = 0
Do not run in C = 0
Echo OFF e = 1
No Post Upgrade x = 0
Reverse Order r = 0
Open Mode Normal o = 0
Debug catcon.pm z = 0
Debug catctl.pl Z = 0
Display Phases y = 0
Child Process I = 0
catctl.pl version: 12.1.0.2.0
Oracle Base = /u01/app/oracle
Analyzing file catupgrd.sql
Log files in /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin
catcon: ALL catcon-related output will be written to catupgrd_catcon_13433.lst
catcon: See catupgrd*.log files for output generated by scripts
catcon: See catupgrd_*.lst files for spool files, if any
Number of Cpus = 2
SQL Process Count = 0
New SQL Process Count = 4
------------------------------------------------------
Phases [0-73]
Serial Phase #: 0 Files: 1
Phases [0-73]
Serial Phase #: 0 Files: 1 Time: 131s
Serial Phase #: 1 Files: 5 Time: 30s
Restart Phase #: 2 Files: 1 Time: 0s
Parallel Phase #: 3 Files: 18 Time: 8s
Restart Phase #: 4 Files: 1 Time: 0s
Serial Phase #: 5 Files: 5 Time: 14s
Serial Phase #: 6 Files: 1 Time: 8s
Serial Phase #: 7 Files: 4 Time: 6s
Restart Phase #: 8 Files: 1 Time: 0s
Parallel Phase #: 9 Files: 62 Time: 48s
Restart Phase #:10 Files: 1 Time: 0s
Serial Phase #:11 Files: 1 Time: 10s
Restart Phase #:12 Files: 1 Time: 0s
Parallel Phase #:13 Files: 91 Time: 6s
Restart Phase #:14 Files: 1 Time: 0s
Parallel Phase #:15 Files: 111 Time: 13s
Restart Phase #:16 Files: 1 Time: 1s
Serial Phase #:17 Files: 3 Time: 0s
Restart Phase #:18 Files: 1 Time: 0s
Parallel Phase #:19 Files: 32 Time: 18s
Restart Phase #:20 Files: 1 Time: 0s
Serial Phase #:21 Files: 3 Time: 5s
Restart Phase #:22 Files: 1 Time: 0s
Parallel Phase #:23 Files: 23 Time: 64s
Restart Phase #:24 Files: 1 Time: 0s
Parallel Phase #:25 Files: 11 Time: 31s
Restart Phase #:26 Files: 1 Time: 0s
Serial Phase #:27 Files: 1 Time: 0s
Restart Phase #:28 Files: 1 Time: 0s
Serial Phase #:30 Files: 1 Time: 0s
Serial Phase #:31 Files: 257 Time: 13s
Serial Phase #:32 Files: 1 Time: 0s
Restart Phase #:33 Files: 1 Time: 0s
Serial Phase #:34 Files: 1 Time: 3s
Restart Phase #:35 Files: 1 Time: 0s
Restart Phase #:36 Files: 1 Time: 0s
Serial Phase #:37 Files: 4 Time: 33s
Restart Phase #:38 Files: 1 Time: 0s
Parallel Phase #:39 Files: 13 Time: 39s
Restart Phase #:40 Files: 1 Time: 0s
Parallel Phase #:41 Files: 10 Time: 6s
Restart Phase #:42 Files: 1 Time: 0s
Serial Phase #:43 Files: 1 Time: 4s
Restart Phase #:44 Files: 1 Time: 0s
Serial Phase #:45 Files: 1 Time: 4s
Serial Phase #:46 Files: 1 Time: 0s
Restart Phase #:47 Files: 1 Time: 0s
Serial Phase #:48 Files: 1 Time: 75s
Restart Phase #:49 Files: 1 Time: 0s
Serial Phase #:50 Files: 1 Time: 29s
Restart Phase #:51 Files: 1 Time: 0s
Serial Phase #:52 Files: 1 Time: 13s
Restart Phase #:53 Files: 1 Time: 0s
Serial Phase #:54 Files: 1 Time: 252s
Restart Phase #:55 Files: 1 Time: 0s
Serial Phase #:56 Files: 1 Time: 55s
Restart Phase #:57 Files: 1 Time: 0s
Serial Phase #:58 Files: 1 Time: 100s
Restart Phase #:59 Files: 1 Time: 0s
Serial Phase #:60 Files: 1 Time: 388s
Restart Phase #:61 Files: 1 Time: 0s
Serial Phase #:62 Files: 1 Time: 988s
Restart Phase #:63 Files: 1 Time: 1s
Serial Phase #:64 Files: 1 Time: 1s
Serial Phase #:65 Files: 1 Calling sqlpatch with LD_LIBRARY_PATH=/u01/app/oracle/product/12.1.0/dbhome_1/lib; export LD_LIBRARY_PATH;/u01/app/oracle/product/12.1.0/dbhome_1/perl/bin/perl -I /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin -I /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/../../sqlpatch /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/../../sqlpatch/sqlpatch.pl -verbose -upgrade_mode_only > catupgrd_datapatch_upgrade.log 2> catupgrd_datapatch_upgrade.err
returned from sqlpatch
Time: 65s
Serial Phase #:66 Files: 1 Time: 61s
Serial Phase #:68 Files: 1 Time: 0s
Serial Phase #:69 Files: 1 Calling sqlpatch with LD_LIBRARY_PATH=/u01/app/oracle/product/12.1.0/dbhome_1/lib; export LD_LIBRARY_PATH;/u01/app/oracle/product/12.1.0/dbhome_1/perl/bin/perl -I /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin -I /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/../../sqlpatch /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/../../sqlpatch/sqlpatch.pl -verbose > catupgrd_datapatch_normal.log 2> catupgrd_datapatch_normal.err
returned from sqlpatch
Time: 37s
Serial Phase #:70 Files: 1 Time: 173s
Serial Phase #:71 Files: 1 Time: 0s
Serial Phase #:72 Files: 1 Time: 0s
Serial Phase #:73 Files: 1 Time: 20s
Grand Total Time: 2766s
LOG FILES: (catupgrd*.log)
Upgrade Summary Report Located in:
/u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/orcl11g/upgrade/upg_summary.log
Grand Total Upgrade Time: [0d:0h:46m:6s]
SQL> @utlu121s.sql
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
CATCTL REPORT = /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/orcl11g/upgrade/upg_summary.log
PL/SQL procedure successfully completed.
Oracle Database 12.1 Post-Upgrade Status Tool 11-07-2016 17:21:54
Component Current Version Elapsed Time
Name Status Number HH:MM:SS
Oracle Server UPGRADED 12.1.0.2.0 00:08:15
JServer JAVA Virtual Machine VALID 12.1.0.2.0 00:01:13
Oracle Workspace Manager VALID 12.1.0.2.0 00:00:44
OLAP Analytic Workspace VALID 12.1.0.2.0 00:00:12
OLAP Catalog OPTION OFF 11.2.0.3.0 00:00:00
Oracle OLAP API VALID 12.1.0.2.0 00:00:16
Oracle XDK VALID 12.1.0.2.0 00:00:29
Oracle Text VALID 12.1.0.2.0 00:00:32
Oracle XML Database VALID 12.1.0.2.0 00:03:39
Oracle Database Java Packages VALID 12.1.0.2.0 00:00:10
Oracle Multimedia VALID 12.1.0.2.0 00:01:40
Spatial UPGRADED 12.1.0.2.0 00:06:27
Oracle Application Express VALID 4.2.5.00.08 00:15:49
Final Actions 00:01:54
Post Upgrade 00:02:38
Total Upgrade Time: 00:44:28
PL/SQL procedure successfully completed.
SQL>
SQL> --
SQL> -- Update Summary Table with con_name and endtime.
SQL> --
SQL> UPDATE sys.registry$upg_summary SET reportname = :ReportName,
2 con_name = SYS_CONTEXT('USERENV','CON_NAME'),
3 endtime = SYSDATE
4 WHERE con_id = -1;
1 row updated.
SQL> commit;
Commit complete.
SQL>
SQL> SELECT * FROM V$TRANSPORTABLE_PLATFORM;
PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT
----------- -------------------------------- --------------
1 Solaris[tm] OE (32-bit) Big
2 Solaris[tm] OE (64-bit) Big
7 Microsoft Windows IA (32-bit) Little
10 Linux IA (32-bit) Little
6 AIX-Based Systems (64-bit) Big
3 HP-UX (64-bit) Big
5 HP Tru64 UNIX Little
4 HP-UX IA (64-bit) Big
11 Linux IA (64-bit) Little
15 HP Open VMS Little
8 Microsoft Windows IA (64-bit) Little
9 IBM zSeries Based Linux Big
13 Linux 64-bit for AMD Little
16 Apple Mac OS Big
12 Microsoft Windows 64-bit for AMD Little
17 Solaris Operating System (x86) Little
16 rows selected.
순번 | 내용 |
---|---|
1 | DBCA 로 새 DB 12c 생성 |
2 | DB로의 모든 연결에 대한 정합성 체크 |
3 | 타겟DB 운영계화(모니터링, 백업 등) 체크 |
4 | 마이그레이션, 테스트, 백아웃 절차 계획 완료 |
5 | 테스트 마이그레이션 반복 수행 |
6 | 타겟DB 테이블스페이스 확장 |
7 | 소스DB METADATA_EXP_DIR 생성 |
8 | 소스DB EXPORT 권한 유저 생성(DATAPUMP_EXP_FULL_DATABASE) |
9 | 소스DB META EXPORT 수행(INDEX 제외) |
10 | 타겟DB IMPORT 권한 유저 생성(DATAPUMP_IMP_FULL_DATABASE) |
11 | 롤백을 위해 GUARANTEED RESTORE POINT 생성 (IMPORT 롤백 필요시 FLASHBACK DATABASE 사용 고려) |
12 | 타겟DB META IMPORT 수행 |
13 | 타겟DB DB_LINK TO 소스DB 생성 |
14 | DB_LINK 점검 |
15 | NETWORK_LINK 옵션과 함께 IMPORT 수행(FOREIGN KEY 주의) |
16 | INDEX IMPORT 수행 |
17 | 오든 오브젝트 재컴파일(utlrp.sql) 수행 |
18 | 타겟DB 백업 |
19 | 데이터 검사 및 클라이언트 전환 |
- 강좌 URL : http://www.gurubee.net/lecture/3315
- 구루비 강좌는 개인의 학습용으로만 사용 할 수 있으며, 다른 웹 페이지에 게재할 경우에는 출처를 꼭 밝혀 주시면 고맙겠습니다.~^^
- 구루비 강좌는 서비스 제공을 위한 목적이나, 학원 홍보, 수익을 얻기 위한 용도로 사용 할 수 없습니다.