linux重启oracle服务:
1.su - oracle —切换到oracle用户
2.lsnrctl stop ----停监听
3.sqlplus / as sysdba
4 .SQL>shutdown immediate —停止oracle
5.SQL> startup; ----启服务
6.SQL>exit;
7.lsnrctl start ----启监听
修改用户密码:
SQL>select username from dba_users;
SQL>alter user sys identified by 123456;
解决linux bash: lsnrctl: command not found:
#su - Oracle
切换帐户一定要加 “-”
否则会出现: bash:lsnrctl:command not found.错误
创建临时表空间:
create temporary tablespace TOMSPACE_TEMP tempfile ‘${ORACLE_HOME}\oradata\TOMSPACE_TEMP.bdf’ size 100m reuse autoextend on next 20m maxsize unlimited;
创建表空间:
create tablespace TOMSPACE datafile ‘${ORACLE_HOME}\oradata\TOMSPACE.dbf’ size 100M reuse autoextend on next 40M maxsize unlimited default storage(initial 128k next 128k minextents 2 maxextents unlimited);
创建用户和密码,指定上边创建的临时表空间和表空间:
create user tom identified by tom123 default tablespace TOMSPACE temporary tablespace TOMSPACE_TEMP;
赋予权限:
grant dba to tom;
grant connect,resource to tom;
grant select any table to tom;
grant delete any table to tom;
grant update any table to tom;
grant insert any table to tom;
TNS-12542: TNS:address already in use
解决办法:
ps -ef|grep LISTENER
oracle 222678 1 0 21:44 ? 00:00:08 /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr LISTENER -inherit
oracle 5740 5611 0 22:02 pts/1 00:00:00 grep LIS
kill 222678 因为已有监听在启动,kill掉进程即可。
再次启动即可。