1 安装 oracle 后, 需要导入表数据, 操作如下:
连接数据库: sqlplus / as sysdba
创建表空间:
- create tablespace user_data
- logging
- datafile D:\oracle\oradata\Oracle9i\user_data.dbf
- size 50m
- autoextend on
- next 50m maxsize 20480m
- extent management local;
创建用户并指定表空间
create user username identified by password -- 注意数字密码有时需要双引号
- default tablespace user_data
- temporary tablespace user_temp;
给用户授权: grant connect,resource,dba to username;
导入数据: sqlplus user/password @数据库服务地址 <file_name.sql
2 重新运行上一次 sql 语句
sql>/
3 查询 oracle 数据库有多少表空间及表空间状态
select tablespace_name, block_size, status, contents, logging from dba_tablespaces;
4 获取表空间文件位置
SELECT file_id, file_name, tablespace_name, status, bytes from dba_data_files;
5 获取 oracle 用户数
select username,created,DEFAULT_TABLESPACE from dba_users;
来源: http://www.bubuko.com/infodetail-2545814.html