1、登录: win + r 打开 cmd 命令界面。
2、先用DBA登陆:sqlplus / as sysdba;
3、再连接库:conn 用户/密码@sid;
例如:conn system/exer@exer;
4、修改密码:alter user 用户 identified by 密码;
列如:alter user system identified by exer;
5、解锁用户:alter user 用户 account unlock;
列如:alter user system account unlock;
6、查询用户角色:select * from dba_role_privs where grantee = '用户';
列如:select * from dba_role_privs where grantee = 'SCOTT';
或者:show user;
select * from user_role_privs;
7、查询角色的权限:select * from role_sys_privs;
8、赋予权限:grant create table to scott; //创建表权限
grant create procedure to scott;
grant create session to scott; //创建会话权限
grant dba to scott; //授予最高权限
删除dba权限: revoke dba from scott;
9、导出
一:将服务器上的ORACLE数据库导入到本地机子上;
具体方法:
在CMD模式下执行以下命令
1\导出:
exp 用户名/密码@服务器端数据库ID owner=用户名 file=c:/文件名.dmp
例如:
exp system/test@192.168.168.16:1521/test owner=system file=e:/test.dmp
10、检查了使用system表空间的用户
select distinct owner from dba_segments where tablespace_name='SYSTEM';
2、先用DBA登陆:sqlplus / as sysdba;
3、再连接库:conn 用户/密码@sid;
例如:conn system/exer@exer;
4、修改密码:alter user 用户 identified by 密码;
列如:alter user system identified by exer;
5、解锁用户:alter user 用户 account unlock;
列如:alter user system account unlock;
6、查询用户角色:select * from dba_role_privs where grantee = '用户';
列如:select * from dba_role_privs where grantee = 'SCOTT';
或者:show user;
select * from user_role_privs;
7、查询角色的权限:select * from role_sys_privs;
8、赋予权限:grant create table to scott; //创建表权限
grant create procedure to scott;
grant create session to scott; //创建会话权限
grant dba to scott; //授予最高权限
删除dba权限: revoke dba from scott;
9、导出
一:将服务器上的ORACLE数据库导入到本地机子上;
具体方法:
在CMD模式下执行以下命令
1\导出:
exp 用户名/密码@服务器端数据库ID owner=用户名 file=c:/文件名.dmp
例如:
exp system/test@192.168.168.16:1521/test owner=system file=e:/test.dmp
10、检查了使用system表空间的用户
select distinct owner from dba_segments where tablespace_name='SYSTEM';