반응형
■ [2024-08-30] Oracle Linux 7.9 및 Oracle 12cR2 Restart 서버의 Hostname을 변경하는 절차

 

[2024-08-30] Oracle Linux 7.9 및 Oracle 12cR2 Restart 서버의 Hostname을 변경하는 절차

 

 

1. 호스트 네임 변경 전 시스템 정보 확인

 

[root@ol79o12cr2sa][/root]$ csrt
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       ol79o12cr2sa             STABLE
ora.FRA.dg
               ONLINE  ONLINE       ol79o12cr2sa             STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       ol79o12cr2sa             STABLE
ora.asm
               ONLINE  ONLINE       ol79o12cr2sa             Started,STABLE
ora.ons
               OFFLINE OFFLINE      ol79o12cr2sa             STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       ol79o12cr2sa             STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       ol79o12cr2sa             STABLE
ora.ptdb.db
      1        ONLINE  ONLINE       ol79o12cr2sa             Open,HOME=/u01/app/o
                                                             racle/product/12c/db
                                                             _1,STABLE
--------------------------------------------------------------------------------

 

[+ASM:grid@ol79o12cr2sa][/home/grid]$ lsnrctl status LISTENER

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 24-AUG-2024 20:04:25

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

Connectingto(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ol79o12cr2sa)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                24-AUG-2024 19:57:49
Uptime                    0 days 0 hr. 6 min. 36 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/12c/grid/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/ol79o12cr2sa/listener/alert/log.xml
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol79o12cr2sa)(PORT=1521)))
 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "+ASM_FRA" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "PTDB" has 1 instance(s).
  Instance "PTDB", status READY, has 1 handler(s) for this service...
Service "PTDBXDB" has 1 instance(s).
  Instance "PTDB", status READY, has 1 handler(s) for this service...
The command completed successfully

 

[PTDB:oracle@ol79o12cr2sa][/home/oracle]$ lsnrctl status LISTENER_PTDB

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 24-AUG-2024 20:05:03

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

Connectingto(ADDRESS=(PROTOCOL=TCP)(HOST=ol79o12cr2sa)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                24-AUG-2024 19:57:49
Uptime                    0 days 0 hr. 7 min. 14 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/12c/grid/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/ol79o12cr2sa/listener/alert/log.xml
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol79o12cr2sa)(PORT=1521)))
 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "+ASM_FRA" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "PTDB" has 1 instance(s).
  Instance "PTDB", status READY, has 1 handler(s) for this service...
Service "PTDBXDB" has 1 instance(s).
  Instance "PTDB", status READY, has 1 handler(s) for this service...
The command completed successfully

 

2. asm instance pfile 생성

[+ASM:grid@ol79o12cr2sa][/home/grid]$ cdod
[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/dbs]$ ls -l

total 12
-rw-rw----. 1 grid oinstall 1489 Aug 24 19:58 ab_+ASM.dat
-rw-rw----. 1 grid oinstall 1544 Aug 24 19:58 hc_+ASM.dat
-rw-r--r--. 1 grid oinstall 3079 May 15  2015 init.ora

 

--> ssa는 sqlplus "/as sysasm" 을 실행시키는 alias임

[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/dbs]$ ssa

SQL*Plus: Release 12.2.0.1.0 Production on Sat Aug 24 20:03:21 2024

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SYS@+ASM> show parameter spfile;

NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- ------------------------------
spfile                               string                            +DATA/ASM/ASMPARAMETERFILE/reg
                                                                       istry.253.1176718089

--> ASM 인스턴스의 spfile 확인

 

SYS@+ASM> create pfile from spfile;

File created.

Elapsed: 00:00:00.03
SYS@+ASM> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/dbs]$ ls -al
total 20
drwxr-xr-x.  2 grid oinstall   80 Aug 24 20:03 .
drwxr-x---. 85 root oinstall 4096 Aug 11 14:30 ..
-rw-rw----.  1 grid oinstall 1489 Aug 24 19:58 ab_+ASM.dat
-rw-rw----.  1 grid oinstall 1544 Aug 24 19:58 hc_+ASM.dat
-rw-r--r--.  1 grid oinstall  348 Aug 24 20:03 init+ASM.ora
-rw-r--r--.  1 grid oinstall 3079 May 15  2015 init.ora

 

[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/dbs]$ cat init+ASM.ora
+ASM.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from in memory value
*._enable_shared_pool_durations=FALSE
+ASM.asm_diskgroups='FRA'#Manual Mount
*.asm_diskstring='/dev/sd*'
*.asm_power_limit=1
*.audit_sys_operations=FALSE
*.large_pool_size=12M
*.memory_max_target=4294967296
*.memory_target=1610612736
*.remote_login_passwordfile='EXCLUSIVE'


3. oracle instance pfile 백업

--> ss는 sqlplus "/as sysdba" 를 실행시키는 alias임

[PTDB:oracle@ol79o12cr2sa][/home/oracle]$ ss

SQL*Plus: Release 12.2.0.1.0 Production on Sat Aug 24 20:27:24 2024

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SYS@PTDB> show parameter spfile;

NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- ------------------------------
spfile                               string                            +DATA/PTDB/PARAMETERFILE/spfil
                                                                       e.266.1176721075

SYS@PTDB> create pfile from spfile;

File created.

Elapsed: 00:00:00.03


[PTDB:oracle@ol79o12cr2sa][/home/oracle]$ cdod


[PTDB:oracle@ol79o12cr2sa][/u01/app/oracle/product/12c/db_1/dbs]$ ls -al
total 24
drwxr-xr-x.  2 oracle oinstall   92 Aug 24 19:58 .
drwxr-xr-x. 77 oracle oinstall 4096 Aug 11 14:37 ..
-rw-rw----.  1 oracle asmadmin 1544 Aug 24 19:58 hc_PTDB.dat
-rw-r--r--.  1 oracle oinstall 3079 May 15  2015 init.ora
-rw-r--r--.  1 oracle asmadmin 3721 Aug 24 20:27 initPTDB.ora
-rw-r-----.  1 oracle asmadmin   24 Aug 11 10:54 lkPTDB
-rw-r-----.  1 oracle oinstall 3584 Aug 11 10:56 orapwPTDB

--> spfile가지고 pfile을 생성해둠

 

[PTDB:oracle@ol79o12cr2sa][/u01/app/oracle/product/12c/db_1/dbs]$

 


4. has deconfig 작업

[root@ol79o12cr2sa][/root]$ $GRID_HOME/crs/install/roothas.sh -deconfig -force
Using configuration parameter file: /u01/app/12c/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/oracle/crsdata/ol79o12cr2sa/crsconfig/hadeconfig.log
2024/08/24 20:29:04 CLSRSC-332: CRS resources for listeners are still configured
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ol79o12cr2sa'
CRS-2673: Attempting to stop 'ora.ptdb.db' on 'ol79o12cr2sa'
CRS-2677: Stop of 'ora.ptdb.db' on 'ol79o12cr2sa' succeeded
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'ol79o12cr2sa'
CRS-2677: Stop of 'ora.FRA.dg' on 'ol79o12cr2sa' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'ol79o12cr2sa'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'ol79o12cr2sa'
CRS-2677: Stop of 'ora.DATA.dg' on 'ol79o12cr2sa' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'ol79o12cr2sa'
CRS-2677: Stop of 'ora.evmd' on 'ol79o12cr2sa' succeeded
CRS-2677: Stop of 'ora.asm' on 'ol79o12cr2sa' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'ol79o12cr2sa'
CRS-2677: Stop of 'ora.cssd' on 'ol79o12cr2sa' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ol79o12cr2sa' has completed
CRS-4133: Oracle High Availability Services has been stopped.
2024/08/24 20:29:41 CLSRSC-337: Successfully deconfigured Oracle Restart stack


5. hostname 변경

 

[root@ol79o12cr2sa][/root]$ hostnamectl set-hostname ptdb
[root@ol79o12cr2sa][/root]$ hostname
hostname
ptdb
--> 여기서 ssh 다시 접속

[root@ptdb][/root]$
--> ptdb로 인식함

 

[root@ptdb][/root]$ vi /etc/hosts
[root@ptdb][/root]$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

### Public IP
#192.168.0.61   ol79o12cr2sa
192.168.0.61    ptdb

--> ptdb로 변경

 

 

6. grid root.sh 실행

 

[root@ptdb][/root]$ cat $GRID_HOME/root.sh
#!/bin/sh
unset WAS_ROOTMACRO_CALL_MADE
. /u01/app/12c/grid/install/utl/rootmacro.sh "$@"
. /u01/app/12c/grid/install/utl/rootinstall.sh

#
# Root Actions related to network
#
/u01/app/12c/grid/network/install/sqlnet/setowner.sh

#
# Invoke standalone rootadd_rdbms.sh
#
/u01/app/12c/grid/rdbms/install/rootadd_rdbms.sh

/u01/app/12c/grid/rdbms/install/rootadd_filemap.sh
/u01/app/12c/grid/crs/config/rootconfig.sh $@
EXITCODE=$?
if [ $EXITCODE -ne 0 ]; then
        exit $EXITCODE
fi

 

[root@ptdb][/root]$ $GRID_HOME/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/12c/grid
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

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.
Using configuration parameter file:
/u01/app/12c/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/oracle/crsdata/ptdb/crsconfig/roothas_2024-08-24_09-08-29PM.log
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node ptdb successfully pinned.
2024/08/24 21:08:43 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ptdb'
CRS-2673: Attempting to stop 'ora.evmd' on 'ptdb'
CRS-2677: Stop of 'ora.evmd' on 'ptdb' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ptdb' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.

ptdb     2024/08/24 21:09:17     /u01/app/12c/grid/cdata/ptdb/backup_20240824_210917.olr     888699610
2024/08/24 21:09:18 CLSRSC-327: Successfully configured Oracle Restart for a standalone server

 

[root@ptdb][/etc/init.d]$ crsctl status resource ora.cssd -p  | grep AUTO_START
AUTO_START=never

 

[root@ptdb][/etc/init.d]$ $GRID_HOME/bin/crsctl modify resource "ora.cssd" -init -attr "AUTO_START=1"  -unsupported
[root@ptdb][/etc/init.d]$ crsctl status resource ora.cssd -p  | grep AUTO_START
AUTO_START=1

 

[root@ptdb][/root]$ crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ptdb'
CRS-2673: Attempting to stop 'ora.evmd' on 'ptdb'
CRS-2677: Stop of 'ora.evmd' on 'ptdb' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ptdb' has completed
CRS-4133: Oracle High Availability Services has been stopped.

 

[root@ptdb][/root]$ crsctl start has
CRS-4123: Oracle High Availability Services has been started.


[root@ptdb][/root]$ crsctl check has
CRS-4638: Oracle High Availability Services is online

[root@ptdb][/root]$ crsctl check css
CRS-4529: Cluster Synchronization Services is online

[root@ptdb][/etc/init.d]$ crsctl status resource
NAME=ora.cssd
TYPE=ora.cssd.type
TARGET=ONLINE
STATE=ONLINE on ptdb

NAME=ora.diskmon
TYPE=ora.diskmon.type
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.evmd
TYPE=ora.evm.type
TARGET=ONLINE
STATE=ONLINE on ptdb

NAME=ora.ons
TYPE=ora.ons.type
TARGET=OFFLINE
STATE=OFFLINE


[root@ptdb][/root]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons
               OFFLINE OFFLINE      ptdb                     STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       ptdb                     STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       ptdb                     STABLE
--------------------------------------------------------------------------------

 

8. asm instance 추가 및 시작

[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/dbs]$ srvctl add asm

 

[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/dbs]$ srvctl start asm
[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/dbs]$ ssa

SQL*Plus: Release 12.2.0.1.0 Production on Sat Aug 24 21:16:26 2024

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

 

SYS@+ASM> show parameter asm

NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- ------------------------------
asm_diskgroups                       string                            FRA
asm_diskstring                       string                            /dev/sd*
asm_power_limit                      integer                           1
asm_preferred_read_failure_groups    string                            (NULL)
SYS@+ASM> show parameter spfile

NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- ------------------------------
spfile                               string                            (NULL)

 

[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/dbs]$ kfod asm_diskstring='/dev/oracleasm/disks/*' disks=all

--------------------------------------------------------------------------------
 Disk          Size Path                                     User     Group
================================================================================
   1:      40960 MB /dev/oracleasm/disks/DATA1               grid     asmadmin
   2:      26624 MB /dev/oracleasm/disks/FRA1                grid     asmadmin
--------------------------------------------------------------------------------
ORACLE_SID ORACLE_HOME
================================================================================
      +ASM /u01/app/12c/grid


SYS@+ASM> ALTER DISKGROUP DATA MOUNT;
--> DATA 그룹은 강제로 mount해줌 (asm 인스턴스 자동 재기동 시 mount all로 올라오게됨)


Diskgroup altered.

Elapsed: 00:00:06.19

 

[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/dbs]$ asmcmd
ASMCMD [+] > ls
DATA/
FRA/

ASMCMD [+] > lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304     40960    26704                0           26704              0             N  DATA/
MOUNTED  EXTERN  N         512             512   4096  4194304     26624    25888                0           25888              0             N  FRA/


SYS@+ASM> create spfile='+DATA' from pfile;

File created.

Elapsed: 00:00:00.50

 

SYS@+ASM> shutdown immediate
ORA-15100: invalid or missing diskgroup name


ASM instance shutdown

 

SYS@+ASM> startup
ASM instance started

Total System Global Area 4294967296 bytes
Fixed Size                  8628936 bytes
Variable Size            4252783928 bytes
ASM Cache                  33554432 bytes
ASM diskgroups mounted

 

SYS@+ASM> show parameter spfile;

NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- --------------------------------------------------
spfile                               string                            +DATA/ASM/ASMPARAMETERFILE/registry.253.1177881639

 

SYS@+ASM> SELECT NAME FROM V$ASM_DISK;

NAME
------------------------------------------------------------------------------------------
DATA_0000
FRA_0000

2 rows selected.


9. oracle instance 추가

[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/dbs]$ asmcmd

ASMCMD [+] > cd +DATA/PTDB/PARAMETERFILE
ASMCMD [+DATA/PTDB/PARAMETERFILE] > ls
spfile.266.1176721075

 

[PTDB:oracle@ptdb][/home/oracle]$ srvctl add database -db PTDB -oraclehome /u01/app/oracle/product/12c/db_1 \

-spfile+DATA/PTDB/PARAMETERFILE/spfile.266.1176721075 \

-pwfile /u01/app/oracle/product/12c/db_1/dbs/orapwPTDB -dbname PTDB

 

[PTDB:oracle@ptdb][/home/oracle]$ srvctl config database -d ptdb
Database unique name: PTDB
Database name: PTDB
Oracle home: /u01/app/oracle/product/12c/db_1
Oracle user: grid
Spfile: +DATA/ASM/PARAMETERFILE/spfile.266.1176721075
Password file: /u01/app/oracle/product/12c/db_1/dbs/orapwPTDB
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups:
Services:
OSDBA group:
OSOPER group:
Database instance: PTDB

 

10. 리스너 추가 및 올리기

[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/network/admin]$ srvctl add listener

 

[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/network/admin]$ vi listener.ora

 

[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/network/admin]$ cat listener.ora
#Backup file is  /u01/app/12c/grid/network/admin/listener.ora.bak.ptdb line added by Agent
# listener.ora Network Configuration File: /u01/app/12c/grid/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ptdb)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER=SUBNET                # line added by Agent

--> host를 ptdb로 변경 (ip를 박아주는것을 추천)

 

 

[PTDB:oracle@ptdb][/u01/app/oracle/product/12c/db_1/network/admin]$ vi tnsnames.ora

 

[PTDB:oracle@ptdb][/u01/app/oracle/product/12c/db_1/network/admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12c/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_PTDB =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ptdb)(PORT = 1521))


PTDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ptdb)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PTDB)
    )
  )

--> host를 ptdb로 변경 (ip를 박아주는것을 추천)


[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/network/admin]$ srvctl start listener

[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/network/admin]$ lsnrctl status

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 24-AUG-2024 21:31:56

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

Connectingto(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ptdb)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                24-AUG-2024 21:31:39
Uptime                    0 days 0 hr. 0 min. 17 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/12c/grid/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/ptdb/listener/alert/log.xml
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ptdb)(PORT=1521)))
 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully

[+ASM:grid@ol79o12cr2sa][/u01/app/12c/grid/network/admin]$ csrt
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       ptdb                     STABLE
ora.FRA.dg
               ONLINE  ONLINE       ptdb                     STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       ptdb                     STABLE
ora.asm
               ONLINE  ONLINE       ptdb                     STABLE
ora.ons
               OFFLINE OFFLINE      ptdb                     STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       ptdb                     STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       ptdb                     STABLE
ora.ptdb.db
      1        OFFLINE OFFLINE                               STABLE
--------------------------------------------------------------------------------


11. oracle instance 기동

[PTDB:oracle@ol79o12cr2sa][/u01/app/oracle/product/12c/db_1/network/admin]$ srvctl start database -d ptdb

[PTDB:oracle@ol79o12cr2sa][/u01/app/oracle/product/12c/db_1/network/admin]$ csrt
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       ptdb                     STABLE
ora.FRA.dg
               ONLINE  ONLINE       ptdb                     STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       ptdb                     STABLE
ora.asm
               ONLINE  ONLINE       ptdb                     STABLE
ora.ons
               OFFLINE OFFLINE      ptdb                     STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       ptdb                     STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       ptdb                     STABLE
ora.ptdb.db
      1        ONLINE  ONLINE       ptdb                     Open,HOME=/u01/app/o
                                                             racle/product/12c/db
                                                             _1,STABLE

 

 

12. IP주소를 변경해야할 경우

 

[root@dtdb][/root]$ vi /etc/hosts

 

[root@dtdb][/root]$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
### Public IP
10.0.2.12       dtdb

 

[root@dtdb][/root]$ vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
[root@dtdb][/root]$ cat /etc/sysconfig/network-scripts/ifcfg-enp0s3

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=2f9b0a98-26ec-47eb-b058-cd6661aab2a0
DEVICE=enp0s3
ONBOOT=yes
IPV6_PRIVACY=no
IPADDR=10.0.2.12
PREFIX=24
GATEWAY=10.0.2.1
DNS1=8.8.8.8
MTU=4088

반응형

+ Recent posts