Oracle add user and empower, modify password, unlock, delete user's method _oracle

Source: Internet
Author: User
Tags sqlplus
Add users (automatically generate a schema with the same name as the user creates)
CREATE USER "TESTER" profile "default" identified by "TESTER" default Tablespace "TESTDATA temporary tablespace" testtemp "Account UNLOCK;
Empowering (to be honest, these permissions are the permissions used in development, and if the user produces the environment, create the appropriate system permissions for the user)
It is said that the production environment, just connect resource such a role can be.
GRANT "CONNECT" to "TESTER";
GRANT "RESOURCE" to "TESTER";
GRANT "DBA" to "TESTER";
GRANT "Exp_full_database" to "TESTER";
GRANT "Imp_full_database" to "TESTER";
Delete User: For example, create a user A, to delete it can do so
Connect sys/password as SYSDBA;
Drop User A cascade;//so the user is deleted
user changes password, unlock
ALTER USER "SCOTT" identified by "*******"
ALTER USER "SCOTT" account UNLOCK
1. View All users:
SELECT * from Dba_user;
SELECT * from All_users;
SELECT * from User_users;
2. View User system permissions:
SELECT * from Dba_sys_privs;
SELECT * from All_sys_privs;
SELECT * from User_sys_privs;
3. View User object permissions:
SELECT * from Dba_tab_privs;
SELECT * from All_tab_privs;
SELECT * from User_tab_privs;
4. View all roles:
SELECT * from Dba_roles;
5. View the roles that users have:
SELECT * from Dba_role_privs;
SELECT * from User_role_privs;
New User name in Oracle
To connect to an Oracle database:
1, in Oracle Database Assistant to establish their own databases;
2, in Oracle Net8 Easy config to establish a connection with their own database connection, take a service name, IP: for the local IP 127.0.0.1,database SID for you to build
SID of the database, Username: System, Password: Manager or the password you set;
3, in the Sqlplus to connect their own database, the user name is: System, Password: Manager or your own password, Tom: You have just established the service name.
4, display the current connection user: show user;
5, the new user and authorization: Sql>create user tom identified by password;
Sql> Grant Connect,resource to tom;//authorized
Note: Authorization also: Create any procedure,select any dictionary (login OEM required), select any table, etc.
6, in Sqlplus with the newly established user: tom/password, connection;
7, the establishment of table space.
Initialization parameter file for database: init+ instance name. ora file, edit the contents of this file, you can change the method used by the database and the allocated resources.
Start Oracle database, run SVRMGR30 in DOS mode, then enter connect internal, password: Oracle, then enter startup.
Table Space creation: Storage Manager
The rollback segment can be established in Storage Manager
Start Oracle Database
Under DOS window, enter SVRMGR30, start Server Manager, enter connect internal, enter password Oracle, enter shutdown, close database, enter startup, start database.
1. Oracle installation After the completion of the initial password? 10g after the installation of senior, password can set their own, oh, Scott/tiger is unchanged.
Internal/oracle
Sys/change_on_install
System/manager
Scott/tiger
Sysman/oem_temp
Create a table space
Create tablespace test1 datafile ' d:tabletest1.dbf ' size 1M;
Create a user named WJQ whose default tablespace is Test1. In Sql*plus, connect the database with the SYS user, and run the following script.
Create user WJQ identified by password default tablespace test1;
Connect Sqlplus with User Wjq
CREATE TABLE: Create TABLE T1 (empno number (5) PRIMARY KEY, ename VARCHAR2 not NULL, Job VARCHAR2 (a), Mgr Number (5), HireDate
DATE DEFAULT (sysdate), Sal number (7,2), comm Number (7,2));
Creates a table T2 and specifies that the table space for this table is test1:create table T2 (empno number (5) PRIMARY key,ename VARCHAR2 () not NULL,
Job VARCHAR2, Mgr Number (5), HireDate DATE DEFAULT (sysdate), Sal number (7,2), comm Number (7,2)) tablespace test1;
Insert record: INSERT INTO T1 values (MS, ' Wang ', ' it ', 25, ', 20,20);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.