Add a user (a schema with the same name as the user is automatically generated as the user is created)
Create user "TESTER" PROFILE "DEFAULT" identified by "TESTER" default tablespace "TESTDATA" temporary tablespace "TESTTEMP" account unlock;
(To be honest, these permissions are used in development. If you create a production environment, create system permissions for the user)
It is said that in the production environment, only the role like connect resource can be used.
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 A User: for example, if user A is created, you can delete the user.
Connect sys/password as sysdba;
Drop user A cascade; // the user is deleted.
Change the password and unlock
Alter user "SCOTT" identified "*******"
Alter user "SCOTT" ACCOUNT UNLOCK
1. View All Users:
Select * from dba_user;
Select * from all_users;
Select * from user_users;
2. view the user's 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 owned by the user:
Select * from dba_role_privs;
Select * from user_role_privs;
Create a username in Oracle
Connect to the ORACLE database:
1. Create your own Database in Oracle Database Assistant;
2. Create a connection to your database in Oracle Net8 Easy config and get a service name, IP Address: local IP address 127.0.0.1. database sid is your created
The SID of the database. Username: system, password: manager or your own password;
3. connect to your database in SQLPLUS with the username: system, password: manager or your own password, tom: the name of the service you just created.
4. display the current connected user: show user;
5. create a user and authorize the user: SQL> create user tom identified by password;
SQL> grant connect, resource to tom; // authorize
Note: authorization also includes: create any procedure, select any dictionary (required for oem login), select any table, etc.
6. Use the user you just created in sqlplus: tom/password to connect;
7. Create a tablespace.
Database initialization parameter file: init + Instance name. ora file, edit the content in this file, you can change the method used by the database and the allocated resources.
Start the ORACLE database, run svrmgr30 in DOS mode, enter connect internal, password: oracle, and then enter startup.
Create a tablespace: storage manager
Rollback segments can be created in storage manager.
Start oracle Database
In the DOS window, enter svrmgr30, start the Server Manager, enter connect internal, enter the oracle password, enter shutdown, close the database, enter startup, and start the database.
1. What is the initial password after Oracle is installed? Select advanced when installing 10 Gb later. You can set your own passwords.
Internal/oracle
Sys/change_on_install
System/manager
Scott/tiger
Sysman/oem_temp
Create a tablespace
Create tablespace test1 datafile 'd: tabletest1.dbf 'size 1 M;
Create a user named wjq whose default tablespace is test1. In SQL * PLUS, connect to the database as a SYS user and run the following script.
Create user wjq identified by password default tablespace test1;
Connect to sqlplus using user wjq
Create table t1 (empno NUMBER (5) primary key, ename VARCHAR2 (15) not null, job VARCHAR2 (10), mgr NUMBER (5), hiredate
Date default (sysdate), sal NUMBER (7,2), comm NUMBER (7,2 ));
Create table T2 and specify the TABLE space as test1: create table t2 (empno NUMBER (5) primary key, ename VARCHAR2 (15) not null,
Job VARCHAR2 (10), mgr NUMBER (5), hiredate date default (sysdate), sal NUMBER (7,2), comm NUMBER (7,2) TABLESPACE test1;
Insert record: insert into t1 values (101, 'wang', 'it', 25, '', 20, 20 );