A, install,
1. Download the Oracle database from its official website
https://www.oracle.com/database/technologies/oracle-database-software-downloads.html
Choose the version and click on SeeAll to download it
2, installation,
Unpack the downloaded installation package and click setup.exe
1) The email can be automatically updated without filling
2) Create and configure the database
3) Click the Desktop class
4) Use a virtual account
Using the virtual account: the Oracle home directory user used for the Oracle database single-instance installation.
Use existing Windows Users: If you select this item, you need to specify users that do not have administrative rights.
Create a New Windows user: Create a new user and enter the user name and password. The new user does not have Windows login permission.
Use Windows Built-in account: An account that Microsoft sets up for users to log in to the system when they start Windows.
Here I choose virtual account, which is also one of oracle’s official recommendations.
Note: If you select the second option, the created user name and the existing user name must not conflict, otherwise the later installation will report an error!
5) Configure the download address
6) set the password, super administrator password is this password, you can set a simple he will remind you, directly ignore it.
To create a container database, check whether the check box is checked or not. To create a container database, check whether the check box is checked.
7) Preconditions check, some errors will appear to see whether the previous download is clean uninstall, mine is the last error, I installed again ah directly successful, try not to ignore because the next step will report an error can not find the file.
The password is the one you just set
Test whether you can log in
9) Login is successful
Second, the use of
1. Create a user with a superuser
1) Oracle database creates a superuser at the beginning, and the password is the password we entered the first time
User name: sys as sysdba
Password: Enter the password for the first time during installation
Log in to sqlPlus as superuser and start creating users
create user c## identified by; // Create a public userCopy the code
Ora-65096: public user name or role name invalid
2) Switch to pdBoace service
select con_id, dbid, guid, name , open_mode from v$pdbs; Alter pluggable database pdBOAEc open; // open the PDB service with the name pdboaecCopy the code
After making the changes, you can create users
create user username identified by password; // The user has been createdCopy the code
2. Create a database
1) We click on the Database Configuration Assistant of oracle Database to create a new Database
Click to create a new database directly and remove the √ from create as a container database
It may take a long time to wait. I have been waiting for almost 20 minutes. After installation, there is a password for management, and you can unlock the required account and close it directly.
3. Log in to the database
1) Log in as the super administrator sys as sysdba. Password: the password you entered
2) Create a user
create user userName identified by password;
Copy the code
3) Change the password
Alter user userName identified by password //Copy the code
4) By default, after a user is created, the system assigns a tablespace (Users) to the user.
select username, default_tablespace from dba_users;
Copy the code
5) In development situations, of course, we do not use the user’s default table space, so we need to create a table space.
create tablespace ts_zzg datafile 'E:\Study\Oracle\oradata\ORCLTEST\DATAFILE\test_zhang.dbf' size 200M;Copy the code
Empfile is the path of the temporary tablespace file, and datafile is the path of the datafile of the tablespace. The default datafile path is $ORACLE_HOME/oradata/$SID. $ORACLE_HOME is the Oracle installation directory, and $SID is the instance name of the database.
6) drop the tablespace, and drop the corresponding tablespace file
Include contents and datafiles cascade constraint;Copy the code
Create table space, allocate table space to user.
alter user oracle default tablespace test_zhang;Copy the code
Mysql > alter table space allocated to user; mysql > alter table space allocated to user
grant create session,create table,create view,create sequence,unlimited tablespace to userName;Copy the code
9) Finally, we can also delete the user and its associated objects
drop user userName cascade;Copy the code