查询oracle各表数据量大小
select t.table_name,t.num_rows from user_tables t ORDER BY NUM_ROWS DESC;
禁止所有表约束的SQL
select 'alter table ' + name + ' nocheck constraint all' from sysobjects where type='U'删除所有表数据的SQL
select 'truncate table ' + name from sysobjects where type='U'
恢复所有表约束的SQL
select 'alter table ' + name + ' check constraint all' from sysobjects where type='U'
创建临时表空间
create temporary TABLESPACE temp_data tempfile 'c:\oracle\oradata\TEMP_DATA.dbf' size 250M autoextend on next 5M maxsize unlimited extent management local;
创建表空间
create tablespace CGW_DATA datafile 'c:\oracle\oradata\CGW_DATA.dbf' size 500M
autoextend on next 5M maxsize unlimited extent management local;
表空间扩容
Meathod1:给表空间增加数据文件
ALTER TABLESPACE app_data ADD DATAFILE
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF' SIZE 50M;
Meathod2:新增数据文件,并且允许数据文件自动增长
ALTER TABLESPACE app_data ADD DATAFILE
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP04.DBF' SIZE 50M
AUTOEXTEND ON NEXT 5M MAXSIZE unlimited;
Meathod3:允许已存在的数据文件自动增长
ALTER DATABASE DATAFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF'
AUTOEXTEND ON NEXT 5M MAXSIZE 100M;
Meathod4:手工改变已存在数据文件的大小
ALTER DATABASE DATAFILE 'c:\oracle\oradata\CGW_DATA.dbf' RESIZE 500M;
--//创建用户并指定表空间
create user cgw_test identified by changxin
default tablespace cgw_data
temporary tablespace cgw_temp;
--//给用户授予权限
grant dba , connect, resource to cgw_test;
导出dmp
exp kf/zx@10.10.10.26/orcl file=d:\zxcc.dmp full=y
导入dmp
imp kf/zx@10.10.10.26/orcl file=d:\zxcc.dmp full=y
仅导入数据
imp kf/zx@10.10.10.26/orcl file=d:\zxcc.dmp data_only=y
查询进程
Select count(*) from v$process ;
查询会话
Select value from v$parameter where name='processes'
拷贝大字段
UPDATE tb_dzblsyxx t1
SET (blbg) = (
SELECT (blbg)
FROM tb_dzblsyxx_bak2 t2
WHERE t2.id$ = t1.id$)
还没有评论,来说两句吧...