手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

如何创建Oracle新用户(新schema)

[日期:2012-06-09] 来源:Linux社区  作者:michael [字体:大 中 小]

Oracle中创建新的user, 也就相应地创建了一个新的schema, 用来区别其他目录的同时, 还保存所有相关user的数据对象以及user的表.

How to create a new user? (create a new db)

首先用system(默认密码为manager)用户登陆连接数据库.

The statement create user creates a user.
In the most simple form, the create user statement is one of the following three:

  1. create user alfredo identified by alfredos_secret;   
  2. create user alfredo identified externally;   
  3. create user alfredo identified globally as 'external_name';  

The first one creates a local user, the second one creates an external user while the last one creates global user.

How to create locked users?

A user can be created locked, that is, the user cannot connect to the database.

SQL> create user alfredo identified by passw0rd account lock;

The user is now created, he can be granted some rights, for example the right to connect to the database:

SQL> grant connect to alfredo;  

Now, if the user tries to connect to the database, he will get ORA-28000:

  1. SQL> connect alfredo/passw0rd   
  2. ERROR:   
  3. ORA-28000: the account is locked  

The user can now be unlocked with an alter user statement:

SQL> alter user alfredo account unlock;  

Which allows Alfredo to log on to the database now:

  1. SQL> connect alfredo/passw0rd   
  2. Connected.  
linux
相关资讯       Oracle存储过程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款