oracle常用命令1

1、连接到oracle
                                      SQL*Plus system/manager
2、显示当前连接用户
                                      SQL> show user
3、查看系统拥有哪些用户
                                      SQL> select * from all_users;
4、新建用户并授权
                                      SQL> create user a identified by a;(默认建在SYSTEM表空间下) 
                                      SQL> grant connect,resource to a;
5、连接到新用户 
                                      SQL> conn a/a
6、查询当前用户下所有对象 
                                      SQL> select * from tab;
7、建立第一个表 
                                      SQL> create table a(a number);
8、查询表结构 
                                      SQL> desc a
9、插入新记录 
                                      SQL> insert into a values(1);
10、查询记录 
                                      SQL> select * from a;
11、更改记录 
                                      SQL> update a set a=2;
12、删除记录 
                                      SQL> delete from a;
13、回滚 
                                      SQL> roll; 
                                      SQL> rollback;
14、提交 
                                      SQL> commit;
15、用户授权: 
                                      GRANT ALTER ANY INDEX TO "user_id " 
                                      GRANT "dba " TO "user_id "; 
                                      ALTER USER "user_id " DEFAULT ROLE ALL
16、创建用户: 
CREATE USER "user_id " PROFILE "DEFAULT " IDENTIFIED BY " DFAULT TABLESPACE " USERS " TEMPORARY TABLESPACE "TEMP " ACCOUNT UNLOCK;
GRANT "CONNECT " TO "user_id ";
17、用户密码设定:
ALTER USER "CMSDB " IDENTIFIED BY "pass_word "
18、表空间创建:
CREATE TABLESPACE "table_space " LOGGING DATAFILE
'C:/ORACLE/ORADATA/dbs/table_space.ora' SIZE 5M

本文来自: 脚本之家(www.jb51.net) 详细出处参考:http://www.jb51.net/article/7827.htm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值