//提交文章的时候,弹出个提示“文章中有违禁词汇,请修改”,检查之后才发现,里面我写了个“shabi”,cu博客还是挺人性化,赞一个!
重启Oracle:
Oracle由于打不到补丁,运行一段时间就出问题,准备重装,但是一直没重装,最近就是出了问题,就重启。。。
人总是很懒,最烦周末接电话了,中午tony打电话给我,说下星期有要给客户交付的东西么?我说没,然后说我们的主程请了婚假,进度咋办?他请假我都不知道,tony还不满意,说你们项目组的人请假你都不知道,你们好好沟通下吧。。。靠,这种请假是跟公司制度有关系,我虽然是项目的负责人,但请假他们是给他们直属领导请假的,这是公司的制度!!!
这种sb的制度,第一,请假人为什么不通知项目负责人?第二:他的直属领导为什么不通知他所在的项目的负责人?毕竟任务是从我这边分发的。
刚才客户又给我打电话说数据库的事儿,我不想弄,还得上vpn。。。我就说“你找XXX吧”,结果人家说是XXX让他找我了,我日。。。那就干吧。
好久没操作了,都tm忘记怎么整的了,命令都打错了,搞个sqlplus /nologin 。。。不废话了,写下操作步骤:
1.找到Oracle安装目录--bin目录
2.lnsrctl stop
3.sqlplus /nolog
4.conn /as sysdba;
5.shutdown immediate;
6.lnsrctl start
7.sqlplus /nolog
8.conn /as sysdba;
9.startup;
10.exit
很简单,但是注意查看屏幕打印的东西,是否报错。
- [oracle@cms01 ~]$ echo $ORACLE_HOME
- /u01/app/oracle/product/11.2/db1
- [oracle@cms01 ~]$ cd /u01/app/oracle/product/
- [oracle@cms01 product]$ ls
- 11.2
- [oracle@cms01 product]$ cd
- cd cdrdao cdrwtool
- cddb-slave2-properties cdrecord
- [oracle@cms01 product]$ cd 11.2/db1/
- apex/ cv/ instantclient/ mgw/ owm/ srvm/
- assistants/ dbs/ inventory/ network/ perl/ mn/ root.sh wwg/
- config/ EMStage/ ldap/ oracore/ scheduler/ xdk/
- crs/ has/ lib/ oraInst.loc slax/
- csmig/ hs/ log/ ord/ sqldeveloper/
- css/ ide/ md/ oui/ sqlj/
- ctx/ install/ mesg/ owb/ sqlplus/
- [oracle@cms01 product]$ cd 11.2/db1/bin/
- [oracle@cms01 bin]$ ls
- acfsroot emagtmc0 ldapmodifymt ott
- adapters emca ldapsearch owm
- d xmlcg
- emagent lcsscan orapwdO xmlwf
- emagent0 ldapadd oraxml xsl
- emagentdeploy.pl ldapaddmt oraxsl xsql
- EMAgentPatch.pm ldapbind orion xvm
- EMAgent.pm ldapcompare orionO zip
- emagtm ldapdelete osdbagrp
- emagtm0 ldapmoddn osdbagrp0
- emagtmc ldapmodify osh
- [oracle@cms01 bin]$ lsn
- lsnodes lsnrctl lsnrctl0
- [oracle@cms01 bin]$ lsnrctl stop
- LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 22-APR-2012 17:11:42
- Copyright (c) 1991, 2011, Oracle. All rights reserved.
- Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=cms01)(PORT=1521)))
- The command completed successfully
- [oracle@cms01 bin]$ sqlplus /nologin
- SQL*Plus: Release 11.2.0.3.0 Production on Sun Apr 22 17:11:59 2012
- Copyright (c) 1982, 2011, Oracle. All rights reserved.
- SQL*Plus: Release 11.2.0.3.0 Production
- Copyright (c) 1982, 2011, Oracle. All rights reserved.
- Use SQL*Plus to execute SQL, PL/SQL and SQL*Plus statements.
- Usage 1: sqlplus -H | -V
- -H Displays the SQL*Plus version and the
- usage help.
- -V Displays the SQL*Plus version.
- Usage 2: sqlplus [ [
-
- -C Sets the compatibility of affected commands to the
- version specified by . The version has
- the form "x.y[.z]". For example, -C 10.2.0
- -L Attempts to log on just once, instead of
- reprompting on error.
- -M "" Sets automatic HTML markup of output. The options
- have the form:
- HTML [ON|OFF] [HEAD text] [BODY text] [TABLE text]
- [ENTMAP {ON|OFF}] [SPOOL {ON|OFF}] [PRE[FORMAT] {ON|OFF}]
- -R Sets restricted mode to disable SQL*Plus commands
- that interact with the file system. The level can
- be 1, 2 or 3. The most restrictive is -R 3 which
- disables all user commands interacting with the
- file system.
- -S Sets silent mode which suppresses the display of
- the SQL*Plus banner, prompts, and echoing of
- commands.
- is: {[/][@] | / }
- [AS {SYSDBA | SYSOPER | SYSASM}] [EDITION=value]
- Specifies the database account username, password and connect
- identifier for the database connection. Without a connect
- identifier, SQL*Plus connects to the default database.
- The AS SYSDBA, AS SYSOPER and AS SYSASM options are database
- administration privileges.
- can be in the form of Net Service Name
- or Easy Connect.
- @[ | [//]Host[:Port]/]
- is a simple name for a service that resolves
- to a connect descriptor.
- Example: Connect to database using Net Service Name and the
- database net service name is ORCL.
- sqlplus myusername/mypassword@ORCL
- Host specifies the host name or IP address of the database
- server computer.
- Port specifies the listening port on the database server.
- specifies the service name of the database you
- want to access.
- Example: Connect to database using Easy Connect and the
- Service name is ORCL.
- sqlplus myusername/mypassword@Host/ORCL
- The /NOLOG option starts SQL*Plus without connecting to a
- database.
- The EDITION specifies the value for Session Edition.
- is: @|[.] [ ...]
- Runs the specified SQL*Plus script from a web server (URL) or the
- local file system (filename.ext) with specified parameters that
- will be assigned to substitution variables in the script.
- When SQL*Plus starts, and after CONNECT commands, the site profile
- (e.g. $ORACLE_HOME/sqlplus/admin/glogin.sql) and the user profile
- (e.g. login.sql in the working directory) are run. The files may
- contain SQL*Plus commands.
- Refer to the SQL*Plus User's Guide and Reference for more information.
- [oracle@cms01 bin]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.3.0 Production on Sun Apr 22 17:13:17 2012
- Copyright (c) 1982, 2011, Oracle. All rights reserved.
- SQL> conn /as sysdba;
- Connected.
- SQL> shutdown immediate;
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
- SQL> quit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
- With the Partitioning, OLAP, Data Mining and Real Application Testing options
- [oracle@cms01 bin]$ lsnrctl start
- LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 22-APR-2012 17:14:37
- Copyright (c) 1991, 2011, Oracle. All rights reserved.
- Starting /u01/app/oracle/product/11.2/db1/bin/tnslsnr: please wait...
- TNSLSNR for Linux: Version 11.2.0.3.0 - Production
- System parameter file is /u01/app/oracle/product/11.2/db1/network/admin/listener.ora
- Log messages written to /u01/app/oracle/diag/tnslsnr/cms01/listener/alert/log.xml
- Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cms01)(PORT=1521)))
- Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
- Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=cms01)(PORT=1521)))
- STATUS of the LISTENER
- ------------------------
- Alias LISTENER
- Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
- Start Date 22-APR-2012 17:14:37
- Uptime 0 days 0 hr. 0 min. 0 sec
- Trace Level off
- Security ON: Local OS Authentication
- SNMP OFF
- Listener Parameter File /u01/app/oracle/product/11.2/db1/network/admin/listener.ora
- Listener Log File /u01/app/oracle/diag/tnslsnr/cms01/listener/alert/log.xml
- Listening Endpoints Summary...
- (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cms01)(PORT=1521)))
- (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
- The listener supports no services
- The command completed successfully
- [oracle@cms01 bin]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.3.0 Production on Sun Apr 22 17:14:42 2012
- Copyright (c) 1982, 2011, Oracle. All rights reserved.
- SQL> conn /as sysdba;
- Connected to an idle instance.
- SQL> startup;
- ORACLE instance started.
- Total System Global Area 1.8840E+10 bytes
- Fixed Size 2236248 bytes
- Variable Size 2617245864 bytes
- Database Buffers 1.6173E+10 bytes
- Redo Buffers 47484928 bytes
- Database mounted.
- Database opened.
- SQL>
- SQL> quit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
- With the Partitioning, OLAP, Data Mining and Real Application Testing options
- [oracle@cms01 bin]$
启动oracle
su - oracle
sqlplus /nolog
conn /as sysdba
startup
exit
lsnrctl start
exit
关闭oracle
su - oracle
sqlplus /nolog
conn /as sysdba
// conn as username/passwd
shutdown immediate
exit
lsnrctl stop
exit
****************************************************************************
linux下安装oracle10g,在执行autorunner之前,执行xhost+ 上次是报dispaly变量错误,所以才无法打开图形界面安装。
又在csdn上看到这个哥们写的比较详细的操作步骤,分享一下:
- 在实际的应用中,有时候工作数据库需要重新启动。本文介绍了一个特别实用的操作步骤,希望对大家有所帮助。
- 1. 停应用层的各种程序
- 2. 停Oralce的监听进程
- $ lsnrctl stop
- 3. 在独占的系统用户下,备份控制文件:
- $ sqlplus "/as sysdba"
- SQL> alter database backup controlfile to trace;
- 4. 在独占的系统用户下,手工切换重作日志文件,确保当前已修改过的数据存入文件:
- SQL> alter system switch logfile;
- 5. 在独占的系统用户下,运行下面SQL语句,生成杀数据库用户连接的kill_all_session.sql文件:
- SQL> set head off;
- SQL> set feedback off;
- SQL> set newpage none;
- SQL> spool ./kill_session.sql
- SQL> select 'alter system kill session ''' sid ',' serial# ''';' from v$session where username is not null;
- SQL> spool off;
- 6. 在独占的系统用户下,执行杀数据库用户连接的kill_session.sql文件
- SQL> @./kill_session.sql
- 7. 在独占的系统用户下,用immediate方式关闭数据库:
- SQL> shutdown immediate;
- 或者
- SVRMGRL> shutdown immediate;
- 8. 启动oralce的监听进程
- $ lsnrctl start
- 9. 进入独占的系统用户下,启动Oralce数据库
- $ sqlplus /nolog
- SQL> connect / as sysdba
- SQL> startup;
- 或者
- $ svrmgrl
- SVRMGRL> connect internal;
- SVRMGRL> startup;
- 10.启动应用层的各种程序
尊重作者,原文地址:http://blog.csdn.net/usthycp/article/details/3847624
阅读(1538) | 评论(0) | 转发(0) |