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

Installation of oracle12C databases for ProxmoxVE (CDB and PDB)

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

On the left above is my personal Wechat. For further communication, please add Wechat. On the right is my official account "Openstack Private Cloud". If you are interested, please follow us.

Two days ago, the RAC environment of oracle12C was built on the PVE environment (see another blog article, "install oracle12C rac Cluster of ProxmoxVE"). The installation of the grid cluster environment and the installation of the oracle database software are completed, and the conditions for creating the database are met. Now use dbca to create databases CDB and PDB on this RAC environment.

The relevant plans are as follows:

A. Storage planning:

1. GRID cluster component disk group

+ grid: 1 for OCR+VOTING DISK, 85g, using asmdiskc, shared storage

2. Database installation disk group

+ system: for database basic tablespaces, control files, parameter files, etc., 50g, using asmdiskd, shared storage

+ recovery: for archiving and flashback log space, 50g, using asmdiske, shared storage

+ data: user database business tablespace, 50g, using asmdiskf, shared storage

B. IP planning:

Oraclenode1:

Publicip: ens18: 192.168.1.32

Vip:192.168.1.36

Privateip: ens19: 192.168.170.32

Oraclenode2:

Publicip: ens18: 192.168.1.33

Vip:192.168.1.37

Privateip: ens19: 192.168.170.33

Scanip: 192.168.1.38

C. Software version:

Operating system: CentOS 7.2

Database: ORACLE12c R2

Cluster management software: ORACLEGRID 12.2.0.1

D, hostname planning:

# public ip

192.168.1.32 oraclenode1

192.168.1.33 oraclenode2

# private ip

192.168.170.32 oraclenode1pri

192.168.170.32 oraclenode2pri

# vip ip

192.168.1.36 oraclenode1vip

192.168.1.37 oraclenode2vip

# scan ip

192.168.1.38 oraclenodescan

E. User and user group planning:

Groupadd-g 60001 oinstall

Groupadd-g 60002 dba

Groupadd-g 60003 oper

Groupadd-g 60004 backupdba

Groupadd-g 60005 dgdba

Groupadd-g 60006 kmdba

Groupadd-g 60007 asmdba

Groupadd-g 60008 asmoper

Groupadd-g 60009 asmadmin

Useradd-u 61001-g oinstall-G asmadmin,asmdba,dba,asmoper grid

Useradd-u 61002-g oinstall-G dba,backupdba,dgdba,kmdba,asmadmin,oper,asmdba oracle

Echo "grid" | passwd-- stdin grid

Echo "oracle" | passwd-- stdin oracle

F, catalogue planning:

Mkdir-p / data/oracle/app/grid

Mkdir-p / data/oracle/app/12.2.0.1/grid

Chown-R grid:oinstall / data/oracle

Mkdir-p / data/oracle/app/oraInventory

Chown-R grid:oinstall / data/oracle/app/oraInventory

Mkdir-p / data/oracle/app/oracle

Chown-R oracle:oinstall / data/oracle/app/oracle

Chmod-R 775 / data/oracle

Asm disk group installation:

Log in to the grid account, ssh grid@oraclenode1-X, run asmca, and create the asm disk group as planned. The grid disk group has already been created when grid is configured, and the remaining three disk groups, system, recovery and data, need to be created:

After the creation is complete:

The above shows that all four asm disk groups have been created. Next install the CDB database and the PDB database.

CDB database installation:

Log in as an oracle account, ssh oracle@oraclenode1-X, and run dbca:

The above step is very important, once the character set is selected, it cannot be changed. Determine the character set with the demand department in advance, and in the case of database migration, determine the character set of the source database in advance to make it consistent.

Use a unified password: oracle

Start the installation and wait patiently.

Installation is complete, as follows:

Log in using grid and use the crsctl status res-t command to check the status as follows:

[grid@oraclenode2] $crsctl status res-t----Name Target State Server State details-- -Local Resources-- -- ora.ASMNET1LSNR_ASM.lsnr ONLINE ONLINE oraclenode1 STABLE ONLINE ONLINE oraclenode2 STABLEora.DATA.dg ONLINE ONLINE oraclenode1 STABLE ONLINE ONLINE Oraclenode2 STABLEora.GRID.dg ONLINE ONLINE oraclenode1 STABLE ONLINE ONLINE oraclenode2 STABLEora.LISTENER.lsnr ONLINE ONLINE oraclenode1 STABLE ONLINE ONLINE oraclenode2 STABLEora.RECOVERY.dg ONLINE ONLINE oraclenode1 STABLE ONLINE ONLINE oraclenode2 STABLEora.SYSTEM.dg ONLINE ONLINE oraclenode1 STABLE ONLINE ONLINE oraclenode2 STABLEora.chad ONLINE ONLINE oraclenode1 STABLE ONLINE ONLINE oraclenode2 STABLEora.net1.network ONLINE ONLINE oraclenode1 STABLE ONLINE ONLINE oraclenode2 STABLEora.ons ONLINE ONLINE oraclenode1 STABLE ONLINE ONLINE oraclenode2 STABLE- -- Cluster Resources----ora.LISTENER _ SCAN1.lsnr 1 ONLINE ONLINE oraclenode1 STABLEora.MGMTLSNR 1 ONLINE ONLINE oraclenode1 169.254.178.157 192. 168.170.32,STABLEora.asm 1 ONLINE ONLINE oraclenode1 Started,STABLE 2 ONLINE ONLINE oraclenode2 Started,STABLE 3 OFFLINE OFFLINE STABLEora.cvu 1 ONLINE ONLINE oraclenode1 STABLEora.mgmtdb 1 ONLINE ONLINE oraclenode1 Open STABLEora.oraclenode1.vip 1 ONLINE ONLINE oraclenode1 STABLEora.oraclenode2.vip 1 ONLINE ONLINE oraclenode2 STABLEora.orcl.db 1 ONLINE ONLINE oraclenode1 Open HOME=/data/orac le/app/oracle/produc t/12.2.0.1/db_1 STAB LE 2 ONLINE ONLINE oraclenode2 Open HOME=/data/orac le/app/oracle/produc t/12.2.0.1/db_1 STAB LEora.qosmserver 1 ONLINE ONLINE oraclenode1 STABLEora.scan1.vip 1 ONLINE ONLINE oraclenode1 STABLE -- [grid@oraclenode2 ~] $

Now you can happily use CDB and PDB. For related concepts and common operations, please refer to this website:

Https://blog.51cto.com/fengfeng688/1946278

It should be noted that there is a SID in the environment variables of oracle and grid, and the two rac nodes need to be different. For example, if the SID prefix is set to orcldb1 when the database is installed, the $ORACLE_SID of the two nodes should be:

Orcldb11

Orcldb12

The environment variables of grid and $ORACLE_SID are:

ASMI

ASM2

If the SID is not set correctly, you will see that the db resource is in the OPEN state when you view the cluster resources, but you will be prompted to connect to an idle instance when you log in with the oracle account and enter the database using sqlplus.

CDB and PDB related tests:

View current container: SQL > show con_name;CON_NAME--CDB$ROOT to view PDB information in CDB: SQL > select con_id, dbid, guid, name, open_mode from v$pdbs CON_ID DBID GUID- NAME -OPEN_MODE- 2 2349385738 7F78C92375923F6DE0532001A8C0107FPDB$SEEDREAD ONLY 3 364970257 7F7A374E7B7E37F5E0532001A8C09EA4ORCL_PDB1READ WRITE CON_ID DBID GUID--NAME -OPEN_MODE- create a test pdb:SQL > create pluggable database test_pdb admin user admin identified by admin Pluggable database created. Open a pdb: SQL > alter pluggable database test_pdb open; Pluggable database altered.SQL > select con_id,dbid,con_uid,guid,name,open_mode,create_scn,total_size,block_size from v$pdbs CON_ID DBID CON_UID GUID--NAME -- OPEN_MODE CREATE_SCN TOTAL_SIZE BLOCK_SIZE- 2 2349385738 2349385738 7F78C92375923F6DE0532001A8C0107FPDB$SEEDREAD ONLY1408773 801112064 8192 3 364970257 364970257 7F7A374E7B7E37F5E0532001A8C09EA4ORCL_PDB1READ WRITE1467170 911212544 8192 CON_ID DBID CON_UID GUID--NAME- -- OPEN_MODE CREATE_SCN TOTAL_SIZE BLOCK_SIZE- 4 841599650 841599650 7F7A57321EE03A16E0532001A8C0E4B4TEST_PDBREAD WRITE1471014 801112064 8192 Clone a pdb from a pdb : SQL > create pluggable database test2_pdb from test_pdb Pluggable database created.SQL > alter pluggable database test2_pdb open; Pluggable database altered. Switch between cdb and PDB threads: SQL > alter session set container=test_pdb;Session altered.SQL > alter session set container=cdb$root; Session altered. Close a pdb:SQL > alter pluggable database test_pdb close;Pluggable database altered. Close all pdb:SQL > alter pluggable database all close; Pluggable database altered. Unplug pdb and generate the xml file: SQL > alter pluggable database orcl_pdb1 unplug into'/ home/oracle/orcl_pdb1.xml';alter pluggable database orcl_pdb1 unplug into'/ home/oracle/orcl_pdb1.xml'*ERROR at line 1:ORA-65025: Pluggable database ORCL_PDB1 is not closed on all instances. The above error is reported because in the rac environment, you need to close pdb in all instances, and after closing pdb in another node oraclenode2, execute the following statement: SQL > alter pluggable database orcl_pdb1 unplug into'/ home/oracle/orcl_pdb1.xml';Pluggable database altered. Delete pdb:SQL > drop pluggable database orcl_pdb1 keep datafiles;Pluggable database dropped. Execute a stored procedure on another node oraclenode2 to check pdb compatibility: SQL > exec DBMS_PDB.Check_Plug_Compatibility (PDB_Descr_File= >'/ home/oracle/orcl_pdb1.xml'); BEGIN DBMS_PDB.Check_Plug_Compatibility (PDB_Descr_File= >'/ home/oracle/orcl_pdb1.xml'); END * ERROR at line 1:ORA-06550: line 1, column 7:PLS-00221: 'CHECK_PLUG_COMPATIBILITY' is not a procedure or is undefinedORA-06550: line 1, column 7:PL/SQL: Statement ignored reports that there is no Check_Plug_Compatibility stored procedure, ignore it, because it is the same cluster and the version is the same. , copy the xml file to another node oraclenode2, and create pdb:SQL > create pluggable database orcl_pdb1 using'/ home/oracle/orcl_pdb1.xml' from xml; Pluggable database created.SQL > SQL > alter pluggable database orcl_pdb1 open;Pluggable database altered.SQL >

At this point, the simple tests related to CDB and PDB are complete.

Summary:

In the case of the completion of the installation of the RAC cluster, and then install the database software, the installation of the database is relatively simple, the main difficulty is to install the RAC cluster grid.

The main work of database installation should be to plan storage, plan data files, plan CDB and PDB, and optimize relevant database parameters according to the actual production environment. The installation itself is relatively simple, just run dbca all the way in the graphical interface to install according to the plan.

In my own installation process, I encountered a problem is that after the successful installation, I found that sqlplus went in and prompted connect to an idle instance. The later check found that it was caused by the incorrect setting of the $ORACLE_SID environment variable of the oracle account. After the correct adjustment, it was normal.

CDB and PDB also have client connections that are not tested using this piece.

In terms of convenience, it can not be said that it is more convenient after having PDB. It can only be said that with PDB, there is a clearer distinction between more complex applications and larger database application logic. For the same kind of business, you can create a new CDB and create a PDB for each business in a CDB. The original database was distinguished by the user schema, but now it is distinguished directly by pdb. In addition, the data import and export aspect has not been tested, I do not know whether the pull-out and insertion of PDB is more efficient than the previous expdp or rman way, only in the future use process through practice to test.

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