加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

误删除Oracle家目录的恢复方法

发布时间:2020-12-12 15:45:03 所属栏目:百科 来源:网络整理
导读:--创建oracle目录 [root@zw home]# mkdir oracle [root@zw home]# ll total 8 drwxr-xr-x 2 root root 4096 Jan 7 21:22 oracle drwx------ 3 oracle dba 4096 Jan 7 19:25 oracle.bak [root@zw home]# chown -R oracle:dba oracle [root@zw home]# ll total
--创建oracle目录 [root@zw home]# mkdir oracle [root@zw home]# ll total 8 drwxr-xr-x 2 root root 4096 Jan 7 21:22 oracle drwx------ 3 oracle dba 4096 Jan 7 19:25 oracle.bak [root@zw home]# chown -R oracle:dba oracle [root@zw home]# ll total 8 drwxr-xr-x 2 oracle dba 4096 Jan 7 21:22 oracle drwx------ 3 oracle dba 4096 Jan 7 19:25 oracle.bak [root@zw home]# --复制骨架文件: [root@zw home]# cp /etc/skel/.* /home/oracle/ cp: omitting directory `/etc/skel/.' cp: omitting directory `/etc/skel/..' cp: omitting directory `/etc/skel/.mozilla' [root@zw home]# [root@dg1 home]# ls -la /home/oracle [root@zw home]# ls -la /home/oracle total 28 drwxr-xr-x 2 oracle dba 4096 Jan 7 21:23 . drwxr-xr-x 4 root root 4096 Jan 7 21:22 .. -rw-r--r-- 1 root root 33 Jan 7 21:23 .bash_logout -rw-r--r-- 1 root root 176 Jan 7 21:23 .bash_profile -rw-r--r-- 1 root root 124 Jan 7 21:23 .bashrc -rw-r--r-- 1 root root 515 Jan 7 21:23 .emacs [root@zw home]# chown -R oracle:dba /home/oracle [root@zw home]# cd /home/oracle [root@dg1 oracle]# ls -la total 28 drwxr-xr-x 2 oracle dba 4096 Jan 7 21:23 . drwxr-xr-x 4 root root 4096 Jan 7 21:22 .. -rw-r--r-- 1 oracle dba 33 Jan 7 21:23 .bash_logout -rw-r--r-- 1 oracle dba 176 Jan 7 21:23 .bash_profile -rw-r--r-- 1 oracle dba 124 Jan 7 21:23 .bashrc -rw-r--r-- 1 oracle dba 515 Jan 7 21:23 .emacs //修改oracle 用户的环境变量: [root@zw oracle]# cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH # Oracle Settings # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db_1 export ORACLE_SID=ogg02 #export NLS_LANG=american_america.zhs16gbk #PATH=$PATH:$HOME/bin alias sqlplus="rlwrap sqlplus" alias rman="rlwrap rman" export PATH=$ORACLE_HOME/bin:$PATH export PATH [root@zw oracle]# . ./.bash_profile --使文件生效 切换一下用户看有没有问题 [root@zw home]# cd oracle [oracle@zw ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Wed Jan 7 21:31:28 2015 Copyright (c) 1982,2011,Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning,OLAP,Data Mining and Real Application Testing options SQL> 恢复成功!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读