OS 환경 : Oracle Linux 8.4 (64bit)
DB 환경 : Oracle Database 23.5.0.24.07 ai for Oracle Cloud and Engineered Systems
방법 : 오라클 23ai cdb, pdb, 리스너 전체 기동 및 정지 스크립트
cdb 환경에서 테스트시 기동, 정지를 빠르게 하기 위해 만듬
cdb, pdb, 리스너까지 같이 기동하거나 중지시키는 스크립트임
cdb, pdb 전체 기동 스크립트
1
2
3
4
5
6
7
8
|
$ cat start.sh
lsnrctl start
sqlplus / as sysdba << EOF
startup
alter pluggable database all open;
alter system register;
EOF
lsnrctl status
|
cdb, pdb 전체 정지 스크립트
1
2
3
4
5
6
7
|
$ cat stop.sh
sqlplus / as sysdba << EOF
shutdown immediate
EOF
lsnrctl stop
ps -ef|grep pmon
ps -ef|grep lsnr
|
cdb, pdb 전체 재기동 스크립트
1
2
3
4
5
6
7
8
9
10
11
12
13
|
$ cat restart.sh
lsnrctl stop
sqlplus / as sysdba << EOF
shutdown immediate
EOF
lsnrctl start
sqlplus / as sysdba << EOF
startup
alter pluggable database all open;
alter system register;
EOF
lsnrctl status
|
권한 부여
1
2
3
|
$ chmod u+x start.sh
$ chmod u+x stop.sh
$ chmod u+x restart.sh
|
실제 실행
기동 스크립트 실행
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
$ sh start.sh
LSNRCTL for Linux: Version 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on 09-FEB-2025 16:32:50
Copyright (c) 1991, 2024, Oracle. All rights reserved.
Starting /app/oracle/product/23ai/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
System parameter file is /app/oracle/product/23ai/network/admin/listener.ora
Log messages written to /app/oracle/diag/tnslsnr/ora23/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora23)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora23)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
Start Date 09-FEB-2025 16:32:50
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /app/oracle/product/23ai/network/admin/listener.ora
Listener Log File /app/oracle/diag/tnslsnr/ora23/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora23)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sun Feb 9 16:32:50 2025
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Connected to an idle instance.
SQL> ORACLE instance started.
Total System Global Area 1238952200 bytes
Fixed Size 5359880 bytes
Variable Size 553648128 bytes
Database Buffers 671088640 bytes
Redo Buffers 8855552 bytes
Database mounted.
Database opened.
SQL>
System altered.
SQL> Disconnected from Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
Version 23.5.0.24.07
LSNRCTL for Linux: Version 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on 09-FEB-2025 16:32:53
Copyright (c) 1991, 2024, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora23)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
Start Date 09-FEB-2025 16:32:50
Uptime 0 days 0 hr. 0 min. 3 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /app/oracle/product/23ai/network/admin/listener.ora
Listener Log File /app/oracle/diag/tnslsnr/ora23/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora23)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "1f2e1fea745ed86fe0631789a8c03e68" has 1 instance(s).
Instance "oracle23", status READY, has 1 handler(s) for this service...
Service "1f2fd9d07446fda2e0631789a8c0ebf2" has 1 instance(s).
Instance "oracle23", status READY, has 1 handler(s) for this service...
Service "oracle23" has 1 instance(s).
Instance "oracle23", status READY, has 1 handler(s) for this service...
Service "oracle23XDB" has 1 instance(s).
Instance "oracle23", status READY, has 1 handler(s) for this service...
Service "oracle23pdb1" has 1 instance(s).
Instance "oracle23", status READY, has 1 handler(s) for this service...
The command completed successfully
|
재기동 스크립트 실행
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
$ sh restart.sh
LSNRCTL for Linux: Version 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on 09-FEB-2025 16:33:17
Copyright (c) 1991, 2024, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora23)(PORT=1521)))
The command completed successfully
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sun Feb 9 16:33:17 2025
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> Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> Disconnected from Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
Version 23.5.0.24.07
LSNRCTL for Linux: Version 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on 09-FEB-2025 16:33:18
Copyright (c) 1991, 2024, Oracle. All rights reserved.
Starting /app/oracle/product/23ai/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
System parameter file is /app/oracle/product/23ai/network/admin/listener.ora
Log messages written to /app/oracle/diag/tnslsnr/ora23/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora23)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora23)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
Start Date 09-FEB-2025 16:33:18
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /app/oracle/product/23ai/network/admin/listener.ora
Listener Log File /app/oracle/diag/tnslsnr/ora23/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora23)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sun Feb 9 16:33:18 2025
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Connected to an idle instance.
SQL> ORACLE instance started.
Total System Global Area 1238952200 bytes
Fixed Size 5359880 bytes
Variable Size 553648128 bytes
Database Buffers 671088640 bytes
Redo Buffers 8855552 bytes
Database mounted.
Database opened.
SQL>
System altered.
SQL> Disconnected from Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
Version 23.5.0.24.07
LSNRCTL for Linux: Version 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on 09-FEB-2025 16:33:20
Copyright (c) 1991, 2024, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora23)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
Start Date 09-FEB-2025 16:33:18
Uptime 0 days 0 hr. 0 min. 2 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /app/oracle/product/23ai/network/admin/listener.ora
Listener Log File /app/oracle/diag/tnslsnr/ora23/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora23)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "1f2e1fea745ed86fe0631789a8c03e68" has 1 instance(s).
Instance "oracle23", status READY, has 1 handler(s) for this service...
Service "1f2fd9d07446fda2e0631789a8c0ebf2" has 1 instance(s).
Instance "oracle23", status READY, has 1 handler(s) for this service...
Service "oracle23" has 1 instance(s).
Instance "oracle23", status READY, has 1 handler(s) for this service...
Service "oracle23XDB" has 1 instance(s).
Instance "oracle23", status READY, has 1 handler(s) for this service...
Service "oracle23pdb1" has 1 instance(s).
Instance "oracle23", status READY, has 1 handler(s) for this service...
The command completed successfully
|
정지 스크립트 실행
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
|
$ sh stop.sh
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sun Feb 9 16:34:41 2025
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> Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> Disconnected from Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
Version 23.5.0.24.07
LSNRCTL for Linux: Version 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on 09-FEB-2025 16:34:42
Copyright (c) 1991, 2024, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora23)(PORT=1521)))
The command completed successfully
oracle 5666 5660 0 16:34 pts/0 00:00:00 grep pmon
oracle 5668 5660 0 16:34 pts/0 00:00:00 grep lsnr
|
모두 잘 동작함
참조 :
'ORACLE > Sql' 카테고리의 다른 글
오라클 19c 유저, 백그라운드 프로세스 pga 사용량 확인 (0) | 2024.05.01 |
---|---|
DBMS_SPACE.UNUSED_SPACE 한번에 여러 세그먼트 조회 (0) | 2024.04.10 |
오라클 19c 파티션 테이블의 파티션별 row count 확인 (0) | 2024.04.01 |
오라클 19c 버전 및 에디션 확인 방법 (0) | 2024.03.30 |
오라클 19c redo log 크기 자동 변경 스크립트 (0) | 2024.03.26 |