oracle数据库安装步骤

1: --在PLSQL或SQLPLUS中执行:
登录system用户normal权限的;

(不能用sys(超级用户),因为是DBA权限,建立的也是DBA权限的用户;DBA权限时,对建立的所有数据库的表空间都起作用,因此当在其他库中建立相同的表空间时会报错,“表空间已存在”;

2:
--在PLSQL或SQLPLUS中执行:
--建用户;
create user dianli identified by dianli;
grant dba, connect to dianli;

--用上面建立好的用户登录:
--建表空间;
create tablespace dianli datafile 'e:\oracle\mytbs01_new.dbf'
SIZE 5M AUTOEXTEND ON NEXT 5M MAXSIZE 1048M; --数据文件自增长;

-- DROP USER dianli CASCADE; --删除此用户名下的所有表和视图
--drop tablespace dianli including contents and datafiles --同时删除其数据库对象和数据文件


3: 导入数据库
用命令行执行(运行-cmd):
imp dianli/dianli@orcl file='e:\daochu0524.dmp' full=y

 

下面是导出备份数据库的语句,不用执行
用命令行执行(运行-cmd):
exp dianli/dianli@orcl file='d:\daochu.dmp' owner=dianli

---空表不能导出解决方案
Select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0 or num_rows is null --查询空表;
alter table table_name allocate extent; --分配空间

-- 参考:http://blog.sina.com.cn/s/blog_5f0e9ca50101it7n.html
oracle 11g不能导出空表的多种解决方法

posted @ 2016-09-12 10:50  zhier*#06*  Views(81)  Comments(0)    收藏  举报