In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Recently, several projects have to go through the security test of the server before going online, and the biggest problem is the oracle database. At the beginning, they all seek help from the DBA of the relevant departments, and this year they are on a new project. After the server has been deployed, a bunch of loopholes in the database are scanned. I decided to learn to patch myself. For me at the entry level of the database, I was really afraid to operate the database of the production system, but I always took this step and practiced on the virtual machine first. After 3 days of consulting resources and reading official documents, it finally succeeded.
Write it down here for later use.
First of all, I would like to thank Brother Feng for the patch and the support given during the installation process. We are currently learning the course of Brother Feng's RAC+DG. A lot of practical experience of Brother Feng is worthy of our novice reference. Introduction to Brother Feng of 51CTO College: http://edu.51cto.com/lecturer/index/user_id-8020378.html
Operating system: Linux redhat enterprise 6.4
Database: oracle 11gr2 11.2.0.4
Patch version: p22378146_112040_Linux-x86-64 released in the first quarter of 2016
Opatch version: p6880880_112000_Linux-x86-64
Environmental check:
SQL > select * from v$version BANNER----Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit ProductionPL/SQL Release 11.2.0.4.0-ProductionCORE11.2.0.4. 0ProductionTNS for Linux: Version 11.2.0.4.0-ProductionNLSRTL Version 11.2.0.4.0-Production
Some patches must have a specific version of opatch to upgrade. The first time I upgraded, I reported an error message that the opatch version could not be upgraded for this upgrade patch package. The following is the opatch version before I upgraded. If your opatch version meets the current patch requirements, you can skip the opatch upgrade step.
[oracle@localhost] $opatch versionOPatch Version: 11.2.0.3.4OPatch succeeded.
OPatch upgrade
1. We need to upgrade OPatch first. The first step is to back up the original OPatch.
You can use tar zcvf opatch_bk.tar OPatch or zip-r Opatch.zip OPatc/.
two。 Download the latest opatch package p6880880_112000_Linux-x86-64 from the official support website and extract it to $ORACLE_HOME
3. Execute opatch version to view the latest version
[oracle@localhost] $opatch versionOPatch Version: 11.2.0.3.6OPatch succeeded.
Database upgrade
Turn off monitoring and shut down the database
Upload the driver to the oracle user directory
Enter the patch directory after decompression
Execute opatch apply for installation
After success, start monitoring and database to see if it can be started normally.
Log in to the database and execute @ $ORACLE_HOME/rdbms/admin/catbundle.sql psu apply
In dba_registry_history, we can also see the record.
Since 2016, the minor version of oracle is no longer in the form of individual digits, but in the form of dates.
Here are some of the official documents I translated in youdao, which are still here as a memo. Finally, put up an advertisement, Fat Brother also sells miscellaneous grain millet, if you need it, add Wechat: aohanxiaomi
If the upgrade is completed and cannot be logged in with PLSQL, it is suggested that all applicable routines in ORA-12526 are in restricted mode: please perform the following steps
Start normally. But the PL/SQL DEVELOPER can't be connected. The upgrade script was not executed. The upgrade was successful through the following steps.
SQL > @ / home/oracle/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/catupgrd.sql
It takes more than half an hour to complete the execution of the catupgrd.sql script; after the execution of the script, the library is automatically closed and exited to the oracle user.
Sqlplus / nolog
SQL > startup
After starting with plsql link success, the following steps I did not continue to operate, if you are in the upgrade, still can not log in to this step can continue to try the following steps.
Execute script D:/oracle/product/10.2.0/db_1/RDBMS/ADMIN/utlrp.sql
Execute the query after execution for all recompilation errors
SQL > select * from utl_recomp_errors
No rows selected (here there are no errors)
Perform a check:
SQL > select name from v$database (confirm that ORACLE_SID is correct, which is orcl)
SQL > show user (confirm that the current user is SYS)
SQL > select tablespace_name, bytes from dba_data_files (confirm the size of the system tablespace).
SQL > @ d:/oracle/product/10.2.0/db_1/rdbms/admin/catalog.sql (rebuild the SYS user view)
(note: when I upgrade, all statements report errors, which should be ignored.)
SQL > shutdown immediate
SQL > startup
Database started successfully
To install the patch, follow these steps.
Install the patch and follow these steps.
Set your current directory to the directory where the patch is located and then run the OPatch utility by entering the following commands:
Set the current directory to the directory where the patch is located, and then run the OPatch utility by entering the following command:
$cd / 22139245
Cd
< PATCH_TOP_DIR >/ 22139245 US dollars
Install the patch by running the following command:
Install the patch by running the following command:
$opatch apply
Us dollar opatch application
Verify whether the patch has been successfully installed by running the following command:
Verify that the patch has been successfully installed by running the following command:
$opatch lsinventory
Us dollar opatch lsinventory
If apply fails for make target jox_refresh_knlopt when applying the patch to the database home, see Issue # 1 in Section 8, "Known Issues" for more information.
If you cannot apply for a patch for the target jox_refresh_knlopt database, see question # 18 and "known problems" for more information.
Start the services from the Oracle home after all the nodes are patched.
All nodes that go home from Oracle after starting the service are patched.
If there are errors, see Section 8, "Known Issues".
If there is an error, see known problems.
4 Postinstallation
4 Postinstallation
The following steps load modified SQL files into the database. For an Oracle RAC environment, perform these steps on only one node.
The following steps modify the SQL file to load into the database. In an Oracle RAC environment, these steps are performed on only one node.
Install the SQL portion of the patch by running the following command for a single instance environment.
The SQL part of the patch is installed by running the following command for the environment of a single instance.
Cd $ORACLE_HOME/sqlpatch/22139245
Cd $ORACLE_HOME / sqlpatch / 22139245
Sqlplus / nolog
Sqlplus / nolog
SQL > CONNECT / AS SYSDBA
SQL > connection / SYSDBA
SQL > startup upgrade
SQL > start the upgrade
SQL > @ postinstall.sql
SQL > @ postinstall.sql
SQL > shutdown
SQL > close
SQL > startup
SQL > start
For an Oracle RAC environment, reload the packages on one of the nodes using the following commands. Make sure no other instance of the database is up on the remote nodes.
For an Oracle RAC environment, the package of the overloaded node in one uses the following command. Make sure there are no other instance databases on the remote node.
Cd $ORACLE_HOME/sqlpatch/22139245
Cd $ORACLE_HOME / sqlpatch / 22139245
Sqlplus / nolog
Sqlplus / nolog
SQL > CONNECT / AS SYSDBA
SQL > connection / SYSDBA
SQL > STARTUP
SQL > start
SQL > alter system set cluster_database=false scope=spfile
SQL > change system settings cluster_database = false range = spfile
SQL > SHUTDOWN
SQL > close
SQL > STARTUP UPGRADE
SQL > start the upgrade
SQL > @ postinstall.sql
SQL > @ postinstall.sql
SQL > alter system set cluster_database=true scope=spfile
SQL > change system set cluster_database = true range = spfile
SQL > SHUTDOWN
SQL > close
SQL > STARTUP
SQL > start
After installing the SQL portion of the patch, some packages could become INVALID. This will get recompiled upon access or you can run utlrp. Sql to get them back into a VALID state.
After installing the SQL portion of the patch, some packages may become invalid. This will be accessed or you can run utlrp recompilation. Sql to get them back to a valid state.
Cd $ORACLE_HOME/rdbms/admin
Cd $ORACLE_HOME / rdbms / admin
Sqlplus / nolog
Sqlplus / nolog
SQL > CONNECT / AS SYSDBA
SQL > connection / SYSDBA
SQL > @ utlrp.sql
SQL > @ utlrp.sql
If there are errors, see Section 8, "Known Issues".
If there is an error, see known problems.
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: 244
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.