ORACLE/ADMIN2023. 9. 21. 10:18
반응형

1. db 기동 중에 데이터 파일 단위로 이동

- 사용자용 데이터 파일 이동 할 때 유용

 

alter database datafile '/data3/MERGE_DB/SP_ETC/SP_ETC_DB_010.DBF' offline;

alter database datafile '/data3/MERGE_DB/SP_IDX/SP_IDX_IX_005.DBF' offline;

cp /data3/MERGE_DB/SP_ETC/SP_ETC_DB_010.DBF /data6/orcl/

cp /data3/MERGE_DB/SP_IDX/SP_IDX_IX_005.DBF /data6/orcl/


alter database rename file '/data3/MERGE_DB/SP_ETC/SP_ETC_DB_010.DBF' to '/data6/orclorcl/SP_ETC_DB_010.DBF';


alter database rename file '/data3/MERGE_DB/SP_IDX/SP_IDX_IX_005.DBF' to '/data6/orcl/SP_IDX_IX_005.DBF';

recover datafile '/data6/orcl/SP_ETC_DB_010.DBF';



recover datafile '/data6/orcl/SP_IDX_IX_005.DBF';

alter database datafile '/data6/orcl/SP_ETC_DB_010.DBF' online;

alter database datafile '/data6/orcl/SP_IDX_IX_005.DBF' online;


============================================================================================


2. DB 정지 후 마운트 상태에서 이동

 

- system 테이블스페이스등  기본 테이블 스페이스 이동 할 때 db down 꼭 필요


select tablespace_name,FILE_ID,file_name,bytes/1024/1024 from dba_data_files
where tablespace_name in ('SYSTEM','SYSAUX','UNDOTBS1','USERS') ORDER BY FILE_ID;

TABLESPACE_NAME             FILE_ID FILE_NAME                                          BYTES/1024/1024
------------------------ ---------- -------------------------------------------------- ---------------
SYSTEM                            1 /oradata/orcl/system01.dbf                                     2048
SYSAUX                            3 /oradata/orcl/sysaux01.dbf                                     2150
UNDOTBS1                          4 /oradata/orcl/undotbs01.dbf                                   10000
USERS                             7 /oradata/orcl/users01.dbf                                      2000

4 rows selected.


DB 기본 테이블스페이스 이동 

startup mount

!cp /oradata/orcl/system01.dbf   /orasys/orcl/system01.dbf   
!cp /oradata/orcl/sysaux01.dbf   /orasys/orcl/sysaux01.dbf   
!cp /oradata/orcl/undotbs01.dbf  /orasys/orcl/undotbs01.dbf  
!cp /oradata/orcl/users01.dbf    /orasys/orcl/users01.dbf    

alter database rename file '/oradata/orcl/system01.dbf'   to '/orasys/orcl/system01.dbf';  
alter database rename file '/oradata/orcl/sysaux01.dbf'   to '/orasys/orcl/sysaux01.dbf' ; 
alter database rename file '/oradata/orcl/undotbs01.dbf'  to '/orasys/orcl/undotbs01.dbf' ;
alter database rename file '/oradata/orcl/users01.dbf'    to '/orasys/orcl/users01.dbf' ; 

alter database open;

반응형
Posted by [PineTree]
ORACLE/ADMIN2023. 9. 20. 14:03
반응형

GI PSU 작업

[root@pradg1 ~]# export LANG=C
[root@pradg1 ~]# opatch auto /patch/31718723/
Executing /u01/app/11.2.0/grid/perl/bin/perl /u01/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /patch -patchn 31718723 -paramfile /u01/app/11.2.0/grid/crs/install/crsconfig_params

This is the main log file: /u01/app/11.2.0/grid/cfgtoollogs/opatchauto2023-09-20_13-03-03.log

This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/11.2.0/grid/cfgtoollogs/opatchauto2023-09-20_13-03-03.report.log

2023-09-20 13:03:03: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
                                                                                                     
Stopping RAC /u01/app/oracle/product/11.2.0/db_1 ...
Stopped RAC /u01/app/oracle/product/11.2.0/db_1 successfully

patch /patch/31718723/29938455/custom/server/29938455  apply successful for home  /u01/app/oracle/product/11.2.0/db_1 
patch /patch/31718723/31537677  apply successful for home  /u01/app/oracle/product/11.2.0/db_1 

Stopping CRS...
Stopped CRS successfully

patch /patch/31718723/29938455  apply successful for home  /u01/app/11.2.0/grid 
patch /patch/31718723/31537677  apply successful for home  /u01/app/11.2.0/grid 
patch /patch/31718723/29509309  apply successful for home  /u01/app/11.2.0/grid 

Starting CRS...
Installing Trace File Analyzer
CRS-4123: Oracle High Availability Services has been started.

Starting RAC /u01/app/oracle/product/11.2.0/db_1 ...
Started RAC /u01/app/oracle/product/11.2.0/db_1 successfully

opatch auto succeeded.

================================================================================================================================================================================================
[grid@+ASM1 ~]$ tail -f /u01/app/11.2.0/grid/cfgtoollogs/opatchauto2023-09-20_13-03-03.report.log
***********  Configuration Data  ***********
* It shows only those targets that will be patched in this session *


crs_home=/u01/app/11.2.0/grid      owner=grid      opatch_ver=11.2.0.3.33
rac_home=/u01/app/oracle/product/11.2.0/db_1      owner=oracle      opatch_ver=11.2.0.3.33

*********** Steps to be executed as owner unless specified as root ***********


1: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch prereq CheckComponents -ph /patch/31718723/29938455/custom/server/29938455 -oh /u01/app/oracle/product/11.2.0/db_1

2: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch prereq CheckComponents -ph /patch/31718723/31537677 -oh /u01/app/oracle/product/11.2.0/db_1

3: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch prereq CheckConflictAgainstOH -ph /patch/31718723/29938455/custom/server/29938455 -oh /u01/app/oracle/product/11.2.0/db_1

4: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch prereq CheckConflictAgainstOH -ph /patch/31718723/31537677 -oh /u01/app/oracle/product/11.2.0/db_1

5: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckComponents -ph /patch/31718723/29938455 -oh /u01/app/11.2.0/grid

6: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckComponents -ph /patch/31718723/31537677 -oh /u01/app/11.2.0/grid

7: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckComponents -ph /patch/31718723/29509309 -oh /u01/app/11.2.0/grid

8: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckConflictAgainstOH -ph /patch/31718723/29938455 -oh /u01/app/11.2.0/grid

9: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckConflictAgainstOH -ph /patch/31718723/31537677 -oh /u01/app/11.2.0/grid

10: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckConflictAgainstOH -ph /patch/31718723/29509309 -oh /u01/app/11.2.0/grid

11: /u01/app/oracle/product/11.2.0/db_1/bin/emctl stop dbconsole

12: /u01/app/oracle/product/11.2.0/db_1/bin/emctl stop agent

13: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch prereq CheckApplicable -ph /patch/31718723/29938455/custom/server/29938455 -oh /u01/app/oracle/product/11.2.0/db_1

14: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch prereq CheckApplicable -ph /patch/31718723/31537677 -oh /u01/app/oracle/product/11.2.0/db_1

15: /u01/app/oracle/product/11.2.0/db_1/bin/srvctl stop home -o /u01/app/oracle/product/11.2.0/db_1 -s /u01/app/oracle/product/11.2.0/db_1/srvm/admin/stophome.txt -n pradg1 -f

16: /patch/31718723/29938455/custom/server/29938455/custom/scripts/prepatch.sh -dbhome /u01/app/oracle/product/11.2.0/db_1

17: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch napply /patch/31718723/29938455/custom/server/29938455 -local -silent -oh /u01/app/oracle/product/11.2.0/db_1 -invPtrLoc /u01/app/oracle/product/11.2.0/db_1/oraInst.loc

18: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch napply /patch/31718723/31537677 -local -silent -oh /u01/app/oracle/product/11.2.0/db_1 -invPtrLoc /u01/app/oracle/product/11.2.0/db_1/oraInst.loc

19: /patch/31718723/29938455/custom/server/29938455/custom/scripts/postpatch.sh -dbhome /u01/app/oracle/product/11.2.0/db_1

20: /u01/app/11.2.0/grid/crs/install/rootcrs.pl -unlock : run as root

21: /u01/app/11.2.0/grid/tfa/bin/tfactl stop : run as root

22: /sbin/fuser -k /u01/app/11.2.0/grid/bin/crsctl.bin : run as root

23: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /patch/31718723/29938455 -oh /u01/app/11.2.0/grid

24: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /patch/31718723/31537677 -oh /u01/app/11.2.0/grid

25: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /patch/31718723/29509309 -oh /u01/app/11.2.0/grid

26: /u01/app/11.2.0/grid/OPatch/opatch napply /patch/31718723/29938455 -local -silent -oh /u01/app/11.2.0/grid -invPtrLoc /u01/app/11.2.0/grid/oraInst.loc

27: /u01/app/11.2.0/grid/OPatch/opatch napply /patch/31718723/31537677 -local -silent -oh /u01/app/11.2.0/grid -invPtrLoc /u01/app/11.2.0/grid/oraInst.loc

28: /u01/app/11.2.0/grid/OPatch/opatch napply /patch/31718723/29509309 -local -silent -oh /u01/app/11.2.0/grid -invPtrLoc /u01/app/11.2.0/grid/oraInst.loc

29: /u01/app/11.2.0/grid/bin/emctl start dbconsole

30: /u01/app/11.2.0/grid/rdbms/install/rootadd_rdbms.sh : run as root

31: /u01/app/11.2.0/grid/crs/install/rootcrs.pl -patch : run as root

32: /u01/app/oracle/product/11.2.0/db_1/bin/emctl start dbconsole

33: /u01/app/oracle/product/11.2.0/db_1/bin/emctl start agent

34: /u01/app/oracle/product/11.2.0/db_1/bin/srvctl start home -o /u01/app/oracle/product/11.2.0/db_1 -s /u01/app/oracle/product/11.2.0/db_1/srvm/admin/stophome.txt -n pradg1

패치 후 추가 작업

For each database instance running on the Oracle home being patched, connect to the database using SQL*Plus. Connect as SYSDBA and run the catbundle.sql script as follows:

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> QUIT
The catbundle.sql execution is reflected in the dba_registry_history view by a row associated with bundle series PSU.

For information about the catbundle.sql script, see My Oracle Support Document 605795.1 Introduction to Oracle Database catbundle.sql.

If the OJVM PSU was applied for a previous GI PSU patch, you may see invalid Java classes after execution of the catbundle.sql script in the previous step. If this is the case, run utlrp.sql to re-validate these Java classes.

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql

완료

반응형
Posted by [PineTree]
ORACLE/TroubleShooting2023. 9. 20. 10:50
반응형

패치 rollback 실패

 

[root@pradg1 ~]# /u01/app/11.2.0/grid/OPatch/opatch auto /patch/31718723 -rollback
Executing /u01/app/11.2.0/grid/perl/bin/perl /u01/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /patch -patchn 31718723 -rollback -paramfile /u01/app/11.2.0/grid/crs/install/crsconfig_params

This is the main log file: /u01/app/11.2.0/grid/cfgtoollogs/opatchauto2023-09-20_10-30-25.log

This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/11.2.0/grid/cfgtoollogs/opatchauto2023-09-20_10-30-25.report.log

2023-09-20 10:30:25: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
unable to get oracle owner for 

 

패치 실패

-rwxrwxr-x.  1 root oinstall     4184  3월 29  2022 crsconfig_params

권한에는 문제가 없다

 

export LANG=C

하고 재 실행 하니 문제 없이 된다.

 

 

[root@pradg1 ~]# export LANG=C
[root@pradg1 ~]# /u01/app/11.2.0/grid/OPatch/opatch auto /patch/31718723 -rollback
Executing /u01/app/11.2.0/grid/perl/bin/perl /u01/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /patch -patchn 31718723 -rollback -paramfile /u01/app/11.2.0/grid/crs/install/crsconfig_params

This is the main log file: /u01/app/11.2.0/grid/cfgtoollogs/opatchauto2023-09-20_10-31-32.log

This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/11.2.0/grid/cfgtoollogs/opatchauto2023-09-20_10-31-32.report.log

2023-09-20 10:31:32: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
A
Stopping RAC /u01/app/oracle/product/11.2.0/db_1 ...
Stopped RAC /u01/app/oracle/product/11.2.0/db_1 successfully

patch 29938455  rollback successful for home /u01/app/oracle/product/11.2.0/db_1
patch 31537677  rollback successful for home /u01/app/oracle/product/11.2.0/db_1

Stopping CRS...
Stopped CRS successfully

patch 29938455  rollback successful for home /u01/app/11.2.0/grid
patch 31537677  rollback successful for home /u01/app/11.2.0/grid
patch 29509309  rollback successful for home /u01/app/11.2.0/grid

Starting CRS...
Installing Trace File Analyzer
CRS-4123: Oracle High Availability Services has been started.

Starting RAC /u01/app/oracle/product/11.2.0/db_1 ...
Started RAC /u01/app/oracle/product/11.2.0/db_1 successfully

opatch auto succeeded.

 

로그

[root@pradg1 install]# tail -f /u01/app/11.2.0/grid/cfgtoollogs/opatchauto2023-09-20_10-31-32.report.log

***********  Configuration Data  ***********
* It shows only those targets that will be patched in this session *


crs_home=/u01/app/11.2.0/grid      owner=grid      opatch_ver=11.2.0.3.33
rac_home=/u01/app/oracle/product/11.2.0/db_1      owner=oracle      opatch_ver=11.2.0.3.33

*********** Steps to be executed as owner unless specified as root ***********


1: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch prereq CheckComponents -ph /patch/31718723/29938455/custom/server/29938455 -oh /u01/app/oracle/product/11.2.0/db_1

2: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch prereq CheckComponents -ph /patch/31718723/31537677 -oh /u01/app/oracle/product/11.2.0/db_1

3: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckComponents -ph /patch/31718723/29938455 -oh /u01/app/11.2.0/grid

4: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckComponents -ph /patch/31718723/31537677 -oh /u01/app/11.2.0/grid

5: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckComponents -ph /patch/31718723/29509309 -oh /u01/app/11.2.0/grid

6: /u01/app/oracle/product/11.2.0/db_1/bin/emctl stop dbconsole

7: /u01/app/oracle/product/11.2.0/db_1/bin/emctl stop agent

8: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch prereq CheckApplicable -ph /patch/31718723/29938455/custom/server/29938455 -oh /u01/app/oracle/product/11.2.0/db_1

9: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch prereq CheckApplicable -ph /patch/31718723/31537677 -oh /u01/app/oracle/product/11.2.0/db_1

10: /u01/app/oracle/product/11.2.0/db_1/bin/srvctl stop home -o /u01/app/oracle/product/11.2.0/db_1 -s /u01/app/oracle/product/11.2.0/db_1/srvm/admin/stophome.txt -n pradg1 -f

11: /patch/31718723/29938455/custom/server/29938455/custom/scripts/prepatch.sh -dbhome /u01/app/oracle/product/11.2.0/db_1

12: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch prereq checkRollbackable  -id 29938455 -oh /u01/app/oracle/product/11.2.0/db_1

13: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch rollback -id 29938455 -local -silent -oh /u01/app/oracle/product/11.2.0/db_1 -invPtrLoc /u01/app/oracle/product/11.2.0/db_1/oraInst.loc

14: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch prereq checkRollbackable  -id 31537677 -oh /u01/app/oracle/product/11.2.0/db_1

15: /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch rollback -id 31537677 -local -silent -oh /u01/app/oracle/product/11.2.0/db_1 -invPtrLoc /u01/app/oracle/product/11.2.0/db_1/oraInst.loc

16: /patch/31718723/29938455/custom/server/29938455/custom/scripts/postpatch.sh -dbhome /u01/app/oracle/product/11.2.0/db_1

17: /u01/app/11.2.0/grid/crs/install/rootcrs.pl -unlock : run as root

18: /u01/app/11.2.0/grid/tfa/bin/tfactl stop : run as root

19: /sbin/fuser -k /u01/app/11.2.0/grid/bin/crsctl.bin : run as root

20: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /patch/31718723/29938455 -oh /u01/app/11.2.0/grid

21: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /patch/31718723/31537677 -oh /u01/app/11.2.0/grid

22: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /patch/31718723/29509309 -oh /u01/app/11.2.0/grid

23: /u01/app/11.2.0/grid/OPatch/opatch prereq checkRollbackable  -id 29938455 -oh /u01/app/11.2.0/grid

24: /u01/app/11.2.0/grid/OPatch/opatch rollback -id 29938455 -local -silent -oh /u01/app/11.2.0/grid -invPtrLoc /u01/app/11.2.0/grid/oraInst.loc

25: /u01/app/11.2.0/grid/OPatch/opatch prereq checkRollbackable  -id 31537677 -oh /u01/app/11.2.0/grid

26: /u01/app/11.2.0/grid/OPatch/opatch rollback -id 31537677 -local -silent -oh /u01/app/11.2.0/grid -invPtrLoc /u01/app/11.2.0/grid/oraInst.loc

27: /u01/app/11.2.0/grid/OPatch/opatch prereq checkRollbackable  -id 29509309 -oh /u01/app/11.2.0/grid

28: /u01/app/11.2.0/grid/OPatch/opatch rollback -id 29509309 -local -silent -oh /u01/app/11.2.0/grid -invPtrLoc /u01/app/11.2.0/grid/oraInst.loc

29: /u01/app/11.2.0/grid/bin/emctl start dbconsole

30: /u01/app/11.2.0/grid/rdbms/install/rootadd_rdbms.sh : run as root

31: /u01/app/11.2.0/grid/crs/install/rootcrs.pl -patch : run as root

32: /u01/app/oracle/product/11.2.0/db_1/bin/emctl start dbconsole

33: /u01/app/oracle/product/11.2.0/db_1/bin/emctl start agent

34: /u01/app/oracle/product/11.2.0/db_1/bin/srvctl start home -o /u01/app/oracle/product/11.2.0/db_1 -s /u01/app/oracle/product/11.2.0/db_1/srvm/admin/stophome.txt -n pradg1

 

확인

[oracle@racdb1 ~]$ opatch lsinv
Oracle Interim 패치 설치 프로그램 버전 11.2.0.3.33
Copyright (c) 2023, Oracle Corporation.  All rights reserved.


Oracle 홈: /u01/app/oracle/product/11.2.0/db_1
중앙 인벤토리: /u01/app/oraInventory
   출처: /u01/app/oracle/product/11.2.0/db_1/oraInst.loc
OPatch 버전: 11.2.0.3.33
OUI 버전: 11.2.0.4.0
로그 파일 위치: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2023-09-20_10-43-56오전_1.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2023-09-20_10-43-56오전.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: pradg1
ARU platform id: 226
ARU platform description:: Linux x86-64

설치된 최상위 레벨 제품(1): 

Oracle Database 11g                                                  11.2.0.4.0
이 Oracle 홈에 1개의 제품이 설치되어 있습니다.


이 Oracle 홈에 설치된 Interim 패치가 없습니다.


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

패치 제거 후 추가 작업

 

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle_PSU_<database SID PREFIX>_ROLLBACK.sql
Check the following log file for errors:
/u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_RACDB_APPLY_2023Sep20_10_55_52.log
SQL> @utlrp 

 


TIMESTAMP
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN  2023-09-20 10:56:55

1 row selected.

DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC>   objects in the database. Recompilation time is proportional to the
DOC>   number of invalid objects in the database, so this command may take
DOC>   a long time to execute on a database with a large number of invalid
DOC>   objects.
DOC>
DOC>   Use the following queries to track recompilation progress:
DOC>
DOC>   1. Query returning the number of invalid objects remaining. This
DOC>      number should decrease with time.
DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC>   2. Query returning the number of objects compiled so far. This number
DOC>      should increase with time.
DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC>   This script automatically chooses serial or parallel recompilation
DOC>   based on the number of CPUs available (parameter cpu_count) multiplied
DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC>   On RAC, this number is added across all RAC nodes.
DOC>
DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC>   recompilation. Jobs are created without instance affinity so that they
DOC>   can migrate across RAC nodes. Use the following queries to verify
DOC>   whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC>   1. Query showing jobs created by UTL_RECOMP
DOC>         SELECT job_name FROM dba_scheduler_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC>   2. Query showing UTL_RECOMP jobs that are running
DOC>         SELECT job_name FROM dba_scheduler_running_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#

PL/SQL procedure successfully completed.


TIMESTAMP
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END  2023-09-20 10:57:01

1 row selected.

DOC> The following query reports the number of objects that have compiled
DOC> with errors.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#

OBJECTS WITH ERRORS
-------------------
                  0

1 row selected.

DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC>#

ERRORS DURING RECOMPILATION
---------------------------
                          0

1 row selected.


Function created.


PL/SQL procedure successfully completed.


Function dropped.


PL/SQL procedure successfully completed.

 

완료

반응형
Posted by [PineTree]
ORACLE/ADMIN2023. 9. 20. 10:40
반응형

1.RU patch

unzip p33587128_<version>_<platform>.zip
cd 33587128
opatch apply

For each separate database running on the same shared Oracle home being patched, run the datapatch utility as described in Table 2.

Table 2 Steps to Run the Datapatch Utility for Standalone DB Versus Single/Multitenant (CDB/PDB) DB

StepsStandalone DBStepsSingle/Multitenant (CDB/PDB) DB
1 % sqlplus /nolog 1 % sqlplus /nolog
2 SQL> Connect / as sysdba 2 SQL> Connect / as sysdba
3 SQL> startup 3 SQL> startup
4 SQL> quit 4 SQL> alter pluggable database all open;Foot 1 
5 % cd $ORACLE_HOME/OPatch 5 SQL> quit
6 % ./datapatch -verbose 6 % cd $ORACLE_HOME/OPatch
    7 % ./datapatch -verbose

2. OJVM 패치

 Installation

To install the patch, follow these steps.

  1. Set your current directory to the directory where the patch is located and then run the OPatch utility by entering the following commands:

$ cd <PATCH_TOP_DIR>/33561275

  1. Install the patch by running the following command:If apply fails for make target jox_refresh_knlopt when applying the patch to the database home, see Issue #1 in Known Issues for more information.

   $ opatch apply

  1. Verify whether the patch has been successfully installed by running the following command:

$ opatch lsinventory

  1. Start the services from the Oracle home.
  2. If there are errors, see Known Issues.
  3.  
StepsNon-CDB DatabaseStepsSingle or Multitenant (CDB or PDB) Database
1 % sqlplus /nolog 1 % sqlplus /nolog
2 SQL> Connect / as sysdba 2 SQL> Connect / as sysdba
3 SQL> startup upgrade Foot 1 3 SQL> startup upgradeFootref 1
4 SQL> quit 4 SQL> alter pluggable database all open upgrade;Foot 2
5 % cd $ORACLE_HOME/OPatch 5 SQL> quit
6 % ./datapatch -verbose 6 % cd $ORACLE_HOME/OPatch
7 % sqlplus /nolog 7 % ./datapatch -verbose
8 SQL> Connect / as sysdba 8 % sqlplus /nolog
9 SQL> startupFoot 3 9 SQL> Connect / as sysdba
    10 SQL> startupFootref 3
    11 SQL> alter pluggable database all open;
  1. After installing the SQL portion of the patch, some packages could become INVALID. This will get recompiled upon access or you can run utlrp.sql to get them back into a VALID state.

cd $ORACLE_HOME/rdbms/admin

sqlplus /nolog

SQL> CONNECT / AS SYSDBA

SQL> @utlrp.sql

 

 

==============================================================

[oracle@ORA12C media]$ cd 33559893/
[oracle@ORA12C 33559893]$ ls -al
합계 32
drwxrwxrwx. 4 oracle oinstall    80  1월 18  2022 .
drwxr-xr-x. 5 oracle oinstall   176  9월 18 11:44 ..
drwxr-xr-x. 4 oracle oinstall    67 12월 10  2021 33561275
drwxr-xr-x. 5 oracle oinstall    81 12월 28  2021 33587128
-rw-rw-r--. 1 oracle oinstall  7080  1월 16  2022 PatchSearch.xml
-rw-r--r--. 1 oracle oinstall 22220  1월 18  2022 README.html
[oracle@ORA12C 33559893]$ cd 33587128/
[oracle@ORA12C 33587128]$ ls -al
합계 84
drwxr-xr-x.  5 oracle oinstall    81 12월 28  2021 .
drwxrwxrwx.  4 oracle oinstall    80  1월 18  2022 ..
-rw-r--r--.  1 oracle oinstall 76160  1월 17  2022 README.html
-rw-r--r--.  1 oracle oinstall    21 12월 28  2021 README.txt
drwxr-x---.  3 oracle oinstall    21 12월 28  2021 custom
drwxr-x---.  3 oracle oinstall    20 12월 28  2021 etc
drwxr-x---. 24 oracle oinstall  4096 12월 28  2021 files
[oracle@ORA12C 33587128]$ opatch apply
Oracle Interim 패치 설치 프로그램 버전 12.2.0.1.39
Copyright (c) 2023, Oracle Corporation.  All rights reserved.


Oracle 홈: /u01/app/oracle/product/12C/db_1
중앙 인벤토리: /u01/app/oraInventory
   출처: /u01/app/oracle/product/12C/db_1/oraInst.loc
OPatch 버전: 12.2.0.1.39
OUI 버전: 12.2.0.1.4
로그 파일 위치: /u01/app/oracle/product/12C/db_1/cfgtoollogs/opatch/opatch2023-09-18_11-45-17오전_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   33587128  

계속하겠습니까? [y|n]
y
User Responded with: Y
All checks passed.

로컬 시스템의 이 ORACLE_HOME에서 실행 중인 Oracle 인스턴스를 종료하십시오.
(Oracle 홈 = '/u01/app/oracle/product/12C/db_1')


로컬 시스템이 패치할 준비가 되었습니까? [y|n]
y
User Responded with: Y
Backing up files...
OH '/u01/app/oracle/product/12C/db_1'에 Interim 패치 '33587128'을(를) 적용하는 중
ApplySession: Oracle 홈에 선택적 구성요소 [ oracle.swd, 12.2.0.1.0 ] , [ oracle.swd.oui, 12.2.0.1.0 ] , [ oracle.network.cman, 12.2.0.1.0 ] , [ oracle.network.gsm, 12.2.0.1.0 ] , [ oracle.rdbms.drdaas, 12.2.0.1.0 ] , [ oracle.ons.cclient, 12.2.0.1.0 ] , [ oracle.ons.daemon, 12.2.0.1.0 ] , [ oracle.ons.eons.bwcompat, 12.2.0.1.0 ] , [ oracle.oid.client, 12.2.0.1.0 ] 이(가) 없거나 상위 버전이 발견되었습니다.

oracle.rdbms.util, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.network.rsf, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms.rsf, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.ctx, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.has.common.cvu, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.ldap.owm, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.ldap.rsf, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.nlsrtl.rsf, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.oracore.rsf, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.oraolap, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms.dbscripts, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms.deconfig, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms.rsf.ic, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.sdo, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.sdo.locator, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.sdo.locator.jrf, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.tfa, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.ctx.rsf, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms.install.plugins, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms.install.common, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.assistants.deconfig, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.ons.ic, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms.rman, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.precomp.rsf, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.install.deinstalltool, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.assistants.acf, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms.oci, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.sqlplus.ic, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.xdk.parser.java, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.dbtoolslistener, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.ldap.rsf.ic, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms.dv, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms.lbac, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.ons, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.ldap.client, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.xdk, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.xdk.rsf, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.sqlplus, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.assistants.server, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms.crs, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.precomp.common, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.precomp.lang, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.jdk, 1.8.0.91.0 구성요소를 패치하는 중...
Patch 33587128 successfully applied.
Log file location: /u01/app/oracle/product/12C/db_1/cfgtoollogs/opatch/opatch2023-09-18_11-45-17오전_1.log

OPatch succeeded.
[oracle@ORA12C 33587128]$ cd ..
[oracle@ORA12C 33559893]$ ls
33561275  33587128  PatchSearch.xml  README.html
[oracle@ORA12C 33559893]$ cd 33561275/
[oracle@ORA12C 33561275]$ ls
README.html  README.txt  etc  files
[oracle@ORA12C 33561275]$ opatch lspatches
33587128;Database Jan 2022 Release Update : 12.2.0.1.220118 (33587128)

OPatch succeeded.
[oracle@ORA12C 33561275]$ opatch apply
Oracle Interim 패치 설치 프로그램 버전 12.2.0.1.39
Copyright (c) 2023, Oracle Corporation.  All rights reserved.


Oracle 홈: /u01/app/oracle/product/12C/db_1
중앙 인벤토리: /u01/app/oraInventory
   출처: /u01/app/oracle/product/12C/db_1/oraInst.loc
OPatch 버전: 12.2.0.1.39
OUI 버전: 12.2.0.1.4
로그 파일 위치: /u01/app/oracle/product/12C/db_1/cfgtoollogs/opatch/opatch2023-09-18_11-48-27오전_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   33561275  

계속하겠습니까? [y|n]
y
User Responded with: Y
All checks passed.

로컬 시스템의 이 ORACLE_HOME에서 실행 중인 Oracle 인스턴스를 종료하십시오.
(Oracle 홈 = '/u01/app/oracle/product/12C/db_1')


로컬 시스템이 패치할 준비가 되었습니까? [y|n]
y
User Responded with: Y
Backing up files...
OH '/u01/app/oracle/product/12C/db_1'에 Interim 패치 '33561275'을(를) 적용하는 중

oracle.javavm.server, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.javavm.server.core, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms.dbscripts, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.javavm.client, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.rdbms, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.dbjava.jdbc, 12.2.0.1.0 구성요소를 패치하는 중...

oracle.dbjava.ic, 12.2.0.1.0 구성요소를 패치하는 중...
Patch 33561275 successfully applied.
Log file location: /u01/app/oracle/product/12C/db_1/cfgtoollogs/opatch/opatch2023-09-18_11-48-27오전_1.log

OPatch succeeded.
[oracle@ORA12C 33561275]$ opatch lspatches
33561275;OJVM RELEASE UPDATE 12.2.0.1.220118 (33561275)
33587128;Database Jan 2022 Release Update : 12.2.0.1.220118 (33587128)

OPatch succeeded.
[oracle@ORA12C 33561275]$ ss

SQL*Plus: Release 12.2.0.1.0 Production on Mon Sep 18 11:49:32 2023

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

Connected to an idle instance.

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 3154116608 bytes
Fixed Size                  8625656 bytes
Variable Size             788529672 bytes
Database Buffers         2348810240 bytes
Redo Buffers                8151040 bytes
Database mounted.
Database opened.
SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@ORA12C 33561275]$ oh
[oracle@ORA12C db_1]$ cd OPatch
[oracle@ORA12C OPatch]$ ./datapatch -verbose
SQL Patching tool version 12.2.0.1.0 Production on Mon Sep 18 11:50:14 2023
Copyright (c) 2012, 2021, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_21032_2023_09_18_11_50_14/sqlpatch_invocation.log

Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:
Patch 33561275 (OJVM RELEASE UPDATE 12.2.0.1.220118):
  Installed in the binary registry only
Bundle series DBRU:
  ID 220118 in the binary registry and not installed in the SQL registry

Adding patches to installation queue and performing prereq checks...
Installation queue:
  Nothing to roll back
  The following patches will be applied:
    33561275 (OJVM RELEASE UPDATE 12.2.0.1.220118)
    33587128 (DATABASE JAN 2022 RELEASE UPDATE 12.2.0.1.220118)

Installing patches...
Patch installation complete.  Total patches installed: 2

Validating logfiles...
Patch 33561275 apply: SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33561275/24539585/33561275_apply_ORA12C_2023Sep18_11_50_25.log (no errors)
Patch 33587128 apply: SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33587128/24566093/33587128_apply_ORA12C_2023Sep18_11_50_49.log (no errors)
SQL Patching tool complete on Mon Sep 18 11:52:52 2023

SQL> select status from v$instance;

STATUS
------------
OPEN MIGRATE

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

Total System Global Area 3154116608 bytes
Fixed Size                  8625656 bytes
Variable Size             788529672 bytes
Database Buffers         2348810240 bytes
Redo Buffers                8151040 bytes
Database mounted.
Database opened.
SQL> @?/rdbms/admin/utlrp 

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN              2023-09-18 11:58:42

DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC>   objects in the database. Recompilation time is proportional to the
DOC>   number of invalid objects in the database, so this command may take
DOC>   a long time to execute on a database with a large number of invalid
DOC>   objects.
DOC>
DOC>   Use the following queries to track recompilation progress:
DOC>
DOC>   1. Query returning the number of invalid objects remaining. This
DOC>      number should decrease with time.
DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC>   2. Query returning the number of objects compiled so far. This number
DOC>      should increase with time.
DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC>   This script automatically chooses serial or parallel recompilation
DOC>   based on the number of CPUs available (parameter cpu_count) multiplied
DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC>   On RAC, this number is added across all RAC nodes.
DOC>
DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC>   recompilation. Jobs are created without instance affinity so that they
DOC>   can migrate across RAC nodes. Use the following queries to verify
DOC>   whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC>   1. Query showing jobs created by UTL_RECOMP
DOC>         SELECT job_name FROM dba_scheduler_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC>   2. Query showing UTL_RECOMP jobs that are running
DOC>         SELECT job_name FROM dba_scheduler_running_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#

PL/SQL procedure successfully completed.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END              2023-09-18 11:58:43

DOC> The following query reports the number of invalid objects.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#

OBJECTS WITH ERRORS
-------------------
                  0

DOC> The following query reports the number of exceptions caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC> Note: Typical compilation errors (due to coding errors) are not
DOC>       logged into this table: they go into DBA_ERRORS instead.
DOC>#

ERRORS DURING RECOMPILATION
---------------------------
                          0


Function created.


PL/SQL procedure successfully completed.


Function dropped.


PL/SQL procedure successfully completed.

SQL> 


[oracle@ORA12C OPatch]$ opatch lsinv
Oracle Interim 패치 설치 프로그램 버전 12.2.0.1.39
Copyright (c) 2023, Oracle Corporation.  All rights reserved.


Oracle 홈: /u01/app/oracle/product/12C/db_1
중앙 인벤토리: /u01/app/oraInventory
   출처: /u01/app/oracle/product/12C/db_1/oraInst.loc
OPatch 버전: 12.2.0.1.39
OUI 버전: 12.2.0.1.4
로그 파일 위치: /u01/app/oracle/product/12C/db_1/cfgtoollogs/opatch/opatch2023-09-18_12-02-13오후_1.log

Lsinventory Output file location : /u01/app/oracle/product/12C/db_1/cfgtoollogs/opatch/lsinv/lsinventory2023-09-18_12-02-13오후.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: ora12c
ARU platform id: 226
ARU platform description:: Linux x86-64

설치된 최상위 레벨 제품(1): 

Oracle Database 12c                                                  12.2.0.1.0
이 Oracle 홈에 1개의 제품이 설치되어 있습니다.


Interim 패치(2):

Patch  33561275     : applied on Mon Sep 18 11:48:43 KST 2023
Unique Patch ID:  24539585
Patch description:  "OJVM RELEASE UPDATE 12.2.0.1.220118 (33561275)"
   Created on 9 Dec 2021, 10:16:28 hrs UTC
   Bugs fixed:
     24318855, 24817447, 25811105, 25890046, 26023042, 26451793, 26570134
     26716835, 27000702, 27461740, 27539876, 27642235, 27952586, 28394726
     28502098, 28915870, 29224710, 29254623, 29415774, 29774362, 30160625
     30534662, 30855101, 31306261, 31668872, 31997805, 32165759, 32523206
     32720458, 32892883, 33131742, 33223248, 33563137

Patch  33587128     : applied on Mon Sep 18 11:47:28 KST 2023
Unique Patch ID:  24566093
Patch description:  "Database Jan 2022 Release Update : 12.2.0.1.220118 (33587128)"
   Created on 27 Dec 2021, 16:38:16 hrs UTC
   Bugs fixed:
     12763598, 13554903, 14221306, 14690846, 15931756, 16002385, 16438495
     16727454, 16942578, 17027695, 17533661, 17947871, 17958365, 18308268
     18521691, 18594510, 18774543, 18878420, 18986501, 19072655, 19211433
     19285025, 19327292, 19526548, 19614243, 19647894, 19649997, 19702201
     19721304, 20003668, 20087519, 20118035, 20120236, 20324049, 20436508
     20532077, 20549013, 20588486, 20591151, 20617383, 20620169, 20736227
     20756305, 20866970, 20917487, 20976443, 21070321, 21089435, 21095391
     21143725, 21147908, 21159907, 21178363, 21186167, 21197098, 21216226
     21320338, 21355390, 21433452, 21479706, 21517767, 21520266, 21547051
     21638600, 21744603, 21788462, 21837606, 21882528, 21935698, 21962287
     21981529, 21985256, 22007324, 22070226, 22070473, 22070853, 22072543
     22087683, 22104866, 22107360, 22174392, 22179537, 22282748, 22310426
     22347493, 22363790, 22364044, 22367053, 22379010, 22446455, 22454940
     22468255, 22495673, 22503283, 22503297, 22504793, 22522515, 22530986
     22564336, 22568728, 22581771, 22594071, 22599050, 22628825, 22645009
     22645496, 22654475, 22700845, 22726044, 22729345, 22820798, 22826067
     22843979, 22845846, 22864303, 22898198, 22921674, 22939829, 22950945
     22970869, 22981722, 23018676, 23019710, 23026585, 23035249, 23055900
     23056058, 23061453, 23065002, 23066146, 23080557, 23104033, 23105538
     23109325, 23110523, 23125560, 23126545, 23127945, 23143074, 23151677
     23168363, 23169712, 23177923, 23179662, 23184263, 23197730, 23234232
     23237091, 23249829, 23271203, 23278750, 23281269, 23282973, 23300142
     23306590, 23308065, 23310101, 23312077, 23328639, 23333567, 23336559
     23342170, 23481673, 23491861, 23499004, 23499160, 23521523, 23527363
     23533647, 23548817, 23567857, 23572982, 23581777, 23588722, 23599216
     23600861, 23602213, 23627427, 23645516, 23665623, 23709062, 23715460
     23715518, 23730961, 23733981, 23735292, 23738304, 23741944, 23743596
     23746128, 23749454, 23761724, 23763462, 24006569, 24010030, 24289874
     24289895, 24294174, 24303148, 24307571, 24308349, 24326444, 24326846
     24328857, 24330708, 24332831, 24334708, 24336249, 24337882, 24341675
     24343905, 24345420, 24346821, 24348685, 24350620, 24352981, 24355111
     24357348, 24368004, 24371491, 24373528, 24373756, 24374976, 24376875
     24376878, 24383086, 24385983, 24401351, 24403922, 24409977, 24415926
     24416451, 24421668, 24423416, 24425056, 24425998, 24432875, 24435982
     24437162, 24440612, 24440648, 24443539, 24445571, 24457597, 24460392
     24461826, 24467122, 24468470, 24470606, 24471079, 24471473, 24473736
     24480567, 24484749, 24485034, 24485161, 24485174, 24485619, 24486059
     24486237, 24509056, 24516314, 24530364, 24534401, 24554533, 24555417
     24556862, 24556967, 24560906, 24563422, 24570214, 24570598, 24573817
     24578718, 24578797, 24588377, 24589081, 24589590, 24591506, 24593740
     24595699, 24596874, 24600330, 24609592, 24609996, 24611527, 24616637
     24617969, 24623975, 24624166, 24642495, 24654629, 24655717, 24664211
     24668398, 24669189, 24669730, 24674197, 24674955, 24676172, 24677696
     24680959, 24687075, 24689376, 24692973, 24693010, 24693290, 24697323
     24699619, 24710696, 24713381, 24714096, 24717183, 24717859, 24718260
     24719799, 24735430, 24737064, 24737403, 24737581, 24737954, 24739791
     24744383, 24744686, 24752618, 24757934, 24759556, 24760407, 24763196
     24764085, 24766309, 24784414, 24786669, 24791883, 24792678, 24793511
     24796092, 24797119, 24798481, 24800423, 24801152, 24802934, 24808504
     24811725, 24812047, 24818566, 24827228, 24827654, 24831514, 24835919
     24841671, 24843188, 24844549, 24844841, 24845157, 24848746, 24848923
     24850622, 24907917, 24908063, 24908321, 24911709, 24912588, 24920582
     24921478, 24922704, 24923080, 24923215, 24923338, 24923790, 24924667
     24926999, 24929210, 24938784, 24940060, 24942749, 24953434, 24957555
     24960044, 24960809, 24965426, 24966594, 24966788, 24967993, 24968162
     24976007, 24978100, 25022574, 25027852, 25028996, 25029022, 25029423
     25031502, 25032818, 25034396, 25036006, 25036474, 25042823, 25044977
     25045228, 25050160, 25051465, 25051628, 25054064, 25057811, 25058080
     25060506, 25062592, 25063971, 25065563, 25072986, 25077278, 25078611
     25086233, 25087436, 25091141, 25092777, 25093872, 25095982, 25098160
     25099339, 25099497, 25099758, 25100063, 25100579, 25103996, 25107662
     25110233, 25114561, 25115178, 25120284, 25120668, 25120742, 25121089
     25123585, 25124363, 25129925, 25130312, 25140197, 25145163, 25145215
     25150925, 25159176, 25162645, 25164293, 25166187, 25171041, 25171084
     25175723, 25176408, 25178032, 25178101, 25178179, 25179774, 25182817
     25184453, 25184555, 25186079, 25189723, 25191872, 25192044, 25192528
     25192729, 25195901, 25199585, 25200101, 25201454, 25202355, 25203656
     25205368, 25205954, 25206864, 25207410, 25209912, 25210268, 25210499
     25210690, 25211628, 25219450, 25223839, 25224242, 25225795, 25226665
     25227381, 25230870, 25230945, 25237577, 25240188, 25240590, 25241448
     25241625, 25244807, 25248384, 25250109, 25251648, 25257085, 25259611
     25262869, 25263960, 25265499, 25269133, 25283790, 25287072, 25288078
     25293659, 25296876, 25299227, 25299807, 25300427, 25303284, 25303756
     25305405, 25307368, 25309116, 25313154, 25313411, 25316758, 25317989
     25320555, 25323525, 25328093, 25328518, 25329664, 25335249, 25335360
     25335790, 25337332, 25337640, 25348567, 25348956, 25353983, 25356118
     25357142, 25360661, 25362958, 25367588, 25367721, 25382812, 25383204
     25384462, 25386748, 25388573, 25388896, 25392535, 25393714, 25395696
     25397936, 25398306, 25404117, 25404202, 25405100, 25405687, 25405813
     25410017, 25410180, 25410802, 25410877, 25411036, 25415713, 25416731
     25417050, 25417056, 25417958, 25425005, 25425451, 25425760, 25427662
     25429959, 25430120, 25433696, 25435038, 25437699, 25440818, 25442559
     25444961, 25445168, 25451531, 25452452, 25455795, 25457409, 25459958
     25462714, 25463844, 25472112, 25472885, 25476125, 25476149, 25477657
     25478885, 25479164, 25481087, 25482971, 25486384, 25489342, 25489367
     25489607, 25492379, 25498930, 25498994, 25516250, 25524955, 25528838
     25530080, 25530814, 25535668, 25536819, 25537470, 25539063, 25540738
     25546580, 25546608, 25547901, 25551676, 25553616, 25554787, 25555252
     25557886, 25558986, 25560487, 25560538, 25561296, 25569149, 25569504
     25570929, 25573623, 25575348, 25575369, 25575628, 25576115, 25579458
     25579761, 25591394, 25594901, 25597525, 25598473, 25599425, 25600342
     25600421, 25601999, 25602488, 25603923, 25606091, 25607726, 25612095
     25614866, 25616268, 25616359, 25616417, 25616645, 25631933, 25633101
     25634317, 25634348, 25635149, 25638456, 25639019, 25643818, 25643889
     25643931, 25646373, 25647325, 25648731, 25653109, 25654459, 25654936
     25655390, 25655966, 25659655, 25660847, 25661819, 25662088, 25662101
     25662524, 25663488, 25667973, 25669791, 25670786, 25671354, 25672640
     25674386, 25680221, 25685152, 25686739, 25687460, 25691904, 25694206
     25695903, 25696520, 25699321, 25700654, 25709368, 25710420, 25715167
     25717371, 25722055, 25722608, 25722720, 25723097, 25723158, 25728085
     25729507, 25730014, 25734963, 25736747, 25739065, 25740844, 25741955
     25743479, 25747569, 25749273, 25752755, 25754606, 25756945, 25757697
     25757748, 25760195, 25762221, 25764020, 25766822, 25768681, 25772669
     25774077, 25775213, 25775444, 25780343, 25783447, 25784002, 25785331
     25785441, 25788879, 25789041, 25789277, 25789579, 25790353, 25792911
     25795865, 25797092, 25797124, 25797305, 25800464, 25802510, 25803364
     25803545, 25807997, 25809524, 25810263, 25810704, 25811650, 25812390
     25813931, 25818707, 25822410, 25823532, 25823754, 25824372, 25825910
     25826740, 25830492, 25832935, 25834581, 25835365, 25838361, 25838755
     25852885, 25856821, 25858672, 25861398, 25865785, 25866948, 25870579
     25871177, 25871639, 25871753, 25872127, 25872389, 25873336, 25874050
     25874678, 25882264, 25883438, 25885148, 25888073, 25888984, 25890002
     25890056, 25890673, 25890782, 25894239, 25895224, 25897615, 25898228
     25904273, 25904490, 25905130, 25906117, 25906886, 25908728, 25911724
     25914276, 25919622, 25932524, 25932728, 25933494, 25941836, 25942868
     25943271, 25945130, 25947799, 25951571, 25953857, 25954022, 25954054
     25957038, 25963024, 25964954, 25967544, 25967985, 25970731, 25971286
     25972417, 25973152, 25975723, 25977302, 25980605, 25980770, 25981498
     25982666, 25986062, 25990907, 25995938, 25997810, 26006257, 26007010
     26019148, 26024732, 26024784, 26025681, 26029075, 26029777, 26029780
     26032573, 26034119, 26036748, 26037215, 26038086, 26039623, 26040483
     26045732, 26051656, 26078437, 26078493, 26080410, 26083298, 26087754
     26088426, 26088836, 26089669, 26090767, 26090893, 26091640, 26091786
     26095327, 26095405, 26096382, 26108080, 26108337, 26110259, 26110632
     26111842, 26112621, 26115103, 26121990, 26123175, 26124078, 26130486
     26137367, 26137416, 26138085, 26145560, 26149904, 26153372, 26153977
     26168933, 26169341, 26169345, 26170659, 26170715, 26176002, 26187943
     26189861, 26198757, 26198926, 26201113, 26203182, 26223039, 26237338
     26237431, 26237773, 26238195, 26242031, 26242677, 26243698, 26244115
     26245237, 26248143, 26249718, 26256131, 26257953, 26259265, 26261327
     26263328, 26263721, 26268756, 26269790, 26271001, 26274660, 26275023
     26275415, 26277439, 26281476, 26285062, 26285933, 26301540, 26308650
     26309047, 26317991, 26318200, 26318627, 26323308, 26324206, 26324769
     26325856, 26327418, 26327624, 26327775, 26330994, 26331743, 26333141
     26334602, 26336977, 26338953, 26351334, 26351996, 26353617, 26354844
     26356098, 26358670, 26359091, 26362155, 26362821, 26366517, 26367012
     26367460, 26371725, 26373967, 26374791, 26375052, 26375250, 26375330
     26380097, 26385189, 26386858, 26388538, 26396790, 26398675, 26399626
     26399691, 26399839, 26405036, 26406387, 26407408, 26410240, 26412540
     26418088, 26420561, 26421667, 26422277, 26423085, 26426526, 26426967
     26430323, 26430737, 26434436, 26434999, 26435073, 26436168, 26438612
     26439748, 26440142, 26440169, 26440749, 26441345, 26442308, 26444601
     26444887, 26446098, 26452606, 26474662, 26474703, 26475419, 26476090
     26476244, 26478970, 26479173, 26482376, 26486365, 26492666, 26492866
     26493289, 26498354, 26513067, 26513709, 26521043, 26522439, 26523432
     26526726, 26526799, 26536320, 26537307, 26541685, 26542135, 26542236
     26542835, 26544823, 26545688, 26546070, 26546664, 26546754, 26548363
     26556014, 26558437, 26569225, 26575788, 26580633, 26582460, 26584641
     26588069, 26597140, 26599395, 26608137, 26608238, 26609942, 26615291
     26615690, 26617804, 26623652, 26626879, 26629381, 26633355, 26633558
     26635897, 26637273, 26637824, 26639167, 26641610, 26641852, 26650226
     26650540, 26654363, 26658759, 26659182, 26669550, 26680105, 26712331
     26714486, 26714910, 26717528, 26724511, 26725687, 26727397, 26729494
     26729611, 26740700, 26743240, 26744595, 26745002, 26751106, 26751171
     26755171, 26758193, 26764561, 26765212, 26768025, 26775602, 26784509
     26790923, 26794786, 26797591, 26798411, 26798514, 26798516, 26802503
     26816582, 26820076, 26822314, 26822620, 26824833, 26828994, 26829845
     26830694, 26832296, 26833932, 26837569, 26837702, 26840654, 26844406
     26844870, 26849779, 26855406, 26855855, 26871815, 26875822, 26883456
     26895149, 26896659, 26898563, 26907236, 26907327, 26908788, 26909100
     26909504, 26910716, 26911000, 26923777, 26939314, 26943004, 26944190
     26947373, 26958896, 26963310, 26966616, 26966916, 26967713, 26968670
     26969321, 26970175, 26970717, 26981902, 26983259, 26985002, 26986173
     26992964, 26999139, 27000158, 27006120, 27006664, 27009164, 27013146
     27028251, 27032785, 27033520, 27033652, 27034890, 27036163, 27037839
     27038986, 27039712, 27044169, 27044297, 27045634, 27052607, 27056711
     27058530, 27060167, 27060859, 27061736, 27072923, 27073314, 27079140
     27079651, 27084613, 27087426, 27090765, 27092508, 27093423, 27097854
     27100800, 27101105, 27105900, 27106179, 27110878, 27115422, 27117822
     27119621, 27119861, 27122162, 27124624, 27125872, 27133662, 27134734
     27135647, 27135993, 27138325, 27142120, 27142373, 27142529, 27144928
     27151826, 27153641, 27160922, 27161071, 27162390, 27162405, 27163928
     27165231, 27169796, 27170305, 27181537, 27181897, 27185188, 27195935
     27199245, 27200959, 27202015, 27203055, 27207110, 27207634, 27208795
     27213224, 27216046, 27217412, 27223075, 27229389, 27231051, 27234962
     27236722, 27242226, 27244337, 27244999, 27248917, 27249531, 27250547
     27251690, 27254335, 27255377, 27256000, 27258578, 27259307, 27262945
     27264464, 27266245, 27274456, 27274536, 27275533, 27276231, 27283960
     27284499, 27285244, 27288638, 27292213, 27293599, 27302711, 27302730
     27303287, 27303938, 27304410, 27304906, 27305039, 27308088, 27314206
     27314390, 27314697, 27320576, 27321179, 27329612, 27333106, 27334316
     27338912, 27338946, 27339115, 27345231, 27346709, 27348081, 27349393
     27350267, 27351628, 27359178, 27364854, 27365014, 27367194, 27369515
     27370965, 27375542, 27381498, 27383281, 27386467, 27392968, 27393570
     27394703, 27395416, 27396624, 27396672, 27396813, 27397048, 27400416
     27400598, 27404573, 27404668, 27405645, 27416997, 27423251, 27424405
     27426363, 27432062, 27432826, 27433385, 27433870, 27434193, 27439835
     27441326, 27442041, 27443406, 27445727, 27452046, 27457891, 27459593
     27459948, 27466597, 27468303, 27486805, 27487919, 27489107, 27493674
     27494663, 275013

반응형
Posted by [PineTree]
ORACLE/ADMIN2023. 9. 15. 11:26
반응형

 

11G 
Database Shutdown ( 1&2 노드 )
< 1번노드 >
1. $ <ORACLE_HOME>/bin/srvctl stop home -o <ORACLE_HOME> -s <status file location> -n <node name>
2. # <GI_HOME>/crs/install/rootcrs.pl –unlock
3. $<GI_HOME>/OPatch/opatch napply -oh <GI_HOME> -local
<UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<OCW Components_number>
$ <GI_HOME>/OPatch/opatch napply -oh <GI_HOME> -local
<UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<ACFS Components_number>
$ <GI_HOME>/OPatch/opatch apply -oh <GI_HOME> -local
<UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<DB_PSU_number>
4. $<UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<OCW Components_number>/custom/server/
<OCW Components_number>/custom/scripts/prepatch.sh -dbhome <ORACLE_HOME>
$ <ORACLE_HOME>/OPatch/opatch napply -oh <ORACLE_HOME> -local
<UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<OCW Components_number>
/custom/server/<OCW Components_number>
$ <ORACLE_HOME>/OPatch/opatch apply -oh <ORACLE_HOME> -local
<UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<DB_PSU_number>
$ <UNZIPPED_PATCH_LOCATION>/<GI_PSU_number>/<OCW Components_number>/custom/server/
<OCW Components_number>/custom/scripts/postpatch.sh -dbhome <ORACLE_HOME>
5. # <GI_HOME>/rdbms/install/rootadd_rdbms.sh
# <GI_HOME>/crs/install/rootcrs.pl –patch
6. $ <ORACLE_HOME>/bin/srvctl start home -o <ORACLE_HOME> -s <status file location> -n <node name>
<2번 노드도 동일하게 수행>
1 ~ 6
Database Startup ( 1&2 노드 )
<한노드에서만 수행>
7. cd $ORACLE_HOME/rdbms/admin
SQL> @catbundle.sql psu apply

반응형
Posted by [PineTree]
2023. 7. 26. 09:22

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

ORACLE/SQL2023. 7. 2. 00:48
반응형

-- 유저 별
select 'select '||'count(*)'||' ' ||'from ' ||table_name||';'   from user_tables; 


-- 전체 건수 뽑는 쿼리 뽑기
select 'select '||'count(*)'||' ' ||' from '|| owner||'.' ||table_name||';'   from dba_tables
order by owner,table_name
;;

-- 유저 별 함수 사용
select table_name
,num_rows "통계건수"
,to_number(
dbms_xmlgen.getxmltype('SELECT COUNT(*) C FROM ' || TABLE_NAME).Extract('//text()'))  "실제 건수"
FROM dba_tables;



select table_name
,num_rows "통계건수"
,to_number(
dbms_xmlgen.getxmltype('SELECT COUNT(*) C FROM ' || TABLE_NAME).Extract('//text()'))  "실제 건수"
FROM user_tables;

반응형
Posted by [PineTree]
카테고리 없음2023. 7. 2. 00:43
반응형

vi 사용시에 화면 밀려 내려가는 것을 방짖 하는 방법

:set noai


같은거
:set noautoindent

:set noshowmatch

:set noai noshowmatch

반응형
Posted by [PineTree]
ORACLE/INSTALL2023. 6. 14. 17:43
반응형

-- /etc/hosts
192.168.219.59  ora19adg1
192.168.219.69  ora19adg2
192.168.219.51  ora19c
192.168.219.57  ora19c-ogg

192.168.56.108  radg1
192.168.56.103  radg2


#1

*.audit_file_dest='/u01/app/oracle/admin/ora19c/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/oradata/ORA19C/control01.ctl','/oradata/ORA19C/control02.ctl'
*.db_block_size=8192
*.db_name='ora19c'
*.db_recovery_file_dest='/oradata'
*.db_recovery_file_dest_size=8256m
*.db_unique_name='primary'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ora19cXDB)'
*.local_listener='LISTENER1','LISTENER2'
*.log_archive_config='dg_config=(primary,standby)'
*.log_archive_dest_1='location=/arch'
*.log_archive_dest_2='service=standby lgwr async valid_for=(online_logfile,primary_role) db_unique_name=standby'
*.log_archive_dest_state_1='enable'
*.log_archive_dest_state_2='enable'
*.log_archive_format='%t_%s_%r.arc'
*.nls_language='KOREAN'
*.nls_territory='KOREA'
*.open_cursors=300
*.pga_aggregate_target=996m
*.processes=320
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=2986m
*.standby_file_management='auto'
*.undo_tablespace='UNDOTBS1'


#2
*.audit_file_dest='/u01/app/oracle/admin/standby/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/oradata/STANDBY/control01.ctl','/oradata/STANDBY/control02.ctl'#Restore Controlfile
*.db_block_size=8192
*.db_file_name_convert='/oradata/ORA19C','/oradata/STANDBY'
*.db_name='ora19c'
*.db_recovery_file_dest='/oradata'
*.db_recovery_file_dest_size=8256m
*.db_unique_name='standby'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=standbyXDB)'
*.fal_client='primary'
*.fal_server='standby'
*.local_listener='LISTENER1','LISTENER2'
*.log_archive_config='dg_config=(primary,standby)'
*.log_archive_dest_1='location=/arch'
*.log_archive_dest_2='service=primary lgwr async valid_for=(online_logfile,primary_role) db_unique_name=primary'
*.log_archive_dest_state_1='enable'
*.log_archive_dest_state_2='enable'
*.log_archive_format='%t_%s_%r.arc'
*.log_file_name_convert='/oradata/ORA19C','/oradata/STANDBY'
*.nls_language='KOREAN'
*.nls_territory='KOR
*.open_cursors=300
*.pga_aggregate_target=996m
*.processes=320
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=2986m
*.standby_file_management='auto'
*.undo_tablespace='UNDOTBS1'



패스워드 파일 DR서버로 복사(SCP)
orapwora19c 복사

복제용 임시 리스너 설정
#2 서버에 적용 listener.ora 및 기동
SID_LIST_LISTENER_ADG =
   (SID_LIST =
     (SID_DESC =
       (SID_NAME = standby)
       (ORACLE_HOME = /u01/app/oracle/product/19c/db_1)
     )
   )



LISTENER_ADG =
   (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 21525))
      (CONNECT_DATA =
       (SERVER = DEDICATED)
       (SERVICE_NAME = standby)
     )
   )

lsnrctl start listener_adg
-- tnsnames.ora설정 #1,#2 서버 모두 설정

LISTENER_ORA19CADG =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1521))


LISTENER_ADG =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 21525))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = standby)
    )
  )

STANDBY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 21521))
      (FAIL_OVER = ON)
    )
    (CONNECT_DATA =
      (SERVICE_NAME = standby)
    )
  )

LISTENER_ADG1 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT = 21521))
    )
    (CONNECT_DATA =
      (SID = primary)
    )
  )



primary =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 21521))
      (FAIL_OVER = ON)
    )
    (CONNECT_DATA =
      (SERVICE_NAME = primary)
    )
  )


복제
1) active 서버 에서 복제
nomount 모드로 기동

sqlplus / as sysdba
startup nomount

[ora19c:/u01/app/oracle/product/19c/db_1/network/admin]> rman target sys/oracle@primary auxiliary sys/oracle@standby

Recovery Manager: Release 19.0.0.0.0 - Production on Thu Jun 1 17:01:41 2023
Version 19.13.0.0.0

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

connected to target database: ORA19C (DBID=1191478324)
connected to auxiliary database: ORA19C (not mounted)

RMAN> run {
2> allocate channel prmy1 type disk;
3> allocate auxiliary channel stby1 type disk;
4> duplicate target database for standby from active database nofilenamecheck dorecover;
5>   }

using target database control file instead of recovery catalog
allocated channel: prmy1
channel prmy1: SID=23 device type=DISK

allocated channel: stby1
channel stby1: SID=10 device type=DISK

Starting Duplicate Db at 01-JUN-23
current log archived

contents of Memory Script:
{
   backup as copy reuse
   passwordfile auxiliary format  '/u01/app/oracle/product/19c/db_1/dbs/orapwstandby'   ;
}
executing Memory Script

Starting backup at 01-JUN-23
Finished backup at 01-JUN-23

contents of Memory Script:
{
   restore clone from service  'primary' standby controlfile;
}
executing Memory Script

Starting restore at 01-JUN-23

channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: restoring control file
channel stby1: restore complete, elapsed time: 00:00:01
output file name=/oradata/STANDBY/control01.ctl
output file name=/oradata/STANDBY/control02.ctl
Finished restore at 01-JUN-23

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/oradata/STANDBY/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to 
 "/oradata/STANDBY/system01.dbf";
   set newname for datafile  3 to 
 "/oradata/STANDBY/sysaux01.dbf";
   set newname for datafile  4 to 
 "/oradata/STANDBY/undotbs01.dbf";
   set newname for datafile  7 to 
 "/oradata/STANDBY/users01.dbf";
   restore
   from  nonsparse   from service 
 'primary'   clone database
   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /oradata/STANDBY/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 01-JUN-23

channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: specifying datafile(s) to restore from backup set
channel stby1: restoring datafile 00001 to /oradata/STANDBY/system01.dbf
channel stby1: restore complete, elapsed time: 00:00:25
channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: specifying datafile(s) to restore from backup set
channel stby1: restoring datafile 00003 to /oradata/STANDBY/sysaux01.dbf
channel stby1: restore complete, elapsed time: 00:00:15
channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: specifying datafile(s) to restore from backup set
channel stby1: restoring datafile 00004 to /oradata/STANDBY/undotbs01.dbf
channel stby1: restore complete, elapsed time: 00:00:01
channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: specifying datafile(s) to restore from backup set
channel stby1: restoring datafile 00007 to /oradata/STANDBY/users01.dbf
channel stby1: restore complete, elapsed time: 00:00:01
Finished restore at 01-JUN-23

sql statement: alter system archive log current
current log archived

contents of Memory Script:
{
   restore clone force from service  'primary' 
           archivelog from scn  2276859;
   switch clone datafile all;
}
executing Memory Script

Starting restore at 01-JUN-23

channel stby1: starting archived log restore to default destination
channel stby1: using network backup set from service primary
channel stby1: restoring archived log
archived log thread=1 sequence=13
channel stby1: restore complete, elapsed time: 00:00:01
channel stby1: starting archived log restore to default destination
channel stby1: using network backup set from service primary
channel stby1: restoring archived log
archived log thread=1 sequence=14
channel stby1: restore complete, elapsed time: 00:00:01
Finished restore at 01-JUN-23

datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=1138381380 file name=/oradata/STANDBY/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=1138381380 file name=/oradata/STANDBY/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=1138381380 file name=/oradata/STANDBY/undotbs01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1138381380 file name=/oradata/STANDBY/users01.dbf

contents of Memory Script:
{
   set until scn  2277311;
   recover
   standby
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 01-JUN-23

starting media recovery

archived log for thread 1 with sequence 13 is already on disk as file /arch/1_13_1138290295.arc
archived log for thread 1 with sequence 14 is already on disk as file /arch/1_14_1138290295.arc
archived log file name=/arch/1_13_1138290295.arc thread=1 sequence=13
archived log file name=/arch/1_14_1138290295.arc thread=1 sequence=14
media recovery complete, elapsed time: 00:00:01
Finished recover at 01-JUN-23

contents of Memory Script:
{
   delete clone force archivelog all;
}
executing Memory Script

deleted archived log
archived log file name=/arch/1_13_1138290295.arc RECID=1 STAMP=1138381378
deleted archived log
archived log file name=/arch/1_14_1138290295.arc RECID=2 STAMP=1138381379
Deleted 2 objects

Finished Duplicate Db at 01-JUN-23
released channel: prmy1
released channel: stby1

2) standby 서버에서 복제 실행

[standby:/oradata/STANDBY]> rman target sys/oracle@primary auxiliary sys/oracle@listener_adg

Recovery Manager: Release 19.0.0.0.0 - Production on Thu Jun 1 17:46:05 2023
Version 19.13.0.0.0

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

connected to target database: ORA19C (DBID=1191478324)
connected to auxiliary database: ORA19C (not mounted)

RMAN> duplicate target database for standby from active database nofilenamecheck dorecover;

Starting Duplicate Db at 01-JUN-23
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=379 device type=DISK
current log archived

contents of Memory Script:
{
   backup as copy reuse
   passwordfile auxiliary format  '/u01/app/oracle/product/19c/db_1/dbs/orapwstandby'   ;
}
executing Memory Script

Starting backup at 01-JUN-23
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
Finished backup at 01-JUN-23

contents of Memory Script:
{
   restore clone from service  'primary' standby controlfile;
}
executing Memory Script

Starting restore at 01-JUN-23
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/oradata/STANDBY/control01.ctl
output file name=/oradata/STANDBY/control02.ctl
Finished restore at 01-JUN-23

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/oradata/STANDBY/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to 
 "/oradata/STANDBY/system01.dbf";
   set newname for datafile  3 to 
 "/oradata/STANDBY/sysaux01.dbf";
   set newname for datafile  4 to 
 "/oradata/STANDBY/undotbs01.dbf";
   set newname for datafile  7 to 
 "/oradata/STANDBY/users01.dbf";
   restore
   from  nonsparse   from service 
 'primary'   clone database
   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /oradata/STANDBY/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 01-JUN-23
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /oradata/STANDBY/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /oradata/STANDBY/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /oradata/STANDBY/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /oradata/STANDBY/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 01-JUN-23

sql statement: alter system archive log current
current log archived

contents of Memory Script:
{
   restore clone force from service  'primary' 
           archivelog from scn  2283316;
   switch clone datafile all;
}
executing Memory Script

Starting restore at 01-JUN-23
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=21
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=22
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 01-JUN-23

datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=1138384007 file name=/oradata/STANDBY/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=1138384007 file name=/oradata/STANDBY/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=1138384007 file name=/oradata/STANDBY/undotbs01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1138384007 file name=/oradata/STANDBY/users01.dbf

contents of Memory Script:
{
   set until scn  2283480;
   recover
   standby
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 01-JUN-23
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 21 is already on disk as file /arch/1_21_1138290295.arc
archived log for thread 1 with sequence 22 is already on disk as file /arch/1_22_1138290295.arc
archived log file name=/arch/1_21_1138290295.arc thread=1 sequence=21
archived log file name=/arch/1_22_1138290295.arc thread=1 sequence=22
media recovery complete, elapsed time: 00:00:01
Finished recover at 01-JUN-23

contents of Memory Script:
{
   delete clone force archivelog all;
}
executing Memory Script

released channel: ORA_DISK_1
released channel: ORA_AUX_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
deleted archived log
archived log file name=/arch/1_21_1138290295.arc RECID=1 STAMP=1138384004
deleted archived log
archived log file name=/arch/1_22_1138290295.arc RECID=2 STAMP=1138384006
Deleted 2 objects

Finished Duplicate Db at 01-JUN-23


 

오라클 single adg 네트워크 설정

#1.listener.ora ############################################################################# LISTENER1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1529)) ) LISTENER2 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT

theone79.tistory.com

 

 

반응형
Posted by [PineTree]
ORACLE/INSTALL2023. 6. 14. 16:12
반응형

#1.listener.ora 
#############################################################################
LISTENER1 =
 (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1529))
)

LISTENER2 =
 (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT = 9999))
)
#############################################################################
#2.listener.ora
#############################################################################
LISTENER1 =
 (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 1529))
)

LISTENER2 =
 (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg2)(PORT = 9999))
)


#############################################################################
#1,#2 서버에 모두 적용
alter system set local_listener='LISTENER1','LISTENER2' scope=both;
#############################################################################

#1.tnsnames.ora

LISTENER1 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1529))

LISTENER2 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT = 9999))
  
SER1 =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = ora19c)
    )
  )

SER2 =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = standby)
    )
  )

primary   =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = primary)
    )
  )

standby   =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg2)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = standby)
    )
~     

#############################################################################
#2.tnsnames.ora

LISTENER1 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 1529))

LISTENER2 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg2)(PORT = 9999))


SER1 =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = ora19c)
    )
  )

SER2 =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = standby)
    )
  )

primary   =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = primary)
    )
  )

standby   =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg2)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = standby)
    )
~     


#############################################################################
#2 서버에서 ADG 기동

alter database recover managed standby database cancel;
alter database flashback on;
alter database recover managed standby database using current logfile disconnect;

모니터링
COLUMN NAME FORMAT A24
COLUMN VALUE FORMAT A16     
COLUMN DATUM_TIME FORMAT A24
SELECT NAME, VALUE, DATUM_TIME FROM V$DATAGUARD_STATS;


 

오라클 single adg 초기 설정 (1)

-- /etc/hosts 192.168.219.59 ora19adg1 192.168.219.69 ora19adg2 192.168.219.51 ora19c 192.168.219.57 ora19c-ogg 192.168.56.108 radg1 192.168.56.103 radg2 #1 *.audit_file_dest='/u01/app/oracle/admin/ora19c/adump' *.audit_trail='db' *.compatible='19.0.0' *.c

theone79.tistory.com

 

반응형

'ORACLE > INSTALL' 카테고리의 다른 글

oracle 19c Silent install linux  (0) 2023.07.26
오라클 single adg 초기 설정 (1)  (0) 2023.06.14
oracle seha 설치 후 relocate 실패  (2) 2022.09.30
오라클 11G upgrade관련문서  (0) 2013.10.29
oracle silent install  (0) 2012.05.11
Posted by [PineTree]