您好,欢迎访问一九零五行业门户网

Dropdual

有网友删除dual表出现了问题: 删除dual表的时候hang住,然后直接shutdown abort。再重新启动数据库的时候,发现open的时候一直hang住,但是打开另外一个窗口数据库确实已经打开的。 下面进行模拟: sys@orcl11gdrop table dual; 一直hang在这不动 在另外一个
有网友删除dual表出现了问题:
删除dual表的时候hang住,然后直接shutdown abort。再重新启动数据库的时候,发现open的时候一直hang住,但是打开另外一个窗口数据库确实已经打开的。
下面进行模拟:
sys@orcl11g>drop table dual;
一直hang在这不动
在另外一个窗口:
sys@orcl11g>shutdown abortoracle instance shut down.
重启数据库:
sys@orcl11g>startup mountoracle instance started.total system global area 417546240 bytesfixed size 2213936 bytesvariable size 327157712 bytesdatabase buffers 83886080 bytesredo buffers 4288512 bytesdatabase mounted.
sys@orcl11g>alter database open;
一直hang这个不动,打开另外一个窗口:
sys@orcl11g>select open_mode from v$database;open_mode----------------------------------------read writesys@orcl11g>
发现数据库已经打开
这是因为系统触发器造成,在初始化参数中加入:
_system_trig_enabled=flase
再次启动数据库:
sys@orcl11g>startup mountoracle instance started.total system global area 417546240 bytesfixed size 2213936 bytesvariable size 327157712 bytesdatabase buffers 83886080 bytesredo buffers 4288512 bytesdatabase mounted.sys@orcl11g>show parameter _sysname type value------------------------------------ ---------------------- ------------------------------_system_trig_enabled boolean falseaudit_sys_operations boolean falseaudit_syslog_level stringfilesystemio_options string noneldap_directory_sysauth string nosys@orcl11g>alter database open;database altered.
最开始删除dual表的时候也是因为系统触发器的存在。
现在我们禁用了系统触发器将dual删除看是什么效果:
sys@orcl11g>drop table dual;table dropped.
重启数据库:
sys@orcl11g>startup nomount pfile=initorcl11g.oraoracle instance started.total system global area 417546240 bytesfixed size 2213936 bytesvariable size 327157712 bytesdatabase buffers 83886080 bytesredo buffers 4288512 bytessys@orcl11g>show parameter repname type value------------------------------------ ---------------------- ------------------------------replication_dependency_tracking boolean truesys@orcl11g>sys@orcl11g>sys@orcl11g>sys@orcl11g>sys@orcl11g>alter database mount;database altered.sys@orcl11g>alter database open;alter database open*error at line 1:ora-01092: oracle instance terminated. disconnection forcedora-01775: looping chain of synonymsprocess id: 2485session id: 1 serial number: 3
这里我们不用trace就知道是因为dual表的缘故,所以dual也是很重要的。不要乱玩
这时候我们需要将replication_dependency_tracking参数设置为false才能打开数据库:
官方文档给出的解释:
replication_dependency_tracking enables or disables dependency tracking for
read/write operations to the database. dependency tracking is essential for
propagating changes in a replicated environment in parallel
加入参数打开数据库:
sys@orcl11g>startup mountoracle instance started.total system global area 417546240 bytesfixed size 2213936 bytesvariable size 327157712 bytesdatabase buffers 83886080 bytesredo buffers 4288512 bytesdatabase mounted.sys@orcl11g>show parameter repname type value------------------------------------ ---------------------- ------------------------------replication_dependency_tracking boolean falsesys@orcl11g>ak^hsp2-0042: unknown command a - rest of line ignored.sys@orcl11g>a;ter^hsys@orcl11g>alter database open;database altered.sys@orcl11g>select * from dual;select * from dual *error at line 1:ora-01775: looping chain of synonyms
这时候我们呢需要重建dual表:
sys@orcl11g>create table sys.dual 2 ( dummy varchar2(1) 3 ) pctfree 10 pctused 40 initrans 1 maxtrans 255 4 nocompress logging 5 storage(initial 16384 next 1048576 minextents 1 maxextents 2147483645 6 pctincrease 0 freelists 1 freelist groups 1 7 buffer_pool default flash_cache default cell_flash_cache default) 8 tablespace system ;table created.sys@orcl11g>sys@orcl11g>grant select on sys.dual to public with grant option;grant succeeded.sys@orcl11g>sys@orcl11g>@?/rdbms/admin/utlrp.sql
至此我们dual已经恢复完成
sys@orcl11g>select 'www.zbdba.com' from dual;'www.zbdba.com'--------------------------www.zbdba.com
其它类似信息

推荐信息