Oracle创建表空间用户等
1、查询其他表空间文件存放路径
select name from v$datafile;
2、创建表空间
create tablespace 表空间名称
datafile 'D:\ORACLE\ORADATA\HRST\HRST.DBF' size 100M
autoextend on next 100M maxsize unlimited;
3、创建用户
create user 用户名 identified by 密码
default tablespace tabelname;
4、给用户授权
grant resource,connect,dba to 用户名;
5、删用户:select * from dba_users
6、查用户:drop user 用户名 cascade
7、查找表空间路径:select * from dba_data_files
8、删表空间: drop tablespace 表空间名 including contents and datafiles cascade constraint
9、查报错日志: t_db_errorlog order by LOGDATE desc;
10、无法删除正在连接的用户:可先查询该用户的进程session值:select user name,sid,serial# from v$session where username='用户名',
再杀死进程:alter system kill session '199, 2321',最后执行删除用户的操作; drop user 用户名 cascade
11、 修改密码:alter user vta identified by vta_2017;
12、创建DBLink:
create public database link DBLinkName(DBLink名称)
connect to username(资源库用户) identified by password(资源库用户密码)
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 资源库所在服务器IP地址)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME =资源库服务名)
)
)';
13、Database Link的查看: select owner,object_name from dba_objects where object_type='DATABASE LINK';
或者select * from dba_db_links;
14、Database Link的删除: drop public database link dblinkname;(注意创建时是否含 public权跟)