随笔 - 26,  文章 - 0,  评论 - 0,  阅读 - 23812

 

1.解决数据库用户被锁的问题

 如果system不能登录出现被锁的状态,解决方法如下:

 

2.删除创建的用户名和表

如果需要删除该用户执行的所有脚本时,只需要删除创建的用户名,重新执行所有的脚本即可。如下执行删除用户的sql语句:

select username,sid,serial# from v$session where username='ORCLYTHLOG';

alter system kill session '178,1146'; 

drop user ORCLYTHLOG cascade;

 

 

 

 3.表空间解决方法

3.1查询用户所在的默认表空间和临时表空间

select default_tablespace from dba_users where username='用户名称';

select temporary_tablespace from dba_users where username='用户名称'

或者:

select * from dba_users where username='用户名称';

 

 3.2查询表空间的语句

 

SELECT a.tablespace_name,  

a.bytes total,  

b.bytes used,  

c.bytes free,  

(b.bytes * 100) / a.bytes "% USED ",  

(c.bytes * 100) / a.bytes "% FREE " 

FROM sys.sm$ts_avail a, sys.sm$ts_used b, sys.sm$ts_free c 

WHERE a.tablespace_name = b.tablespace_name 

AND a.tablespace_name = c.tablespace_name and a.tablespace_name='YTH_JBXXKJ'

 

 3.3查询表空间的安装路径

select file_name,tablespace_name from dba_data_files where tablespace_name='YTH_JBXXKJ'

 

 

 3.4表空间不足时扩充语句

alter tablespace YTH_XXXXX add datafile 路径/文件 size 20480M;

说明:路径就是上面的截图路径

注:如果之前的路径中磁盘不够的话,就不能直接扩充,可以换个地址扩充表空间的路径(表空间的名称不变)

select * from dba_data_files where tablespace_name='YTH_JBXXKJ' 

alter tablespace YTH_JBXXKJ add datafile '/mnt/dzystorage/YTHYTH_JBXXKJ_01_data01.ora' 

size 2G autoextend on next 1G

 

posted on   雪之缘  阅读(457)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?

< 2025年3月 >
23 24 25 26 27 28 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 1 2 3 4 5
点击右上角即可分享
微信分享提示