GVKun编程网logo

Oracle 19c 上的查询性能缓慢,具体取决于日期(oracle查询速度很慢,最后超时)

1

如果您对Oracle19c上的查询性能缓慢,具体取决于日期感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于Oracle19c上的查询性能缓慢,具体取决于日期的详细内容,我们还

如果您对Oracle 19c 上的查询性能缓慢,具体取决于日期感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于Oracle 19c 上的查询性能缓慢,具体取决于日期的详细内容,我们还将为您解答oracle查询速度很慢,最后超时的相关问题,并且为您提供关于 Install Oracle Database 19c.、android – Firebase按点排序,具体取决于日期、CentOS8 安装 Oracle datebase 19C、CUUG 的 Oracle OCP 19c 的题库解析(国内首发)的有价值信息。

本文目录一览:

Oracle 19c 上的查询性能缓慢,具体取决于日期(oracle查询速度很慢,最后超时)

Oracle 19c 上的查询性能缓慢,具体取决于日期(oracle查询速度很慢,最后超时)

如何解决Oracle 19c 上的查询性能缓慢,具体取决于日期

几周前,我们将 Oracle 数据库升级到 19c,一切正常。

上周,有一个晚上查询性能下降,我们真的不知道为什么。

为什么 Oracle Optimizer 会在不到一秒的时间内返回他们查询的 6 月份日期,而需要 4 分钟时间响应 8 月份的日期。优化器对每个查询使用不同的计划。我们正在尝试找出可能会发生什么变化,以使查询快速响应,而在几分钟内响应如此缓慢。

   Install Oracle Database 19c.

Install Oracle Database 19c.

OSC 请你来轰趴啦!1028 苏州源创会,一起寻宝 AI 时代
 
Install Oracle Database 19c.
[1] Login and work with [oracle] user which you create in pre-requirements settings.
[2] Download Oracle Databse 18c for Linux and upload on your server.
https://www.oracle.com/database/technologies/oracle-database-software-downloads.html
[3] After uploading Oracle files, move to a tmp directory and run an Installer like follows.
[oracle@dlp ~]$
cd database

[oracle@dlp database]$
unzip LINUX.X64_193000_db_home.zip

[oracle@dlp database]$
./runInstaller
[4] Select Installation Option. On this example, Select [Install database software only].
[5] Select Database type you install. On this example, Select [Single Instance Database ***].
[6] Select edition you''d like to install.
[7] Specify the base directory and application files for Oracle. On this example, keep default and proceed to next.
[8] Specify the directory for installation metadata files. On this example, keep default and proceed to next.
[9] Specify the privileged group. On this example, keep default and proceed to next.
[10] This is the root script configuration section. Select automatic or manually. If you select automatic, input root password or username and password who has root privilege with sudo. If you do not select automatic, run root script manually later on this installation task.
[11] Pre-requirements are checked. If some settings are not configured for recomendations, notification is displayed like follows. Confirm them again.
[12] The summary is shown for configuration. Click [Install] if it''s OK all.
[13] Installation starts.
After this task, if you selected manual execution for root script on the [10] section, it is required. Then, run it like follows manually.
[root@dlp ~]#
/u01/app/oraInventory/orainstRoot.sh
 
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@dlp ~]#
/usr/oracle/database/root.sh
 
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /usr/oracle/database

Enter the full pathname of the local bin directory: [/usr/local/bin]:  # Enter
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Do you want to setup Oracle Trace File Analyzer (TFA) now ? yes|[no] :
yes
Installing Oracle Trace File Analyzer (TFA).
Log File: /usr/oracle/database/install/root_dlp.srv.world_2020-01-21_19-13-21-711439865.log
Finished installing Oracle Trace File Analyzer (TFA)
[14] Installation finished. Click [Close] button.
[15] Set Environment variables for Oracle user.
[oracle@dlp ~]$
vi ~/.bash_profile
# add to the end
 
export ORACLE_HOME=/usr/oracle/database
export PATH=$PATH:$ORACLE_HOME/bin
[oracle@dlp ~]$
source ~/.bash_profile

android – Firebase按点排序,具体取决于日期

android – Firebase按点排序,具体取决于日期

我想添加一个月度记分牌,但对我来说似乎有点困难.我不知道如何将特定值取为某个列表或数组.与日期一样,只有09.01.2017值的日期.如果我能做到那么我认为我可以按价值对它们进行排序.

        FirebaseDatabase database = FirebaseDatabase.getInstance();
    final DatabaseReference highscoreRef = database.getReference();




    // Ordering with score and adding key values as string to nameList and scoreList
    highscoreRef.orderByChild("score").limitToLast(10).addChildEventListener(new ChildEventListener() {
        @Override
        public void onChildAdded(DataSnapshot snapshot, String prevIoUsChildKey) {
            try {

                nameList.push(snapshot.child("name").getValue().toString());
                scoreList.push(snapshot.child("score").getValue().toString());

            } catch (Exception e) {
                //Toast.makeText(getApplicationContext(), "Error fetching data.", Toast.LENGTH_SHORT).show();
            }
        }
        @Override
        public void onChildChanged(DataSnapshot dataSnapshot, String s) {

        }
        @Override
        public void onChildRemoved(DataSnapshot dataSnapshot) {

        }
        @Override
        public void onChildMoved(DataSnapshot dataSnapshot, String s) {

        }
        @Override
        public void onCancelled(DatabaseError databaseError) {
            Toast.makeText(getApplicationContext(), "Error sending data.", Toast.LENGTH_LONG).show();
        }

    });

解决方法:

如果要查询日期范围,则应将其存储为允许查询范围的格式.对于可以是按字典顺序排序的timestamp或字符串的日期.

您当前将日期存储为dd.MM.yyyy字符串,该字符串不是按字典顺序排序的.我建议切换到yyyy-MM-dd,所以2019-01-09.这样,如果你想获得1月份的所有帖子,你可以进行范围查询:

ref.orderByChild("date").startAt("2017-01-01").endAt("2017-01-31")

如果您已经知道您需要每月排行榜,我建议您更改数据库结构以反映这一点.所以:按照他们所在的月份存储分数:

2017-01
  -K34761761238712
    name: "GGGG"
    score: 3
  -K4875731941298a
    name: "AAA"
    score: 1

通过这种方式,您可以获得1月份的高分,其顺序为:

ref.child("2017-01").orderByChild("score").limitToLast(10)

CentOS8 安装 Oracle datebase 19C

CentOS8 安装 Oracle datebase 19C



    我这里安装 Oracle 数据库是 rpm 格式的包。需要先得有以下依赖包关系,先依次按此顺序安装。



yum install ./compat-libcap1-1.10-7.el7.x86_64.rpm



yum install ./compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm



yum install ./oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm



如果找不到依赖关系包,可以在(https://pkgs.org/)进行查找



yum install -y gcc-c++ make

yum install
-y ksh

yum install
-y sysstat

yum install
-y xorg-x11-utils

yum install java
-11-openjdk-devel

yum install
-y libnsl

rpm
-ivh libaio-devel-0.3.110-12.el8.x86_64.rpm

rpm
-ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm

rpm
-ivh compat-libcap1-1.10-7.el7.x86_64.rpm

yum install libnsl-2.28-72.el8.i686

dnf install libnsl



这些包也是需要进行安装的,若 yum 无法使用时,可以使用 dnf 进行安装。



vim /etc/init.d/oracledb_ORCLCDB-19c

export ORACLE_VERSION=19c

export ORACLE_SID=ORA19C

export TEMPLATE_NAME=General_Purpose.dbc

export CHARSET=ZHS16GBK

export PDB_NAME=ORA19CPDB

export LISTENER_NAME=LISTENER

export NUMBER_OF_PDBS=1

export CREATE_AS_CDB=true


设置字符集


vim /etc/profile.d/db.sh


cat /etc/profile.d/db.sh

export  ORACLE_HOME=/opt/oracle/product/19c/dbhome_1

export  PATH=$PATH:/opt/oracle/product/19c/dbhome_1/bin

export  ORACLE_SID=ORA19C



新增变量环境    


同时进行初始化一下,执行后等待较长时间即可 一般这一步不会出问题


[root@localhost ~]# /etc/init.d/oracledb_ORCLCDB-19c configure

Configuring Oracle Database ORCLCDB.

Prepare for db operation

8% complete

Copying database files

31% complete

Creating and starting Oracle instance

32% complete

36% complete

40% complete

43% complete

46% complete

Completing Database Creation

51% complete

54% complete

Creating Pluggable Databases

58% complete

77% complete

Executing Post Configuration Actions

100% complete

Database creation complete. For details check the logfiles at:

 /opt/oracle/cfgtoollogs/dbca/ORCLCDB.

Database Information:

Global Database Name:ORCLCDB

System Identifier(SID):ORCLCDB

Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.


Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database 

using ''sqlplus / as sysdba'' as the oracle user.



看到 100% complete 即可完成


添加

alias sqlplus=''rlwrap sqlplus''


alias rman=''rlwrap rman''


把 N 设置为 Y 设置为允许自启动

设置 Oracle 启动命令


vim /usr/bin/oracle.sh


增加的内容为:



#! /bin/bash


#  script  For oracle19c.service


/opt/oracle/product/19c/dbhome_1/bin/lsnrctl start


/opt/oracle/product/19c/dbhome_1/bin/dbstart /opt/oracle/product/19c/dbhome_1



设置权限


chmod 777 /usr/bin/oracle.sh


设置一个 systemd 的服务


vim /etc/systemd/system/oracle19c.service


增加内容为:

[Unit]
Description=Oracle19c
After=syslog.target network.target

[Service]
LimitMEMLOCK=infinity
LimitNOFILE=65535
Type=oneshot
RemainAfterExit=yes
User=oracle
Environment="ORACLE_HOME=/opt/oracle/product/19c/dbhome_1"
ExecStart=/usr/bin/oracle.sh

[Install]
WantedBy=multi-user.target



设置自启动

systemctl daemon-reload && systemctl enable oracle19c

 




本文分享自微信公众号 - Linux 运维交流社区(gh_2eb939cabae1)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与 “OSC 源创计划”,欢迎正在阅读的你也加入,一起分享。

CUUG 的 Oracle OCP 19c 的题库解析(国内首发)

CUUG 的 Oracle OCP 19c 的题库解析(国内首发)

高春辉、王春生、朱峰:关于开源创业的 15 件小事

CUUG 已经开始了 Oracle OCP 19c 的题库解析

继 11g 和 12c 之后,OCP 19c 考试题库解析已于 2020 年 7 月 17 日在腾讯课堂免费直播,此为国内首家 19c 的题库解析。

、**、

CUUG 的 OCP 考试题库,从 2018 年开始讲解,当时 052 考试题一变再变,让很多考生考试失利,所以我们专门收集整理了最新版本的考题,并由老师给出答案,并在腾讯课堂上免费发布,开始讲解的内容为 oracle 11g 版本的 052、053 等科目。

随着 11g 版本的 “退出”,继续讲解 oracle 12c 版本的题库解析,包括 071、062、063 等科目的考试原题。

现在,CUUG 已经开始了 OCP 19c 题库解析。希望对大家考 19c OCP 有帮助。

时间:每周五晚上 8 点 - 9 点

*、、*

CUUG 的 OCP 考试题库解析,已经讲了 94 期 (截止 2020 年 7 月 17 日),即将满百期,有想进一步了解 OCP 考试的同学,请联系我们。

我们今天的关于Oracle 19c 上的查询性能缓慢,具体取决于日期oracle查询速度很慢,最后超时的分享已经告一段落,感谢您的关注,如果您想了解更多关于 Install Oracle Database 19c.、android – Firebase按点排序,具体取决于日期、CentOS8 安装 Oracle datebase 19C、CUUG 的 Oracle OCP 19c 的题库解析(国内首发)的相关信息,请在本站查询。

本文标签:

上一篇Oracle PL/SQL 未找到数据 - 非连续的 Id 值(oracle 未找到任何数据)

下一篇Oracle apex,从下拉列表中选择项目会导致无限缓冲