1.修改sys用户名为sysadmin

update user$ set name='sysadmin' where name='SYS';

2.修改后数据库正常,停库重启后报错

SQL> startup
ORACLE instance started.

Total System Global Area  964546560 bytes
Fixed Size            2259080 bytes
Variable Size          612370296 bytes
Database Buffers      343932928 bytes
Redo Buffers            5984256 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00600: internal error code, arguments: [kokasgi1], [], [], [], [], [], [],
[], [], [], [], []
Process ID: 2646
Session ID: 125 Serial number: 5

3.将数据库起到mount状态后进入调试模式

3.1 数据库启动到mount状态
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  964546560 bytes
Fixed Size            2259080 bytes
Variable Size          612370296 bytes
Database Buffers      343932928 bytes
Redo Buffers            5984256 bytes
Database mounted.

3.2 gdb进入调试模式
[oracle@ora11gr2 ~]$ ps -ef|grep LOCAL
oracle     2753   2601  0 08:36 ?        00:00:00 oracleora11gr2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle     2757   2683  0 08:37 pts/2    00:00:00 grep LOCAL
[oracle@ora11gr2 ~]$ gdb /u01/app/oracle/product/11.2.0/db/bin/oracle 2753
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-92.el6)
Copyright (C) 2010 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 /u01/app/oracle/product/11.2.0/db/bin/oracle...(no debugging symbols found)...done.
Attaching to program: /u01/app/oracle/product/11.2.0/db/bin/oracle, process 2753
Reading symbols from /u01/app/oracle/product/11.2.0/db/lib/libodm11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/db/lib/libodm11.so
Reading symbols from /u01/app/oracle/product/11.2.0/db/lib/libcell11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/db/lib/libcell11.so
Reading symbols from /u01/app/oracle/product/11.2.0/db/lib/libskgxp11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/db/lib/libskgxp11.so
Reading symbols from /lib64/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /u01/app/oracle/product/11.2.0/db/lib/libnnz11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/db/lib/libnnz11.so
Reading symbols from /u01/app/oracle/product/11.2.0/db/lib/libclsra11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/db/lib/libclsra11.so
Reading symbols from /u01/app/oracle/product/11.2.0/db/lib/libdbcfg11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/db/lib/libdbcfg11.so
Reading symbols from /u01/app/oracle/product/11.2.0/db/lib/libhasgen11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/db/lib/libhasgen11.so
Reading symbols from /u01/app/oracle/product/11.2.0/db/lib/libskgxn2.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/db/lib/libskgxn2.so
Reading symbols from /u01/app/oracle/product/11.2.0/db/lib/libocr11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/db/lib/libocr11.so
Reading symbols from /u01/app/oracle/product/11.2.0/db/lib/libocrb11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/db/lib/libocrb11.so
Reading symbols from /u01/app/oracle/product/11.2.0/db/lib/libocrutl11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/db/lib/libocrutl11.so
Reading symbols from /lib64/libaio.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libaio.so.1
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libpthread.so.0...(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/libnsl.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnsl.so.1
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /usr/lib64/libnuma.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libnuma.so.1
Reading symbols from /lib64/libnss_files.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnss_files.so.2
Reading symbols from /u01/app/oracle/product/11.2.0/db/lib/libnque11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/db/lib/libnque11.so
0x0000003042e0e810 in __read_nocancel () from /lib64/libpthread.so.0
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.209.el6.x86_64 libaio-0.3.107-10.el6.x86_64 numactl-2.0.9-2.el6.x86_64
(gdb) b kokiasg
Breakpoint 1 at 0x15037cc
(gdb) c
Continuing.


此时在另外一个窗口起库,显示hang住,其实已经open了。
SQL> alter database open;

4.新开窗口,执行恢复操作

4.1 查看数据库状态
SQL> select status from v$instance;

STATUS
------------
OPEN

4.2 将sys用户恢复
SQL> update user$ set name='sys' where name='sysadmin';

0 rows updated.

SQL> commit;

Commit complete.

4.3 gdb窗口退出后open报错,原因为将SYS用户置为小写sys了,更新没有生效
(gdb) quit
A debugging session is active.

    Inferior 1 [process 2753] will be detached.

Quit anyway? (y or n) y
Detaching from program: /u01/app/oracle/product/11.2.0/db/bin/oracle, process 2753
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00600: internal error code, arguments: [kokasgi1], [], [], [], [], [], [],
[], [], [], [], []
Process ID: 3175
Session ID: 125 Serial number: 5
4.4 重新进入调试模式,恢复SYS用户,退出调试模式
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  964546560 bytes
Fixed Size            2259080 bytes
Variable Size          612370296 bytes
Database Buffers      343932928 bytes
Redo Buffers            5984256 bytes
Database mounted.
[oracle@ora11gr2 ~]$ ps -ef |grep LOCAL
oracle     3238   3130  0 08:59 ?        00:00:00 oracleora11gr2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle     3240   3003  0 08:59 pts/1    00:00:00 grep LOCAL
[oracle@ora11gr2 ~]$ gdb $ORACLE_HOME/bin/oracle 3238
(gdb) b kokiasg
Breakpoint 1 at 0x15037cc
(gdb) c
Continuing.
SQL> alter database open;

Breakpoint 1, 0x00000000015037cc in kokiasg ()
SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> select rowid,name from user$ where name like 'sys%';

ROWID           NAME
------------------ ------------------------------
AAAAAKAABAAAADRAAB sys

SQL>  update user$ set name='SYS' where name='sys'; 

1 row updated.

SQL> commit
  2  ;

Commit complete.
(gdb) quit
A debugging session is active.

    Inferior 1 [process 3238] will be detached.

Quit anyway? (y or n) y
Detaching from program: /u01/app/oracle/product/11.2.0/db/bin/oracle, process 3238
SQL> alter database open;

Database altered.

5.测试数据库正常启停

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

Total System Global Area  964546560 bytes
Fixed Size            2259080 bytes
Variable Size          612370296 bytes
Database Buffers      343932928 bytes
Redo Buffers            5984256 bytes
Database mounted.
Database opened.
SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> show user
USER is "SYS

 

posted on 2021-09-28 10:11  Tomatoes  阅读(258)  评论(0编辑  收藏  举报