会话1中,数据库已启动至mount状态。
在会话2中,执行gdb进行调试操作。首先通过ps命令查找与LOCAL相关的进程信息:
[oracle@oracle ~]$ ps -ef|grep LOCAL
oracle 23028 20763 ? 0 15:40 ? ? ? ? ?00:00:00 oracletjyd (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 23034 19834 ? 0 15:40 pts/1 ? ?00:00:00 grep --color=auto LOCAL
从输出结果可见,进程号为23028的Oracle进程是目标调试对象。接下来使用gdb附加到该进程:
[oracle@oracle ~]$ gdb $ORACLE_HOME/bin/oracle 23028
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /data/u01/app/oracle/product/19c/dbhome_1/bin/oracle...(no debugging symbols found)...done.
Attaching to program: /data/u01/app/oracle/product/19c/dbhome_1/bin/oracle, process 23028
成功附加后,系统开始加载相关共享库符号文件:
Reading symbols from /data/u01/app/oracle/product/19c/dbhome_1/lib/libodm19.so...(no debugging symbols found)...done.
Loaded symbols for /data/u01/app/oracle/product/19c/dbhome_1/lib/libodm19.so
Reading symbols from /data/u01/app/oracle/product/19c/dbhome_1/lib/libofs.so...(no debugging symbols found)...done.
Loaded symbols for /data/u01/app/oracle/product/19c/dbhome_1/lib/libofs.so
Reading symbols from /data/u01/app/oracle/product/19c/dbhome_1/lib/libcell19.so...done.
Loaded symbols for /data/u01/app/oracle/product/19c/dbhome_1/lib/libcell19.so
Reading symbols from /data/u01/app/oracle/product/19c/dbhome_1/lib/libskgxp19.so...(no debugging symbols found)...done.
Loaded symbols for /data/u01/app/oracle/product/19c/dbhome_1/lib/libskgxp19.so
Reading symbols from /data/u01/app/oracle/product/19c/dbhome_1/lib/libskjcx19.so...(no debugging symbols found)...done.
Loaded symbols for /data/u01/app/oracle/product/19c/dbhome_1/lib/libskjcx19.so
SQL> create table test (id int);
Table created.
SQL> insert into test values(1);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
ID
----------
1
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Dec 8 15:40:49 2025
Version 19.18.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
SQL> select * from test;
ID
----------
1
SQL> insert into test values(2);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
ID
----------
1
2
SQL> truncate table test;
Table truncated.
SQL> select * from test;
no rows selected
SQL> insert into test values(2);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
ID
----------
2
SQL> create index test_idx on test(id);
create index test_idx on test(id)
*
ERROR at line 1:
ORA-01109: database not open
SQL> drop table test;
Table dropped.
SQL> create table test (id int);
create table test (id int)
*
ERROR at line 1:
ORA-01109: database not open
SQL> create view test as select * from dual;
View created.
SQL> CREATE OR REPLACE PROCEDURE hello_world AS
2 BEGIN
3 DBMS_OUTPUT.PUT_LINE('Hello, Oracle World!');
4 DBMS_OUTPUT.PUT_LINE('当前时间: ' || TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS'));
5 END hello_world;
6 /
Procedure created.
SQL> exec hello_world;
BEGIN hello_world; END;
*
ERROR at line 1:
ORA-22303: type "SYS"."CHARARR" not found
ORA-00942: table or view does not exist
ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_OUTPUT"
ORA-06512: at "SYS.HELLO_WORLD", line 3
ORA-06512: at line 1
SQL> drop PROCEDURE hello_world;
Procedure dropped.
SQL> drop view test;
View dropped.
SQL> create table test as select * from dual;
create table test as select * from dual
*
ERROR at line 1:
ORA-01109: database not open
SQL> create table test (id int);
Table created.
SQL> create index test_idx on test(id);
Index created.
SQL> insert into test values(2);
1 row created.
SQL> commit;
Commit complete.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Dec 8 15:49:50 2025
Version 19.18.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
SQL> alter index test_idx rebuild;
alter index test_idx rebuild
*
ERROR at line 1:
ORA-01109: database not open
SQL> drop index test_idx;
drop index test_idx
*
ERROR at line 1:
ORA-01109: database not open
SQL> drop table test;
drop table test
*
ERROR at line 1:
ORA-01109: database not open
SQL> alter index test_idx rebuild;
alter index test_idx rebuild
*
ERROR at line 1:
ORA-01109: database not open
SQL>
SQL> alter index test_idx rebuild online;
alter index test_idx rebuild online
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01109: database not open
SQL> drop index test_idx;
Index dropped.
SQL> create index test_idx on test(id);
create index test_idx on test(id)
*
ERROR at line 1:
ORA-01109: database not open
SQL>Loading symbol information from system and Oracle library files...
Symbol data successfully loaded for /lib64/librt.so.1, though no debugging symbols were present during the read process.
Processing symbols from Oracle Clusterware-related libraries located in the database home directory:
Reading symbols from /data/u01/app/oracle/product/19c/dbhome_1/lib/libclsra19.so — debugging information not available... completed.
Symbols loaded for libclsra19.so.
Retrieving symbol table from /data/u01/app/oracle/product/19c/dbhome_1/lib/libdbcfg19.so — no debug data found... finished.
Symbols now available for libdbcfg19.so.
Attempting to load symbols from /data/u01/app/oracle/product/19c/dbhome_1/lib/libhasgen19.so — no debugging symbols detected... done.
Library libhasgen19.so has been processed and symbols are loaded.
Symbol acquisition in progress for /data/u01/app/oracle/product/19c/dbhome_1/lib/libskgxn2.so — no debug info discovered... complete.
Symbols loaded for libskgxn2.so.
Successfully read symbol data from /data/u01/app/oracle/product/19c/dbhome_1/lib/libocr19.so.
Loaded symbols for libocr19.so.
Symbol loading completed for /data/u01/app/oracle/product/19c/dbhome_1/lib/libocrb19.so.
Debugging information was available and processed.
Processing of symbols from /data/u01/app/oracle/product/19c/dbhome_1/lib/libocrutl19.so finished successfully.
Symbols have been loaded into session.
SQL> create table test (id int);
Table created.
SQL> insert into test values(1);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
ID
----------
1
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Dec 8 15:40:49 2025
Version 19.18.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
SQL> select * from test;
ID
----------
1
SQL> insert into test values(2);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
ID
----------
1
2
SQL> truncate table test;
Table truncated.
SQL> select * from test;
no rows selected
SQL> insert into test values(2);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
ID
----------
2
SQL> create index test_idx on test(id);
create index test_idx on test(id)
*
ERROR at line 1:
ORA-01109: database not open
SQL> drop table test;
Table dropped.
SQL> create table test (id int);
create table test (id int)
*
ERROR at line 1:
ORA-01109: database not open
SQL> create view test as select * from dual;
View created.
SQL> CREATE OR REPLACE PROCEDURE hello_world AS
2 BEGIN
3 DBMS_OUTPUT.PUT_LINE('Hello, Oracle World!');
4 DBMS_OUTPUT.PUT_LINE('当前时间: ' || TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS'));
5 END hello_world;
6 /
Procedure created.
SQL> exec hello_world;
BEGIN hello_world; END;
*
ERROR at line 1:
ORA-22303: type "SYS"."CHARARR" not found
ORA-00942: table or view does not exist
ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_OUTPUT"
ORA-06512: at "SYS.HELLO_WORLD", line 3
ORA-06512: at line 1
SQL> drop PROCEDURE hello_world;
Procedure dropped.
SQL> drop view test;
View dropped.
SQL> create table test as select * from dual;
create table test as select * from dual
*
ERROR at line 1:
ORA-01109: database not open
SQL> create table test (id int);
Table created.
SQL> create index test_idx on test(id);
Index created.
SQL> insert into test values(2);
1 row created.
SQL> commit;
Commit complete.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Dec 8 15:49:50 2025
Version 19.18.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
SQL> alter index test_idx rebuild;
alter index test_idx rebuild
*
ERROR at line 1:
ORA-01109: database not open
SQL> drop index test_idx;
drop index test_idx
*
ERROR at line 1:
ORA-01109: database not open
SQL> drop table test;
drop table test
*
ERROR at line 1:
ORA-01109: database not open
SQL> alter index test_idx rebuild;
alter index test_idx rebuild
*
ERROR at line 1:
ORA-01109: database not open
SQL>
SQL> alter index test_idx rebuild online;
alter index test_idx rebuild online
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01109: database not open
SQL> drop index test_idx;
Index dropped.
SQL> create index test_idx on test(id);
create index test_idx on test(id)
*
ERROR at line 1:
ORA-01109: database not open
SQL>
Handling asynchronous I/O library symbol retrieval:
Reading symbols from /lib64/libaio.so.1 — no debugging symbols found... operation completed.
Symbols for libaio.so.1 are now loaded.
Continuing with Oracle Notification Service library processing:
Symbol read attempt on /data/u01/app/oracle/product/19c/dbhome_1/lib/libons.so — no debug information present... done.
Loaded symbols for libons.so.
Final library in sequence: /data/u01/app/oracle/product/19c/dbhome_1/lib/libmql1.so — no debugging symbols located... processing complete.
Symbols loaded for libmql1.so.
Loading debugging information for shared libraries used by the Oracle 19c environment...
Processing symbol data from /data/u01/app/oracle/product/19c/dbhome_1/lib/libipc1.so — no debug symbols available. Symbols loading complete.
Symbols successfully loaded for /data/u01/app/oracle/product/19c/dbhome_1/lib/libipc1.so
Retrieving symbols from /lib64/libdl.so.2 — debugging symbols not found. Process finished.
Symbols loaded for /lib64/libdl.so.2
Reading symbol table from /lib64/libm.so.6 — no debugging information detected. Completed.
Symbols successfully registered for /lib64/libm.so.6
Obtaining symbols from /lib64/libpthread.so.0 — no debug symbols present. Done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Symbols loaded for /lib64/libpthread.so.0
Attempting to read symbols from /lib64/libnsl.so.1 — no debugging symbols found. Operation complete.
Symbols now loaded for /lib64/libnsl.so.1
Loading symbol data from /lib64/libresolv.so.2 — no debug symbols available. Finished.
Symbols successfully loaded for /lib64/libresolv.so.2
Reading symbols from /lib64/libc.so.6 — no debugging information included. Done.
Symbols registered for /lib64/libc.so.6
Processing symbol input from /lib64/ld-linux-x86-64.so.2 — no debug symbols located. Complete.
Symbols loaded for /lib64/ld-linux-x86-64.so.2
Fetching symbol data from /usr/lib64/libnuma.so.1 — initial attempt interrupted, retrying...
Reading symbols from /usr/lib64/libnuma.so.1 — no debugging symbols found. Done.
(no debugging symbols found)...finalized.
Symbols successfully loaded for /usr/lib64/libnuma.so.1
Reading symbol table from /lib64/libgcc_s.so.1 — no debug symbols detected. Completed.
Symbols now available for /lib64/libgcc_s.so.1
Loading symbols from /lib64/libnss_files.so.2 — no debugging information found. Finished.
Symbols loaded for /lib64/libnss_files.so.2
Processing symbol data from Oracle library: /data/u01/app/oracle/product/19c/dbhome_1/lib/libnque19.so — no debug symbols present. Done.
Symbols successfully loaded for /data/u01/app/oracle/product/19c/dbhome_1/lib/libnque19.so
Retrieving symbol information from /data/u01/app/oracle/product/19c/dbhome_1/lib/libshpkavx19.so — no debugging symbols located. Complete.
Symbols loaded for /data/u01/app/oracle/product/19c/dbhome_1/lib/libshpkavx19.so
0x00007f6a060c0740 in __read_nocancel () from /lib64/libpthread.so.0
缺少独立的调试信息,可使用以下命令安装:debuginfo-install glibc-2.17-326.el7_9.x86_64 libaio-0.3.109-13.el7.x86_64 libgcc-4.8.5-44.el7.x86_64 numactl-libs-2.0.12-5.el7.x86_64
(gdb)
b kokiasg
Breakpoint 1 at 0x28b4ff0
(gdb)
c
Continuing.
Breakpoint 1, 0x00000000028b4ff0 in kokiasg ()
此时切换至会话1,执行 alter database open 命令,操作将出现挂起状态。
接着开启会话3:
在该会话中可以执行如下操作:drop table、index,truncate table,以及 update、delete、insert 操作;同时支持 create/drop view/procedure 等对象管理操作。
但以下操作被禁止:create table/index 和 alter table/index 等结构变更指令。
SQL> create table test (id int);
Table created.
SQL> insert into test values(1);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
ID
----------
1
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Dec 8 15:40:49 2025
Version 19.18.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
SQL> select * from test;
ID
----------
1
SQL> insert into test values(2);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
ID
----------
1
2
SQL> truncate table test;
Table truncated.
SQL> select * from test;
no rows selected
SQL> insert into test values(2);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
ID
----------
2
SQL> create index test_idx on test(id);
create index test_idx on test(id)
*
ERROR at line 1:
ORA-01109: database not open
SQL> drop table test;
Table dropped.
SQL> create table test (id int);
create table test (id int)
*
ERROR at line 1:
ORA-01109: database not open
SQL> create view test as select * from dual;
View created.
SQL> CREATE OR REPLACE PROCEDURE hello_world AS
2 BEGIN
3 DBMS_OUTPUT.PUT_LINE('Hello, Oracle World!');
4 DBMS_OUTPUT.PUT_LINE('当前时间: ' || TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS'));
5 END hello_world;
6 /
Procedure created.
SQL> exec hello_world;
BEGIN hello_world; END;
*
ERROR at line 1:
ORA-22303: type "SYS"."CHARARR" not found
ORA-00942: table or view does not exist
ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_OUTPUT"
ORA-06512: at "SYS.HELLO_WORLD", line 3
ORA-06512: at line 1
SQL> drop PROCEDURE hello_world;
Procedure dropped.
SQL> drop view test;
View dropped.
SQL> create table test as select * from dual;
create table test as select * from dual
*
ERROR at line 1:
ORA-01109: database not open
SQL> create table test (id int);
Table created.
SQL> create index test_idx on test(id);
Index created.
SQL> insert into test values(2);
1 row created.
SQL> commit;
Commit complete.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Dec 8 15:49:50 2025
Version 19.18.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
SQL> alter index test_idx rebuild;
alter index test_idx rebuild
*
ERROR at line 1:
ORA-01109: database not open
SQL> drop index test_idx;
drop index test_idx
*
ERROR at line 1:
ORA-01109: database not open
SQL> drop table test;
drop table test
*
ERROR at line 1:
ORA-01109: database not open
SQL> alter index test_idx rebuild;
alter index test_idx rebuild
*
ERROR at line 1:
ORA-01109: database not open
SQL>
SQL> alter index test_idx rebuild online;
alter index test_idx rebuild online
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01109: database not open
SQL> drop index test_idx;
Index dropped.
SQL> create index test_idx on test(id);
create index test_idx on test(id)
*
ERROR at line 1:
ORA-01109: database not open
SQL>

雷达卡


京公网安备 11010802022788号







