首页 > 其他分享 >三、更改INSTANCE_NAME

三、更改INSTANCE_NAME

时间:2023-06-25 16:38:00浏览次数:41  
标签:NAME instance 更改 INSTANCE oracle ORACLE dbs ora10g ora


三、更改INSTANCE_NAME

1、检查当前的instance_name 是wwl

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
wwl

2、创建pfile参数文件
SQL> create pfile from spfile;
                             
File created.

3、关闭数据库
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> host

4、切换到操作系统命令行,修改用户环境下的.bash_profile参数文件,将ORACLE_SID的值由原来的wwl改为wwl01
[oracle@ora10g ~]$ cd
[oracle@ora10g ~]$ vi .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

export ORACLE_SID=wwl01
export ORACLE_BASE=/orasoft/
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBARY_PATH=$ORACLE_HOME/lib
export LANG="zh_CN.GB18030";
export PATH
umask 022

".bash_profile" 22L, 410C written

5、让刚才修改的ORACLE_SID的值立即生效                                                        
[oracle@ora10g ~]$ source .bash_profile

6、检查下系统的环境变量中的ORACLE_SID的值是否已经更改为我们理想中的wwl01
[oracle@ora10g ~]$ echo $ORACLE_SID
wwl01

7、进入$ORACLE_HOME/dbs目录,也就是pfile存放的路径,将initwwl.ora参数文件改名为initwwl01.ora
[oracle@ora10g ~]$ cd $ORACLE_HOME/dbs
[oracle@ora10g dbs]$ ls
hc_wwl.dat  initdw.ora  init.ora  initwwl.ora  lkWWL  lkWWL01  spfilewwl.ora
[oracle@ora10g dbs]$ mv initwwl.ora initwwl01.ora
[oracle@ora10g dbs]$ pwd
/orasoft/product/10.2.0/db_1/dbs

8、进入数据库用刚才复制的参数文件启动数据库
[oracle@ora10g dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Dec 22 00:37:33 2011

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

Connected to an idle instance.

SQL> startup mount pfile='/orasoft/product/10.2.0/db_1/dbs/initwwl01.ora';
ORACLE instance started.

Total System Global Area  285212672 bytes
Fixed Size                  1218992 bytes
Variable Size              62916176 bytes
Database Buffers          218103808 bytes
Redo Buffers                2973696 bytes
Database mounted.

9、检查数据库的当前instance_name是否已经修改为wwl01了,我们看到已经成功了。
SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
wwl01

10、将数据库OPEN,数据库已经能够正常运行了。
SQL> alter database open;

Database altered.

SQL> select instance_name,status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
wwl01            OPEN

SQL>

 

标签:NAME,instance,更改,INSTANCE,oracle,ORACLE,dbs,ora10g,ora
From: https://blog.51cto.com/prudentwoo/6546669

相关文章

  • 【已解决】GO语言开发中调用另一个库报错 cannot refer to unexported name XXXX
    packagemainimport( "fmt" "study_gos/main/kehu")//使用了go.mod//GOPATH;D:\workspace\studys\study_gos//cd/d/workspace/studys/study_gos/src//goenv-wGO111MODULE=on//gomodinitstudy_gos//gomodtidy//跳过goget失败//go......
  • 容器基础-- namespace,Cgoup 和 UnionFS
    Namespace什么是Namespace?这里的"namespace"指的是Linuxnamespace技术,它是Linux内核实现的一种隔离方案。简而言之,Linux操作系统能够为不同的进程分配不同的namespace,每个namespace都具有独立的资源分配,从而实现了进程间的隔离。如果你的Linux安装了GCC,可以通过......
  • 【JS基础】instanceof 和 typeof
     instanceof 运算符用于检测构造函数的 prototype 属性是否出现在某个实例对象的原型链上。objectinstanceofconstructortypeof 运算符返回一个字符串,表示操作数的类型。typeofoperandconsole.log('--------------------instanceof-------------------')//t......
  • webdriver通过tag_name定位
    webdriver通过tag_name定位代码示例:#encoding=utf-8importtimefromseleniumimportwebdriverfromselenium.webdriver.common.byimportBydriver=webdriver.Chrome()#打开百度首页driver.get("https://www.baidu.com")#根据名LINK_TEXT获取元素tag_name=dri......
  • Springboot更改banner
    首先创建一个banner.txt。 将图像放到txt然后你启动就会发现: ......
  • C:\Windows\Installer\ 存储安装程序的数据库 修复和更改安装程序 安装程序的缓存
    C:\Windows\Installer\是一个特殊的系统文件夹,在Windows操作系统中扮演着重要的角色。它主要用于存储安装程序的相关信息和安装源。具体来说,C:\Windows\Installer\文件夹有以下几个作用和功能:存储安装程序的数据库:文件夹中包含一个名为"Installer"的数据库文件(即MSI数据库),......
  • initWithNibName 和 loadNibNamed 的区别
    UIViewControllerinitWithNibName这时候是延迟加载主要代码如下:ShowViewController*showMessage=[[ShowViewControlleralloc]initWithNibName:@"ShowViewController"bundle:nil];self.showViewControllerrelease];这时候是延迟加载,这个View上的控件是nil的self.showVie......
  • webdriver根据class_name获取元素
    webdriver根据class_name获取元素#encoding=utf-8importtimefromseleniumimportwebdriverfromselenium.webdriver.common.byimportBydriver=webdriver.Chrome()#打开百度首页driver.get("https://www.baidu.com")#根据class_name获取元素driver.find_eleme......
  • webdriver根据name名称获取元素
    #encoding=utf-8importtimefromseleniumimportwebdriverfromselenium.webdriver.common.byimportBydriver=webdriver.Chrome()#打开百度首页driver.get("https://www.baidu.com")#根据name名称获取元素driver.find_element(by=By.NAME,value="wd").send_keys......
  • 【pywifi】Windows下import pywifi库报错:ModuleNotFoundError: No module named ‘com
    1、解决方法pipinstallcomtypes 参考链接:(88条消息)Windows下importpywifi库报错:ModuleNotFoundError:Nomodulenamed‘comtypes‘原因排查_广东上大分的博客-CSDN博客......