Using RMAN duplicate Created Remote Auxiliary Database

2024-02-01 09:08

本文主要是介绍Using RMAN duplicate Created Remote Auxiliary Database,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

目标数据库SID=backupdb
辅助数据库SID=backupdb
准备工作包括:目标数据库的全备;在辅助数据库端安装oracle10gR2软件,创建相应的目录、口令文件、pfile,拷贝备份集到辅助数据库

备份全库和当前的controlfile

RMAN> run {
2> allocate channel c1 device type disk;
3> backup as compressed backupset
4> incremental level=0
5> format='/orabackup/inc0_%d_%U' tag='inc0'
6> channel=c1
7> database plus archivelog delete input;
8> backup
9> format='/orabackup/bkctl.ctl' tag='bkctl'
10> channel=c1
11> current controlfile;
12> release channel c1;
13> }
released channel: ORA_DISK_1
allocated channel: c1
channel c1: sid=145 devtype=DISKStarting backup at 28-MAR-12
current log archived
channel c1: starting compressed archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=6 recid=4 stamp=779120629
channel c1: starting piece 1 at 28-MAR-12
channel c1: finished piece 1 at 28-MAR-12
piece handle=/orabackup/inc0_BACKUPDB_01n70rvl_1_1 tag=INC0 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:02
channel c1: deleting archive log(s)
archive log filename=/arch/1_6_778974218.dbf recid=4 stamp=779120629
Finished backup at 28-MAR-12Starting backup at 28-MAR-12
channel c1: starting compressed incremental level 0 datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00006 name=/u01/app/oracle/oradata/backupdb/catalog01.dbf
input datafile fno=00001 name=/u01/app/oracle/oradata/backupdb/system01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/backupdb/sysaux01.dbf
input datafile fno=00005 name=/u01/app/oracle/oradata/backupdb/example01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/backupdb/undotbs01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/backupdb/users01.dbf
channel c1: starting piece 1 at 28-MAR-12
channel c1: finished piece 1 at 28-MAR-12
piece handle=/orabackup/inc0_BACKUPDB_02n70rvn_1_1 tag=INC0 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:55
channel c1: starting compressed incremental level 0 datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel c1: starting piece 1 at 28-MAR-12
channel c1: finished piece 1 at 28-MAR-12
piece handle=/orabackup/inc0_BACKUPDB_03n70s1e_1_1 tag=INC0 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:02
Finished backup at 28-MAR-12Starting backup at 28-MAR-12
current log archived
channel c1: starting compressed archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=7 recid=5 stamp=779120688
channel c1: starting piece 1 at 28-MAR-12
channel c1: finished piece 1 at 28-MAR-12
piece handle=/orabackup/inc0_BACKUPDB_04n70s1g_1_1 tag=INC0 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:02
channel c1: deleting archive log(s)
archive log filename=/arch/1_7_778974218.dbf recid=5 stamp=779120688
Finished backup at 28-MAR-12Starting backup at 28-MAR-12
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
channel c1: starting piece 1 at 28-MAR-12
channel c1: finished piece 1 at 28-MAR-12
piece handle=/orabackup/bkctl.ctl tag=BKCTL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:02
Finished backup at 28-MAR-12released channel: c1RMAN>
RMAN> list backupset summary;
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
1 B A A DISK 28-MAR-12 1 1 YES INC0
2 B 0 A DISK 28-MAR-12 1 1 YES INC0
3 B 0 A DISK 28-MAR-12 1 1 YES INC0
4 B A A DISK 28-MAR-12 1 1 YES INC0
5 B F A DISK 28-MAR-12 1 1 NO BKCTLRMAN>

在远端服务器上创建相应的目录

[oracle@zhong ~]$ mkdir -p $ORACLE_BASE/admin/backupdb/adump
[oracle@zhong ~]$ mkdir -p $ORACLE_BASE/admin/backupdb/bdump
[oracle@zhong ~]$ mkdir -p $ORACLE_BASE/admin/backupdb/cdump
[oracle@zhong ~]$ mkdir -p $ORACLE_BASE/admin/backupdb/udump
[oracle@zhong ~]$ mkdir -p $ORACLE_BASE/oradata/backupdb
[oracle@zhong ~]$ mkdir -p /u01/app/oracle/flash_recovery_area
[oracle@zhong ~]$ su - root
Password:
[root@zhong ~]# mkdir -p /arch/
[root@zhong ~]# chown oracle.oinstall /arch/
[root@zhong ~]# su - oracle
[oracle@zhong ~]$

在远端服务器上创建口令文件,pfile

[oracle@zhong ~]$ orapwd file=$ORACLE_HOME/dbs/orapwbackupdb password=oracle entries=5
[oracle@zhong ~]$ cat $ORACLE_HOME/dbs/initbackupdb.ora
backupdb.__db_cache_size=184549376
backupdb.__java_pool_size=4194304
backupdb.__large_pool_size=4194304
backupdb.__shared_pool_size=88080384
backupdb.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/backupdb/adump'
*.background_dump_dest='/u01/app/oracle/admin/backupdb/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/app/oracle/oradata/backupdb/control01.ctl','/u01/app/oracle/oradata/backupdb/control02.ctl','/u01/app/oracle/oradata/backupdb/control03.ctl'
*.core_dump_dest='/u01/app/oracle/admin/backupdb/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='backupdb'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=21474836480
*.dispatchers='(PROTOCOL=TCP) (SERVICE=backupdbXDB)'
*.job_queue_processes=10
*.log_archive_dest_1='LOCATION=/arch'
*.log_archive_format='%t_%s_%r.dbf'
*.nls_language='SIMPLIFIED CHINESE'
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=285212672
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/backupdb/udump'

将目标数据库的备份集传输到远端,这里我的目录结构是一致的

[oracle@catalog orabackup]$ scp -r * oracle@192.168.106.162:/orabackup
The authenticity of host '192.168.106.162 (192.168.106.162)' can't be established.
RSA key fingerprint is a0:e4:b0:94:30:e4:20:56:00:12:c7:fa:48:9e:c8:d0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.106.162' (RSA) to the list of known hosts.
oracle@192.168.106.162's password:
bkctl.ctl 100% 6944KB 6.8MB/s 00:00
inc0_BACKUPDB_01n70rvl_1_1 100% 5635KB 5.5MB/s 00:00
inc0_BACKUPDB_02n70rvn_1_1 100% 116MB 29.0MB/s 00:04
inc0_BACKUPDB_03n70s1e_1_1 100% 1072KB 1.1MB/s 00:00
inc0_BACKUPDB_04n70s1g_1_1 100% 3072 3.0KB/s 00:00

启动远端数据库到nomount状态

[oracle@zhong ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 28 15:16:56 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to an idle instance.SYS@backupdb:~>startup nomount
ORACLE instance started.Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 96470608 bytes
Database Buffers 184549376 bytes
Redo Buffers 2973696 bytes
SYS@backupdb:~>


tnsnames.ora里配置好了网络服务名,在远端使用RMAN连接目标数据库,查看备份集,检查备份集状态

[oracle@zhong ~]$ rman target sys/oracle@target
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Mar 28 15:48:21 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database: BACKUPDB (DBID=4125018504)RMAN> list backupset summary;using target database control file instead of recovery catalogList of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
1 B A A DISK 28-MAR-12 1 1 YES INC0
2 B 0 A DISK 28-MAR-12 1 1 YES INC0
3 B 0 A DISK 28-MAR-12 1 1 YES INC0
4 B A A DISK 28-MAR-12 1 1 YES INC0
5 B F A DISK 28-MAR-12 1 1 NO BKCTLRMAN> crosscheck backupset;allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=143 devtype=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/orabackup/inc0_BACKUPDB_01n70rvl_1_1 recid=1 stamp=779120630
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/orabackup/inc0_BACKUPDB_02n70rvn_1_1 recid=2 stamp=779120631
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/orabackup/inc0_BACKUPDB_03n70s1e_1_1 recid=3 stamp=779120687
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/orabackup/inc0_BACKUPDB_04n70s1g_1_1 recid=4 stamp=779120689
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/orabackup/bkctl.ctl recid=5 stamp=779120691
Crosschecked 5 objects

然后连接到本机nomount状态的辅助数据库

RMAN> connect auxiliary sys/oracle@backupdb;
connected to auxiliary database: BACKUPDB (not mounted)RMAN> list backupset by file;using target database control file instead of recovery catalogList of Datafile Backups
========================File Key TY LV S Ckp SCN Ckp Time #Pieces #Copies Compressed Tag
---- ------- - -- - ---------- --------- ------- ------- ---------- ---
1 2 B 0 A 555821 28-MAR-12 1 1 YES INC0
2 2 B 0 A 555821 28-MAR-12 1 1 YES INC0
3 2 B 0 A 555821 28-MAR-12 1 1 YES INC0
4 2 B 0 A 555821 28-MAR-12 1 1 YES INC0
5 2 B 0 A 555821 28-MAR-12 1 1 YES INC0
6 2 B 0 A 555821 28-MAR-12 1 1 YES INC0List of Archived Log Backups
============================Thrd Seq Low SCN Low Time BS Key S #Pieces #Copies Compressed Tag
---- ------- ---------- --------- ------- - ------- ------- ---------- ---
1 6 548132 28-MAR-12 1 A 1 1 YES INC0
1 7 555817 28-MAR-12 4 A 1 1 YES INC0List of Control File Backups
============================CF Ckp SCN Ckp Time BS Key S #Pieces #Copies Compressed Tag
---------- --------- ------- - ------- ------- ---------- ---
555849 28-MAR-12 5 A 1 1 NO BKCTL
555839 28-MAR-12 3 A 1 1 YES INC0
List of SPFILE Backups
======================Modification Time BS Key S #Pieces #Copies Compressed Tag
----------------- ------- - ------- ------- ---------- ---
26-MAR-12 3 A 1 1 YES INC0RMAN>

使用RMAN创建辅助数据库

RMAN> connect auxiliary sys/oracle@backupdb;
connected to auxiliary database: BACKUPDB (not mounted)RMAN> run {
2> allocate auxiliary channel c1 device type disk;
3> duplicate target database to backupdb nofilenamecheck until logseq 8;
4> }using target database control file instead of recovery catalog
allocated channel: c1
channel c1: sid=155 devtype=DISKStarting Duplicate Db at 28-MAR-12contents of Memory Script:
{
set until scn 555843;
set newname for datafile 1 to
"/u01/app/oracle/oradata/backupdb/system01.dbf";
set newname for datafile 2 to
"/u01/app/oracle/oradata/backupdb/undotbs01.dbf";
set newname for datafile 3 to
"/u01/app/oracle/oradata/backupdb/sysaux01.dbf";
set newname for datafile 4 to
"/u01/app/oracle/oradata/backupdb/users01.dbf";
set newname for datafile 5 to
"/u01/app/oracle/oradata/backupdb/example01.dbf";
set newname for datafile 6 to
"/u01/app/oracle/oradata/backupdb/catalog01.dbf";
restore
check readonly
clone database
;
}
executing Memory Scriptexecuting command: SET until clauseexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEStarting restore at 28-MAR-12channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/app/oracle/oradata/backupdb/system01.dbf
restoring datafile 00002 to /u01/app/oracle/oradata/backupdb/undotbs01.dbf
restoring datafile 00003 to /u01/app/oracle/oradata/backupdb/sysaux01.dbf
restoring datafile 00004 to /u01/app/oracle/oradata/backupdb/users01.dbf
restoring datafile 00005 to /u01/app/oracle/oradata/backupdb/example01.dbf
restoring datafile 00006 to /u01/app/oracle/oradata/backupdb/catalog01.dbf
channel c1: reading from backup piece /orabackup/inc0_BACKUPDB_02n70rvn_1_1
channel c1: restored backup piece 1
piece handle=/orabackup/inc0_BACKUPDB_02n70rvn_1_1 tag=INC0
channel c1: restore complete, elapsed time: 00:00:39
Finished restore at 28-MAR-12
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "BACKUPDB" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 SIZE 50 M ,
GROUP 2 SIZE 50 M ,
GROUP 3 SIZE 50 M
DATAFILE
'/u01/app/oracle/oradata/backupdb/system01.dbf'
CHARACTER SET ZHS16GBKcontents of Memory Script:
{
switch clone datafile all;
}
executing Memory Scriptdatafile 2 switched to datafile copy
input datafile copy recid=1 stamp=779126597 filename=/u01/app/oracle/oradata/backupdb/undotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=779126597 filename=/u01/app/oracle/oradata/backupdb/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=3 stamp=779126597 filename=/u01/app/oracle/oradata/backupdb/users01.dbf
datafile 5 switched to datafile copy
input datafile copy recid=4 stamp=779126597 filename=/u01/app/oracle/oradata/backupdb/example01.dbf
datafile 6 switched to datafile copy
input datafile copy recid=5 stamp=779126597 filename=/u01/app/oracle/oradata/backupdb/catalog01.dbfcontents of Memory Script:
{
set until scn 555843;
recover
clone database
delete archivelog
;
}
executing Memory Scriptexecuting command: SET until clauseStarting recover at 28-MAR-12starting media recoverychannel c1: starting archive log restore to default destination
channel c1: restoring archive log
archive log thread=1 sequence=7
channel c1: reading from backup piece /orabackup/inc0_BACKUPDB_04n70s1g_1_1
channel c1: restored backup piece 1
piece handle=/orabackup/inc0_BACKUPDB_04n70s1g_1_1 tag=INC0
channel c1: restore complete, elapsed time: 00:00:02
archive log filename=/arch/1_7_778974218.dbf thread=1 sequence=7
channel clone_default: deleting archive log(s)
archive log filename=/arch/1_7_778974218.dbf recid=1 stamp=779126599
media recovery complete, elapsed time: 00:00:01
Finished recover at 28-MAR-12contents of Memory Script:
{
shutdown clone;
startup clone nomount ;
}
executing Memory Scriptdatabase dismounted
Oracle instance shut downconnected to auxiliary database (not started)
Oracle instance startedTotal System Global Area 285212672 bytesFixed Size 1218992 bytes
Variable Size 96470608 bytes
Database Buffers 184549376 bytes
Redo Buffers 2973696 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "BACKUPDB" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 SIZE 50 M ,
GROUP 2 SIZE 50 M ,
GROUP 3 SIZE 50 M
DATAFILE
'/u01/app/oracle/oradata/backupdb/system01.dbf'
CHARACTER SET ZHS16GBKcontents of Memory Script:
{
set newname for tempfile 1 to
"/u01/app/oracle/oradata/backupdb/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u01/app/oracle/oradata/backupdb/undotbs01.dbf";
catalog clone datafilecopy "/u01/app/oracle/oradata/backupdb/sysaux01.dbf";
catalog clone datafilecopy "/u01/app/oracle/oradata/backupdb/users01.dbf";
catalog clone datafilecopy "/u01/app/oracle/oradata/backupdb/example01.dbf";
catalog clone datafilecopy "/u01/app/oracle/oradata/backupdb/catalog01.dbf";
switch clone datafile all;
}
executing Memory Scriptexecuting command: SET NEWNAMErenamed temporary file 1 to /u01/app/oracle/oradata/backupdb/temp01.dbf in control filecataloged datafile copy
datafile copy filename=/u01/app/oracle/oradata/backupdb/undotbs01.dbf recid=1 stamp=779126606cataloged datafile copy
datafile copy filename=/u01/app/oracle/oradata/backupdb/sysaux01.dbf recid=2 stamp=779126607cataloged datafile copy
datafile copy filename=/u01/app/oracle/oradata/backupdb/users01.dbf recid=3 stamp=779126607cataloged datafile copy
datafile copy filename=/u01/app/oracle/oradata/backupdb/example01.dbf recid=4 stamp=779126607cataloged datafile copy
datafile copy filename=/u01/app/oracle/oradata/backupdb/catalog01.dbf recid=5 stamp=779126607datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=779126606 filename=/u01/app/oracle/oradata/backupdb/undotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=779126607 filename=/u01/app/oracle/oradata/backupdb/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=3 stamp=779126607 filename=/u01/app/oracle/oradata/backupdb/users01.dbf
datafile 5 switched to datafile copy
input datafile copy recid=4 stamp=779126607 filename=/u01/app/oracle/oradata/backupdb/example01.dbf
datafile 6 switched to datafile copy
input datafile copy recid=5 stamp=779126607 filename=/u01/app/oracle/oradata/backupdb/catalog01.dbfcontents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Scriptdatabase opened
Finished Duplicate Db at 28-MAR-12RMAN>

验证

[oracle@zhong ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 28 16:06:33 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining optionsSYS@backupdb:~>select open_mode from v$database;OPEN_MODE
----------
READ WRITESYS@backupdb:~>select member from v$logfile;MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/flash_recovery_area/BACKUPDB/onlinelog/o1_mf_3_7q5kgjwh_.log
/u01/app/oracle/flash_recovery_area/BACKUPDB/onlinelog/o1_mf_2_7q5kghoy_.log
/u01/app/oracle/flash_recovery_area/BACKUPDB/onlinelog/o1_mf_1_7q5kghf5_.logSYS@backupdb:~>select count(*) from hr.employees;COUNT(*)
----------
107SYS@backupdb:~>


这篇关于Using RMAN duplicate Created Remote Auxiliary Database的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/666779

相关文章

SQL中的外键约束

外键约束用于表示两张表中的指标连接关系。外键约束的作用主要有以下三点: 1.确保子表中的某个字段(外键)只能引用父表中的有效记录2.主表中的列被删除时,子表中的关联列也会被删除3.主表中的列更新时,子表中的关联元素也会被更新 子表中的元素指向主表 以下是一个外键约束的实例展示

基于MySQL Binlog的Elasticsearch数据同步实践

一、为什么要做 随着马蜂窝的逐渐发展,我们的业务数据越来越多,单纯使用 MySQL 已经不能满足我们的数据查询需求,例如对于商品、订单等数据的多维度检索。 使用 Elasticsearch 存储业务数据可以很好的解决我们业务中的搜索需求。而数据进行异构存储后,随之而来的就是数据同步的问题。 二、现有方法及问题 对于数据同步,我们目前的解决方案是建立数据中间表。把需要检索的业务数据,统一放到一张M

如何去写一手好SQL

MySQL性能 最大数据量 抛开数据量和并发数,谈性能都是耍流氓。MySQL没有限制单表最大记录数,它取决于操作系统对文件大小的限制。 《阿里巴巴Java开发手册》提出单表行数超过500万行或者单表容量超过2GB,才推荐分库分表。性能由综合因素决定,抛开业务复杂度,影响程度依次是硬件配置、MySQL配置、数据表设计、索引优化。500万这个值仅供参考,并非铁律。 博主曾经操作过超过4亿行数据

性能分析之MySQL索引实战案例

文章目录 一、前言二、准备三、MySQL索引优化四、MySQL 索引知识回顾五、总结 一、前言 在上一讲性能工具之 JProfiler 简单登录案例分析实战中已经发现SQL没有建立索引问题,本文将一起从代码层去分析为什么没有建立索引? 开源ERP项目地址:https://gitee.com/jishenghua/JSH_ERP 二、准备 打开IDEA找到登录请求资源路径位置

MySQL数据库宕机,启动不起来,教你一招搞定!

作者介绍:老苏,10余年DBA工作运维经验,擅长Oracle、MySQL、PG、Mongodb数据库运维(如安装迁移,性能优化、故障应急处理等)公众号:老苏畅谈运维欢迎关注本人公众号,更多精彩与您分享。 MySQL数据库宕机,数据页损坏问题,启动不起来,该如何排查和解决,本文将为你说明具体的排查过程。 查看MySQL error日志 查看 MySQL error日志,排查哪个表(表空间

MySQL高性能优化规范

前言:      笔者最近上班途中突然想丰富下自己的数据库优化技能。于是在查阅了多篇文章后,总结出了这篇! 数据库命令规范 所有数据库对象名称必须使用小写字母并用下划线分割 所有数据库对象名称禁止使用mysql保留关键字(如果表名中包含关键字查询时,需要将其用单引号括起来) 数据库对象的命名要能做到见名识意,并且最后不要超过32个字符 临时库表必须以tmp_为前缀并以日期为后缀,备份

[MySQL表的增删改查-进阶]

🌈个人主页:努力学编程’ ⛅个人推荐: c语言从初阶到进阶 JavaEE详解 数据结构 ⚡学好数据结构,刷题刻不容缓:点击一起刷题 🌙心灵鸡汤:总有人要赢,为什么不能是我呢 💻💻💻数据库约束 🔭🔭🔭约束类型 not null: 指示某列不能存储 NULL 值unique: 保证某列的每行必须有唯一的值default: 规定没有给列赋值时的默认值.primary key:

MySQL-CRUD入门1

文章目录 认识配置文件client节点mysql节点mysqld节点 数据的添加(Create)添加一行数据添加多行数据两种添加数据的效率对比 数据的查询(Retrieve)全列查询指定列查询查询中带有表达式关于字面量关于as重命名 临时表引入distinct去重order by 排序关于NULL 认识配置文件 在我们的MySQL服务安装好了之后, 会有一个配置文件, 也就

Java 连接Sql sever 2008

Java 连接Sql sever 2008 /Sql sever 2008 R2 import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class TestJDBC

rman compress

级别         初始         备完    耗时    low          1804       3572    0:10     High         1812       3176   2:00     MEDIUM  1820       3288    0:13    BASIC      1828   3444    0:56 ---不如MEDIUM,