반응형

기존상태 확인

[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 09:34:42 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> --SPFILE 확인
SQL> show parameter spfile
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /dev/raw/raw9
SQL>
SQL> --Control File 확인
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/dev/raw/raw10
/dev/raw/raw11
SQL>
SQL> --Data File 확인
SQL> col FILE_NAME for a30
SQL> select TABLESPACE_NAME, FILE_NAME from dba_data_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
SYSTEM                         /dev/raw/raw1
SYSAUX                         /dev/raw/raw2
UNDOTBS1                       /dev/raw/raw5
USERS                          /dev/raw/raw4
TS_DATA                        /dev/raw/raw12
TS_IDX                         /dev/raw/raw13
6 rows selected.
SQL>
SQL> --Temp File 확인
SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
TEMP                           /dev/raw/raw3
SQL>
SQL> --Redo Log 확인
SQL> SET LINESIZE 150
SQL> COLUMN member FORMAT A20
SQL> COLUMN first_change# FORMAT 99999999999999999999
SQL> COLUMN next_change# FORMAT 99999999999999999999
SQL> SELECT l.thread#,
SQL>        lf.group#,
SQL>        lf.member,
SQL>        TRUNC(l.bytes/1024/1024) AS size_mb,
SQL>        l.status,
SQL>        l.archived,
SQL>        lf.type,
SQL>        lf.is_recovery_dest_file AS rdf,
SQL>        l.sequence#,
SQL>        l.first_change#,
SQL>        l.next_change#   
SQL> FROM   v$logfile lf
SQL>        JOIN v$log l ON l.group# = lf.group#
SQL> ORDER BY l.thread#,lf.group#, lf.member;

   THREAD#     GROUP# MEMBER                  SIZE_MB STATUS           ARC TYPE    RDF  SEQUENCE#         FIRST_CHANGE#          NEXT_CHANGE#
---------- ---------- -------------------- ---------- ---------------- --- ------- --- ---------- --------------------- ---------------------
         1          1 /dev/raw/raw6                50 CURRENT          NO  ONLINE  NO          85                818528       281474976710655
         1          2 /dev/raw/raw7                50 INACTIVE         YES ONLINE  NO          83                818196                818419
         1          3 /dev/raw/raw8                50 INACTIVE         YES ONLINE  NO          84                818419                818528

SQL>
SQL> --Archive Log 확인
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /log/arch/
Oldest online log sequence     83
Next log sequence to archive   85
Current log sequence           85
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

RMAN를 이용한 Rawdevice를 Filesystem으로 변경 하기

사전 확인 / 주요 파일 백업 DB 종료

[oracle@ol7 DATASYNCXML]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 DATASYNCXML]$ pwd
/home/oracle/DATASYNCXML
[oracle@ol7 DATASYNCXML]$ ls
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 09:54:41 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> --Spfile 백업
SQL> create pfile='/home/oracle/DATASYNCXML/initTST.ora_org' from spfile;
File created.
SQL>
SQL> --Control File 백업
SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/home/oracle/DATASYNCXML/TST_cr_controlfile.sql';
Database altered.
SQL>
SQL> --주요 Table Row수 확인
SQL> select count(*) from scott.big_emp;
  COUNT(*)
----------
   3440640
SQL>
SQL> --SCN Number 확인
SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
                  819396

SQL>
SQL> --DB 종료
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

RMAN으로 Rawdevice를 Filesystem으로 변경 하기(Temp/Redo/Control 제외)

[oracle@ol7 DATASYNCXML]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 10:30:54 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> --DB를 Mounut 하기
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size                  2253784 bytes
Variable Size            1040190504 bytes
Database Buffers          603979776 bytes
Redo Buffers                7094272 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Sep 29 10:36:46 2022
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: TST (DBID=2257768950, not open)
RMAN> run {
2> allocate channel c1 type disk;
3> copy datafile '/dev/raw/raw1' to '/oradata/system/sytem01.dbf';
4> copy datafile '/dev/raw/raw2' to '/oradata/system/sysaux01.dbf';
5> copy datafile '/dev/raw/raw5' to '/oradata/system/unotodb01.dbf';
6> copy datafile '/dev/raw/raw4' to '/oradata/system/user01.dbf';
7> copy datafile '/dev/raw/raw12' to '/oradata/data/ts_data_01.dbf';
8> copy datafile '/dev/raw/raw13' to '/oradata/idx/ts_indx_01.dbf';
9> }
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=133 device type=DISK
Starting backup at 29-SEP-22
channel c1: starting datafile copy
input datafile file number=00001 name=/dev/raw/raw1
output file name=/oradata/system/sytem01.dbf tag=TAG20220929T103806 RECID=1 STAMP=1116671888
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 29-SEP-22
Starting backup at 29-SEP-22
channel c1: starting datafile copy
input datafile file number=00002 name=/dev/raw/raw2
output file name=/oradata/system/sysaux01.dbf tag=TAG20220929T103809 RECID=2 STAMP=1116671891
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 29-SEP-22
Starting backup at 29-SEP-22
channel c1: starting datafile copy
input datafile file number=00003 name=/dev/raw/raw5
output file name=/oradata/system/unotodb01.dbf tag=TAG20220929T103812 RECID=3 STAMP=1116671895
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 29-SEP-22
Starting backup at 29-SEP-22
channel c1: starting datafile copy
input datafile file number=00004 name=/dev/raw/raw4
output file name=/oradata/system/user01.dbf tag=TAG20220929T103815 RECID=4 STAMP=1116671895
channel c1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 29-SEP-22
Starting backup at 29-SEP-22
channel c1: starting datafile copy
input datafile file number=00005 name=/dev/raw/raw12
output file name=/oradata/data/ts_data_01.dbf tag=TAG20220929T103816 RECID=5 STAMP=1116671899
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 29-SEP-22
Starting backup at 29-SEP-22
channel c1: starting datafile copy
input datafile file number=00006 name=/dev/raw/raw13
output file name=/oradata/idx/ts_indx_01.dbf tag=TAG20220929T103820 RECID=6 STAMP=1116671902
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 29-SEP-22
released channel: c1
RMAN> exit
Recovery Manager complete.
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 10:40:08 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select status from v$instance;
STATUS
------------
MOUNTED
SQL>
SQL> --DBF File Rename
SQL> alter database rename file '/dev/raw/raw1' to '/oradata/system/sytem01.dbf';
Database altered.
SQL> alter database rename file '/dev/raw/raw2' to '/oradata/system/sysaux01.dbf';
Database altered.
SQL> alter database rename file '/dev/raw/raw5' to '/oradata/system/unotodb01.dbf';
Database altered.
SQL> alter database rename file '/dev/raw/raw4' to '/oradata/system/user01.dbf';
Database altered.
SQL> alter database rename file '/dev/raw/raw12' to '/oradata/data/ts_data_01.dbf';
Database altered.
SQL> alter database rename file '/dev/raw/raw13' to '/oradata/idx/ts_indx_01.dbf';
Database altered.
SQL>
SQL> --Database Open
SQL> alter database open;
Database altered.
SQL> select status from v$instance;
STATUS
------------
OPEN
SQL> select count(*) from scott.big_emp;
  COUNT(*)
----------
   3440640
SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
                  819977
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

Temp Tablespace Filesystem으로 생성 및 기존 Raw Device Temp Tablespace 삭제

[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 10:46:40 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL> --사용자 기본 Temp Tablespace 확인
SQL> select username, TEMPORARY_TABLESPACE from dba_users where ACCOUNT_STATUS='OPEN';
USERNAME                       TEMPORARY_TABLESPACE
------------------------------ ------------------------------
SYSTEM                         TEMP
SYS                            TEMP
SCOTT                          TEMP
SQL>
SQL>  --Temp Tablespace 상태 학인
SQL> col FILE_NAME for a20
SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ --------------------
TEMP                           /dev/raw/raw3
SQL>
SQL> --임시 Temp Tablespace 생성 및 기존 Raw Device Temp Tablespace 삭제
SQL> create temporary tablespace temp2 tempfile '/oradata/temp/imsi01.dbf' size 512m autoextend on;
Tablespace created.
SQL> alter database default temporary tablespace temp2;
Database altered.
SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
TEMP                           /dev/raw/raw3
TEMP2                          /oradata/temp/imsi01.dbf
SQL> select username, TEMPORARY_TABLESPACE from dba_users where ACCOUNT_STATUS='OPEN';
USERNAME                       TEMPORARY_TABLESPACE
------------------------------ ------------------------------
SYSTEM                         TEMP2
SYS                            TEMP2
SCOTT                          TEMP2
SQL>
SQL> drop tablespace temp;
Tablespace dropped.
SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
TEMP2                          /oradata/temp/imsi01.dbf
SQL>
SQL> --정식 Temp Tablespace 생성 및 임시 Temp Tablespace 삭제
SQL> create temporary tablespace temp tempfile '/oradata/temp/temp01.dbf' size 512m autoextend on;
Tablespace created.
SQL> alter database default temporary tablespace temp;
Database altered.
SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
TEMP                           /oradata/temp/temp01.dbf
TEMP2                          /oradata/temp/imsi01.dbf
SQL> select username, TEMPORARY_TABLESPACE from dba_users where ACCOUNT_STATUS='OPEN';
USERNAME                       TEMPORARY_TABLESPACE
------------------------------ ------------------------------
SYSTEM                         TEMP
SYS                            TEMP
SCOTT                          TEMP
SQL>
SQL> drop tablespace TEMP2;
Tablespace dropped.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

File system으로 Redolog 생성 및 기존 Raw Device Redolog 삭제

[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 11:09:32 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL> --현 상태 학인
SQL> SET LINESIZE 150
SQL> COLUMN member FORMAT A50
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;

   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1          1 /dev/raw/raw6                                      CURRENT          NO  ONLINE
         1          2 /dev/raw/raw7                                      INACTIVE         YES ONLINE
         1          3 /dev/raw/raw8                                      INACTIVE         YES ONLINE

SQL>
SQL> --임시 Redo Log 생성
SQL> alter database add logfile group 11 '/oradata/redo1/imsi_redo11.log' size 200m;
Database altered.
SQL> alter database add logfile group 12 '/oradata/redo1/imsi_redo12.log' size 200m;
Database altered.
SQL> alter database add logfile group 13 '/oradata/redo1/imsi_redo13.log' size 200m;
Database altered.
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;

   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1          1 /dev/raw/raw6                                      CURRENT          NO  ONLINE
         1          2 /dev/raw/raw7                                      INACTIVE         YES ONLINE
         1          3 /dev/raw/raw8                                      INACTIVE         YES ONLINE
         1         11 /oradata/redo1/imsi_redo11.log                     UNUSED           YES ONLINE
         1         12 /oradata/redo1/imsi_redo12.log                     UNUSED           YES ONLINE
         1         13 /oradata/redo1/imsi_redo13.log                     UNUSED           YES ONLINE

6 rows selected.
SQL>
SQL> --기존 Rawdevice Redo Log 삭제
SQL> alter system switch logfile; --3~4회 반복
System altered.
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;
   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1          1 /dev/raw/raw6                                      INACTIVE         YES ONLINE
         1          2 /dev/raw/raw7                                      INACTIVE         YES ONLINE
         1          3 /dev/raw/raw8                                      INACTIVE         YES ONLINE
         1         11 /oradata/redo1/imsi_redo11.log                     CURRENT          NO  ONLINE
         1         12 /oradata/redo1/imsi_redo12.log                     INACTIVE         YES ONLINE
         1         13 /oradata/redo1/imsi_redo13.log                     INACTIVE         YES ONLINE

6 rows selected.
SQL>
SQL> --리두로그 상태가 INACTIVE 인 경우만 삭제 가능
SQL> alter database drop logfile group 1;
Database altered.
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database drop logfile group 3;
Database altered.
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;

   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1         11 /oradata/redo1/imsi_redo11.log                     CURRENT          NO  ONLINE
         1         12 /oradata/redo1/imsi_redo12.log                     INACTIVE         YES ONLINE
         1         13 /oradata/redo1/imsi_redo13.log                     INACTIVE         YES ONLINE
SQL>
SQL>
SQL> --정식 Redo log 생성
SQL> alter database add logfile group 1 '/oradata/redo1/redo11.log' size 200m;
Database altered.
SQL> alter database add logfile group 2 '/oradata/redo1/redo12.log' size 200m;
Database altered.
SQL> alter database add logfile group 3 '/oradata/redo1/redo13.log' size 200m;
Database altered.
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;
   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1          1 /oradata/redo1/redo11.log                          UNUSED           YES ONLINE
         1          2 /oradata/redo1/redo12.log                          UNUSED           YES ONLINE
         1          3 /oradata/redo1/redo13.log                          UNUSED           YES ONLINE
         1         11 /oradata/redo1/imsi_redo11.log                     CURRENT          NO  ONLINE
         1         12 /oradata/redo1/imsi_redo12.log                     INACTIVE         YES ONLINE
         1         13 /oradata/redo1/imsi_redo13.log                     INACTIVE         YES ONLINE

6 rows selected.
SQL>
SQL> --임시 Redo Log 삭제
SQL> alter system switch logfile; --3~4회 반복
System altered.
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;

   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1          1 /oradata/redo1/redo11.log                          INACTIVE         YES ONLINE
         1          2 /oradata/redo1/redo12.log                          CURRENT          NO  ONLINE
         1          3 /oradata/redo1/redo13.log                          INACTIVE         YES ONLINE
         1         11 /oradata/redo1/imsi_redo11.log                     INACTIVE         YES ONLINE
         1         12 /oradata/redo1/imsi_redo12.log                     INACTIVE         YES ONLINE
         1         13 /oradata/redo1/imsi_redo13.log                     INACTIVE         YES ONLINE

6 rows selected.
SQL>
SQL> --리두로그 상태가 INACTIVE 인 경우만 삭제 가능
SQL> alter database drop logfile group 11;
Database altered.
SQL> alter database drop logfile group 12;
Database altered.
SQL> alter database drop logfile group 13;
Database altered.
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;
   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1          1 /oradata/redo1/redo11.log                          INACTIVE         YES ONLINE
         1          2 /oradata/redo1/redo12.log                          CURRENT          NO  ONLINE
         1          3 /oradata/redo1/redo13.log                          INACTIVE         YES ONLINE

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

Control File/Spfile을 File systemd로 변경 하기

[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 11:34:55 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> --Control File 상태 확인
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/dev/raw/raw10
/dev/raw/raw11
SQL> --DB 중지
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 11:37:46 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> --DB NOMOUNT
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size                  2253784 bytes
Variable Size            1040190504 bytes
Database Buffers          603979776 bytes
Redo Buffers                7094272 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ --rman을 이용하여 Control File Resotre
[oracle@ol7 DATASYNCXML]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Sep 29 11:40:17 2022
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: TST (not mounted)
RMAN> restore controlfile to '/oradata/control/control01.ctl' from '/dev/raw/raw10';
Starting restore at 29-SEP-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK
channel ORA_DISK_1: copied control file copy
Finished restore at 29-SEP-22
RMAN> quit
Recovery Manager complete.
[oracle@ol7 DATASYNCXML]$ --Control File을 다중화를 위해서 복사
[oracle@ol7 DATASYNCXML]$ ls -al /oradata/control/control01.ctl
-rw-r-----. 1 oracle dba 10043392 Sep 29 11:40 /oradata/control/control01.ctl
[oracle@ol7 DATASYNCXML]$ cp /oradata/control/control01.ctl /oradata/control/control02.ctl
[oracle@ol7 DATASYNCXML]$ ls -al /oradata/control/control*
-rw-r-----. 1 oracle dba 10043392 Sep 29 11:40 /oradata/control/control01.ctl
-rw-r-----. 1 oracle dba 10043392 Sep 29 11:41 /oradata/control/control02.ctl
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 11:41:23 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> --DB Shutdown
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ pwd
/home/oracle/DATASYNCXML
[oracle@ol7 DATASYNCXML]$ ls
initTST.ora_org  TST_cr_controlfile.sql
[oracle@ol7 DATASYNCXML]$ cp initTST.ora_org imsiTST.ora
[oracle@ol7 DATASYNCXML]$ vi imsiTST.ora
[oracle@ol7 DATASYNCXML]$ more imsiTST.ora
*.audit_file_dest='/log/dblog/admin/TST/adump'
*.audit_trail='none'
*.compatible='11.2.0.4.0'
#*.control_files='/dev/raw/raw10','/dev/raw/raw11' --주석 처리
*.control_files='/oradata/control/control01.ctl','/oradata/control/control02.ctl' --변경 Control File 추가
*.db_block_size=8192
*.db_domain=''
*.db_name='TST'
*.diagnostic_dest='/log/dblog/'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=TSTXDB)'
*.log_archive_dest_1='location=/log/arch/'
*.log_archive_format='TST_%t_%s_%r.log'
*.memory_target=1645215744
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 11:45:59 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> --임시 Pfile을 이용하여 DB Startup
SQL> startup pfile='/home/oracle/DATASYNCXML/imsiTST.ora';
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size                  2253784 bytes
Variable Size            1006636072 bytes
Database Buffers          637534208 bytes
Redo Buffers                7094272 bytes
Database mounted.
Database opened.
SQL>
SQL> --Spfile 생성
SQL> create spfile from pfile='/home/oracle/DATASYNCXML/imsiTST.ora';
File created.
SQL> !ls -al /u01/app/oracle/product/11.2.0.4/dbs/sp*
-rw-r-----. 1 oracle dba 2560 Sep 29 11:47 /u01/app/oracle/product/11.2.0.4/dbs/spfileTST.ora
SQL> 
SQL> --DB Restart
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size                  2253784 bytes
Variable Size            1006636072 bytes
Database Buffers          637534208 bytes
Redo Buffers                7094272 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

최종 상태 확인

[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 11:50:35 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL> --SPFILE 확인
SQL> show parameter spfile
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.0.4/dbs/spfileTST.ora
SQL>
SQL> --Control File 확인
SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/oradata/control/control01.ctl
/oradata/control/control02.ctl
SQL>
SQL> --Data File 확인
SQL> col FILE_NAME for a30
SQL> select TABLESPACE_NAME, FILE_NAME from dba_data_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
SYSTEM                         /oradata/system/sytem01.dbf
SYSAUX                         /oradata/system/sysaux01.dbf
UNDOTBS1                       /oradata/system/unotodb01.dbf
USERS                          /oradata/system/user01.dbf
TS_DATA                        /oradata/data/ts_data_01.dbf
TS_IDX                         /oradata/idx/ts_indx_01.dbf
6 rows selected.
SQL>
SQL> --Temp File 확인
SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
TEMP                           /oradata/temp/temp01.dbf
SQL>
SQL> --Redo Log 확인
SQL> SET LINESIZE 200
SQL> COLUMN member FORMAT A50
SQL> COLUMN first_change# FORMAT 99999999999999999999
SQL> COLUMN next_change# FORMAT 99999999999999999999
SQL> SELECT l.thread#,lf.group#,lf.member,TRUNC(l.bytes/1024/1024) AS size_mb,l.status,l.archived,lf.type,
  2  lf.is_recovery_dest_file AS rdf,l.sequence#,l.first_change#,l.next_change#
  3  FROM   v$logfile lf
  4  JOIN v$log l ON l.group# = lf.group#
  5  ORDER BY l.thread#,lf.group#, lf.member;

   THREAD#     GROUP# MEMBER                                                SIZE_MB STATUS           ARC TYPE    RDF  SEQUENCE#         FIRST_CHANGE#          NEXT_CHANGE#
---------- ---------- -------------------------------------------------- ---------- ---------------- --- ------- --- ---------- --------------------- ---------------------
         1          1 /oradata/redo1/redo11.log                                 200 INACTIVE         YES ONLINE  NO         105                822039                822042
         1          2 /oradata/redo1/redo12.log                                 200 CURRENT          NO  ONLINE  NO         106                822042       281474976710655
         1          3 /oradata/redo1/redo13.log                                 200 INACTIVE         YES ONLINE  NO         101                822002                822005

SQL>
SQL> --Archive Log 확인
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /log/arch/
Oldest online log sequence     101
Next log sequence to archive   106
Current log sequence           106
SQL>
SQL> --주요 Table Row수 확인
SQL> select count(*) from scott.big_emp;
  COUNT(*)
----------
   3440640
SQL>
SQL> --SCN Number 확인
SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
                  823169
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

참고문서

Raw Device 에서 File System 으로 데이타파일 변환하기 (문서 ID 1907460.1)

 

반응형
반응형

기존 상태 확인

[grid@one19c ~]$ id
uid=102(grid) gid=1001(oinstall) groups=1001(oinstall),1002(dbaoper),1004(asmadmin),1005(asmoper),1006(asmdba)
[grid@one19c ~]$ df -h
Filesystem                      Size  Used Avail Use% Mounted on
devtmpfs                         32G     0   32G   0% /dev
tmpfs                            32G  845M   31G   3% /dev/shm
tmpfs                            32G   17M   32G   1% /run
tmpfs                            32G     0   32G   0% /sys/fs/cgroup
/dev/mapper/vg00-root           9.6G  2.9G  6.2G  32% /
/dev/sda2                       488M  237M  216M  53% /boot
/dev/mapper/vg00-var            5.7G  156M  5.3G   3% /var
/dev/mapper/vg00-home           960M  2.7M  891M   1% /home
/dev/mapper/vg00-var_log        3.8G   19M  3.6G   1% /var/log
/dev/mapper/vg00-opt             39G  1.9G   36G   6% /opt
/dev/mapper/vg00-var_log_audit  1.9G   13M  1.8G   1% /var/log/audit
/dev/sda1                       128M  7.5M  121M   6% /boot/efi
tmpfs                            32G  4.0K   32G   1% /var/tmp
tmpfs                            32G  256K   32G   1% /tmp
/dev/sdh                        196G   33G  154G  18% /u01
tmpfs                           6.3G     0  6.3G   0% /run/user/102
tmpfs                           6.3G     0  6.3G   0% /run/user/1000
/dev/asm/commonstore-62          10G  329M  9.7G   4% /opt/oracle/dcs/commonstore
/dev/asm/volume1-62              10G  329M  9.7G   4% /u02
tmpfs                           6.3G     0  6.3G   0% /run/user/0
[grid@one19c ~]$
[grid@one19c ~]$ crsctl status res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.COMMONSTORE.advm
               ONLINE  ONLINE       one19c                   STABLE
ora.DATA.VOLUME1.advm
               ONLINE  ONLINE       one19c                   STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       one19c                   STABLE
ora.chad
               ONLINE  ONLINE       one19c                   STABLE
ora.data.commonstore.acfs
               ONLINE  ONLINE       one19c                   mounted on /opt/orac
                                                             le/dcs/commonstore,S
                                                             TABLE
ora.data.volume1.acfs
               ONLINE  ONLINE       one19c                   mounted on /u02,STAB
                                                             LE
ora.net1.network
               ONLINE  ONLINE       one19c                   STABLE
ora.ons
               ONLINE  ONLINE       one19c                   STABLE
ora.proxy_advm
               ONLINE  ONLINE       one19c                   STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       one19c                   STABLE
ora.DATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       one19c                   STABLE
ora.LISTENER_SCAN1.lsnr
      1        OFFLINE OFFLINE                               STABLE
ora.RECO.dg(ora.asmgroup)
      1        ONLINE  ONLINE       one19c                   STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       one19c                   Started,STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       one19c                   STABLE
ora.cvu
      1        ONLINE  ONLINE       one19c                   STABLE
ora.one19c.vip
      1        ONLINE  ONLINE       one19c                   STABLE
ora.one19c_icn153.db
      1        ONLINE  ONLINE       one19c                   Open,HOME=/u01/app/o
                                                             racle/product/19.0.0
                                                             .0/dbhome_1,STABLE
ora.qosmserver
      1        ONLINE  ONLINE       one19c                   STABLE
ora.scan1.vip
      1        OFFLINE OFFLINE                               STABLE
--------------------------------------------------------------------------------
[grid@one19c ~]$
[grid@one19c ~]$ acfsutil info fs
/u02
    ACFS Version: 19.0.0.0.0
    on-disk version:       49.0
    compatible.advm:       19.0.0.0.0
    ACFS compatibility:    19.0.0.0.0
    flags:        MountPoint,Available,KiloSnap
    creation time:   Tue Sep 27 14:39:52 2022
    mount time:      Wed Sep 28 08:59:50 2022
    mount sequence number: 0
    number of nodes:       1
    allocation unit:       4096
    metadata block size:   4096
    volumes:      1
    total size:   10737418240  (  10.00 GB )
    total free:   10392436736  (   9.68 GB )
    file entry table allocation: 262144
    primary volume: /dev/asm/volume1-62
        label:
        state:                 Available
        major, minor:          251, 31746
        logical sector size:   512
        size:                  10737418240  (  10.00 GB )
        free:                  10392436736  (   9.68 GB )
        metadata read I/O count:         2090
        metadata write I/O count:        10
        total metadata bytes read:       8560640  (   8.16 MB )
        total metadata bytes written:    40960  (  40.00 KB )
        ADVM diskgroup:        DATA
        ADVM resize increment: 67108864
        ADVM redundancy:       unprotected
        ADVM stripe columns:   8
        ADVM stripe width:     1048576
    number of snapshots:  0
    snapshot space usage: 0  ( 0.00 )
    replication status: DISABLED
    compression status: DISABLED

/opt/oracle/dcs/commonstore
    ACFS Version: 19.0.0.0.0
    on-disk version:       49.0
    compatible.advm:       19.0.0.0.0
    ACFS compatibility:    19.0.0.0.0
    flags:        MountPoint,Available,KiloSnap
    creation time:   Mon Sep 26 09:59:48 2022
    mount time:      Wed Sep 28 08:59:50 2022
    mount sequence number: 1
    number of nodes:       1
    allocation unit:       4096
    metadata block size:   4096
    volumes:      1
    total size:   10737418240  (  10.00 GB )
    total free:   10392502272  (   9.68 GB )
    file entry table allocation: 262144
    primary volume: /dev/asm/commonstore-62
        label:
        state:                 Available
        major, minor:          251, 31745
        logical sector size:   512
        size:                  10737418240  (  10.00 GB )
        free:                  10392502272  (   9.68 GB )
        metadata read I/O count:         2111
        metadata write I/O count:        10
        total metadata bytes read:       8646656  (   8.25 MB )
        total metadata bytes written:    40960  (  40.00 KB )
        ADVM diskgroup:        DATA
        ADVM resize increment: 67108864
        ADVM redundancy:       unprotected
        ADVM stripe columns:   8
        ADVM stripe width:     1048576
    number of snapshots:  0
    snapshot space usage: 0  ( 0.00 )
    replication status: DISABLED
    compression status: DISABLED
[grid@one19c ~]$
[grid@one19c ~]$ asmcmd lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304    262144   236248                0          236248              0             Y  DATA/
MOUNTED  EXTERN  N         512             512   4096  4194304    262144   257020                0          257020              0             N  RECO/
[grid@one19c ~]$
[grid@one19c ~]$ crsctl status res ora.data.volume1.acfs -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.data.volume1.acfs
               ONLINE  ONLINE       one19c                   mounted on /u02,STAB
                                                             LE
--------------------------------------------------------------------------------
[grid@one19c ~]$
[grid@one19c ~]$ sqlplus "/as sysasm"
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Sep 28 09:24:08 2022 Version 19.16.0.0.0
Copyright (c) 1982, 2022, Oracle.  All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.16.0.0.0
SQL> col volume_name for a20
SQL> col volume_device for a50
SQL> set linesize 150
SQL> SELECT volume_name, volume_device FROM V$ASM_VOLUME;
VOLUME_NAME          VOLUME_DEVICE
-------------------- --------------------------------------------------
COMMONSTORE          /dev/asm/commonstore-62
VOLUME1              /dev/asm/volume1-62
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.16.0.0.0
[grid@one19c ~]$
[grid@one19c ~]$

ACFS 삭제 

--ACFS FIlesystem Resources 중지
[grid@one19c ~]$ srvctl stop filesystem -volume VOLUME1 -diskgroup DATA
--ACFS Filesystem Resources 삭제
[root@one19c bin]# id
uid=0(root) gid=0(root) groups=0(root)
[root@one19c bin]#
[root@one19c bin]#
[root@one19c bin]# id
uid=0(root) gid=0(root) groups=0(root)
[root@one19c bin]# pwd
/u01/app/19.0.0.0/grid/bin
[root@one19c bin]# ./srvctl remove filesystem  -volume VOLUME1 -diskgroup DATA
[root@one19c bin]# ./crsctl status res ora.data.volume1.acfs -t
CRS-2613: Could not find resource 'ora.data.volume1.acfs'.
[root@one19c bin]# ./crsctl status res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.COMMONSTORE.advm
               ONLINE  ONLINE       one19c                   STABLE
ora.DATA.VOLUME1.advm
               ONLINE  ONLINE       one19c                   STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       one19c                   STABLE
ora.chad
               ONLINE  ONLINE       one19c                   STABLE
ora.data.commonstore.acfs
               ONLINE  ONLINE       one19c                   mounted on /opt/orac
                                                             le/dcs/commonstore,S
                                                             TABLE
ora.net1.network
               ONLINE  ONLINE       one19c                   STABLE
ora.ons
               ONLINE  ONLINE       one19c                   STABLE
ora.proxy_advm
               ONLINE  ONLINE       one19c                   STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       one19c                   STABLE
ora.DATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       one19c                   STABLE
ora.LISTENER_SCAN1.lsnr
      1        OFFLINE OFFLINE                               STABLE
ora.RECO.dg(ora.asmgroup)
      1        ONLINE  ONLINE       one19c                   STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       one19c                   Started,STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       one19c                   STABLE
ora.cvu
      1        ONLINE  ONLINE       one19c                   STABLE
ora.one19c.vip
      1        ONLINE  ONLINE       one19c                   STABLE
ora.one19c_icn153.db
      1        ONLINE  ONLINE       one19c                   Open,HOME=/u01/app/o
                                                             racle/product/19.0.0
                                                             .0/dbhome_1,STABLE
ora.qosmserver
      1        ONLINE  ONLINE       one19c                   STABLE
ora.scan1.vip
      1        OFFLINE OFFLINE                               STABLE
--------------------------------------------------------------------------------
[root@one19c bin]#
[root@one19c bin]#
[root@one19c bin]# ./asmcmd lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304    262144   236248                0          236248              0             Y  DATA/
MOUNTED  EXTERN  N         512             512   4096  4194304    262144   257020                0          257020              0             N  RECO/
[root@one19c bin]#
--ACFS Volume 삭제
[grid@one19c ~]$ id
uid=102(grid) gid=1001(oinstall) groups=1001(oinstall),1002(dbaoper),1004(asmadmin),1005(asmoper),1006(asmdba)
[grid@one19c ~]$
[grid@one19c ~]$ asmcmd volinfo --all
Diskgroup Name: DATA
         Volume Name: COMMONSTORE
         Volume Device: /dev/asm/commonstore-62
         State: ENABLED
         Size (MB): 10240
         Resize Unit (MB): 64
         Redundancy: UNPROT
         Stripe Columns: 8
         Stripe Width (K): 1024
         Usage: ACFS
         Mountpath: /opt/oracle/dcs/commonstore

         Volume Name: VOLUME1
         Volume Device: /dev/asm/volume1-62
         State: ENABLED
         Size (MB): 10240
         Resize Unit (MB): 64
         Redundancy: UNPROT
         Stripe Columns: 8
         Stripe Width (K): 1024
         Usage: ACFS
         Mountpath: /u02
[grid@one19c ~]$
[grid@one19c ~]$ asmcmd voldelete -G DATA VOLUME1
[grid@one19c ~]$
[grid@one19c ~]$ asmcmd volinfo --all
Diskgroup Name: DATA

         Volume Name: COMMONSTORE
         Volume Device: /dev/asm/commonstore-62
         State: ENABLED
         Size (MB): 10240
         Resize Unit (MB): 64
         Redundancy: UNPROT
         Stripe Columns: 8
         Stripe Width (K): 1024
         Usage: ACFS
         Mountpath: /opt/oracle/dcs/commonstore

[grid@one19c ~]$
[grid@one19c ~]$ asmcmd lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304    262144   246492                0          246492              0             Y  DATA/
MOUNTED  EXTERN  N         512             512   4096  4194304    262144   257020                0          257020              0             N  RECO/
[grid@one19c ~]$
[grid@one19c ~]$ exit
logout
[root@one19c /]# id
uid=0(root) gid=0(root) groups=0(root)
[root@one19c /]# rm -rf /u02
[root@one19c /]#

 

반응형
반응형

Patch전 사전 확인

[root@one19c ~]# cliadm update-dbcli
Job details
----------------------------------------------------------------
                     ID:  fe8c68e7-4f63-41af-bebb-23b0901ffccb
            Description:  DcsCli patching
                 Status:  Created
                Created:  September 26, 2022 11:17:59 AM KST
                Message:  Dcs cli will be updated
Task Name                                                                Start Time                          End Time                            Status
------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ----------

[root@one19c ~]#
[root@one19c ~]# dbcli describe-component
System Version
---------------
22.3.2.1.0
Component                                Installed Version    Available Version
---------------------------------------- -------------------- --------------------
GI                                        19.15.0.0.0           19.16.0.0
DB                                        19.15.0.0.0           19.16.0.0
[root@one19c ~]#
[root@one19c ~]# dbcli describe-latestpatch
componentType   availableVersion
--------------- --------------------
gi              12.2.0.1.220719
gi              12.1.0.2.220719
gi              18.16.0.0.0
gi              19.16.0.0.0
gi              21.7.0.0.0
db              11.2.0.4.220719
db              12.2.0.1.220719
db              12.1.0.2.220719
db              18.16.0.0.0
db              19.16.0.0.0
db              21.7.0.0.0
[root@one19c ~]#
[root@one19c ~]# su - grid
Last login: Mon Sep 26 11:17:11 KST 2022
[grid@one19c ~]$ cd $ORACLE_HOME/OPatch
[grid@one19c OPatch]$ pwd
/u01/app/19.0.0.0/grid/OPatch
[grid@one19c OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.32
OPatch succeeded.
[grid@one19c OPatch]$ ./opatch lspatches -oh /u01/app/19.0.0.0/grid
33610957;OCW Interim patch for 33610957
33912872;DATABASE PERL UPDATE IN 19C TO V5.32-1 (CVE-2022-23990 - LIBEXPAT UPDATE)
33810130;JDK BUNDLE PATCH 19.0.0.0.220419
33911149;TOMCAT RELEASE UPDATE 19.0.0.0.0 (33911149)
33815607;ACFS RELEASE UPDATE 19.15.0.0.0 (33815607)
33806152;Database Release Update : 19.15.0.0.220419 (33806152)
33575402;DBWLM RELEASE UPDATE 19.0.0.0.0 (33575402)
OPatch succeeded.
[grid@one19c OPatch]$ exit
[root@one19c ~]#
[root@one19c ~]# su - oracle
Last login: Mon Sep 26 11:20:21 KST 2022 on pts/0
[oracle@one19c ~]$ cd $ORACLE_HOME/OPatch
[oracle@one19c OPatch]$ pwd
/u01/app/oracle/product/19.0.0.0/dbhome_1/OPatch
[oracle@one19c OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.30
OPatch succeeded.
[oracle@one19c OPatch]$ ./opatch lspatches -oh /u01/app/oracle/product/19.0.0.0/dbhome_1
34096213;Fix for Bug 34096213
33810360;CVE-2021-45943 REPORTED IN (OPEN SOURCE GEOSPATIAL FOUNDATION/GEOSPATIAL DATA ABSTRACTION LIBRARY/OPENGIS SIMPLE FEATURES REFERENCE IMPLEMENTATION (GDAL/OGR)/3.3.0)
34088989;ONE-OFF REQUEST FOR DELETE DIR FOR SUPTOOLS/TFA + SUPTOOLS/ORACHK + SUPTOOLS/ORACHK.ZIP FROM DB PSU/BP/RU/RUR
33809062;TRACKING BUG FOR REGRESSION RTI 24544369 CAUSED BY PKNAGGS_BUG-32472737 APPROVED/INCLUDED IN 21.0.0.0 ADBSBP
33613829;RDBMS - DSTV37 UPDATE - TZDATA2021E
32327201;RDBMS - DSTV36 UPDATE - TZDATA2020E
31335037;RDBMS - DSTV35 UPDATE - TZDATA2020A
30432118;MERGE REQUEST ON TOP OF 19.0.0.0.0 FOR BUGS 28852325 29997937
33808367;OJVM RELEASE UPDATE: 19.15.0.0.220419 (33808367)
31732095;UPDATE PERL IN 19C DATABASE ORACLE HOME TO V5.32
33810130;JDK BUNDLE PATCH 19.0.0.0.220419
33815596;OCW RELEASE UPDATE 19.15.0.0.0 (33815596)
33806152;Database Release Update : 19.15.0.0.220419 (33806152)
OPatch succeeded.
[oracle@one19c OPatch]$ exit
logout
[root@one19c ~]#

Oracle GRID Patch

[root@one19c ~]# dbcli update-server -h
Usage: update-server [options]
  Options:
    --component, -c
      Component to update
    --help, -h
      get help
    --json, -j
      json output
    --local, -l
      Update Server Components Locally
    --node, -n
      Node to be updated
    --precheck, -p
      Only Analyze the patch
    --version, -v
      Version to be updated
[root@one19c ~]#
[root@one19c ~]# dbcli update-server -p
{
  "jobId" : "88bb70c4-c738-43f2-875d-c643213ebc36",
  "status" : "Created",
  "message" : null,
  "errorCode" : "",
  "reports" : [ ],
  "createTimestamp" : "September 26, 2022 11:24:33 AM KST",
  "resourceList" : [ ],
  "description" : "Server Patching Prechecks",
  "updatedTime" : "September 26, 2022 11:24:33 AM KST",
  "percentageProgress" : "0%",
  "cause" : null,
  "action" : null
}
[root@one19c ~]#
[root@one19c ~]# dbcli update-server
{
  "jobId" : "2fd66f64-23ae-4db4-999d-2467d1c35981",
  "status" : "Created",
  "message" : null,
  "errorCode" : "",
  "reports" : [ ],
  "createTimestamp" : "September 26, 2022 11:25:26 AM KST",
  "resourceList" : [ ],
  "description" : "Server Patching",
  "updatedTime" : "September 26, 2022 11:25:26 AM KST",
  "percentageProgress" : "0%",
  "cause" : null,
  "action" : null
}
[root@one19c ~]#
[root@one19c ~]# dbcli describe-job -i 2fd66f64-23ae-4db4-999d-2467d1c35981
Job details
----------------------------------------------------------------
                     ID:  2fd66f64-23ae-4db4-999d-2467d1c35981
            Description:  Server Patching
                 Status:  Waiting
                Created:  September 26, 2022 11:25:26 AM KST
               Progress:  0%
                Message:
             Error Code:

Task Name                                                                Start Time                          End Time                            Status
------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ----------
[root@one19c ~]#
[root@one19c ~]# dbcli describe-job -i 2fd66f64-23ae-4db4-999d-2467d1c35981
Job details
----------------------------------------------------------------
                     ID:  2fd66f64-23ae-4db4-999d-2467d1c35981
            Description:  Server Patching
                 Status:  Success
                Created:  September 26, 2022 11:25:26 AM KST
               Progress:  100%
                Message:
             Error Code:

Task Name                                                                Start Time                          End Time                            Status
------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ----------
Pre-operations for Server Patching                                       September 26, 2022 11:29:14 AM KST  September 26, 2022 11:30:31 AM KST  Success
Server Patching                                                          September 26, 2022 11:30:31 AM KST  September 26, 2022 11:49:45 AM KST  Success
[root@one19c ~]#
[root@one19c ~]# dbcli describe-component
System Version
---------------
22.2.3.1.0
Component                                Installed Version    Available Version
---------------------------------------- -------------------- --------------------
GI                                        19.16.0.0.0           up-to-date
DB                                        19.15.0.0.0           19.16.0.0
[root@one19c ~]#

Oracle Database Patch

[root@one19c ~]# dbcli list-dbhomes
ID                                       Name                 DB Version                               Home Location                                 Status
---------------------------------------- -------------------- ---------------------------------------- --------------------------------------------- ----------
5d519ce8-5ae6-4f4f-a4a6-bd0dd63a1612     OraDB19000_home1     19.15.0.0.0                              /u01/app/oracle/product/19.0.0.0/dbhome_1     Configured
[root@one19c ~]#
[root@one19c ~]# dbcli update-dbhome -h
Usage: update-dbhome [options]
  Options:
    --cloneOcid, -o
      clone OCID
    --cloneType, -cc
      Clone type
    --cloneVersion, -cv
      cloneVersion
  * --dbhomeid, -i
      Db home to be updated
    --help, -h
      get help
    --json, -j
      json output
    --local, -l
      Update Db home Locally
    --node, -n
      Node to be updated
    --parUrl, -pu
      par Url
    --precheck, -p
      Only Analyze the patch
    --sha256sum, -ss
      sha256sum
    --version, -v
      Patch version to be updated
[root@one19c ~]#
[root@one19c ~]# dbcli update-dbhome -i 5d519ce8-5ae6-4f4f-a4a6-bd0dd63a1612
{
  "jobId" : "9ab958f6-93bb-4238-b996-5b97f039ab1f",
  "status" : "Created",
  "message" : null,
  "errorCode" : "",
  "reports" : [ ],
  "createTimestamp" : "September 26, 2022 12:28:26 PM KST",
  "resourceList" : [ ],
  "description" : "Database inplace image patching with dbhomeId : 5d519ce8-5ae6-4f4f-a4a6-bd0dd63a1612",
  "updatedTime" : "September 26, 2022 12:28:27 PM KST",
  "percentageProgress" : "0%",
  "cause" : null,
  "action" : null
}
[root@one19c ~]#
[root@one19c ~]# dbcli describe-job -i 9ab958f6-93bb-4238-b996-5b97f039ab1f

Job details
----------------------------------------------------------------
                     ID:  9ab958f6-93bb-4238-b996-5b97f039ab1f
            Description:  Database inplace image patching with dbhomeId : 5d519ce8-5ae6-4f4f-a4a6-bd0dd63a1612
                 Status:  Success
                Created:  September 26, 2022 12:28:26 PM KST
               Progress:  100%
                Message:
             Error Code:

Task Name                                                                Start Time                          End Time                            Status
------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ----------
Precheck DBHome patching tasks                                           September 26, 2022 12:28:27 PM KST  September 26, 2022 12:31:53 PM KST  Success
DBHome patching                                                          September 26, 2022 12:31:53 PM KST  September 26, 2022 12:44:18 PM KST  Success
Post DBHome patching tasks                                               September 26, 2022 12:44:18 PM KST  September 26, 2022 12:49:31 PM KST  Success

[root@one19c ~]#
[root@one19c ~]#
[root@one19c ~]# dbcli describe-component
System Version
---------------
22.2.3.1.0
Component                                Installed Version    Available Version
---------------------------------------- -------------------- --------------------
GI                                        19.16.0.0.0           up-to-date
DB                                        19.16.0.0.0           up-to-date
[root@one19c ~]#

Patch결과 확인

[root@one19c ~]# dbcli describe-component
System Version
---------------
22.2.3.1.0
Component                                Installed Version    Available Version
---------------------------------------- -------------------- --------------------
GI                                        19.16.0.0.0           up-to-date
DB                                        19.16.0.0.0           up-to-date

[root@one19c ~]#
[root@one19c ~]# su - grid
Last login: Mon Sep 26 13:02:52 KST 2022 on pts/0
[grid@one19c ~]$ cd $ORACLE_HOME/OPatch
[grid@one19c OPatch]$ pwd
/u01/app/19.0.0.0/grid/OPatch
[grid@one19c OPatch]$ ./opatch lspatches -oh /u01/app/19.0.0.0/grid
34122773;OCW Interim patch for 34122773
34113634;JDK BUNDLE PATCH 19.0.0.0.220719
33912872;DATABASE PERL UPDATE IN 19C TO V5.32-1 (CVE-2022-23990 - LIBEXPAT UPDATE)
34318175;TOMCAT RELEASE UPDATE 19.0.0.0.0 (34318175)
34139601;ACFS RELEASE UPDATE 19.16.0.0.0 (34139601)
34133642;Database Release Update : 19.16.0.0.220719 (34133642)
33575402;DBWLM RELEASE UPDATE 19.0.0.0.0 (33575402)
OPatch succeeded.
[grid@one19c OPatch]$
[grid@one19c OPatch]$ exit
logout
[root@one19c ~]# su - oracle
Last login: Mon Sep 26 13:03:09 KST 2022
[oracle@one19c ~]$ cd $ORACLE_HOME/OPatch
[oracle@one19c OPatch]$ pwd
/u01/app/oracle/product/19.0.0.0/dbhome_1/OPatch
[oracle@one19c OPatch]$ ./opatch lspatches -oh /u01/app/oracle/product/19.0.0.0/dbhome_1
33303486;UNPLUG/PLUG A PLUGGABLE DATABASE MOVE DO A COPY AND NEED DOUBLE SPACE IN ASM.
29780459;INCREASE _LM_RES_HASH_BUCKET AND BACK OUT CHANGES FROM THE BUG 29416368 FIX
34006650;DSTV38 UPDATE - TZDATA2022A - NEED OJVM FIX
34006614;RDBMS - DSTV38 UPDATE - TZDATA2022A
33613829;RDBMS - DSTV37 UPDATE - TZDATA2021E
34113634;JDK BUNDLE PATCH 19.0.0.0.220719
32327201;RDBMS - DSTV36 UPDATE - TZDATA2020E
31335037;RDBMS - DSTV35 UPDATE - TZDATA2020A
30432118;MERGE REQUEST ON TOP OF 19.0.0.0.0 FOR BUGS 28852325 29997937
33912872;DATABASE PERL UPDATE IN 19C TO V5.32-1 (CVE-2022-23990 - LIBEXPAT UPDATE)
34086870;OJVM RELEASE UPDATE: 19.16.0.0.220719 (34086870)
34160635;OCW RELEASE UPDATE 19.16.0.0.0 (34160635)
34133642;Database Release Update : 19.16.0.0.220719 (34133642)
OPatch succeeded.
[oracle@one19c OPatch]$
[oracle@one19c OPatch]$ sqlplus "/as sysdba"
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Sep 26 13:05:59 2022 Version 19.16.0.0.0
Copyright (c) 1982, 2022, Oracle.  All rights reserved.
Connected to:
Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production Version 19.16.0.0.0
SQL> SET LINESIZE 400
SQL> COLUMN ACTION_TIME FORMAT A20
SQL> COLUMN ACTION FORMAT A10
SQL> COLUMN STATUS FORMAT A10
SQL> COLUMN DESCRIPTION FORMAT A60
SQL> COLUMN VERSION FORMAT A10
SQL> SELECT TO_CHAR(ACTION_TIME, 'YYYYMMDD HH24:MI:SS') AS ACTION_TIME
  2  ,ACTION ,STATUS ,DESCRIPTION ,SOURCE_VERSION ,TARGET_VERSION ,PATCH_ID
  3  FROM DBA_REGISTRY_SQLPATCH
  4  ORDER BY ACTION_TIME;
ACTION_TIME          ACTION     STATUS     DESCRIPTION                                                  SOURCE_VERSION  TARGET_VERSION    PATCH_ID
-------------------- ---------- ---------- ------------------------------------------------------------ --------------- --------------- ----------
20220501 20:01:24    APPLY      SUCCESS    OJVM RELEASE UPDATE: 19.15.0.0.220419 (33808367)             19.1.0.0.0      19.1.0.0.0        33808367
20220501 20:01:24    APPLY      SUCCESS    Database Release Update : 19.15.0.0.220419 (33806152)        19.1.0.0.0      19.15.0.0.0       33806152
20220926 12:48:24    ROLLBACK   SUCCESS    OJVM RELEASE UPDATE: 19.15.0.0.220419 (33808367)             19.16.0.0.0     19.16.0.0.0       33808367
20220926 12:48:26    APPLY      SUCCESS    OJVM RELEASE UPDATE: 19.16.0.0.220719 (34086870)             19.15.0.0.0     19.15.0.0.0       34086870
20220926 12:48:26    APPLY      SUCCESS    Database Release Update : 19.16.0.0.220719 (34133642)        19.15.0.0.0     19.16.0.0.0       34133642
SQL> exit
Disconnected from Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.16.0.0.0
[oracle@one19c OPatch]$
반응형

+ Recent posts