Oracle database create users, import data, export data

Time:2020-11-27

After Oracle 11g is installed on the computer and the environment variables are configured, the following operations can be performed.

 

Open the start menu in the lower left corner of the computer, search the blue below and enter [CMD]

Enter [sqlplus / as SYSDBA] to enter ORALCE console

Create a table space:
1. Temporary table space:
create temporary tablespace portal_temp tempfile ‘E:\Oracle_orcl\portal_temp.dbf’ size 50m autoextend on next 50m maxsize 20480m extent management local;
2. Table space:
CREATE TABLESPACE portal LOGGING DATAFILE ‘E:\Oracle_orcl\portal.DBF’ SIZE 32M AUTOEXTEND ON NEXT 32M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL;

3. Create user:
create user portal identified by portal_123456 DEFAULT TABLESPACE portal TEMPORARY TABLESPACE portal_temp;

Note: the portal needs to be consistent with the portal of the table space
Note: create user portal identified by portal_ 123456: the user name is hnyxgk and the password is portal_ one hundred and twenty-three thousand four hundred and fifty-six
Note: default tablespace portal temporary tablespace portal_ Temp: tells the database to let the specified user use the table space created above
Note: if it is a 12C database, the user name should be preceded by C ාාාාාාාාාාාාාාාාාා

4. Authorization:
grant dba,resource,connect to portal;

5. Import database:
imp portal/portal_ 123456 file = D: – can collect OA / office network data backup / portal20200731. DMP full = y ignore = y statistics = none buffer = 81920

Export database
exp portal/[email protected]:1521/portal file=D:\portal20200731.dmp owner=portal

 

Note: all marked in red should be changed by ourselves