误删/home/oracle/恢复

本文记录了Oracle11g数据库安装后的配置步骤,包括环境变量设置、监听器状态验证及数据库启动情况检查等关键操作。通过具体命令演示如何进行基本的Oracle管理任务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[root@11g home]# rm -rf oracle/
[root@11g home]# ls
[root@11g home]# su - oracle
su: warning: cannot change directory to /home/oracle: No such file or directory
-bash-4.1$ 
-bash-4.1$ pwd
/home
-bash-4.1$ mkdir oracle
mkdir: cannot create directory `oracle': Permission denied
-bash-4.1$ exit
logout
[root@11g home]# mkdir oracle
[root@11g home]# chown -R oracle:oinstall oracle
[root@11g home]# cp /etc/skel/.* /home/oracle
cp: omitting directory `/etc/skel/.'
cp: omitting directory `/etc/skel/..'
cp: omitting directory `/etc/skel/.gnome2'
cp: omitting directory `/etc/skel/.mozilla'
[root@11g home]# cd oracle/
[root@11g oracle]# ls -a
.  ..  .bash_logout  .bash_profile  .bashrc  .kshrc
[root@11g oracle]# vi .bash_profile
PATH=$PATH:$HOME/bin


# .bash_profile


# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi


# User specific environment and startup programs


PATH=$PATH:$HOME/bin
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH


export PATH
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
".bash_profile" 16L, 325C written
[root@11g oracle]# su - oracle
[oracle@11g ~]$ lsnrctl status


LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-FEB-2017 01:46:25


Copyright (c) 1991, 2013, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=11g)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                20-FEB-2017 20:11:04
Uptime                    0 days 5 hr. 35 min. 20 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/11g/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=11g)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@11g ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.4.0 Production on Tue Feb 21 01:46:31 2017


Copyright (c) 1982, 2013, Oracle.  All rights reserved.




Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> select open_mode from gv$Database;


OPEN_MODE
--------------------
MOUNTED


SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g ~]$ 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值