1、linux 下oracle的启动
<wbr><wbr> 以<span style="font-family:Times New Roman">oracle</span>身份登录<span style="font-family:Times New Roman"><wbr></wbr></span></wbr></wbr>
<wbr><wbr> 启动<span style="font-family:Times New Roman"><wbr><wbr>lsnrctlstart</wbr></wbr></span></wbr></wbr>
<wbr><wbr> 登录<span style="font-family:Times New Roman"><wbr><wbr>sqplus/nolog</wbr></wbr></span></wbr></wbr>
<wbr><wbr>连接数据库</wbr></wbr><wbr>connect<wbr>/as<wbr><wbr>sysdba</wbr></wbr></wbr></wbr>
<wbr><wbr> 启动数据库<span style="font-family:Times New Roman"><wbr><wbr>startup</wbr></wbr></span></wbr></wbr>
<wbr><wbr> 关闭数据库<span style="font-family:Times New Roman"><wbr><wbr>shutdownimmediate</wbr></wbr></span></wbr></wbr>
2、<wbr></wbr>在数据中创建用户名
<wbr><wbr> 启动数据库后创建用户名</wbr></wbr>
<wbr><wbr> 连接超级用户<span style="font-family:Times New Roman"><wbr><wbr>connectsystem/admin<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>system</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></span> 系统用户名字<span style="font-family:Times New Roman"><wbr>admin</wbr></span> 密码</wbr></wbr>
<wbr><wbr> 创建用户名字<span style="font-family:Times New Roman"><wbr><wbr>create<wbr>user<wbr> SYSDATA<wbr> identified<wbr>by<wbr>admin<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></span>用户名:SYSDATA<span style="font-family:Times New Roman"><wbr><wbr><wbr></wbr></wbr></wbr></span>密码:<span style="font-family:Times New Roman">admin</span></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>可以写<wbr><wbr>Defaulttablespaceuser<wbr><wbr>//</wbr></wbr></wbr></wbr>指定存储对象使用的默认空间表默认是system
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>Temporarytablespace temp; //</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>保存临时对象所使用的空间表默认是system
<wbr><wbr><wbr><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>上面的俩行,可以写空间表为user临时为temp;不写就默认
3、<wbr></wbr>添加用户的权限
Grant是授予权限的如:
<wbr><wbr><wbr><wbr>Grantcreate session to SYSDATA</wbr></wbr></wbr></wbr>;//授予SYSDATA连接数据的权限
<wbr></wbr>系统权限如下:
<wbr></wbr>
系统特权 | 允许执行的操作 |
Create session | 连接数据库 |
Create sequence | 创建序列 |
Create synonym | 创建同名对象 |
Create table | 创建表 |
Create any table | 创建任何模式的表 |
Droptable | 删除表 |
Create procedure | 创建存储过程 |
Execute any procedure | 执行任何模式的存储过程 |
Create user | 创建用户 |
Create view | 创建视图 |
Dropuser | 删除用户 |
Dropany table | 删除任何模式的表 |
<wbr></wbr>
4、<wbr></wbr>向用户授予系统特权
<wbr><wbr><wbr><wbr><wbr><wbr>Grant execute any procedure to<wbr>SYSDATA with adminoption<wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> 此句意思为为<span style="font-family:Times New Roman">sha</span>用户创建系统特权并且可以用<span style="font-family:Times New Roman">SYSDATA</span>为别的用户授予权限</wbr></wbr>
<wbr><wbr> 连接<span style="font-family:Times New Roman">SYSDATA</span>用户<span style="font-family:Times New Roman"><wbr>connectSYSDATA/admin</wbr></span></wbr></wbr>
<wbr><wbr> 可以创建别的用户</wbr></wbr>
5、查看用户权限
<wbr><wbr> 进入<span style="font-family:Times New Roman">SYSDATA</span>用户<span style="font-family:Times New Roman">connect SYSDATA/admin</span></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr>Select * from user_sys_privs;</wbr></wbr></wbr></wbr></wbr></wbr>可以查看到一个列表,
<wbr><wbr>列代表用户名权限是否可以给别的用户附加权限(<span style="font-family:Times New Roman">N</span>、<span style="font-family:Times New Roman">Y</span>)<span style="font-family:Times New Roman"><wbr></wbr></span></wbr></wbr>
<wbr><wbr> 行代表权限都有那些</wbr></wbr>
6、撤销用户授予的权限
<wbr><wbr> 必须连接<span style="font-family:Times New Roman">connect system/admin</span></wbr></wbr>
<wbr><wbr> 撤销权限<span style="font-family:Times New Roman"><wbr>revoke</wbr></span>是系统撤销权限的关键词</wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr>Revoke execute any procedure from SYSDATA</wbr></wbr></wbr></wbr></wbr></wbr>;
7、更改用户密码
<wbr><wbr> 进入<span style="font-family:Times New Roman">SYSDATA</span>用户<span style="font-family:Times New Roman"><wbr>connectSYSDATA/admin</wbr></span></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr>Password<wbr><wbr><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>输入旧密码<wbr></wbr>输入新密码俩边<wbr><wbr>OK</wbr></wbr>
<wbr><wbr> 或者用<span style="font-family:Times New Roman">alter user <wbr>SYSDATA identifiedby xinmima</wbr></span></wbr></wbr>
8、删除用户
<wbr><wbr><wbr><wbr><wbr><wbr>Connect system/admin</wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr>Drop user SYSDATA</wbr></wbr></wbr></wbr></wbr></wbr>;
9、为用户授予角色
<wbr><wbr><wbr><wbr><wbr><wbr>Grant dba to SYSDATA</wbr></wbr></wbr></wbr></wbr></wbr>;
<wbr><wbr><wbr><wbr><wbr><wbr>Grant connect to SYSDATA</wbr></wbr></wbr></wbr></wbr></wbr>;
<wbr><wbr><wbr><wbr><wbr><wbr>Linux</wbr></wbr></wbr></wbr></wbr></wbr>下的plsql<wbr></wbr>创建用户
<wbr><wbr><wbr><wbr><wbr><wbr>create user SYSDATA identified by admin</wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr>Default tablespace user</wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr>Temporary tablespace temp;</wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr>Granr unlimited tablespace to SYSDATA</wbr></wbr></wbr></wbr></wbr></wbr>;<wbr><wbr><wbr>//</wbr></wbr></wbr>权限
<wbr><wbr><wbr><wbr><wbr><wbr>Grant dba to SYSDATA</wbr></wbr></wbr></wbr></wbr></wbr>;<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>//</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>角色
<wbr><wbr><wbr><wbr><wbr><wbr>Grant connect to SYSDATA</wbr></wbr></wbr></wbr></wbr></wbr>;