【Oracle】数据库迁移

42 阅读1分钟

查看数据文件的位置

select
b.file_name 物理文件名,
b.tablespace_name 表空间,
b.bytes/1024/1024 大小M,
(b.bytes-sum(nvl(a.bytes,0)))/1024/1024 已使用M,
substr((b.bytes-sum(nvl(a.bytes,0)))/(b.bytes)*100,1,5) 利用率
from dba_free_space a,dba_data_files b
where a.file_id=b.file_id
group by b.tablespace_name,b.file_name,b.bytes
order by b.tablespace_name;

创建表空间

create tablespace zlbApp
logging
datafile 'D:\ORACLECLIENT\APP\ADMIN\ORADATA\ORCL\ZLBAPP01.DBF'
size 2048m
autoextend on
next 512m maxsize 10240m      extent management local;   

创建用户

create user 用户名 identified by 密码 default tablespace 命名空间名;

授权

grant connect,resource,dba to 用户名;