Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

If you feel sleepy, do a modified spfile path test.

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Oracle DBA came back. After two years and three months away, I came back, full of blood and resurrection. Why do you say you are back? because I have been working on MySQL, MongoDB, redis and hbase since 15 years. These two years have been very hard. I have lost a lot and gained a lot. I have a deep understanding of the open source database of the Internet industry, and I know a lot of friends from the north, Shanghai, Guangzhou and Shenzhen. Although they have not met, they all keep in touch and often do technical exchanges together.

The following is to do a small test to see if the oracle database, which has been thrown away for two years, is born, casually and mentally, so as to avoid sleepiness in the afternoon.

I. description of the environment

11g rac Virtualization Test Environment

II. Practical operation

1) View the current spfile location

[oracle@ysdb1 dbs] $sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Jun 27 13:32:20 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, Real Application Clusters, Automatic Storage Management, OLAP

Data Mining and Real Application Testing options

SYS@ysdb1 > show parameter spfile

NAME TYPE VALUE

-

Spfile string + DATA1/ysdb/spfileysdb.ora

2) back up pfile to generate a new spfile

SYS@ysdb1 > create pfile='/tmp/pfile.ora' from spfile

File created.

SYS@ysdb1 > create spfile='+data1/ysdb/parameter/spfileysdb.ora' from pfile='/tmp/pfile.ora'

Create spfile='+data1/ysdb/parameter/spfileysdb.ora' from pfile='/tmp/pfile.ora'

*

ERROR at line 1:

ORA-17502: ksfdcre:4 Failed to create file + data1/ysdb/parameter/spfileysdb.ora

ORA-15173: entry 'parameter' does not exist in directory' ysdb'

SYS@ysdb1 > create spfile='+data1/ysdb/ysdbspfile.ora' from pfile='/tmp/pfile.ora'

File created.

SYS@ysdb1 >

3) modify pfile (multiple nodes)

[oracle@ysdb1 dbs] $more initysdb1.ora

SPFILE='+DATA1/ysdb/spfileysdb.ora'

[oracle@ysdb1 dbs] $echo "spfile='+DATA1/ysdb/ysdbspfile.ora'" > initysdb1.ora

[oracle@ysdb1 dbs] $less initysdb1.ora

Spfile='+DATA1/ysdb/ysdbspfile.ora'

[oracle@ysdb1 dbs] $

[root@ysdb2 ~] # su-oracle

[oracle@ysdb2 ~] $cd $ORACLE_HOME/dbs

[oracle@ysdb2 dbs] $less initysdb2.ora

SPFILE='+DATA1/ysdb/spfileysdb.ora'

[oracle@ysdb2 dbs] $echo "spfile='+DATA1/ysdb/ysdbspfile.ora'" > initysdb2.ora

[oracle@ysdb2 dbs] $less initysdb2.ora

Spfile='+DATA1/ysdb/ysdbspfile.ora'

[oracle@ysdb2 dbs] $

4) modify the spfile path in OCR through srvctl

[oracle@ysdb2] $srvctl modify database-d ysdb-p + DATA1/ysdb/ysdbspfile.ora

5) restart the database to verify the spfile path

[oracle@ysdb2] $srvctl stop database-d ysdb

PRCC-1016: ysdb was already stopped

[oracle@ysdb2] $srvctl start database-d ysdb

[oracle@ysdb2 ~] $sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Jun 27 13:53:00 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, Real Application Clusters, Automatic Storage Management, OLAP

Data Mining and Real Application Testing options

SYS@ysdb2 > show parameter spfile

NAME TYPE VALUE

-

Spfile string + DATA1/ysdb/ysdbspfile.ora

SYS@ysdb2 >

III. Summary

1) there is nothing wrong with more hands-on operation, which makes perfect.

2) compare the differences between different databases, see their advantages and disadvantages, and then you will know which database should be used in what scenario, and it will be much easier to select the database in the future.

3) documents still need to be written, not necessarily very esoteric, very difficult, very powerful, just form a habit.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report