oracle学习之路(一)

1、使用sqlplus登录oracle服务器

如果是本机 使用sqlplus username/password (sa sysdba、as sysoper)即可

如果远程登录 则使用 sqlplus username/password@ip/dbname(sa sysdba、as sysoper)



2、创建、删除用户

create user username identified by password;

DROP USER username CASCADE


3、查看用户表空间

      select username,default_tablespace from user_users;


4、创建、删除表空间

CREATE TABLESPACE nameDATAFILE 'E:\tablespace\demo' size 800M  

EXTENT MANAGEMENT LOCAL 

SEGMENT SPACE MANAGEMENT AUTO;


drop tablespace test_data including contents and datafiles


5、授权表空间

 grant unlimited tablespace to username;  

6、修改默认表空间

  alter user username default tablespace tablespacename;

7、查看登录用户的角色权限

select * from role_sys_privs;

8、导入导出备份文件

     exp demo/demo@127.0.0.1:1521/orcl file=f:/f.dmp full=y  

exp demo/demo@orcl file=f:/f.dmp full=y  

imp demo/demo@orcl file=f:/f.dmp full=y ignore=y

将数据导入不同的用户

imp system/密码 fromuser=源用户名  touser=目标用户名  file=xxx.dmp  ignore=y  grants=y 

imp system/manager@orcl file=tank log=tank fromuser=seapark TABLES=(a,b)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值