In 12.2 and later

AWR Snapshot 및 Report 는 CDB level 또는 PDB level 에서 생성가능하며 AWR Snapshot 은 기본으로 CDB level 에서만 생성된다.

1. PDB AWR snapshot 수동 생성하는 경우.

SQL> connect <username>/<password> as sysdba
SQL> alter session set container=PDB1;
SQL> exec dbms_workload_repository.create_snapshot();


2. PDB AWR snapshots 의 자동생성 환경 구성.

SQL> alter session set container = CDB$ROOT;
SQL> alter system set AWR_PDB_AUTOFLUSH_ENABLED = TRUE;
SQL> alter system set AWR_SNAPSHOT_TIME_OFFSET=1000000; 

SQL> select * from cdb_hist_wr_control;    

      DBID SNAP_INTERVAL                            RETENTION                                TOPNSQL        CON_ID
---------- ---------------------------------------- ---------------------------------------- ---------- ----------
1793141417 +00000 01:00:00.0                        +00008 00:00:00.0                        DEFAULT             0
4182556862 +40150 00:01:00.0                        +00008 00:00:00.0                        DEFAULT             3  

PDB의 기본 snap_interval 은 너무 길기 때문에 변경해 준다.

SQL> alter session set container=PDB1;
SQL> exec dbms_workload_repository.modify_snapshot_settings(interval => 30, dbid => 4182556862);

SQL> alter session set container = CDB$ROOT;
SQL> select * from cdb_hist_wr_control;

      DBID SNAP_INTERVAL                            RETENTION                                TOPNSQL        CON_ID
---------- ---------------------------------------- ---------------------------------------- ---------- ----------
1793141417 +00000 01:00:00.0                        +00008 00:00:00.0                        DEFAULT             0
4182556862 +00000 00:30:00.0                        +00008 00:00:00.0                        DEFAULT             3

3. cdb_hist_snapshot 을 조회해서 CDB, PDB 의 AWR snapshot 확인가능

SQL> alter session set container=CDB$ROOT;
SQL> select con_id, instance_number, snap_id, begin_interval_time, end_interval_time from cdb_hist_snapshot order by 1,2,3;

    CON_ID INSTANCE_NUMBER    SNAP_ID BEGIN_INTERVAL_TIME              END_INTERVAL_TIME
---------- --------------- ---------- -------------------------------- --------------------------------
         0               1          1 28-FEB-19 06.26.06.000 PM        28-FEB-19 07.00.14.425 PM
         0               1          2 28-FEB-19 07.00.14.425 PM        28-FEB-19 08.00.30.362 PM
         0               1          3 28-FEB-19 08.00.30.362 PM        28-FEB-19 09.00.46.286 PM
         0               1          4 28-FEB-19 09.00.46.286 PM        28-FEB-19 10.00.02.598 PM
         0               1          5 28-FEB-19 10.00.02.598 PM        28-FEB-19 11.00.15.351 PM
         3               1          1 28-FEB-19 07.00.14.425 PM        28-FEB-19 07.30.36.225 PM   <<--- PDB snapshot
         3               1          2 28-FEB-19 07.30.36.225 PM        28-FEB-19 08.00.31.532 PM   <<--- PDB snapshot
         3               1          3 28-FEB-19 08.00.31.532 PM        28-FEB-19 08.30.10.270 PM   <<--- PDB snapshot

4. CDB 에서 CDB AWR report 생성

SQL> alter session set container=CDB$ROOT;
SQL> @?/rdbms/admin/awrrpt    

5. PDB에서 PDB AWR reportSQL> alter session set container=PDB1;
SQL> @?/rdbms/admin/awrrpt

Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
AWR reports can be generated in the following formats.  Please enter the name of the format at the prompt.  Default value is 'html'.

'html'          HTML format (default)
'text'          Text format
'active-html'   Includes Performance Hub active report

Enter value for report_type: 

Specify the location of AWR Data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AWR_ROOT - Use AWR data from root (default)  
AWR_PDB  - Use AWR data from PDB          <<------- PDB Snapshot이  별도로 생성된 경우 선택가능
 
Enter value for awr_location:

 

AWR Snapshots and Reports from Oracle Multitentant Database(CDB, PDB) (Doc ID 2295998.1)

Posted by pat98

 

특정 Tablspace 를 제외시키고 duplicate 가 가능한지 테스트 해봄

 

원본에 TEST 라는 tablespace 를 만들고 복제를 진행한다.

 

SQL> create tablespace TEST datafile  '/oracle/app/oracle/oradata/ORCL/test01.dbf' size 100M;

 


RMAN> DUPLICATE DATABASE TO ORCL2 skip tablespace 'TEST'
2> FROM ACTIVE DATABASE
3> SPFILE
4> parameter_value_convert ('ORCL','ORCL2')
5> set db_file_name_convert='/oracle/app/oracle/oradata/ORCL/','/oracle/app/oracle/oradata/ORCL2/'
6> set log_file_name_convert='/oracle/app/oracle/oradata/ORCL/','/oracle/app/oracle/oradata/ORCL2/'
7> set control_files='/oracle/app/oracle/oradata/ORCL2/control01.ctl','/oracle/app/oracle/oradata/ORCL2/control02.ctl'
8> set log_archive_dest_1='location=/oracle/archive2'
9> ;
10>
Starting Duplicate Db at 2024-09-23:22:05:56
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=38 device type=DISK
current log archived

contents of Memory Script:
{
   restore clone from service  'ORCL' spfile to
 '/oracle/app/oracle/product/19.0.0/dbs/spfileORCL2.ora';
   sql clone "alter system set spfile= ''/oracle/app/oracle/product/19.0.0/dbs/spfileORCL2.ora''";
}
executing Memory Script

Starting restore at 2024-09-23:22:05:58
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 ORCL
channel ORA_AUX_DISK_1: restoring SPFILE
output file name=/oracle/app/oracle/product/19.0.0/dbs/spfileORCL2.ora
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2024-09-23:22:06:02

sql statement: alter system set spfile= ''/oracle/app/oracle/product/19.0.0/dbs/spfileORCL2.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''ORCL2'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  audit_file_dest =
 ''/oracle/app/oracle/admin/ORCL2/adump'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_name =
 ''ORCL2'' comment=
 '''' scope=spfile";
   sql clone "alter system set  dispatchers =
 ''(PROTOCOL=TCP) (SERVICE=ORCL2XDB)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  local_listener =
 ''LISTENER_ORCL2'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_file_name_convert =
 ''/oracle/app/oracle/oradata/ORCL/'', ''/oracle/app/oracle/oradata/ORCL2/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_file_name_convert =
 ''/oracle/app/oracle/oradata/ORCL/'', ''/oracle/app/oracle/oradata/ORCL2/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  control_files =
 ''/oracle/app/oracle/oradata/ORCL2/control01.ctl'', ''/oracle/app/oracle/oradata/ORCL2/control02.ctl'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_archive_dest_1 =
 ''location=/oracle/archive2'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''ORCL2'' comment= ''duplicate'' scope=spfile
sql statement: alter system set  audit_file_dest =  ''/oracle/app/oracle/admin/ORCL2/adump'' comment= '''' scope=spfile
sql statement: alter system set  db_name =  ''ORCL2'' comment= '''' scope=spfile
sql statement: alter system set  dispatchers =  ''(PROTOCOL=TCP) (SERVICE=ORCL2XDB)'' comment= '''' scope=spfile
sql statement: alter system set  local_listener =  ''LISTENER_ORCL2'' comment= '''' scope=spfile
sql statement: alter system set  db_file_name_convert =  ''/oracle/app/oracle/oradata/ORCL/'', ''/oracle/app/oracle/oradata/ORCL2/'' comment= '''' scope=spfile
sql statement: alter system set  log_file_name_convert =  ''/oracle/app/oracle/oradata/ORCL/'', ''/oracle/app/oracle/oradata/ORCL2/'' comment= '''' scope=spfile
sql statement: alter system set  control_files =  ''/oracle/app/oracle/oradata/ORCL2/control01.ctl'', ''/oracle/app/oracle/oradata/ORCL2/control02.ctl'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_dest_1 =  ''location=/oracle/archive2'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    3690983864 bytes

Fixed Size                     8946104 bytes
Variable Size                721420288 bytes
Database Buffers            2952790016 bytes
Redo Buffers                   7827456 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''ORCL'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''ORCL2'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone from service  'ORCL' primary controlfile;
   alter clone database mount;
}
executing Memory Script

 

sql statement: alter system set  db_name =  ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set  db_unique_name =  ''ORCL2'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area    3690983864 bytes

Fixed Size                     8946104 bytes
Variable Size                721420288 bytes
Database Buffers            2952790016 bytes
Redo Buffers                   7827456 bytes

Starting restore at 2024-09-23:22:06:54
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=35 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service ORCL
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/oracle/app/oracle/oradata/ORCL2/control01.ctl
output file name=/oracle/app/oracle/oradata/ORCL2/control02.ctl
Finished restore at 2024-09-23:22:06:59

database mounted
Checking that duplicated tablespaces are self-contained
Datafile 5 skipped by request

contents of Memory Script:
{
   set newname for datafile  1 to
 "/oracle/app/oracle/oradata/ORCL2/system01.dbf";
   set newname for datafile  2 to
 "/oracle/app/oracle/oradata/ORCL2/sysaux01.dbf";
   set newname for datafile  3 to
 "/oracle/app/oracle/oradata/ORCL2/undotbs01.dbf";
   set newname for datafile  4 to
 "/oracle/app/oracle/oradata/ORCL2/users01.dbf";
   restore
   from  nonsparse   from service
 'ORCL'   clone database
   skip forever tablespace  "TEST"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME

Starting restore at 2024-09-23:22:07:09
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 ORCL
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /oracle/app/oracle/oradata/ORCL2/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service ORCL
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00002 to /oracle/app/oracle/oradata/ORCL2/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service ORCL
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /oracle/app/oracle/oradata/ORCL2/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 ORCL
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /oracle/app/oracle/oradata/ORCL2/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2024-09-23:22:07:18

sql statement: alter system archive log current
current log archived

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

Starting restore at 2024-09-23:22:07:19
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 ORCL
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=71
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service ORCL
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=72
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2024-09-23:22:07:21

datafile 1 switched to datafile copy
input datafile copy RECID=5 STAMP=1180476441 file name=/oracle/app/oracle/oradata/ORCL2/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=6 STAMP=1180476441 file name=/oracle/app/oracle/oradata/ORCL2/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=7 STAMP=1180476441 file name=/oracle/app/oracle/oradata/ORCL2/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=8 STAMP=1180476441 file name=/oracle/app/oracle/oradata/ORCL2/users01.dbf

contents of Memory Script:
{
   set until scn  1346449;
   recover
   clone database
   skip forever tablespace  "TEST"    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 2024-09-23:22:07:21
using channel ORA_AUX_DISK_1

Executing: alter database datafile 5 offline drop
starting media recovery

archived log for thread 1 with sequence 71 is already on disk as file /oracle/archive2/arch_1_1151767787_71.arc
archived log for thread 1 with sequence 72 is already on disk as file /oracle/archive2/arch_1_1151767787_72.arc
archived log file name=/oracle/archive2/arch_1_1151767787_71.arc thread=1 sequence=71
archived log file name=/oracle/archive2/arch_1_1151767787_72.arc thread=1 sequence=72
media recovery complete, elapsed time: 00:00:00
Finished recover at 2024-09-23:22:07:22

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

released channel: ORA_AUX_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=85 device type=DISK
deleted archived log
archived log file name=/oracle/archive2/arch_1_1151767787_71.arc RECID=1 STAMP=1180476439
deleted archived log
archived log file name=/oracle/archive2/arch_1_1151767787_72.arc RECID=2 STAMP=1180476440
Deleted 2 objects

Oracle instance started

Total System Global Area    3690983864 bytes

Fixed Size                     8946104 bytes
Variable Size                721420288 bytes
Database Buffers            2952790016 bytes
Redo Buffers                   7827456 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''ORCL2'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
}
executing Memory Script

sql statement: alter system set  db_name =  ''ORCL2'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile
Oracle instance started

Total System Global Area    3690983864 bytes

Fixed Size                     8946104 bytes
Variable Size                721420288 bytes
Database Buffers            2952790016 bytes
Redo Buffers                   7827456 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORCL2" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP     1 ( '/oracle/app/oracle/oradata/ORCL2/redo01.log' ) SIZE 200 M  REUSE,
  GROUP     2 ( '/oracle/app/oracle/oradata/ORCL2/redo02.log' ) SIZE 200 M  REUSE,
  GROUP     3 ( '/oracle/app/oracle/oradata/ORCL2/redo03.log' ) SIZE 200 M  REUSE
 DATAFILE
  '/oracle/app/oracle/oradata/ORCL2/system01.dbf'
 CHARACTER SET AL32UTF8

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/oracle/app/oracle/oradata/ORCL2/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/oracle/app/oracle/oradata/ORCL2/sysaux01.dbf",
 "/oracle/app/oracle/oradata/ORCL2/undotbs01.dbf",
 "/oracle/app/oracle/oradata/ORCL2/users01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /oracle/app/oracle/oradata/ORCL2/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/oracle/app/oracle/oradata/ORCL2/sysaux01.dbf RECID=1 STAMP=1180476479
cataloged datafile copy
datafile copy file name=/oracle/app/oracle/oradata/ORCL2/undotbs01.dbf RECID=2 STAMP=1180476479
cataloged datafile copy
datafile copy file name=/oracle/app/oracle/oradata/ORCL2/users01.dbf RECID=3 STAMP=1180476479

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=1180476479 file name=/oracle/app/oracle/oradata/ORCL2/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=1180476479 file name=/oracle/app/oracle/oradata/ORCL2/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=1180476479 file name=/oracle/app/oracle/oradata/ORCL2/users01.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Dropping offline and skipped tablespaces
Executing: drop tablespace "TEST" including contents cascade constraints
Finished Duplicate Db at 2024-09-23:22:08:14

Recovery Manager complete.

 

- Source 

 

TABLESPACE_NAME      FILE_NAME                                           TOT_KB      FREE_KB USAGE_P
-------------------- --------------------------------------------- ------------ ------------ -------
SYSAUX               /oracle/app/oracle/oradata/ORCL/sysaux01.dbf       563,200      181,056    67.9
SYSTEM               /oracle/app/oracle/oradata/ORCL/system01.dbf       716,800      101,888    85.8
TEST                 /oracle/app/oracle/oradata/ORCL/test01.dbf         102,400      101,376     1.0
UNDOTBS1             /oracle/app/oracle/oradata/ORCL/undotbs01.dbf      261,120       79,680    69.5
USERS                /oracle/app/oracle/oradata/ORCL/users01.dbf          5,120        4,096    20.0

 

- Target 

 

TABLESPACE_NAME      FILE_NAME                                           TOT_KB      FREE_KB USAGE_P
-------------------- --------------------------------------------- ------------ ------------ -------
SYSAUX               /oracle/app/oracle/oradata/ORCL2/sysaux01.dbf      563,200      175,488    68.8
SYSTEM               /oracle/app/oracle/oradata/ORCL2/system01.dbf      716,800      101,888    85.8
UNDOTBS1             /oracle/app/oracle/oradata/ORCL2/undotbs01.dbf     261,120       78,656    69.9
USERS                /oracle/app/oracle/oradata/ORCL2/users01.dbf         5,120        4,096    20.0

Posted by pat98

12c Alert Log Appears To Show Unexpected Instance Restart (Doc ID 2049516.1)
Dumping Current Patch Information Shows Up In Alert Log At Random Times (Doc ID 2377750.1)

증상 : 
log.xml 파일이 10MB 에 도달하여 새로 생성되는 시점에 alert log 에 "Creating new log segment:" 정보 발생하거나
또는 재기동하지 않았는데 뜬금없이 db parameter 정보와 patch 정보를 alert 에 발생시킴

Solution : 
-> ls -al $ORACLE_BASE/diag/rdbms/sid/SID/alert 에서 xml 파일 확인
-> log.xml 은 10M 단위로 rotate 됨

SQL> alter system set "_log_segment_dump_parameter"=FALSE <---- db parameter
SQL> alter system set "_log_segment_dump_patch"=FALSE       <---- db patch

두 파라미터 모두 시스템 즉시 적용 되며 , 운영에 지장을 주지 않음.

XML alert log 인 log.xml file 이 새로 생성될 때, db 의 parameter 정보와 patch 정보를 남기는 기능을 off 하는 기능임.

Posted by pat98


원격이 아닌 Local 환경에서 rman dulicate 테스트를 해 보자..

- 현재 Single 19c 환경에 ORCL 이라는 DB가 있다.
  필요에 의해 ORCL2 이라는 이름으로 DB 복제하여 생성하고자 할 경우 아래과 같이 진행...
  

전체조건 : Source가 Archive mode 이여야 가능함 !!

테스트 환경은 19.23 으로 진행
    
1. parameter 화일 생성

vi /oracle/app/oracle/product/19.0.0/dbs/initORCL2.ora
DB_NAME=ORCL2

2. passwd 화일 생성

$ORACLE_HOME/dbs/orapwd file=orapwORCL2 password=oracle entries=10 format=12 force=y

3. 접속환경 구성

listener.ora 에 추가

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora19c)(PORT = 1522))
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = ORCL2)
      (ORACLE_HOME = /oracle/app/oracle/product/19.0.0)
      (SID_NAME = ORCL2)
    )
  )

tnsnames.ora 에 추가

ORCL2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora19c)(PORT = 1522))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ORCL2)
    )
  )
  
 [ORCL2]oracle@ora19c:/home/oracle# lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 20-AUG-2024 16:02:21

Copyright (c) 1991, 2024, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.140)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                20-AUG-2024 14:52:10
Uptime                    0 days 1 hr. 10 min. 11 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/oracle/product/19.0.0/network/admin/listener.ora
Listener Log File         /oracle/app/oracle/diag/tnslsnr/ora19c/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.140)(PORT=1522)))
Services Summary...
Service "ORCL" has 1 instance(s).
  Instance "ORCL", status READY, has 1 handler(s) for this service...
Service "ORCL2" has 1 instance(s).
  Instance "ORCL2", status UNKNOWN, has 1 handler(s) for this service...
Service "ORCLXDB" has 1 instance(s).
  Instance "ORCL", status READY, has 1 handler(s) for this service...
The command completed successfully

3. 디렉토리 생성
mkdir -p /oracle/app/oracle/oradata/ORCL2
mkdir -p /oracle/app/oracle/admin/ORCL2/adump
mkdir -p /oracle/archive2

5. nomount 로 DB기동

export ORACLE_SID=ORCL2
sqlplus "/as sysdba"

startup nomount pfile=/oracle/app/oracle/product/19.0.0/dbs/initORCL2.ora

6. rman 접속

! rman target sys/oracle@ORCL auxiliary sys/oracle@ORCL2

RMAN>
DUPLICATE DATABASE TO ORCL2
FROM ACTIVE DATABASE
SPFILE
parameter_value_convert ('ORCL','ORCL2')
set db_file_name_convert='/oracle/app/oracle/oradata/ORCL/','/oracle/app/oracle/oradata/ORCL2/'
set log_file_name_convert='/oracle/app/oracle/oradata/ORCL/','/oracle/app/oracle/oradata/ORCL2/'
set control_files='/oracle/app/oracle/oradata/ORCL2/control01.ctl','/oracle/app/oracle/oradata/ORCL2/control02.ctl'
set log_archive_dest_1='location=/oracle/archive2'
;

- 여기서부터는 진행 로그
Starting Duplicate Db at 20-AUG-24
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=38 device type=DISK
current log archived

contents of Memory Script:
{
   restore clone from service  'ORCL' spfile to 
 '/oracle/app/oracle/product/19.0.0/dbs/spfileORCL2.ora';
   sql clone "alter system set spfile= ''/oracle/app/oracle/product/19.0.0/dbs/spfileORCL2.ora''";
}
executing Memory Script

Starting restore at 20-AUG-24
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 ORCL
channel ORA_AUX_DISK_1: restoring SPFILE
output file name=/oracle/app/oracle/product/19.0.0/dbs/spfileORCL2.ora
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 20-AUG-24

sql statement: alter system set spfile= ''/oracle/app/oracle/product/19.0.0/dbs/spfileORCL2.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''ORCL2'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  audit_file_dest = 
 ''/oracle/app/oracle/admin/ORCL2/adump'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_name = 
 ''ORCL2'' comment=
 '''' scope=spfile";
   sql clone "alter system set  dispatchers = 
 ''(PROTOCOL=TCP) (SERVICE=ORCL2XDB)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  local_listener = 
 ''LISTENER_ORCL2'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_file_name_convert = 
 ''/oracle/app/oracle/oradata/ORCL/'', ''/oracle/app/oracle/oradata/ORCL2/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_file_name_convert = 
 ''/oracle/app/oracle/oradata/ORCL/'', ''/oracle/app/oracle/oradata/ORCL2/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  control_files = 
 ''/oracle/app/oracle/oradata/ORCL2/control01.ctl'', ''/oracle/app/oracle/oradata/ORCL2/control02.ctl'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_archive_dest_1 = 
 ''location=/oracle/archive2'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''ORCL2'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  audit_file_dest =  ''/oracle/app/oracle/admin/ORCL2/adump'' comment= '''' scope=spfile

sql statement: alter system set  db_name =  ''ORCL2'' comment= '''' scope=spfile

sql statement: alter system set  dispatchers =  ''(PROTOCOL=TCP) (SERVICE=ORCL2XDB)'' comment= '''' scope=spfile

sql statement: alter system set  local_listener =  ''LISTENER_ORCL2'' comment= '''' scope=spfile

sql statement: alter system set  db_file_name_convert =  ''/oracle/app/oracle/oradata/ORCL/'', ''/oracle/app/oracle/oradata/ORCL2/'' comment= '''' scope=spfile

sql statement: alter system set  log_file_name_convert =  ''/oracle/app/oracle/oradata/ORCL/'', ''/oracle/app/oracle/oradata/ORCL2/'' comment= '''' scope=spfile

sql statement: alter system set  control_files =  ''/oracle/app/oracle/oradata/ORCL2/control01.ctl'', ''/oracle/app/oracle/oradata/ORCL2/control02.ctl'' comment= '''' scope=spfile

sql statement: alter system set  log_archive_dest_1 =  ''location=/oracle/archive2'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    3690983864 bytes

Fixed Size                     8946104 bytes
Variable Size                721420288 bytes
Database Buffers            2952790016 bytes
Redo Buffers                   7827456 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''ORCL'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name = 
 ''ORCL2'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone from service  'ORCL' primary controlfile;
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''ORCL2'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area    3690983864 bytes

Fixed Size                     8946104 bytes
Variable Size                721420288 bytes
Database Buffers            2952790016 bytes
Redo Buffers                   7827456 bytes

Starting restore at 20-AUG-24
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=7 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service ORCL
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/oracle/app/oracle/oradata/ORCL2/control01.ctl
output file name=/oracle/app/oracle/oradata/ORCL2/control02.ctl
Finished restore at 20-AUG-24

database mounted

contents of Memory Script:
{
   set newname for datafile  1 to 
 "/oracle/app/oracle/oradata/ORCL2/system01.dbf";
   set newname for datafile  2 to 
 "/oracle/app/oracle/oradata/ORCL2/sysaux01.dbf";
   set newname for datafile  3 to 
 "/oracle/app/oracle/oradata/ORCL2/undotbs01.dbf";
   set newname for datafile  4 to 
 "/oracle/app/oracle/oradata/ORCL2/users01.dbf";
   restore
   from  nonsparse   from service 
 'ORCL'   clone database
   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 20-AUG-24
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 ORCL
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /oracle/app/oracle/oradata/ORCL2/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service ORCL
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00002 to /oracle/app/oracle/oradata/ORCL2/sysaux01.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 ORCL
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /oracle/app/oracle/oradata/ORCL2/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 ORCL
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /oracle/app/oracle/oradata/ORCL2/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 20-AUG-24

sql statement: alter system archive log current
current log archived

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

Starting restore at 20-AUG-24
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 ORCL
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=36
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service ORCL
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=37
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 20-AUG-24

datafile 1 switched to datafile copy
input datafile copy RECID=5 STAMP=1177516834 file name=/oracle/app/oracle/oradata/ORCL2/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=6 STAMP=1177516834 file name=/oracle/app/oracle/oradata/ORCL2/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=7 STAMP=1177516834 file name=/oracle/app/oracle/oradata/ORCL2/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=8 STAMP=1177516834 file name=/oracle/app/oracle/oradata/ORCL2/users01.dbf

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

executing command: SET until clause

Starting recover at 20-AUG-24
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 36 is already on disk as file /oracle/archive2/arch_1_1151767787_36.arc
archived log for thread 1 with sequence 37 is already on disk as file /oracle/archive2/arch_1_1151767787_37.arc
archived log file name=/oracle/archive2/arch_1_1151767787_36.arc thread=1 sequence=36
archived log file name=/oracle/archive2/arch_1_1151767787_37.arc thread=1 sequence=37
media recovery complete, elapsed time: 00:00:00
Finished recover at 20-AUG-24

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

released channel: ORA_AUX_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=80 device type=DISK
deleted archived log
archived log file name=/oracle/archive2/arch_1_1151767787_36.arc RECID=1 STAMP=1177516832
deleted archived log
archived log file name=/oracle/archive2/arch_1_1151767787_37.arc RECID=2 STAMP=1177516833
Deleted 2 objects

Oracle instance started

Total System Global Area    3690983864 bytes

Fixed Size                     8946104 bytes
Variable Size                721420288 bytes
Database Buffers            2952790016 bytes
Redo Buffers                   7827456 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''ORCL2'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
}
executing Memory Script

sql statement: alter system set  db_name =  ''ORCL2'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile
Oracle instance started

Total System Global Area    3690983864 bytes

Fixed Size                     8946104 bytes
Variable Size                721420288 bytes
Database Buffers            2952790016 bytes
Redo Buffers                   7827456 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORCL2" RESETLOGS ARCHIVELOG 
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP     1 ( '/oracle/app/oracle/oradata/ORCL2/redo01.log' ) SIZE 200 M  REUSE,
  GROUP     2 ( '/oracle/app/oracle/oradata/ORCL2/redo02.log' ) SIZE 200 M  REUSE,
  GROUP     3 ( '/oracle/app/oracle/oradata/ORCL2/redo03.log' ) SIZE 200 M  REUSE
 DATAFILE
  '/oracle/app/oracle/oradata/ORCL2/system01.dbf'
 CHARACTER SET AL32UTF8


contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/oracle/app/oracle/oradata/ORCL2/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/oracle/app/oracle/oradata/ORCL2/sysaux01.dbf", 
 "/oracle/app/oracle/oradata/ORCL2/undotbs01.dbf", 
 "/oracle/app/oracle/oradata/ORCL2/users01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /oracle/app/oracle/oradata/ORCL2/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/oracle/app/oracle/oradata/ORCL2/sysaux01.dbf RECID=1 STAMP=1177516866
cataloged datafile copy
datafile copy file name=/oracle/app/oracle/oradata/ORCL2/undotbs01.dbf RECID=2 STAMP=1177516866
cataloged datafile copy
datafile copy file name=/oracle/app/oracle/oradata/ORCL2/users01.dbf RECID=3 STAMP=1177516866

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=1177516866 file name=/oracle/app/oracle/oradata/ORCL2/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=1177516866 file name=/oracle/app/oracle/oradata/ORCL2/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=1177516866 file name=/oracle/app/oracle/oradata/ORCL2/users01.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 20-AUG-24

RMAN>

복제 완료 !!

- 테스트후 ORCL2 drop

export ORACLE_SID=ORCL2
sqlplus "/as sysdba"

shutdown immediate
startup mount exclusive restrict;
drop database;

- 만일 이짓거리를 반복적으로 수행하고자 한다면..

1. vi dup.sql

DUPLICATE DATABASE TO ORCL2
FROM ACTIVE DATABASE
SPFILE
parameter_value_convert ('ORCL','ORCL2')
set db_file_name_convert='/oracle/app/oracle/oradata/ORCL/','/oracle/app/oracle/oradata/ORCL2/'
set log_file_name_convert='/oracle/app/oracle/oradata/ORCL/','/oracle/app/oracle/oradata/ORCL2/'
set control_files='/oracle/app/oracle/oradata/ORCL2/control01.ctl','/oracle/app/oracle/oradata/ORCL2/control02.ctl'
set log_archive_dest_1='location=/oracle/archive2'
;


2. vi dup.sh
export ORACLE_SID=ORCL2
sqlplus / as sysdba <<EOF
shutdown immediate;
startup mount exclusive restrict;
drop database;
EOF
export ORACLE_SID=ORCL2
sqlplus / as sysdba <<EOF
startup nomount pfile='/oracle/app/oracle/product/19.0.0/dbs/initORCL2.ora';
! rman target sys/oracle@ORCL auxiliary sys/oracle@ORCL2 cmdfile=/home/oracle/dup.sql log=/home/oracle/dup.log append
exit
EOF

3. crontab 등록해서 원하는 주기로 반복 사용 가능
00 23 * * * /home/oracle/dup.sh

Posted by pat98

2024. 8. 12. 13:34 오라클

Oracle 23ai RAC 설치


귀찮아서 미뤄 두었던 23ai RAC 를설치해 보았다. Single 설치에 이은 2탄이라고나 할까? 

단, Exadata 용 설치 binary 이기 때문에 운영 용도로 성급히 사용해서는 절대 안된다. 반드시 반드시 테스트 용도로만 사용해 볼것!!!

 

1. Oracle Grid Infrastructure S/W 설치

- Directory 사전 생성
mkdir -p /u01/app/23.0.0.0/grid
chown -R oracle:dba /u01


1. 설치파일을 FTP로 해당서버에 upload
LINUX.X64_235000_forEngineeredSytems_grid_home.zip (Size 2.8G)
 
2. 설치이미지 압축해제 (반드시 $GI_HOME 밑에 압축해제 해야 함)
unzip LINUX.X64_235000_forEngineeredSytems_grid_home.zip -d $GI_HOME
 
3. gridSetup.sh실행

xhost +
su – oracle
export DISPLAY=작업PC IP:0.0
cd $GI_HOME
./ gridSetup.sh 실행
 

[Configure Oracle Grid Infrastructure for a New Cluster 선택후, Next]

[Configure Clusterto manage Oracle RAC databases, Next]

[Cluster Name, SCAN Name 지정후, Next]

[add 버튼으로 rac2노드 추가 후 passwordless ssh , Next]

[Network Interface 지정 후, Next]

[Use Oracle Flex ASM for storage 선택 후, Next]

[VOTE 디스크 지정 후, Next] 

여기서는 HIGH로 구성함

[비밀번호 지정 후, Next]

[Enable Automatic Self Correction uncheck, Next]

[Do not use IPMI , Next]

[EM 미구성, Next]

[dba 그룹지정후, Next]

[GI Base 지정 후, Next]

[Inventory 지정후, Next]

[자동 스크립트 uncheck, Next]

[Fixup  Ignore All check , Next]

[rsp 파일 저장후, Install Click] 

[화면의 내용대로 반드시 노드별 순서대로 스크립트 실행]


orainstRoot.sh 수행 (모든 노드 수행)

 

1번노드에서 수행
root@rose1:/root# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
 
Changing groupname of /u01/app/oraInventory to dba.
The execution of the script is complete.


2번노드에서 수행
root@rose2:/root# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
 
Changing groupname of /u01/app/oraInventory to dba.
The execution of the script is complete.
 
1번노드에서 수행
root@rose1:/root# /u01/app/23.0.0.0/grid/root.sh
Performing root user operation.
 
The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/23.0.0.0/grid
 
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
 
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
RAC option enabled on: Linux
Executing command '/u01/app/23.0.0.0/grid/perl/bin/perl -I/u01/app/23.0.0.0/grid/perl/lib -I/u01/app/23.0.0.0/grid/crs/install /u01/app/23.0.0.0/grid/crs/install/rootcrs.pl '
Using configuration parameter file: /u01/app/23.0.0.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/oracle/crsdata/rose1/crsconfig/rootcrs_rose1_2024-08-07_03-50-49PM.log
2024/08/07 15:50:56 CLSRSC-594: Executing installation step 1 of 19: 'ValidateEnv'.
2024/08/07 15:50:56 CLSRSC-594: Executing installation step 2 of 19: 'CheckRootCert'.
2024/08/07 15:50:57 CLSRSC-594: Executing installation step 3 of 19: 'GenSiteGUIDs'.
2024/08/07 15:50:59 CLSRSC-594: Executing installation step 4 of 19: 'SetupOSD'.
2024/08/07 15:50:59 CLSRSC-594: Executing installation step 5 of 19: 'CheckCRSConfig'.
2024/08/07 15:51:00 CLSRSC-594: Executing installation step 6 of 19: 'SetupLocalGPNP'.
2024/08/07 15:51:01 CLSRSC-594: Executing installation step 7 of 19: 'CreateRootCert'.
2024/08/07 15:51:02 CLSRSC-594: Executing installation step 8 of 19: 'ConfigOLR'.
2024/08/07 15:51:02 CLSRSC-594: Executing installation step 9 of 19: 'ConfigCHMOS'.
2024/08/07 15:51:02 CLSRSC-594: Executing installation step 10 of 19: 'CreateOHASD'.
2024/08/07 15:51:03 CLSRSC-594: Executing installation step 11 of 19: 'ConfigOHASD'.
2024/08/07 15:51:13 CLSRSC-594: Executing installation step 12 of 19: 'SetupTFA'.
2024/08/07 15:51:13 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2024/08/07 15:51:13 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
2024/08/07 15:51:16 CLSRSC-594: Executing installation step 15 of 19: 'CheckFirstNode'.
2024/08/07 15:51:17 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.
2024/08/07 15:51:21 CLSRSC-4002: Successfully installed Oracle Autonomous Health Framework (AHF).
CRS-4256: Updating the profile
Successful addition of voting disk 70302270ae374f52bfdb52dce11423c6.
Successful addition of voting disk 853b00134e034fcebf88f25576fa2a80.
Successful addition of voting disk 7578baed74b14fd6bfcdf937816cc086.
Successful addition of voting disk def894b31fa94f55bf82a38e52a1eedf.
Successful addition of voting disk 31929cd8f29d4f0ebf1b91a21ee27fa6.
Successfully replaced voting disk group with +VOTE.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   70302270ae374f52bfdb52dce11423c6 (/dev/VOTE1) [VOTE]
 2. ONLINE   853b00134e034fcebf88f25576fa2a80 (/dev/VOTE2) [VOTE]
 3. ONLINE   7578baed74b14fd6bfcdf937816cc086 (/dev/VOTE3) [VOTE]
 4. ONLINE   def894b31fa94f55bf82a38e52a1eedf (/dev/VOTE4) [VOTE]
 5. ONLINE   31929cd8f29d4f0ebf1b91a21ee27fa6 (/dev/VOTE5) [VOTE]
Located 5 voting disk(s).
2024/08/07 15:52:29 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2024/08/07 15:52:57 CLSRSC-343: Successfully started Oracle Clusterware stack
2024/08/07 15:53:03 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
clscfg: EXISTING configuration version 23 detected.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
2024/08/07 15:53:41 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2024/08/07 15:54:13 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
 
2번노드에서 수행
root@rose2:/root#  /u01/app/23.0.0.0/grid/root.sh
Performing root user operation.
 
The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/23.0.0.0/grid
 
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
 
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
RAC option enabled on: Linux
Executing command '/u01/app/23.0.0.0/grid/perl/bin/perl -I/u01/app/23.0.0.0/grid/perl/lib -I/u01/app/23.0.0.0/grid/crs/install /u01/app/23.0.0.0/grid/crs/install/rootcrs.pl '
Using configuration parameter file: /u01/app/23.0.0.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/oracle/crsdata/rose2/crsconfig/rootcrs_rose2_2024-08-07_04-54-49PM.log
2024/08/07 16:54:56 CLSRSC-594: Executing installation step 1 of 19: 'ValidateEnv'.
2024/08/07 16:54:56 CLSRSC-594: Executing installation step 2 of 19: 'CheckRootCert'.
2024/08/07 16:54:57 CLSRSC-594: Executing installation step 3 of 19: 'GenSiteGUIDs'.
2024/08/07 16:54:57 CLSRSC-594: Executing installation step 4 of 19: 'SetupOSD'.
2024/08/07 16:54:57 CLSRSC-594: Executing installation step 5 of 19: 'CheckCRSConfig'.
2024/08/07 16:54:58 CLSRSC-594: Executing installation step 6 of 19: 'SetupLocalGPNP'.
2024/08/07 16:54:58 CLSRSC-594: Executing installation step 7 of 19: 'CreateRootCert'.
2024/08/07 16:54:58 CLSRSC-594: Executing installation step 8 of 19: 'ConfigOLR'.
2024/08/07 16:54:59 CLSRSC-594: Executing installation step 9 of 19: 'ConfigCHMOS'.
2024/08/07 16:54:59 CLSRSC-594: Executing installation step 10 of 19: 'CreateOHASD'.
2024/08/07 16:55:00 CLSRSC-594: Executing installation step 11 of 19: 'ConfigOHASD'.
2024/08/07 16:55:06 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2024/08/07 16:55:15 CLSRSC-594: Executing installation step 12 of 19: 'SetupTFA'.
2024/08/07 16:55:15 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2024/08/07 16:55:15 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
2024/08/07 16:55:19 CLSRSC-594: Executing installation step 15 of 19: 'CheckFirstNode'.
2024/08/07 16:55:19 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.
2024/08/07 16:55:21 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2024/08/07 16:56:15 CLSRSC-4002: Successfully installed Oracle Autonomous Health Framework (AHF).
2024/08/07 16:57:25 CLSRSC-343: Successfully started Oracle Clusterware stack
2024/08/07 16:57:25 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2024/08/07 16:57:25 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2024/08/07 16:57:43 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
 
 양 노드에서 root.sh가 완료되어 OK 하면 후속작업이 진행되고 완료된다.

[설치완료]
 

- crs 상태확인

root@rose1:/root# crsctl stat res -t

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

Name           Target  State        Server                   State details      

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

Local Resources

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

ora.LISTENER.lsnr

               ONLINE  ONLINE       rose1                    STABLE

               ONLINE  ONLINE       rose2                    STABLE

ora.chad

               ONLINE  ONLINE       rose1                    STABLE

               ONLINE  ONLINE       rose2                    STABLE

ora.cvuadmin

               OFFLINE OFFLINE      rose1                    STABLE

               OFFLINE OFFLINE      rose2                    STABLE

ora.helper

               OFFLINE OFFLINE      rose1                    STABLE

               OFFLINE OFFLINE      rose2                    IDLE,STABLE

ora.net1.network

               ONLINE  ONLINE       rose1                    STABLE

               ONLINE  ONLINE       rose2                    STABLE

ora.ons

               ONLINE  ONLINE       rose1                    STABLE

               ONLINE  ONLINE       rose2                    STABLE

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

Cluster Resources

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

ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)

      1        ONLINE  ONLINE       rose1                    STABLE

      2        ONLINE  ONLINE       rose2                    STABLE

ora.LISTENER_SCAN1.lsnr

      1        ONLINE  ONLINE       rose1                    STABLE

ora.VOTE.dg(ora.asmgroup)

      1        ONLINE  ONLINE       rose1                    STABLE

      2        OFFLINE OFFLINE                               STABLE

ora.asm(ora.asmgroup)

      1        ONLINE  ONLINE       rose1                    Started,STABLE

      2        ONLINE  ONLINE       rose2                    Started,STABLE

ora.asmnet1.asmnetwork(ora.asmgroup)

      1        ONLINE  ONLINE       rose1                    STABLE

      2        ONLINE  ONLINE       rose2                    STABLE

ora.cdp1.cdp

      1        ONLINE  ONLINE       rose1                    STABLE

ora.cvu

      1        ONLINE  ONLINE       rose1                    STABLE

ora.rhpserver

      1        OFFLINE OFFLINE                               STABLE

ora.rose1.vip

      1        ONLINE  ONLINE       rose1                    STABLE

ora.rose2.vip

      1        ONLINE  ONLINE       rose2                    STABLE

ora.scan1.vip

      1        ONLINE  ONLINE       rose1                    STABLE

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

root@rose1:/root# crsctl stat res -t -init

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

Name           Target  State        Server                   State details      

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

Cluster Resources

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

ora.asm

      1        ONLINE  ONLINE       rose1                    Started,STABLE

ora.cluster_interconnect.haip

      1        ONLINE  ONLINE       rose1                    STABLE

ora.crf

      1        ONLINE  ONLINE       rose1                    STABLE

ora.crsd

      1        ONLINE  ONLINE       rose1                    STABLE

ora.cssd

      1        ONLINE  ONLINE       rose1                    STABLE

ora.cssdmonitor

      1        ONLINE  ONLINE       rose1                    STABLE

ora.diskmon

      1        OFFLINE OFFLINE                               STABLE

ora.evmd

      1        ONLINE  ONLINE       rose1                    STABLE

ora.gipcd

      1        ONLINE  ONLINE       rose1                    STABLE

ora.gpnpd

      1        ONLINE  ONLINE       rose1                    STABLE

ora.mdnsd

      1        ONLINE  ONLINE       rose1                    STABLE

ora.storage

      1        ONLINE  ONLINE       rose1                    STABLE

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

 

2. ASMCA 이용 추가 Diskgroup 생성

- Diskgroup 생성전 asm_diskstring 추가작업
 
root@rose1:/root# su - oracle
[ROSE1]oracle@rose1:/home/oracle# . oraenv
ORACLE_SID = [ROSE1] ? +ASM1
ORACLE_HOME = [/home/oracle] ? /u01/app/23.0.0.0/grid
The Oracle base remains unchanged with value /u01/app/oracle
[+ASM1]oracle@rose1:/home/oracle# sa
 
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Thu Aug 8 09:03:08 2024
Version 23.5.0.24.07
 Copyright (c) 1982, 2024, Oracle.  All rights reserved.
Connected to:
Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
Version 23.5.0.24.07
 
SQL> alter system set asm_diskstring='/dev/VOTE*','/dev/DATA*','/dev/RECO*';
System altered.
 
export DISPLAY=작업PC IP:0.0
 ./asmca

[왼쪽메뉴 Disk Groups 선택, Create Click]
[DATA 디스크 그룹지정, External 선택후 OK]
[RECO 디스크 그룹지정, External 선택후 OK]
[생성된 Diskgroup 확인후 Exit]

3. Oracle Database S/W 설치

- Directory 사전 생성
mkdir -p /u01/app/oracle/product/23.0.0.0/dbhome_1
chown -R oracle:dba /u01
chmod -R 755 /u01
 
1. 설치파일을 FTP로 해당서버에upload
LINUX.X64_235000_forEngineeredSystems_db_home.zip (Size 2.1G)
 
2. 설치이미지 압축해제 (반드시 $ORACLE_HOME 밑에 압축해제 해야 함)
LINUX.X64_235000_forEngineeredSystems_db_home.zip -d $ORACLE_HOME
 
3. runInstaller실행
xhost +
su – oracle
export DISPLAY=작업PC IP:0.0
cd $ORACLE_HOME
./runInstaller 실행
 

[Set Up RAC Software Only 지정 후, Next]

[Oralcle Real Application Clusters 선택후 Next]

[노드 지정후, Next]

[Enterprise Edition 지정 후, Next]

[Oracle base 지정 후, Next]

[그룹 지정 후, Next]

[Automatically run configuration scripts 선택하지 않는다, Next]

[Ignore all 체크후, Next]

[Summary 확인후, Install]

[설치 진행이 완료되면 화면의 script 를 순서대로 실행]


[root@rose1]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
 
Changing groupname of /u01/app/oraInventory to dba.
The execution of the script is complete.
 
[root@rose1]# /u01/app/oracle/product/23.0.0.0/dbhome_1/root.sh
Performing root user operation.
 
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME=  /u01/app/oracle/product/23.0.0.0/dbhome_1
 
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
 
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
 
2번도 동일하게 수행후 OK 

[Database S/W 설치완료]

4. Netca 이용 리스너 생성

GRID 설치시 구성되어 있으므로 생략 

 

5. DBCA 이용 Database 생성

export DISPLAY=작업PC IP:0.0
cd $ORACLE_HOME/bin
./dbca
 

[Create Database 선택 후, Next]

[Advanced configuration선택 후, Next]

[Custom Database 선택 후, Next]

[노드 지정 후, Next]

[db name/SID 지정, PDB 이름 지정 (252개까지 가능) , Next]

[Datafile 저장경로 설정 후, Next]

[Fast Recovery Area / 아카이브 경로 설정, Next]

[설치할 component 확인 후, Next]

[Character sets 확인 후, Next]

[EM Uncheck , Next]

[SYS, SYSTEM password 설정 후, Next]

[Generate database creation scripts Check, Next]

[Prerequisite Check 진행, Ignore All 선택후, Next]

[Summary 확인후, Finish] 

[스크립트만 생성후, Close]
 


- Exadata version이기 때문에 engine설치는 잘 되지만 dbca생성시 아래와 같은 Error발 생합니다. (ORA-27350, ORA-01034) 

 

This version of the Oracle Database software cannot be run on this platform.

 

해결방법은 silentDatabase생성하여야 하며 아래와 같은 script 수정하여 dbca 돌리시면 됩니다.


우선 GUI dbca실행하여 script만 받아낸 후에…

[ROSEC1]oracle@rose1:/u01/app/oracle/admin/ROSEC/scripts# ls -al
total 97272
drwxr-x--- 2 oracle dba4096 Aug8 12:27 .
drwxr-x--- 7 oracle dba79 Aug8 10:42 ..
-rw-r----- 1 oracle dba849 Aug8 10:18 CreateClustDBViews.sql
-rw-r----- 1 oracle dba1948 Aug8 10:18 CreateDBCatalog.sql
-rw-r----- 1 oracle dba459 Aug8 10:18 CreateDBFiles.sql
-rw-r----- 1 oracle dba1201 Aug8 10:18 CreateDB.sql
-rw-r----- 1 oracle dba2512 Aug8 12:22 init.ora
-rw-r----- 1 oracle dba1758 Aug8 10:18 lockAccount.sql
-rw-r----- 1 oracle dba92 Aug8 10:18 mkDir.sql
-rw-r----- 1 oracle dba92 Aug8 10:18 PDBCreation.sql
-rw-r----- 1 oracle dba1591 Aug8 10:18 plug_ROSEP1.sql
-rw-r----- 1 oracle dba1266 Aug8 10:18 postDBCreation.sql
-rw-r----- 1 oracle dba1586 Aug8 10:18 postPDBCreation_ROSEP1.sql
-rwxr-x--- 1 oracle dba1131 Aug8 10:18 ROSEC1.sh
-rw-r----- 1 oracle dba      1314 Aug  8 10:18 ROSEC1.sql

 

vi init.ora

_exadata_feature_on=true   <--- 마지막 줄에 해당 hidden 추가후 저장


ROSEC1.sh실행하면 됨.

 

6. 설치완료후 확인

1번 노드
root@rose1:/root# crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details      
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       rose1                    STABLE
               ONLINE  ONLINE       rose2                    STABLE
ora.chad
               ONLINE  ONLINE       rose1                    STABLE
               ONLINE  ONLINE       rose2                    STABLE
ora.cvuadmin
               OFFLINE OFFLINE      rose1                    STABLE
               OFFLINE OFFLINE      rose2                    STABLE
ora.helper
               OFFLINE OFFLINE      rose1                    IDLE,STABLE
               OFFLINE OFFLINE      rose2                    IDLE,STABLE
ora.net1.network
               ONLINE  ONLINE       rose1                    STABLE
               ONLINE  ONLINE       rose2                    STABLE
ora.ons
               ONLINE  ONLINE       rose1                    STABLE
               ONLINE  ONLINE       rose2                    STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       rose1                    STABLE
      2        ONLINE  ONLINE       rose2                    STABLE
ora.DATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       rose1                    STABLE
      2        ONLINE  ONLINE       rose2                    STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rose1                    STABLE
ora.RECO.dg(ora.asmgroup)
      1        ONLINE  ONLINE       rose1                    STABLE
      2        ONLINE  ONLINE       rose2                    STABLE
ora.VOTE.dg(ora.asmgroup)
      1        ONLINE  ONLINE       rose1                    STABLE
      2        ONLINE  ONLINE       rose2                    STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       rose1                    Started,STABLE
      2        ONLINE  ONLINE       rose2                    Started,STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       rose1                    STABLE
      2        ONLINE  ONLINE       rose2                    STABLE
ora.cdp1.cdp
      1        ONLINE  ONLINE       rose1                    STABLE
ora.cvu
      1        ONLINE  ONLINE       rose1                    STABLE
ora.rhpserver
      1        OFFLINE OFFLINE                               STABLE
ora.rose1.vip
      1        ONLINE  ONLINE       rose1                    STABLE
ora.rose2.vip
      1        ONLINE  ONLINE       rose2                    STABLE
ora.rosec.db
      1        ONLINE  ONLINE       rose1                    Open,HOME=/u01/app/o
                                                             racle/product/23.0.0
                                                             .0/dbhome_1,STABLE
      2        ONLINE  ONLINE       rose2                    Open,HOME=/u01/app/o
                                                             racle/product/23.0.0
                                                             .0/dbhome_1,STABLE
ora.rosec.rosep1.pdb
      1        ONLINE  ONLINE       rose1                    READ WRITE,STABLE
      2        ONLINE  ONLINE       rose2                    READ WRITE,STABLE
ora.scan1.vip

      1        ONLINE  ONLINE       rose1                    STABLE

 
2번 노드
root@rose2:/root# crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details      
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       rose1                    STABLE
               ONLINE  ONLINE       rose2                    STABLE
ora.chad
               ONLINE  ONLINE       rose1                    STABLE
               ONLINE  ONLINE       rose2                    STABLE
ora.cvuadmin
               OFFLINE OFFLINE      rose1                    STABLE
               OFFLINE OFFLINE      rose2                    STABLE
ora.helper
               OFFLINE OFFLINE      rose1                    IDLE,STABLE
               OFFLINE OFFLINE      rose2                    IDLE,STABLE
ora.net1.network
               ONLINE  ONLINE       rose1                    STABLE
               ONLINE  ONLINE       rose2                    STABLE
ora.ons
               ONLINE  ONLINE       rose1                    STABLE
               ONLINE  ONLINE       rose2                    STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       rose1                    STABLE
      2        ONLINE  ONLINE       rose2                    STABLE
ora.DATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       rose1                    STABLE
      2        ONLINE  ONLINE       rose2                    STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rose1                    STABLE
ora.RECO.dg(ora.asmgroup)
      1        ONLINE  ONLINE       rose1                    STABLE
      2        ONLINE  ONLINE       rose2                    STABLE
ora.VOTE.dg(ora.asmgroup)
      1        ONLINE  ONLINE       rose1                    STABLE
      2        ONLINE  ONLINE       rose2                    STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       rose1                    Started,STABLE
      2        ONLINE  ONLINE       rose2                    Started,STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       rose1                    STABLE
      2        ONLINE  ONLINE       rose2                    STABLE
ora.cdp1.cdp
      1        ONLINE  ONLINE       rose1                    STABLE
ora.cvu
      1        ONLINE  ONLINE       rose1                    STABLE
ora.rhpserver
      1        OFFLINE OFFLINE                               STABLE
ora.rose1.vip
      1        ONLINE  ONLINE       rose1                    STABLE
ora.rose2.vip
      1        ONLINE  ONLINE       rose2                    STABLE
ora.rosec.db
      1        ONLINE  ONLINE       rose1                    Open,HOME=/u01/app/o
                                                             racle/product/23.0.0
                                                             .0/dbhome_1,STABLE
      2        ONLINE  ONLINE       rose2                    Open,HOME=/u01/app/o
                                                             racle/product/23.0.0
                                                             .0/dbhome_1,STABLE
ora.rosec.rosep1.pdb
      1        ONLINE  ONLINE       rose1                    READ WRITE,STABLE
      2        ONLINE  ONLINE       rose2                    READ WRITE,STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       rose1                    STABLE
--------------------------------------------------------------------------------

Posted by pat98

2024. 8. 1. 22:50 오라클

Oracle 23ai 설치


 

 

현재 23ai 버전은 클라우드에서만 정식 release 되어 사용가능하고 on-premise 버전은 release 되지 않았다. (아마 9월에 있을  2024년 Oracle Cloud World 할때 래리 앨리슨이 짜잔~~ 하면서 발표하지 않을까 조심스럽게 예상)

 

free developer 버전이 있지만 뭔가 아쉽고..

 

마침 7월22일부터  Exadata 용 23ai 버전을 edelivery.oracle.com 을 download 받을수 있어 설치해 보고 기록을 남기고자 한다. 설치과정 자체는 이전버전과 거의 같아서 사실 별거 없다..RAC 는 귀찮아서 나중에 해보도록 하겠다.

 

단, Exadata 용 설치 binary 이기 때문에 운영 용도로 성급히 사용해서는 절대 안된다. 반드시 반드시 테스트 용도로만 사용해 볼것!!!

 

- https://edelivery.oracle.com 으로 가서 설치 화일을 다운 받는다.

 

edelivery.oracle.com

 

1. 설치파일을 FTP로 해당서버에 upload
LINUX.X64_235000_forEngineeredSystems_db_home .zip (Size 2.1G)

 

2. mkdir -p /u01/app/oracle/product/23.0.0.0/dbhome_1

   chown -R oracle:dba /u01


3. 설치이미지 압축해제 (반드시 $ORACLE_HOME 밑에 압축해제 해야 함)
unzip LINUX.X64_235000_forEngineeredSystems_db_home .zip -d $ORACLE_HOME


4. runInstaller실행
xhost +
su – oracle
export DISPLAY=작업PC IP:0.0
cd $ORACLE_HOME
./runInstaller 실행

[Set Up Software Only 지정 후, Next]

 

[Single instance database installation지정 후, Next]

 

[Enterprise Edition 지정 후, Next]

 

[Oracle base 지정 후, Next]

 

[Inventory 지정 후, Next]

 

[그룹 지정 후, Next]

 

[Automatically run configuration scripts 선택하지 않는다, Next]

 

[Ignore all 체크후, Next]

 

[설치 진행이 완료되면 화면의 script 를 순서대로 실행]

 

[root@23ai ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to dba.
The execution of the script is complete.

[root@23ai ~]# /u01/app/oracle/product/23.0.0.0/dbhome_1/root.sh
Performing root user operation.

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/23.0.0.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...

Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

[Database S/W 설치완료]


5. Netca 이용 리스너 생성
cd $ORACLE_HOME/bin
./netca

[Listener configuration 지정 후, Next]

 

[Add 지정 후, Next]

 

[Listener name지정 후, Next]

 

[Protocol 지정 후, Next]

 

[Port 지정 후, Next]

 

[No 지정 후, Next]

 

[Next]

 

[Finish]


6. DBCA 이용 Database 생성 <--- 단 여기서 Exadata 용 Binary 이므로 마지막에 Error 가 난다. 해결방법도 기술한다.
export DISPLAY=작업PC IP:0.0
cd $ORACLE_HOME/bin
./dbca

[Create Database 선택 후, Next]

 

[Advanced configuration선택 후, Next]

 

[Custom Database 선택 후, Next]

 

[db name/SID 지정, PDB 이름 지정 (252개까지 가능) 후, Next]

 

[Datafile 저장경로 설정 후, Next]

 

[Fast Recovery Area / 아카이브 경로 설정, Next]

 

[리스너 지정 후, Next]

 

[Component 확인 후, Next]

 

[Character sets 확인 후, Next]

 

[EM Uncheck 후, Next]

 

[SYS, SYSTEM password 설정 후, Next]

 

[Generate database creation scripts 체크후 , Next]

 

[Summary 확인후, Finish]

 

[Database 생성 진행]

On-premise 정식버전이면 에러 안 뿜겠지만 이 단계 이후 진행하면 DB생성 진행중

ORA-27350: This version of the Oracle Database software cannot be run on this platform

메세지와 함께 더 이상 설치를 진행할수 없다.

 

- 해결방법- 

GUI 로는 설치를 마무리 할수 없고 Silent mode 를 써서 아름답게 마무리 하자.

DB생성 12 step 에서 생성된 scripts 의 directory 로 간다.

cd /u01/app/oracle/admin/CDB1/scripts

 vi init.ora

_exadata_feature_on=true   <--- 마지막 줄에 해당 hidden 추가후 저장

 

[CDB1]oracle@23ai:/u01/app/oracle/admin/CDB1/scripts# ls -al

total 52

drwxr-x--- 2 oracle dba 4096 Jul 31 15:50 .

drwxr-x--- 6 oracle dba   66 Jul 31 15:07 ..

-rwxr-x--- 1 oracle dba  746 Jul 31 15:07 CDB1.sh

-rw-r----- 1 oracle dba  857 Jul 31 15:07 CDB1.sql

-rw-r----- 1 oracle dba  845 Jul 31 15:07 CreateClustDBViews.sql

-rw-r----- 1 oracle dba 1941 Jul 31 15:07 CreateDBCatalog.sql

-rw-r----- 1 oracle dba  383 Jul 31 15:07 CreateDBFiles.sql

-rw-r----- 1 oracle dba 1465 Jul 31 15:07 CreateDB.sql

-rw-r----- 1 oracle dba 2150 Jul 31 15:46 init.ora

-rw-r----- 1 oracle dba 1757 Jul 31 15:07 lockAccount.sql

-rw-r----- 1 oracle dba   91 Jul 31 15:07 PDBCreation.sql

-rw-r----- 1 oracle dba 1885 Jul 31 15:07 plug_PDB1.sql

-rw-r----- 1 oracle dba  879 Jul 31 15:07 postDBCreation.sql

-rw-r----- 1 oracle dba 1603 Jul 31 15:07 postPDBCreation_PDB1.sql

 

CDB1.sh 실행하면 됨. <---- 당연하게도 스크립트는 설정된 이름에 따라 다를수 있다.

 

text 모드로 쭈욱 진행되고 완료가 되면...

 

[CDB1]oracle@23ai:/home/oracle# ss

SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Thu Aug 1 22:48:48 2024
Version 23.5.0.24.07

Copyright (c) 1982, 2024, Oracle.  All rights reserved.
Connected to:
Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
Version 23.5.0.24.07

CDB$ROOT@CDB1> show pdbs

    CON_ID CON_NAME         OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                                 MOUNTED

 

- 설치 끝!!--

 

23ai 는 설치작업 보다는 새로이 적용된 기능 및 Architecture 자체를 이해하고 접근하는 것이 굉장히 중요한 버전이 되었다.

Posted by pat98

23ai pdb별 timezone 설정 테스트

 

23ai 부터는 생성된 PDB별로 timezone 을 개별로 설정할 수가 있게 되었다.

- 설정확인
Connected to:
Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
Version 23.5.0.24.07

SQL> show parameter time_at_dbtimezone
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
time_at_dbtimezone                   string      off

SQL> select name,ISPDB_MODIFIABLE from v$parameter where name='time_at_dbtimezone';
NAME                                     ISPDB
---------------------------------------- -----
time_at_dbtimezone                       TRUE


- 2개의 PDB가 있다고 가정
- 각각의 PDB에 접속하여 아래와 같이 변경

미국 LA
SQL>alter system set time_at_dbtimezone = 'DATABASE' scope=spfile;
SQL>alter database set time_zone='America/Los_Angeles';

한국 Seoul
SQL>alter system set time_at_dbtimezone = 'DATABASE' scope=spfile;
SQL>alter database set time_zone='Asia/Seoul';

- CDB에서 모든 PDB 재기동
SQL>alter pluggable database all close;
SQL>alter pluggable database all open;

- 각각의 PDB에 접속하여 아래와 같이 확인
show parameter time_at_dbtimezone
SELECT TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS') "NOW" FROM DUAL;

NOW
-------------------
2024-08-01 14:19:05

* value 값 참고

https://docs.oracle.com/en/database/oracle/oracle-database/23/refrn/TIME_AT_DBTIMEZONE.html#REFRN-GUID-493916F5-AFD7-4001-8FB4-02258E0AD595


OFF- 모든 시간 종속 작업의 경우 데이터베이스는 데이터베이스가 시작될 때 적용되었던 데이터베이스 호스트 시스템의 표준 시간대를 사용합니다. 이는 Oracle Database 23ai 이전 릴리스의 동작입니다.

USER_SQL- SQL 함수는 PDB 설정 에 따라 날짜와 시간을 반환합니다 SYSDATE. 다른 모든 시간 종속 작업의 경우 데이터베이스는 데이터베이스가 시작되었을 때 적용되었던 데이터베이스 호스트 시스템의 표준 시간대를 사용합니다. SYSTIMESTAMPDBTIMEZONE

DATABASE - 모든 시간 종속 작업에 대해 데이터베이스는 PDB 설정 에서 지정된 시간대를 사용합니다.

Posted by pat98

Critical Patch Update (CPU) Program Jul 2024 Patch Availability Document (DB-only) (Doc ID 3027813.1)

 

패치작업 19.24.0.0.240716 (GI PSU 36582629)

Database Patch Set Update : 19.24.0.0.240716 (36582781)
OCW Patch Set Update      : 19.24.0.0.240716 (36587798)
ACFS Patch Set Update     : 19.24.0.0.240716 (36590554)
Tomcat Release Update     : 19.0.0.0.0       (36648174)
DBWLM Release Update      : 19.0.0.0.0       (36758186)

Oracle Grid Infrastructure Patch Set Update 19.24.0.0.240716 
-------------------------------------
GI_HOME, ORACLE_HOME 을 개별로 각각 할때

- grid 유저
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/patch/36582629/36582781
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/patch/36582629/36587798
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/patch/36582629/36590554
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/patch/36582629/36758186
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/patch/36582629/36648174

- oracle 유저
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/patch/36582629/36582781
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/patch/36582629/36587798

(oracle)
$ <ORACLE_HOME>/bin/srvctl stop home -o <ORACLE_HOME> -s <status file location> -n <node name>

(root 유저)
export GI_HOME=/u01/app/19.0.0.0/grid
$GI_HOME/crs/install/rootcrs.sh -prepatch 

(grid 유저)
export GI_HOME=/u01/app/19.0.0.0/grid
cd /u01/patch
$GI_HOME/OPatch/opatch apply -oh $GI_HOME -local /u01/patch/36582629/36587798 -silent
$GI_HOME/OPatch/opatch apply -oh $GI_HOME -local /u01/patch/36582629/36590554 -silent
$GI_HOME/OPatch/opatch apply -oh $GI_HOME -local /u01/patch/36582629/36582781 -silent
$GI_HOME/OPatch/opatch apply -oh $GI_HOME -local /u01/patch/36582629/36758186 -silent
$GI_HOME/OPatch/opatch apply -oh $GI_HOME -local /u01/patch/36582629/36648174 -silent

(oracle 유저)
export ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
cd /u01/patch
./36582629 /36587798/custom/scripts/prepatch.sh -dbhome $ORACLE_HOME
$ORACLE_HOME/OPatch/opatch apply -oh $ORACLE_HOME -local /u01/patch/36582629/36587798 -silent
$ORACLE_HOME/OPatch/opatch apply -oh $ORACLE_HOME -local /u01/patch/36582629/36582781 -silent
./36582629 /36587798/custom/scripts/postpatch.sh -dbhome $ORACLE_HOME 

(root 유저)
export GI_HOME=/u01/app/19.0.0.0/grid
$GI_HOME/rdbms/install/rootadd_rdbms.sh
$GI_HOME/crs/install/rootcrs.sh -postpatch 

(oracle)
$ <ORACLE_HOME>/bin/srvctl start home -o <ORACLE_HOME> -s <status file location> -n <node name> 

- Loading Modified SQL Files into the Database
sqlplus /nolog
SQL> conect / as sysdba
SQL> startup
SQL> quit
cd $ORACLE_HOME/OPatch
./datapatch -verbose

### [롤백하는 경우] ###########

(oracle)
$ <ORACLE_HOME>/bin/srvctl stop home -o <ORACLE_HOME> -s <status file location> -n <node name>

GI Home
(root로)
$GI_HOME/crs/install/rootcrs.sh -prepatch -rollback

(grid 유저로)
export GI_HOME=/u01/app/19.0.0.0/grid
cd /u01/install
$GI_HOME/OPatch/opatch nrollback -local -id 36587798,36590554,36582781,36758186,36648174 -oh $GI_HOME -silent

(oracle 유저로)
export ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
cd /u01/install
./36582629 /36587798/custom/scripts/prepatch.sh -dbhome $ORACLE_HOME 
$ORACLE_HOME/OPatch/opatch nrollback -local -id 36587798,36582781 -oh /u01/app/oracle/product/19.0.0.0/dbhome_1 -silent
./36582629 /36587798/custom/scripts/postpatch.sh -dbhome $ORACLE_HOME

Run post script
(root로)
export GI_HOME=/u01/app/19.0.0.0/grid
$GI_HOME/rdbms/install/rootadd_rdbms.sh
$GI_HOME/crs/install/rootcrs.sh -postpatch -rollback

(oracle)
$ <ORACLE_HOME>/bin/srvctl start home -o <ORACLE_HOME> -s <status file location> -n <node name>

sqlplus /nolog
SQL> conect / as sysdba
SQL> startup
SQL> quit
cd $ORACLE_HOME/OPatch
./datapatch -verbose



Posted by pat98

19c CDB 환경에서 PDB로 접속하기 위해서는

 

1.CDB에 접속

2. SQL> alter session set container=PDB;

이런식으로 접속하곤 하는데 이것 마저 귀찮다면 환경변수 설정하고 바로 SYS나 SYSTEM 계정으로 PDB로 접속할수 있다. = bequeath connections

 

공식적인 방법은 아니다.

 

1. 우선 CDB 에 접속하여 아래와 같은 trigger 를 만들어 준다.

 

 SQL>CREATE OR REPLACE NONEDITIONABLE TRIGGER "SYS"."DBMS_SET_PDB" after logon on database

  WHEN (user = 'SYS' or user = 'SYSTEM') declare
  pdb_name varchar2(64);
  begin
  DBMS_SYSTEM.get_env ('ORACLE_PDB_SID', pdb_name);
  if(pdb_name is not null)
  then
  EXECUTE IMMEDIATE 'alter session set container = ' || pdb_name;
  end if;
  exception
  when others then
  NULL;
  end dbms_set_pdb;
  /
Trigger created.

 

2. 오라클 계정 .bash_profile 설정

 

CDB 이름은 CDB

PDB 이름은 PDB 라고 가정

 

export ORACLE_SID=CDB
export ORACLE_PDB_SID=PDB

 

:wq! 

 

저장후..

 

다시 접속

sqlplus "/as sysdba"

SQL> show user
USER is "SYS"

SQL> show con_name

CON_NAME
------------------------------
PDB

 

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 PDB                            READ WRITE NO

 

 

 

Posted by pat98

Database 생성후 instace 번호가 바뀌어 보일 때...

증상 : database 생성 완료 후 crsctl stat res -t 로 상태 확인 하였을시 1,2,3,4 로 순차적으로 보이는 것이 아닌 바뀌어서 보임.

  INST_ID INSTANCE_NUMBER INSTANCE_NAME HOST_NAME
---------- --------------- --------------------------------------------------
  1 1 RACDB1 RACNode1
  4 4 RACDB4 RACNode4
  3 3 RACDB3 RACNode3
  2 2 RACDB2 RACNode2
  
 원인 : 
 DBCA는 srvm api에서 검색한 노드를 기반으로 인스턴스를 생성하는 반면 노드 순서는 crs 노드에서 실행된 루트 스크립트의 순서에 따라 반환됨.
 이 특정 사례에서 인스턴스 이름이 노드 이름과 일치하더라도 crsctl 출력은 다른 순서로 나타나게 됨.
 
 결론 : 
 olsnodes -n -t 가 정상적이면 상관없기 때문에 expected behavior 임.

RACNode1   1       Unpinned
RACNode2   2       Unpinned
RACNode3   3       Unpinned
RACNode4   4       Unpinned
 
노든의 순서는 인스턴스 번호와 일치하지 않음.
인스턴스 이름이 노드 이름과 일치하더라도 crsctl 출력은 인스턴스마다 순서가 다를 수 있슴.

관련 MOS :
Database Instance Resources Sequence in "crsctl stat res -t" Output Mismatches With Output of "olsnodes -n" (Doc ID 1580894.1)

Posted by pat98

01-03 07:06
Flag Counter
Yesterday
Today
Total

글 보관함

최근에 올라온 글

달력

 « |  » 2025.1
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

최근에 달린 댓글