下载Oracle:
https://www.oracle.com/database/technologies/xe-prior-releases.html
安装:
解压下载后的文件,运行DISK1/setup.exe
Unzip the download and run the DISK1/setup.exe
中间有一步骤设置密码,设置123
启动数据库
启动应用 Start Database
设置用户并授权
win+r–cmd
C:\Users\dongzhensong>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on 星期日 12月 27 23:09:21 2020
Copyright (c) 1982, 2014, Oracle. All rights reserved.
连接到:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL> create user shop identified by 123;
用户已创建。
SQL> grant connect,resource,dba to shop;
授权成功。
SQL> show user;
USER 为 "SYS"
SQL>
使用新建的用户连接数据库:
SQL> conn shop/123;
已连接。
SQL> show user;
USER 为 "SHOP"
SQL>
创建表插表查表
SQL> create table t_stu(
2 stuid number(10) primary key,
3 stuname varchar2(20) not null,
4 stusex varchar2(2)
5 );
表已创建。
SQL> insert into t_stu(stuid,stuname,stusex) values(1,'董','1');
已创建 1 行。
SQL> select * from t_stu;
STUID STUNAME STUS
---------- ---------------------------------------- ----
1 董 1