标签:oracle、静默
建库后实例检查
ps -ef | grep ora_ | grep -v grep | wc -l
ps -ef | grep ora_ | grep -v grep
建库后监听检查
lsnrctl status
如果出现以下错误
lsnrctl: error while loading shared libraries: /u01/app/oracle/product/11.2.0/db_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied
解决办法:在root用户下执行以下命令
su - root
setenforce 0
15.修改oracle启动配置文件
su - oracle
vi /etc/oratab
racl:/u01/app/oracle/product/11.2.0/db_1:Y //把“N”改成“Y”
这样就可以通过dbstart 启动此实例,监听器。
dbstart $ORACLE_HOME
此时所有oracle的进程关闭,监听器也停止。
dbshut $ORACLE_HOME
再次查看监听器状态。
lsnrctl status
如果使用归档日志
sqlplus / as sysdba
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter database flashback on; (如果要启用数据库闪回功能则执行)
SQL> alter database open;
SQL> execute utl_recomp.recomp_serial(); (重新编译所有可能失效对象)
SQL> alter system archive log current; (手工归档测试)
默认安装的数据库用户检查
SQL> set lines 256 pages 500
SQL> select USER_ID,USERNAME,ACCOUNT_STATUS,DEFAULT_TABLESPACE from dba_users
建库后实例检查:
$ ps -ef | grep ora_ | grep -v grep
oracle 9743 0.0 1.7 743204 18664 ? Ss 23:47 0:00 ora_pmon_wang
oracle 9745 0.4 1.4 740956 15356 ? Ss 23:47 0:01 ora_vktm_wang
oracle 9749 0.0 1.4 740956 15504 ? Ss 23:47 0:00 ora_gen0_wang
oracle 9751 0.0 1.4 740956 15320 ? Ss 23:47 0:00 ora_diag_wang
oracle 9753 0.0 2.1 741492 23412 ? Ss 23:47 0:00 ora_dbrm_wang
oracle 9755 0.0 1.4 740956 15524 ? Ss 23:47 0:00 ora_psp0_wang
oracle 9757 0.0 1.7 741468 18820 ? Ss 23:47 0:00 ora_dia0_wang
oracle 9759 0.0 2.6 740956 28544 ? Ss 23:47 0:00 ora_mman_wang
oracle 9761 0.0 2.1 746712 23984 ? Ss 23:47 0:00 ora_dbw0_wang
oracle 9763 0.0 1.8 756508 20752 ? Ss 23:47 0:00 ora_lgwr_wang
oracle 9765 0.0 1.6 741468 18120 ? Ss 23:47 0:00 ora_ckpt_wang
oracle 9767 0.0 7.1 747664 77796 ? Ss 23:47 0:00 ora_smon_wang
oracle 9769 0.0 2.2 741476 25052 ? Ss 23:47 0:00 ora_reco_wang
oracle 9771 0.1 5.9 746928 64728 ? Ss 23:47 0:00 ora_mmon_wang
oracle 9773 0.0 2.0 740956 21864 ? Ss 23:47 0:00 ora_mmnl_wang
oracle 9775 0.0 1.4 742876 15428 ? Ss 23:47 0:00 ora_d000_wang
oracle 9777 0.0 1.3 742020 14616 ? Ss 23:47 0:00 ora_s000_wang
oracle 9831 0.0 1.5 740956 17436 ? Ss 23:47 0:00 ora_qmnc_wang
oracle 9846 0.0 4.1 745608 44952 ? Ss 23:47 0:00 ora_cjq0_wang
oracle 9848 0.0 3.0 742540 33700 ? Ss 23:48 0:00 ora_q000_wang
oracle 9850 0.0 1.6 740952 18496 ? Ss 23:48 0:00 ora_q001_wang
oracle 9861 0.0 1.4 740956 15696 ? Ss 23:52 0:00 ora_smco_wang
oracle 9863 0.0 1.8 740984 20516 ? Ss 23:52 0:00 ora_w000_wang
查看监听状态
$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 14-MAR-2012 07:09:03
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 14-MAR-2012 06:16:50
Uptime 0 days 0 hr. 52 min. 15 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oracle11gcentos6/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
Services Summary...
Service "hello.dlxg.gov.cn" has 1 instance(s).
Instance "hello", status READY, has 1 handler(s) for this service...
Service "helloXDB.dlxg.gov.cn" has 1 instance(s).
Instance "hello", status READY, has 1 handler(s) for this service...
The command completed successfully
13 修改数据库为归档模式(归档模式才能热备份,增量备份)
$ export ORACLE_SID=wang
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 14 07:18:16 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size 2213776 bytes
Variable Size 402655344 bytes
Database Buffers 1191182336 bytes
Redo Buffers 7360512 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database flashback on;
Database altered.
SQL> alter database open;
Database altered.
SQL> execute utl_recomp.recomp_serial();
PL/SQL procedure successfully completed.
SQL> alter system archive log current;
System altered.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
14 修改oracle启动配置文件
$vim /etc/oratab
racl:/u01/app/oracle/product/11.2.0/db_1:Y //把“N”改成“Y”
这样就可以通过dbstart 启动此实例,也可以通过dbshut关闭此实例了。
$ dbshut /u01/app/oracle/product/11.2.0/db_1/
Processing Database instance "hello": log file /u01/app/oracle/product/11.2.0/db_1/shutdown.log
此时所有oracle的进程关闭,监听器也停止。
$dbstart /u01/app/oracle/product/11.2.0/db_1/
Processing Database instance "hello": log file /u01/app/oracle/product/11.2.0/db_1/startup.log
此时监听器工作,hello实例运行,再次查看监听器状态。
$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 14-MAR-2012 07:35:52
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 14-MAR-2012 07:35:38
Uptime 0 days 0 hr. 0 min. 13 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oracle11gcentos6/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
Services Summary...
Service "hello.dlxg.gov.cn" has 1 instance(s).
Instance "hello", status READY, has 1 handler(s) for this service...
Service "helloXDB.dlxg.gov.cn" has 1 instance(s).
Instance "hello", status READY, has 1 handler(s) for this service...
The command completed successfully
以上就是安装的全部过程,如果想使用OEM管理和监控数据库,就要启动dbconsole了,如下:
$emctl start dbconsole
报这种错误:出现如下错误:
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.
网上说ORACLE_UNQNAME就是ORACL_SID,但我export ORACLE_SID=xxx设置后重新运行还是不行,不过报的是另外的错。
根据网上解决方法,可以重新创建 EM 资料档案库:
一。首先可以重建试下。
尝试解决步骤:
1,修改DBSNMP密码:
重新配置DBCONSOLE,需要输入DBSNMP密码,但任何密码都会显示错误,需要预先修改。
sql>alter user dbsnmp identified by xxx;
2,删除早期DBCONSOLE创建的用户:
sql>drop role MGMT_USER;
sql>drop user MGMT_VIEW cascade;
sql>drop user sysman cascade;
3,删除早期DBCONSOLE创建的对象:
sql>drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;
sql>drop public synonym SETEMVIEWUSERCONTEXT;
$emca -config dbcontrol db -repos create
按照提示做下去,一般会成功创建新资料档案库的,如果还是报错。
查看日志发现如下错误:
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-00955:nameis already used by an existing object
二。接下来使用如下方法:
Drop the Repository using RepManager:
<ORACLE_HOME>/sysman/admin/emdrep/bin/RepManager<hostname><listener_port> <sid> -action drop
例 如:
$cd /u01/app/oracle/product/11.2.0/db_1/sysman/admin/emdrep/bin
$./RepManager bobower 1521 racl -action drop
三。最后再重新建库。
$emca -config dbcontrol db -repos create
这样基本就是搞定了。
最后启动em
$ emctl start dbconsole
$netstat -tunpl |grep 1158
用浏览器访问https://hostname(或IP):1158/em登陆。
本文出自 “李鹏飞oracle” 博客,请务必保留此出处http://lipengfei666666.blog.51cto.com/6384154/1635663
标签:oracle、静默
原文地址:http://lipengfei666666.blog.51cto.com/6384154/1635663