linux下oracle 操作
准备:在创建实例前必须用netca创建一个监听。
1、创建数据库实例
bin目录下执行 dbca
oracle用户在linux桌面下执行如果报错误:
xlib:connection to ":0.0" refuesed by server
xlib:No protocol specified
解决办法root下执行:
#xhost local:oracle non-network local connections being added to access control list 参考地址:http://icooke.blog.51cto.com/4123148/802353
2、启动监听
bin目录 执行lsnrctl start
3、启动监听配置
netmgr
4、启动数据库
dbstart $ORACLE_HOME(关闭数据库dbshut $ORACLE_HOME)
4、启动控制台
# emctl start
配置完成后执行:
emctl start dbconsole
in 11.2 dbconsole, the $ORACLE_UNQNAME needs to be set rather than $ORACLE_SID
Error starting Database Control.Please execute the following command(s).
1) Set the environment variable ORACLE_UNQNAME to Database unique name
2) /opt/app/oracle/product/11.2.0/dbhome_1/bin/emctl start dbconsole
关闭vnc服务
shell>/etc/init.d/vncserver stop
成功后可使用
https://192.168.120.149:1158/em/console访问
5、设置oracle随linux一起启动
#cd /etc/rc.d
#vi rc.local
加入
su - oracle -c "lsnrctl start"
su - oracle -c "dbstart $ORACLE_HOME"
su -oracle -c "emctl start dbconsole"