vmware_redhat_oracle下载地址
系统涉及账号信息
root/root
oracle/oracle
设置虚拟机固定IP地址
设置/etc/hosts
vi /etc/hosts 将::1 注释掉 因为系统的hostname为bogon 所以也将该bogon添加到hosts文件中
放开防火墙
vi /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 1521 -j ACCEPT
重启防火墙
service iptables restart
重启一下redhat系统然后重连一下
su - oracle
sqlplus /nolog
conn / as sysdba
select * from user_users;
此时要启动oracle
SQL> startup shutdown关闭服务
创建表空间
进入命令行查询其它表空间存放位置
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/home/oracle/app/oradata/orcl/system01.dbf
/home/oracle/app/oradata/orcl/sysaux01.dbf
/home/oracle/app/oradata/orcl/undotbs01.dbf
/home/oracle/app/oradata/orcl/users01.dbf
/home/oracle/app/oradata/orcl/example01.dbf
创建表空间
create tablespace demo datafile '/home/oracle/app/oradata/orcl/demo.dbf' size 100M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO DEFAULT NOCOMPRESS;
创建用户
create user maqingbin
identified by 123456
default tablespace demo
quota 10m on DEMO
temporary tablespace temp ;
对用户进行授权
grant dba, connect to maqingbin;
开启监听
[root@localhost ~]# su - oracle
[oracle@localhost ~]$ lsnrctl start
客户端tnsnames.ora文件新增
192.168.201.189 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.201.189)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)