(八)PostgreSQL的数据库管理

PostgreSQL的数据库管理

基础信息
OS版本:Red Hat Enterprise Linux Server release 7.9 (Maipo)
DB版本:16.2
pg软件目录:/home/pg16/soft
pg数据目录:/home/pg16/data
端口:5777

1 创建数据库

CREATE DATABASE创建一个新的PostgreSQL数据库。 
若要创建数据库,您必须是超级用户或具有特殊的CREATEDB权限。请参阅CREATE ROLE部分内容。 
默认情况下,将通过克隆系统数据库template1来创建新数据库。也可以通过参数 template 来指定不同的模板。特别是,通过指定TEMPLATE template0,可以创建一个原始数据库(其中不存在用户定义的对象,并且系统对象没有更改),其中只包含PostgreSQL版本预定义的标准对象。这样可以避免复制任何可能已添加到template1中的本地对象。

语法

CREATE DATABASE name
[ WITH ] [ OWNER [=] user_name ]
[ TEMPLATE [=] template ]
[ ENCODING [=] encoding ]
[ STRATEGY [=] strategy ] ]
[ LOCALE [=] locale ]
[ LC_COLLATE [=] lc_collate ]
[ LC_CTYPE [=] lc_ctype ]
[ ICU_LOCALE [=] icu_locale ]
[ ICU_RULES [=] icu_rules ]
[ LOCALE_PROVIDER [=] locale_provider ]
[ COLLATION_VERSION = collation_version ]
[ TABLESPACE [=] tablespace_name ]
[ ALLOW_CONNECTIONS [=] allowconn ]
[ CONNECTION LIMIT [=] connlimit ]
[ IS_TEMPLATE [=] istemplate ]
[ OID [=] oid ]

参数解析

  • name
    The name of a database to create.
    要创建的数据库的名称。

  • user_name
    The role name of the user who will own the new database, or DEFAULT to use the default (namely, the user executing the command). To create a database owned by another role, you must be able to SET ROLE to that role.
    将拥有新数据库的用户的角色名称,或使用默认值的DEFAULT(即执行命令的用户)。若要创建由另一个角色拥有的数据库,您必须能够将角色设置为该角色。

  • template
    The name of the template from which to create the new database, or DEFAULT to use the default template (template1).
    用于创建新数据库的模板的名称,或使用默认模板 template1。

  • encoding
    Character set encoding to use in the new database. Specify a string constant (e.g.,
    ‘SQL_ASCII’), or an integer encoding number, or DEFAULT to use the default encoding (namely, the encoding of the template database). The character sets supported by the PostgreSQL server
    are described in Section 24.3.1. See below for additional restrictions.
    要在新数据库中使用的字符集编码。指定字符串常量(例如“SQL_ASCII”)、整数编码数字或使用默认编码(即模板数据库的编码)。PostgreSQL服务器支持的字符集如第24.3.1节所述。有关其他限制,请参见下文。

  • strategy
    Strategy to be used in creating the new database. If the WAL_LOG strategy is used, the database
    will be copied block by block and each block will be separately written to the write-ahead log.
    This is the most efficient strategy in cases where the template database is small, and therefore it is
    the default. The older FILE_COPY strategy is also available. This strategy writes a small record
    to the write-ahead log for each tablespace used by the target database. Each such record represents copying an entire directory to a new location at the filesystem level. While this does reduce the write-ahead log volume substantially, especially if the template database is large, it also forces the system to perform a checkpoint both before and after the creation of the new database. In some situations, this may have a noticeable negative impact on overall system performance.
    用于创建新数据库的策略。如果使用WAL_LOG策略,数据库将被逐块复制,并且每个块将分别写入预写日志。在模板数据库很小的情况下,这是最有效的策略,因此它是默认的。旧的FILE_COPY策略也可用。此策略为目标数据库使用的每个表空间向预写日志中写入一条小记录。每个这样的记录都表示将整个目录复制到文件系统级别的新位置。虽然这确实大大减少了预写日志量,特别是在模板数据库很大的情况下,但它也迫使系统在创建新数据库之前和之后执行检查点。在某些情况下,这可能会对整个系统性能产生明显的负面影响。

  • locale
    Sets the default collation order and character classification in the new database. Collation affects the sort order applied to strings, e.g., in queries with ORDER BY, as well as the order used in indexes on text columns. Character classification affects the categorization of characters, e.g., lower, upper, and digit. Also sets the associated aspects of the operating system environment, LC_COLLATE and LC_CTYPE. The default is the same setting as the template database. See Section 24.2.2.3.1 and Section 24.2.2.3.2 for details.
    设置新数据库中的默认排序规则顺序和字符分类。排序规则影响应用于字符串的排序顺序,例如,在使用order BY的查询中,以及在文本列的索引中使用的顺序。字符分类会影响字符的分类,例如低位、高位和数字。还设置操作系统环境的相关方面LC_COLLATE和LC_CTYPE。默认设置与模板数据库的设置相同。详见第24.2.2.3.1节和第24.2.2.3.2节。

  • lc_collate
    Sets LC_COLLATE in the database server’s operating system environment. The default is the
    setting of locale if specified, otherwise the same setting as the template database. See below
    for additional restrictions.
    If locale_provider is libc, also sets the default collation order to use in the new database,
    overriding the setting locale.
    在数据库服务器的操作系统环境中设置LC_COLLATE。默认值是区域设置(如果指定),否则与模板数据库的设置相同。有关其他限制,请参见下文。
    如果locale_provider是libc,还将设置要在新数据库中使用的默认排序规则顺序,覆盖设置区域设置。

  • lc_ctype
    Sets LC_CTYPE in the database server’s operating system environment. The default is the setting of locale if specified, otherwise the same setting as the template database. See below for additional restrictions.
    If locale_provider is libc, also sets the default character classification to use in the new database, overriding the setting locale.
    在数据库服务器的操作系统环境中设置LC_CTYPE。默认值是区域设置(如果指定),否则与模板数据库的设置相同。有关其他限制,请参见下文。
    如果locale_provider是libc,还将设置要在新数据库中使用的默认字符分类,从而覆盖设置区域设置。

  • icu_locale
    Specifies the ICU locale (see Section 24.2.2.3.2) for the database default collation order and character classification, overriding the setting locale. The locale provider must be ICU. The default is the setting of locale if specified; otherwise the same setting as the template database.
    为数据库默认排序规则顺序和字符分类指定ICU区域设置(请参见第24.2.2.3.2节),覆盖设置区域设置。区域设置提供程序必须是ICU。如果指定,则默认为区域设置;否则设置与模板数据库相同

  • icu_rules
    Specifies additional collation rules to customize the behavior of the default collation of this database. This is supported for ICU only. See Section 24.2.3.4 for details.
    指定其他排序规则以自定义此数据库的默认排序规则的行为。这仅适用于ICU。详见第24.2.3.4节。

  • locale_provider
    Specifies the provider to use for the default collation in this database. Possible values are icu (if the server was built with ICU support) or libc. By default, the provider is the same as that of
    the template. See Section 24.1.4 for details.
    指定用于此数据库中默认排序规则的提供程序。可能的值是icu(如果服务器是在icu支持下构建的)或libc。默认情况下,提供程序与模板的提供程序相同。详见第24.1.4节。

  • collation_version
    Specifies the collation version string to store with the database. Normally, this should be omitted, which will cause the version to be computed from the actual version of the database collation as provided by the operating system. This option is intended to be used by pg_upgrade for copying the version from an existing installation.
    See also ALTER DATABASE for how to handle database collation version mismatches.
    指定要与数据库一起存储的排序规则版本字符串。通常情况下,应该忽略这一点,这将导致根据操作系统提供的数据库排序规则的实际版本来计算版本。此选项用于pg_upgrade从现有安装中复制版本。
    有关如何处理数据库排序规则版本不匹配的信息,请参阅ALTER DATABASE。

  • tablespace_name
    The name of the tablespace that will be associated with the new database, or DEFAULT to use
    the template database’s tablespace. This tablespace will be the default tablespace used for objects created in this database. See CREATE TABLESPACE for more information.
    将与新数据库相关联的表空间的名称,或默认使用模板数据库表空间。此表空间将是用于在此数据库中创建的对象的默认表空间。有关详细信息,请参见CREATE TABLESPACE。

  • allowconn
    If false then no one can connect to this database. The default is true, allowing connections (except as restricted by other mechanisms, such as GRANT/REVOKE CONNECT).
    如果为false,则没有人可以连接到此数据库。默认值为true,允许连接(除非受到其他机制的限制,如GRANT/REVOKE CONNECT)。

  • connlimit
    How many concurrent connections can be made to this database. -1 (the default) means no limit.
    可以与此数据库建立多少个并发连接-1(默认值)表示没有限制。

  • istemplate
    If true, then this database can be cloned by any user with CREATEDB privileges; if false (the
    default), then only superusers or the owner of the database can clone it.
    如果为true,则任何具有CREATEDB权限的用户都可以克隆此数据库;如果为false(默认值),则只有超级用户或数据库所有者才能克隆它。

  • oid
    The object identifier to be used for the new database. If this parameter is not specified, PostgreSQL will choose a suitable OID automatically. This parameter is primarily intended for internal use by pg_upgrade, and only pg_upgrade can specify a value less than 16384.
    要用于新数据库的对象标识符。如果没有指定这个参数,PostgreSQL会自动选择一个合适的OID。此参数主要供pg_upgrade内部使用,只有pg_upggrade才能指定小于16384的值。

Optional parameters can be written in any order, not only the order illustrated above.
以上可选参数可以按照任何顺序写入,而不仅仅是按照上面所示的顺序。

case 1:创建数据库test1

postgres=# create database test1;
CREATE DATABASE
postgres=# \l
                                                       List of databases
   Name    |  Owner   | Encoding | Locale Provider |   Collate   |    Ctype    | ICU Locale | ICU Rules |   Access privileges   
-----------+----------+----------+-----------------+-------------+-------------+------------+-----------+-----------------------
 postgres  | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 template0 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 template1 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 test1     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 white     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
(5 rows)

case 2:创建数据库test2,并指定表空间。

--创建表空间test1
mkdir -p /pgdir/test1
chown -R pg16:pg16  /pgdir/test1

[pg16@test test1]$ psql -p 5777
psql (16.2)
Type "help" for help.

postgres=# CREATE TABLESPACE test1 LOCATION '/pgdir/test1';
CREATE TABLESPACE
postgres=# \db
         List of tablespaces
    Name    |  Owner   |   Location   
------------+----------+--------------
 pg_default | postgres | 
 pg_global  | postgres | 
 test1      | postgres | /pgdir/test1
(3 rows)

–创建数据库test2

postgres=# create database test2 tablespace test1;
CREATE DATABASE
postgres=# \l
                                                       List of databases
   Name    |  Owner   | Encoding | Locale Provider |   Collate   |    Ctype    | ICU Locale | ICU Rules |   Access privileges   
-----------+----------+----------+-----------------+-------------+-------------+------------+-----------+-----------------------
 postgres  | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 template0 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 template1 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 test1     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 test2     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 white     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
(6 rows)

postgres=# select b.datname,a.spcname from pg_tablespace a,pg_database b where a.oid=b.dattablespace and b.datname='test2';
 datname | spcname 
---------+---------
 test2   | test1
(1 row)

2 修改数据库

语法

ALTER DATABASE name [ [ WITH ] option [ ... ] ]
where option can be:
ALLOW_CONNECTIONS allowconn
CONNECTION LIMIT connlimit
IS_TEMPLATE istemplate
ALTER DATABASE name RENAME TO new_name
ALTER DATABASE name OWNER TO { new_owner | CURRENT_ROLE |
CURRENT_USER | SESSION_USER }
ALTER DATABASE name SET TABLESPACE new_tablespace
ALTER DATABASE name REFRESH COLLATION VERSION
ALTER DATABASE name SET configuration_parameter { TO | = } { value
| DEFAULT }
ALTER DATABASE name SET configuration_parameter FROM CURRENT
ALTER DATABASE name RESET configuration_parameter
ALTER DATABASE name RESET ALL

参数解析

  • name
    The name of the database whose attributes are to be altered.

  • allowconn
    If false then no one can connect to this database.

  • connlimit
    How many concurrent connections can be made to this database. -1 means no limit.

  • istemplate
    If true, then this database can be cloned by any user with CREATEDB privileges; if false, then
    only superusers or the owner of the database can clone it.

  • new_name
    The new name of the database.

  • new_owner
    The new owner of the database.

  • new_tablespace
    The new default tablespace of the database.
    This form of the command cannot be executed inside a transaction block.

  • REFRESH COLLATION VERSION
    Update the database collation version. See Notes for background.

  • configuration_parameter

  • value
    Set this database’s session default for the specified configuration parameter to the given value. Ifvalue is DEFAULT or, equivalently, RESET is used, the database-specific setting is removed,
    so the system-wide default setting will be inherited in new sessions. Use RESET ALL to clear
    all database-specific settings. SET FROM CURRENT saves the session’s current value of the
    parameter as the database-specific value.

case 1:数据库test1的表空间为test1

postgres=# select b.datname,a.spcname from pg_tablespace a,pg_database b where a.oid=b.dattablespace and b.datname='test1';
 datname |  spcname   
---------+------------
 test1   | pg_default
(1 row)

postgres=# alter database test1 set tablespace test1;
ALTER DATABASE
postgres=# select b.datname,a.spcname from pg_tablespace a,pg_database b where a.oid=b.dattablespace and b.datname='test1';
 datname | spcname 
---------+---------
 test1   | test1
(1 row)

postgres=# 

case 2:修改数据库test1的名字为test1_new

postgres=# \l
                                                       List of databases
   Name    |  Owner   | Encoding | Locale Provider |   Collate   |    Ctype    | ICU Locale | ICU Rules |   Access privileges   
-----------+----------+----------+-----------------+-------------+-------------+------------+-----------+-----------------------
 postgres  | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 template0 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 template1 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 test1     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 test2     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 white     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
(6 rows)

postgres=# alter database test1 rename to test1_new;
ALTER DATABASE
postgres=# \l
                                                       List of databases
   Name    |  Owner   | Encoding | Locale Provider |   Collate   |    Ctype    | ICU Locale | ICU Rules |   Access privileges   
-----------+----------+----------+-----------------+-------------+-------------+------------+-----------+-----------------------
 postgres  | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 template0 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 template1 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 test1_new | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 test2     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 white     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
(6 rows)

3 删除数据库

DROP DATABASE删除数据库。它删除数据库的目录条目,并删除包含数据的目录。它只能由数据库所有者执行。当您连接到目标数据库时,它无法执行。(连接到postgres或任何其他数据库以发出此命令。)此外,如果其他任何人连接到目标数据库,则除非使用下面描述的FORCE选项,否则此命令将失败。
DROP DATABASE无法撤消。小心使用!

语法

DROP DATABASE [ IF EXISTS ] name [ [ WITH ] ( option [, ...] ) ]
where option can be:
FORCE

case 1:删除数据库test1

postgres=# \l
                                                       List of databases
   Name    |  Owner   | Encoding | Locale Provider |   Collate   |    Ctype    | ICU Locale | ICU Rules |   Access privileges   
-----------+----------+----------+-----------------+-------------+-------------+------------+-----------+-----------------------
 postgres  | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 template0 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 template1 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 test1     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 test2     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 white     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
(6 rows)

postgres=# drop database test1;
DROP DATABASE
postgres=# \l
                                                       List of databases
   Name    |  Owner   | Encoding | Locale Provider |   Collate   |    Ctype    | ICU Locale | ICU Rules |   Access privileges   
-----------+----------+----------+-----------------+-------------+-------------+------------+-----------+-----------------------
 postgres  | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 template0 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 template1 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 test2     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 white     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
(5 rows)

case 2:删除数据库test2,加force参数。(报语法错误

postgres=# \l
                                                       List of databases
   Name    |  Owner   | Encoding | Locale Provider |   Collate   |    Ctype    | ICU Locale | ICU Rules |   Access privileges   
-----------+----------+----------+-----------------+-------------+-------------+------------+-----------+-----------------------
 postgres  | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 template0 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 template1 | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 test2     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
 white     | postgres | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
(5 rows)

postgres=# drop database test2;
ERROR:  database "test2" is being accessed by other users
DETAIL:  There is 1 other session using the database.
postgres=# drop database test2 force;
ERROR:  syntax error at or near "force"
LINE 1: drop database test2 force;
                            ^

更多内容请查看对应数据库版本的官方文档。

谨记:心存敬畏,行有所止。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/548071.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

web前端js笔记

1,对象 let{ 属性 方法 } 2,闭包 只有函数内部的子函数才能读取局部变量,所以闭包可以理解成定义在一个函数内部的函数,在本质上,闭包是将函数内部和函数外部连接起来的桥梁。 3,math console.log(Math.flo…

✌粤嵌—2024/4/15—汇总区间

代码实现&#xff1a; /*** Note: The returned array must be malloced, assume caller calls free().*/ char** summaryRanges(int* nums, int numsSize, int *returnSize) {char **res malloc(sizeof(char*) * numsSize);*returnSize 0;int i, j;for (i 0; i < numsSi…

npm run serve报错:error:0308010C:digital envelope routines::unsupported

这是因为Node.js17中的OpenSSL加密库不支持当前的加密设置。 因为新版本默认使用OpenSSL 3&#xff0c;它可能不再支持旧版的加密算法或配置。 > demo0.1.0 serve > vue-cli-service serveINFO Starting development server... 10% building 2/5 modules 3 active ...…

2024蓝桥A组D题

团建 问题描述格式输入格式输出样例输入样例输出评测用例规模与约定解析参考程序难度等级 问题描述 格式输入 输入的第一行包含两个正整数n,m&#xff0c;用一个空格分隔。 第二行包含n个正整数c1,c2, ,cn&#xff0c;相邻整数之间使用一个空格分隔&#xff0c; 其中ci表示第一…

Python教程:备份你的文件夹里面的数据

1.完全备份是最基本的备份类型&#xff0c;它涉及复制所有选定的数据到备份位置。无论文件是否自上次备份以来发生了变化&#xff0c;所有文件都会被复制。这种备份方式简单直接&#xff0c;确保了备份存储的数据总是最新的。 完全备份是通过递归复制源文件夹中的所有文件和子…

简单了解C++常见编程问题解决方案

这篇文章主要介绍了C常见编程问题解决方案,文中通过示例代码介绍的非常详细&#xff0c;对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下 电脑配置&#xff1a;window10, 64位操作系统&#xff0c;基于x64的处理器&#xff0c;Microsoft Visual Studio Comm…

Fluent网格划分小结

Fluent网格划分小结 1. 确定划分什么网格类型&#xff1f;2. Fluent mesh (FM)网格划分3. 网格划分demo参考资料 1. 确定划分什么网格类型&#xff1f; &#xff08;1&#xff09;结构网格&#xff08;出图好看&#xff0c;论文中说服力强&#xff09;和非结构网格&#xff08…

基于Springboot的校园闲置物品交易网站

基于SpringbootVue的校园闲置物品交易网站的设计与实现 开发语言&#xff1a;Java数据库&#xff1a;MySQL技术&#xff1a;SpringbootMybatis工具&#xff1a;IDEA、Maven、Navicat 系统展示 用户登录 首页 商品信息展示 商品资讯 后台管理 后台首页 用户管理 商品类型管…

适当睡眠有助于缓解抑郁

适当睡眠&#x1f634;&#x1f62a;&#x1f971;&#x1f4a4;&#x1f6cc;&#x1f3fc;有助于缓解抑郁&#x1f917; 睡眠与抑郁之间存在密切的关系。一方面&#xff0c;良好的睡眠可以促进身体和大脑的恢复与修复&#xff0c;有助于缓解抑郁症状并提高生活质量。另一方面…

如何助力数字化校园建设领先一步

数字化校园建设是一个系统工程&#xff0c;涉及教学方法、智慧校园平台、教学资源、硬件设置、后勤服务等多个方面。要想在数字化校园建设中领先一步&#xff0c;需要综合考虑教育理念、技术应用、资源整合、人才培养等多个层面。 数字化校园的建设不是一蹴而就的&#xff0c;而…

​面试经典150题——LRU 缓存

​ 1. 题目描述 2. 题目分析与解析 首先讲解一下LRU LRU 是“Least Recently Used”的缩写&#xff0c;LRU 算法的基本思想是跟踪最近最少使用的数据&#xff0c;并在缓存已满且需要存储新数据时优先驱逐该数据。 LRU 算法通常的工作原理的简化解释&#xff1a; 当访问或使…

农业环境监测设备:促进农业可持续发展

TH-NQ14农业环境监测设备在现代化农业发展中扮演着至关重要的角色。这些设备能够实时监测农田环境参数&#xff0c;为农业生产提供科学依据&#xff0c;促进农业可持续发展。 随着技术的不断进步&#xff0c;农业环境监测设备的功能和性能得到了极大的提升。现代的农业环境监测…

Docker篇(三)— Docker的基本操作

目录 镜像操作镜像名称镜像命令案例1-拉取、查看镜像案例2-保存、导入镜像 镜像操作 镜像名称 首先来看下镜像的名称组成&#xff1a; 镜名称一般分两部分组成&#xff1a;[repository]:[tag]。在没有指定tag时&#xff0c;默认是latest&#xff0c;代表最新版本的镜像 如图…

35. UE5 RPG制作火球术技能

接下来&#xff0c;我们将制作技能了&#xff0c;总算迈进了一大步。首先回顾一下之前是如何实现技能触发的&#xff0c;然后再进入正题。 如果想实现我之前的触发方式的&#xff0c;请看此栏目的31-33篇文章&#xff0c;讲解了实现逻辑&#xff0c;这里总结一下&#xff1a; …

一个实例了解JVM运行原理

下面以一个具体的代码示例&#xff0c;来说明Java代码对象是如何分配的&#xff0c;Java代码又是如何在JVM中运行的。 public class JVMCase {// 常量public final static String MAN_SEX_TYPE "man";// 静态变量public static String WOMAN_SEX_TYPE "woman…

MGRE环境下的OSPF配置

拓扑图 R1配置 [r1]int Tunnel 0/0/0 [r1-Tunnel0/0/0]ip add 192.168.7.1 24 [r1-Tunnel0/0/0]tunnel-protocol gre p2mp [r1-Tunnel0/0/0]source 16.0.0.1 [r1-Tunnel0/0/0]nhrp network-id 100[r1]int t0/0/1 [r1-Tunnel0/0/1]ip add 192.168.8.1 24 [r1-Tunnel0/0/1]tunn…

远程抄表系统与配电能效系统在大学学生公寓的应用/远程抄表计费系统

安科瑞薛瑶瑶18701709087 摘要&#xff1a;该校及全国各大高校学生公寓目前收费模式及现状&#xff0c;远程抄表智能系统的必要性及系统运行状况的对比。 关键词&#xff1a;远程抄表智能系统&#xff1b;必要性&#xff1b;优点 0、前言 该校在远程抄表智能系统使用前学生…

文字转语音TTS在线使用经验

文字转语音TTS在线使用经验 文字转语音TTS在线使用经验 2024-04-15 &#xff0c;今天测试了一下微软 Azure TTS 的新语音引擎&#xff0c;主要测试了英语和中文。 这次 MicroSoft 一共推出了 9 款包括&#xff1a; 美式英语 - en-US-AvaMultilingualNeural 女性 美式英语 - en…

【Java基础学习】面向对象编程

开始时间: April 10, 2024 结束时间: April 16, 2024 阶段: Done 基础部分 类与对象的关系 类是抽象的&#xff0c;概念的&#xff0c;代表一类事物对象是具体的&#xff0c;实际的&#xff0c;代表一个具体事物&#xff08;实例&#xff09;类是对象的模板&#xff0c;对象…

基于Springboot+Vue的Java项目-校园管理系统(附演示视频+源码+LW)

大家好&#xff01;我是程序员一帆&#xff0c;感谢您阅读本文&#xff0c;欢迎一键三连哦。 &#x1f49e;当前专栏&#xff1a;Java毕业设计 精彩专栏推荐&#x1f447;&#x1f3fb;&#x1f447;&#x1f3fb;&#x1f447;&#x1f3fb; &#x1f380; Python毕业设计 &am…