Window10环境下安装oracle12c及注意事项

Window10环境下安装oracle12c及注意事项

**
1、下载
访问oracle官网(https://www.oracle.com/database/technologies/oracle-database-software-downloads.html)找到对应的版本然后进行下载。
2、解压
Window10环境下安装oracle12c及注意事项
将下载的zip包放到同一个目录下,并解压到当前目录:
Window10环境下安装oracle12c及注意事项
3、安装
进入database目录,点击setup.exe进行安装。具体注意事项可以参考以下这篇文章:https://blog.csdn.net/qq_37939251/article/details/82964479
4、创建用户
安装完成后,会默认存在数据库orcl,由于orcl属于容器数据库,在创建用户、授权时,需要添加前缀:c##。例如:create user C##test identified by test,grant connect,resource,dba to C##test;
如果想不使用c##,则需要创建一个新的数据库,在创建的时候,勾掉“创建为容器数据库”。
Window10环境下安装oracle12c及注意事项
以下是常用的命令:
 create user mondb identified by “mondb”;
 create tablespace mondbts datafile ‘e:\app\tablespace\mondbts.dfb’ size 50M autoextend on next 10M;
注意:目录e:\app\tablespace必须存在。
 alter user 用户名 quota unlimited on 表空间;
 grant connect,resource to demo;
 grant create any sequence to demo;
 grant create any table to demo;
 grant delete any table to demo;
 grant insert any table to demo;
 grant select any table to demo;
 grant unlimited tablespace to demo;
 grant execute any procedure to demo;
 grant update any table to demo;
 grant create any view to demo;
 select * from v$version; 查询数据库版本
 SELECT TABLE_NAME,PARTITION_NAME,TABLESPACE_NAME FROM USER_TAB_PARTITIONS;查询表分区情况

5、登录
Oracle12c可以通过em登录数据库,例如https://localhost:5501/em,如果创建了多个数据库,需要修改对应的端口就行访问。由于oracle12c没有emctl命令,可以通过以下方式进行查询:
 通过cmd命令:lsnrctl status。
Window10环境下安装oracle12c及注意事项
其中:protocol=tcps,如果等于tcps,需要https访问。
 执行sql:select dbms_xdb_config.gethttpsport() from dual;

Window10环境下安装oracle12c及注意事项
查询到对应的端口,可以浏览器直接访问:使用sytem用户登录

Window10环境下安装oracle12c及注意事项