In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Blog structure
Configure and connect to the database
Control the management of documents
Management of log files
Management of archived logs
Data dictionary
one。 Configuration database
In the actual production environment, Oracle is generally managed and maintained remotely. Besides the use of client tools, the communication principle of Oracle remote operation also needs to be mastered.
Oracle client side and server side
Whether you use SQL*Plus tools or third-party tools to connect to a remote database, you must establish both the client and server side
The connection between them. Oracle provides Oracle Net Services components for easily configuring and managing network connections. These components are not
It needs to be installed separately and will be installed automatically when you install Oracle server or client software.
Enable listening [oracle@Oracle ~] $lsnrctl start
1.Oracle Net protocol
As shown in the figure, Oracle realizes the connection and data transmission between client and server through Oracle Net protocol. Oracle Net
Is a software layer that resides on both the Oracle server and the client. It encapsulates the TCP/IP protocol and is responsible for establishing and maintaining customers.
Connection of the client application to the database server.
two。 The connection process between the client and the server
Before analyzing the connection mechanism between the client and the server, you need to understand two concepts: one is the Oracle Net listener and the other is the Oracle network service name.
Case: client remote connection oracle
[root@oracle ~] # systemctl stop firewalld [root@oracle ~] # vim / etc/sysconfig/network-scripts/ifcfg-ens33 [root@oracle ~] # systemctl restart network [root@oracle ~] # xhost + access control disabled, clients can connect from any host [root@oracle ~] # su-oracle [oracle@oracle root] $export DISPLAY=:0.0 [oracle@oracle ~] $lsnrctl start [oracle@oracle ~] $sqlplus / as sysdbaSQL > select instance_name from v$instance [oracle@oracle admin] $pwd/u01/app/oracle/product/12.2.0/dbhome_1/network/ admin [oracle @ oracle admin] $vim tnsnames.ora\\ gaiyi change the address
The client configuration is as follows:
Download oracle client software
Default is always the next step.
Click to edit the file
The configuration is as follows
ORCL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.1) (PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID=orcl)
Save
Open the connection
two。 Management control file
The control file plays a very important role in the Oracle database. If the control file is damaged or lost, the database can not be started, so it is very important for DBA to manage and maintain the control file reasonably.
The role of control files in database startup
For DBA, Oracle database control file is a very important file. It is a binary file automatically generated when the database is created, which records the status information of the database and mainly includes the following:
The name of the database, a control file can only belong to one database. The time when the database was created. Name, location, online and offline status information of the data file. The name, location, and archive information of the redo log file. All tablespace information. The current log serial number. Recent checkpoint information.
The control file is read during the MOUNT phase of database startup. The relationship between database startup and control files is shown in.
Case: backup and restore database
Get control file information SQL > select name from v$controlfile NAME----/u01/app/oracle/oradata/orcl/control01.ctl/u01/app/oracle/oradata/orcl/control02.ctlSQL > get the contents contained in the control file
SQL > select type,record_size,records_total,records_used from v$controlfile_record_section
Create a multiplexing control file [oracle@rhel1 ~] $su-root [root@oracle ~] # mkdir-p / backup1/control [root@oracle ~] # mkdir-p / backup2/control [root@oracle ~] # chown-R oracle / backup1 [root@oracle ~] # chown-R oracle / backup2 while the database is still open Modify the contro_files parameter SQL > alter system set 2 control_files= 3'/ u01 in spfile The system has changed.
Shut down the database
SQL > shutdown immediate
Use operating system commands to copy files to a new location
SQL > quit; [oracle@rhel1 ~] $cp / u01/app/oracle/oradata/orcl/control01.ctl / backup1/control/control02.ctl [oracle@rhel1 ~] $cp / u01/app/oracle/oradata/orcl/control01.ctl / backup2/control/control03.ctl
Restart the database
[oracle@rhel1 ~] $sqlplus sys/123456 as sysdba
SQL > startup
4. Backup and recovery control files
Directly overwrite damaged or missing control files with existing intact control files
Simulate failure, stop database, delete control file
Sql > shutdown immediatesql > quit$rm-f / badkup1/control/control02.ctl
Start the database
Sql > startup observation phenomenon
Restore control file
Sql > shutdown abort;sql > quit$ cp / u01/app/oracle/oradata/orcl/control01.ctl / backup1/control/control02.ctl
Start the database again
Sql > startup
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.
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.