--第一步:查看是否有死锁存在,查出有数据则代表有死锁
select p.spid,c.object_name,b.session_id,b.oracle_username,b.os_user_name from v$process p,v$session a,v$locked_object b,all_objects c
where p.addr=a.paddr
and a.process=b.process
and c.object_id=b.object_id
--第二步:查出死锁session的精确信息【sid 为前面语句的session_id】
SELECT sid, serial#, username, osuser FROM v$session where sid='第一步查询出来的session_id';
--第三步:删除死锁【第一个参数为sid,第二个为serial#】
alter system kill session '第一个参数,第二个参数';
1、先查询空闲空间
select tablespace_name,file_id,block_id,bytes,blocks from dba_free_space;
2、增加Oracle表空间
先查询数据文件名称、大小和路径的信息,语句如下:
select tablespace_name,file_id,bytes,file_name from dba_data_files;
3、修改文件大小语句如下
alter database datafile
'需要增加的数据文件路径,即上面查询出来的路径
'resize 800M;
4、创建Oracle表空间
create tablespace test
datafile '/home/app/oracle/oradata/oracle8i/test01.dbf' size 8M
autoextend on
next 5M
maxsize 10M;
create tablespace sales
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
autoextend on
next 50M
maxsize unlimited
maxsize unlimited 是大小不受限制
create tablespace sales
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
autoextend on
next 50M
maxsize 1000M
extent management local uniform;
unform表示区的大小相同,默认为1M
create tablespace sales
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
autoextend on
next 50M
maxsize 1000M
extent management local uniform size 500K;
unform size 500K表示区的大小相同,为500K
create tablespace sales
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
autoextend on
next 50M
maxsize 1000M
extent management local autoallocate;
autoallocate表示区的大小由随表的大小自动动态改变,大表使用大区小表使用小区
create tablespace sales
datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
autoextend on
next 50M
maxsize 1000M
temporary;
temporary创建字典管理临时表空间
create temporary tablespace sales
tempfile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
autoextend on
next 50M
maxsize 1000M
创建本地管理临时表空间,如果是临时表空间,所有语句中的datafile都换为tempfile
8i系统默认创建字典管理临时表空间,要创建本地管理临时表空间要加temporary tablespace关键字
创建本地管理临时表空间时,不得使用atuoallocate参数,系统默认创建uniform管理方式
为表空间增加数据文件:
alter tablespace sales add
datafile '/home/app/oracle/oradata/oracle8i/sales02.dbf' size 800M
autoextend on next 50M
maxsize 1000M;
创 建本地管理临时Oracle表空间,如果是临时表空间,所有语句中的datafile都换为tempfile8i系统默认创建字典管理临时表空间,要创建 本地管理临时表空间要加temporary tablespace关键字创建本地管理临时表空间时,不得使用atuoallocate参数,系统默认创建uniform管理方式
为表空间增加数据文件:
alter tablespace sales add
datafile '/home/app/oracle/oradata/oracle8i/sales02.dbf' size 800M
autoextend on next 50M
maxsize 1000M;
5、更改自动扩展属性:
alter database datafile
'/home/app/oracle/oradata/oracle8i/sales01.dbf',
'/home/app/oracle/oradata/oracle8i/sales02.dbf'
'/home/app/oracle/oradata/oracle8i/sales01.dbf
autoextend off;
6、删除表空间:
drop tablespace xxx including contents and datafiles