1.使用plsql:

sqlplus /nolog

(Linux:su - oracle)

2.连接数据库:

连接本地数据库:conn / as sysdba

远程连接数据库:conn username/[email protected]地址:端口/orcl;

3.查询当前的数据库名、服务名、实例名、表空间、用户名:

数据库:select name from V$database;

服务名:show parameter service_names;

实例名:select instance_name from V$instance;

表空间:select default_tablespace from dba_users where username=‘登录用户‘(用户名要大写)

用户名:select * from user_users;

4.用户管理

创建用户:create user ukey identified by aisino;

赋予权限:

grant connect,resource,dba to ukey;

grant create session to ukey;

查询该用户下的所有表:

select * from all_tables where owner=‘登录用户‘(用户名要大写)

select table_name from user_tables;

修改用户默认表空间:alter user dbcenter default tablespace DBCENTER_DATA

5.新建表空间:

create tablespace user_temp

tempfile 'D:\oracle\oradata\Oracle9i\user_temp.dbf'

size 50m

autoextend on

next 50m maxsize 20480m;

6.退出oracle:

quit

原文:https://www.cnblogs.com/GodSince/p/11973174.html

Logo

更多推荐