1.连接到服务器,由root账户切换到orale账户下(su - oracle ) ,在切换至dba 账户(sqlplus / as sysdba)
2 建立临时表空间 和永久表空间(实际存放地址)
(1)临时:
select name from v$tempfile;(查询当前的临时表)
create temporary tablespace temp tempfile ‘/home/yyt/oracle/y_temp.dbf’ size 500m autoextend on ;
(2)永久:
select name from v$datafile;(查看当前永久表)
create tablespace user datafile ‘/home/yyt/oracle/yuser_temp.dbf’ size 500m autoextend on;(当前开启了表空间的自动扩展功能,一般是开启的。)
3 建立用户:
create user uname identified by password default tablespace user temporary tablespace temp;
可能出现的问题:表空间不存在,(关闭当前oracle 重启一下 shutdown startup )
4 授权:
grant dba to name ;
grant connect,resource to name ;
grant select any table to name ;
grant delete any table to name ;
grant update any table to name ;
grant insert any table to name ;
5 表空间出现问题,重装,修改name等
查询当前的表空间:
select tablespace_name from user_tablespaces;
drop:(移除掉所有的表空间以及文件)
drop tablespace name including contents and datafiles;
修改表空间name:
alter tablespace userdname rename to nowname;
删除用户:drop user uname cascade;
6 liunx下面进入oracle乱码问题
xshell 解决:export NLS_LANG=“SIMPLIFIED Chinese_CHINA.AL32UTF8” (单次进入有效);
或者进入 vim /etc/profile 修改path (永久)