^全^ 获取SQL SERVER2000/2005、MySql、Oracle元数据的SQL语句(1)

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS SQL Server,基础系列 2核4GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
简介:

前言

     前段时间老赵发了一篇关于和谐社区,和谐技术:微软的宠儿们,为什么富人的孩子就不能早当家?引发的争论至今令我诚惶诚恐,说得很在理!!这篇文章本打算放首页的,但是由于是拿来主义,我认为这属于新手的典型特征之一(本来就是新手=_=),故老老实实的放新手区吧。心里比较踏实一点,即使看到的人不多也没关系,自己做个笔记 :)

     有很多朋友都比较关心代码自动生成,理所当然离不开元数据了,但是对于获取元数据的方法不一。由于最近我也在写代码生成,对元数据的获取SQL语句并不齐全,意外的想到了CodeSmith,它也可以根据元数据来生成三层的,于是乎习惯性的去找他的源码了,果然没有失望,我们在SchemaProviders目录下能看到如下文件:

SchemaExplorer.ADOXSchemaProvider.dll

SchemaExplorer.MySQLSchemaProvider.dll

SchemaExplorer.OracleSchemaProvider.dll

SchemaExplorer.SqlSchemaProvider.dll

没有加密!但是SchemaExplorer.SqlSchemaProvider.dll混淆了!用Reflector查看源代码仍然能看到SQL语句,于是乎拷贝出来,替换\t\n,弄了我两个小时才完,今天一搜,原来有源码- - !!超级郁闷!!大伙就别走我的弯路了吧!源码在Samples\Projects\目录下。下面开始Ctrl+C,然后Ctrl+V,贴上来给没有下载CodeSmith的朋友收藏一下吧:)

 

版本

     CodeSmithProfessional 4.1

 

正文

     1.     闲话少说,直接贴SQL2000/2005获取元数据的SQL语句了,大家一看就会明白的。

#region  SQL Templates
        
private   const   string  SQL_GetDatabaseName  =   " SELECT db_name() " ;

        
private   const   string  SQL2005_GetTables  =   @"
          SELECT
              object_name(so.id) AS OBJECT_NAME,
              schema_name(so.uid) AS USER_NAME,
              so.type AS TYPE,
              so.crdate AS DATE_CREATED,
              fg.file_group AS FILE_GROUP,
              so.id as OBJECT_ID
          FROM 
              dbo.sysobjects so
          LEFT JOIN (
              SELECT 
                  s.groupname AS file_group,
                  i.id        AS id
              FROM dbo.sysfilegroups s
              INNER JOIN dbo.sysindexes i
                  ON i.groupid = s.groupid 
              WHERE i.indid < 2                           
          ) AS fg
              ON so.id = fg.id
          WHERE
              so.type = N'U'
              AND permissions(so.id) & 4096 <> 0
              AND ObjectProperty(so.id, N'IsMSShipped') = 0
              AND NOT EXISTS (SELECT * FROM sys.extended_properties WHERE major_id = so.id AND name = 'microsoft_database_tools_support' AND value = 1)
          ORDER BY schema_name(so.uid), object_name(so.id)
" ;

        
private   const   string  SQL2000_GetTables  =   @"
          SELECT
              object_name(so.id) AS OBJECT_NAME,
              user_name(so.uid)  AS USER_NAME,
              so.type            AS TYPE,
              so.crdate          AS DATE_CREATED,
              fg.file_group      AS FILE_GROUP,
              so.id              AS OBJECT_ID
          FROM 
              dbo.sysobjects so
          LEFT JOIN (
                SELECT 
                    s.groupname AS file_group,
                    i.id        AS id
                FROM dbo.sysfilegroups s
                INNER JOIN dbo.sysindexes i
                    ON i.groupid = s.groupid 
                WHERE i.indid < 2                           
              ) AS fg
              ON so.id = fg.id
          WHERE
              so.type = N'U'
              AND permissions(so.id) & 4096 <> 0
              AND ObjectProperty(so.id, N'IsMSShipped') = 0
          ORDER BY user_name(so.uid), object_name(so.id)
" ;

        
private   const   string  SQL_GetTables  =   @"
            SELECT
              object_name(id) AS OBJECT_NAME,
              user_name(uid) AS USER_NAME,
              type AS TYPE,
              crdate AS DATE_CREATED,
              '' AS FILE_GROUP,
              id as OBJECT_ID
            FROM
              sysobjects
            WHERE
              type = N'U'
              AND permissions(id) & 4096 <> 0
              AND ObjectProperty(id, N'IsMSShipped') = 0
            ORDER BY user_name(uid), object_name(id)
" ;

        
private   const   string  SQL2005_GetTableColumns  =   @"
             SELECT
              clmns.[name] AS [Name],
              usrt.[name] AS [DataType],
              ISNULL(baset.[name], N'') AS [SystemType],
              CAST(CASE WHEN baset.[name] IN (N'char', N'varchar', N'binary', N'varbinary', N'nchar', N'nvarchar') THEN clmns.prec ELSE clmns.length END AS int) AS [Length],
              CAST(clmns.xprec AS tinyint) AS [NumericPrecision],
              CAST(clmns.xscale AS int) AS [NumericScale],
              CASE CAST(clmns.isnullable AS bit) WHEN 1 THEN 'YES' ELSE 'NO' END AS [Nullable],
              defaults.text AS [DefaultValue],
              CAST(COLUMNPROPERTY(clmns.id, clmns.[name], N'IsIdentity') AS int) AS [Identity],
              CAST(COLUMNPROPERTY(clmns.id, clmns.[name], N'IsRowGuidCol') AS int) AS IsRowGuid,
              CAST(COLUMNPROPERTY(clmns.id, clmns.[name], N'IsComputed') AS int) AS IsComputed,
              CAST(COLUMNPROPERTY(clmns.id, clmns.[name], N'IsDeterministic') AS int) AS IsDeterministic,
              CAST(CASE COLUMNPROPERTY(clmns.id, clmns.[name], N'IsIdentity') WHEN 1 THEN IDENT_SEED(QUOTENAME(SCHEMA_NAME(tbl.uid)) + '.' + QUOTENAME(tbl.[name])) ELSE 0 END AS nvarchar(40)) AS [IdentitySeed],
              CAST(CASE COLUMNPROPERTY(clmns.id, clmns.[name], N'IsIdentity') WHEN 1 THEN IDENT_INCR(QUOTENAME(SCHEMA_NAME(tbl.uid)) + '.' + QUOTENAME(tbl.[name])) ELSE 0 END AS nvarchar(40)) AS [IdentityIncrement],
              cdef.[text] AS ComputedDefinition,
              clmns.[collation] AS Collation,
              CAST(clmns.colid AS int) AS ObjectId
            FROM
              dbo.sysobjects AS tbl
              INNER JOIN dbo.syscolumns AS clmns ON clmns.id=tbl.id
              LEFT JOIN dbo.systypes AS usrt ON usrt.xusertype = clmns.xusertype
              LEFT JOIN dbo.sysusers AS sclmns ON sclmns.uid = usrt.uid
              LEFT JOIN dbo.systypes AS baset ON baset.xusertype = clmns.xtype and baset.xusertype = baset.xtype
              LEFT JOIN dbo.syscomments AS defaults ON defaults.id = clmns.cdefault
              LEFT JOIN dbo.syscomments AS cdef ON cdef.id = clmns.id AND cdef.number = clmns.colid
            WHERE
              (tbl.[type] = 'U' OR tbl.[type] = 'S')
              AND SCHEMA_NAME(tbl.uid) = @SchemaName
              AND tbl.[name] = @TableName
            ORDER BY
              clmns.colorder
" ;

        
private   const   string  SQL2000_GetTableColumns  =   @"
              SELECT
                clmns.[name] AS [Name],
                usrt.[name] AS [DataType],
                ISNULL(baset.[name], N'') AS [SystemType],
                CAST(CASE WHEN baset.[name] IN (N'char', N'varchar', N'binary', N'varbinary', N'nchar', N'nvarchar') THEN clmns.prec ELSE clmns.length END AS INT) AS [Length],
                CAST(clmns.xprec AS TINYINT) AS [NumericPrecision],
                CAST(clmns.xscale AS INT) AS [NumericScale],
                CASE CAST(clmns.isnullable AS BIT) WHEN 1 THEN 'YES' ELSE 'NO' END AS [Nullable],
                defaults.text AS [DefaultValue],
                CAST(COLUMNPROPERTY(clmns.id, clmns.[name], N'IsIdentity') AS INT) AS [Identity],
                CAST(COLUMNPROPERTY(clmns.id, clmns.[name], N'IsRowGuidCol') AS INT) AS IsRowGuid,
                CAST(COLUMNPROPERTY(clmns.id, clmns.[name], N'IsComputed') AS INT) AS IsComputed,
                CAST(COLUMNPROPERTY(clmns.id, clmns.[name], N'IsDeterministic') AS INT) AS IsDeterministic,
                CAST(CASE COLUMNPROPERTY(clmns.id, clmns.[name], N'IsIdentity') WHEN 1 THEN IDENT_SEED(QUOTENAME(stbl.[name]) + '.' + QUOTENAME(tbl.[name])) ELSE 0 END AS NVARCHAR(40)) AS [IdentitySeed],
                CAST(CASE COLUMNPROPERTY(clmns.id, clmns.[name], N'IsIdentity') WHEN 1 THEN IDENT_INCR(QUOTENAME(stbl.[name]) + '.' + QUOTENAME(tbl.[name])) ELSE 0 END AS NVARCHAR(40)) AS [IdentityIncrement],
                cdef.[text] AS ComputedDefinition,
                clmns.[collation] AS Collation,
                CAST(clmns.colid AS int) AS ObjectId
              FROM
                dbo.sysobjects AS tbl
                INNER JOIN dbo.sysusers AS stbl ON stbl.[uid] = tbl.[uid]
                INNER JOIN dbo.syscolumns AS clmns ON clmns.id=tbl.id
                LEFT JOIN dbo.systypes AS usrt ON usrt.xusertype = clmns.xusertype
                LEFT JOIN dbo.sysusers AS sclmns ON sclmns.uid = usrt.uid
                LEFT JOIN dbo.systypes AS baset ON baset.xusertype = clmns.xtype and baset.xusertype = baset.xtype
                LEFT JOIN dbo.syscomments AS defaults ON defaults.id = clmns.cdefault
                LEFT JOIN dbo.syscomments AS cdef ON cdef.id = clmns.id AND cdef.number = clmns.colid
              WHERE
                (tbl.[type] = 'U' OR tbl.[type] = 'S') 
                AND stbl.[name] = @SchemaName
                AND tbl.[name] = @TableName
              ORDER BY
                  clmns.colorder
" ;

        
private   const   string  SQL_GetTableColumns  =   @"
                  SELECT
                      cols.COLUMN_NAME,
                      CASE
                          WHEN cols.DOMAIN_NAME IS NOT NULL THEN cols.DOMAIN_NAME
                          ELSE cols.DATA_TYPE
                      END
                      AS DATA_TYPE,
                      cols.DATA_TYPE AS UNDERLYING_TYPE,
                      CAST(cols.CHARACTER_MAXIMUM_LENGTH AS int),
                      cols.NUMERIC_PRECISION,
                      cols.NUMERIC_SCALE,
                      cols.IS_NULLABLE,
                      cols.COLUMN_DEFAULT,
                      COLUMNPROPERTY(OBJECT_ID(N'[' + @DatabaseName + N'].[' + @OwnerName + N'].[' + @TableName + N']'),cols.COLUMN_NAME,'IsIdentity') AS IS_IDENTITY,
                      COLUMNPROPERTY(OBJECT_ID(N'[' + @DatabaseName + N'].[' + @OwnerName + N'].[' + @TableName + N']'),cols.COLUMN_NAME,'IsRowGuidCol') AS IS_ROW_GUID_COL,
                      COLUMNPROPERTY(OBJECT_ID(N'[' + @DatabaseName + N'].[' + @OwnerName + N'].[' + @TableName + N']'),cols.COLUMN_NAME,'IsComputed') AS IS_COMPUTED,
                      COLUMNPROPERTY(OBJECT_ID(N'[' + @DatabaseName + N'].[' + @OwnerName + N'].[' + @TableName + N']'),cols.COLUMN_NAME,'IsDeterministic') AS IS_DETERMINISTIC,
                      CASE WHEN (COLUMNPROPERTY(OBJECT_ID(N'[' + @DatabaseName + N'].[' + @OwnerName + N'].[' + @TableName + N']'), cols.COLUMN_NAME, N'IsIdentity') <> 0) then CONVERT(nvarchar(40), ident_seed(N'[' + @DatabaseName + N'].[' + @OwnerName + N'].[' + @TableName + N']')) else null end AS IDENTITY_SEED,
                      CASE WHEN (COLUMNPROPERTY(OBJECT_ID(N'[' + @DatabaseName + N'].[' + @OwnerName + N'].[' + @TableName + N']'), cols.COLUMN_NAME, N'IsIdentity') <> 0) then CONVERT(nvarchar(40), ident_incr(N'[' + @DatabaseName + N'].[' + @OwnerName + N'].[' + @TableName + N']')) else null end AS IDENTITY_INCREMENT,
                    NULL AS COMPUTED_DEFINITION,
                    NULL AS [collation],
                    CAST(0 AS int) AS ObjectId
                  FROM
                      INFORMATION_SCHEMA.COLUMNS cols
                  WHERE
                      cols.TABLE_CATALOG = @DatabaseName
                      AND cols.TABLE_SCHEMA = @OwnerName
                      AND cols.TABLE_NAME = @TableName
                  ORDER BY
                      cols.ORDINAL_POSITION
" ;

        
private   const   string  SQL2005_GetViews  =   @"
                  SELECT
                      object_name(id) AS OBJECT_NAME,
                      schema_name(uid) AS USER_NAME,
                      type AS TYPE,
                      crdate AS DATE_CREATED,
                      id as OBJECT_ID
                  FROM
                      sysobjects
                  WHERE
                      type = N'V'
                      AND permissions(id) & 4096 <> 0
                      AND ObjectProperty(id, N'IsMSShipped') = 0
                      AND NOT EXISTS (SELECT * FROM sys.extended_properties WHERE major_id = id AND name = 'microsoft_database_tools_support' AND value = 1)
                  ORDER BY object_name(id)
" ;

        
private   const   string  SQL_GetViews  =   @"
                  SELECT
                      object_name(id) AS OBJECT_NAME,
                      user_name(uid) AS USER_NAME,
                      type AS TYPE,
                      crdate AS DATE_CREATED,
                      id as OBJECT_ID
                  FROM
                      sysobjects
                  WHERE
                      type = N'V'
                      AND permissions(id) & 4096 <> 0
                      AND ObjectProperty(id, N'IsMSShipped') = 0
          ORDER BY object_name(id)
" ;

        
private   const   string  SQL2000_GetViewColumns  =   @"
                  SELECT
                      cols.COLUMN_NAME,
                      CASE
                          WHEN cols.DOMAIN_NAME IS NOT NULL THEN cols.DOMAIN_NAME COLLATE Latin1_General_BIN
                          ELSE cols.DATA_TYPE
                      END
                      AS DATA_TYPE,
                      cols.DATA_TYPE AS UNDERLYING_TYPE,
                      CAST(cols.CHARACTER_MAXIMUM_LENGTH AS int),
                      cols.NUMERIC_PRECISION,
                      cols.NUMERIC_SCALE,
                      cols.IS_NULLABLE,
                      COLUMNPROPERTY(OBJECT_ID(N'[' + @DatabaseName + N'].[' + @OwnerName + N'].[' + @ViewName + N']'),cols.COLUMN_NAME,'IsComputed') AS IS_COMPUTED,
                      COLUMNPROPERTY(OBJECT_ID(N'[' + @DatabaseName + N'].[' + @OwnerName + N'].[' + @ViewName + N']'),cols.COLUMN_NAME,'IsDeterministic') AS IS_DETERMINISTIC
                  FROM
                      INFORMATION_SCHEMA.COLUMNS cols
                  WHERE
                      cols.TABLE_CATALOG = @DatabaseName
                      AND cols.TABLE_SCHEMA = @OwnerName
                      AND cols.TABLE_NAME = @ViewName
                  ORDER BY
                      cols.ORDINAL_POSITION
" ;

        
private   const   string  SQL_GetViewColumns  =   @"
                  SELECT
                      cols.COLUMN_NAME,
                      CASE
                          WHEN cols.DOMAIN_NAME IS NOT NULL THEN cols.DOMAIN_NAME
                          ELSE cols.DATA_TYPE
                      END
                      AS DATA_TYPE,
                      cols.DATA_TYPE AS UNDERLYING_TYPE,
                      CAST(cols.CHARACTER_MAXIMUM_LENGTH AS int),
                      cols.NUMERIC_PRECISION,
                      cols.NUMERIC_SCALE,
                      cols.IS_NULLABLE,
                      COLUMNPROPERTY(OBJECT_ID(N'[' + @DatabaseName + N'].[' + @OwnerName + N'].[' + @ViewName + N']'),cols.COLUMN_NAME,'IsComputed') AS IS_COMPUTED,
                      COLUMNPROPERTY(OBJECT_ID(N'[' + @DatabaseName + N'].[' + @OwnerName + N'].[' + @ViewName + N']'),cols.COLUMN_NAME,'IsDeterministic') AS IS_DETERMINISTIC
                  FROM
                      INFORMATION_SCHEMA.COLUMNS cols
                  WHERE
                      cols.TABLE_CATALOG = @DatabaseName
                      AND cols.TABLE_SCHEMA = @OwnerName
                      AND cols.TABLE_NAME = @ViewName
                  ORDER BY
                      cols.ORDINAL_POSITION
" ;

        
private   const   string  SQL_GetTablePrimaryKey  =   " EXEC sp_MStablekeys @tablename " ;

        
private   const   string  SQL_GetTableIndexes  =   @"
        SELECT 
          i.name, 
          i.status, 
          i.indid, 
          i.OrigFillFactor,
          IndCol1  = INDEX_COL(@tablename, i.indid, 1),
          IndCol2  = INDEX_COL(@tablename, i.indid, 2),
          IndCol3  = INDEX_COL(@tablename, i.indid, 3),
          IndCol4  = INDEX_COL(@tablename, i.indid, 4),
          IndCol5  = INDEX_COL(@tablename, i.indid, 5),
          IndCol6  = INDEX_COL(@tablename, i.indid, 6),
          IndCol7  = INDEX_COL(@tablename, i.indid, 7),
          IndCol8  = INDEX_COL(@tablename, i.indid, 8),
          IndCol9  = INDEX_COL(@tablename, i.indid, 9),
          IndCol10 = INDEX_COL(@tablename, i.indid, 10),
          IndCol11 = INDEX_COL(@tablename, i.indid, 11),
          IndCol12 = INDEX_COL(@tablename, i.indid, 12),
          IndCol13 = INDEX_COL(@tablename, i.indid, 13),
          IndCol14 = INDEX_COL(@tablename, i.indid, 14),
          IndCol15 = INDEX_COL(@tablename, i.indid, 15),
          IndCol16 = INDEX_COL(@tablename, i.indid, 16),    
          IsDescCol1  = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 1,  N'isdescending'),
          IsDescCol2  = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 2,  N'isdescending'),
          IsDescCol3  = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 3,  N'isdescending'),
          IsDescCol4  = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 4,  N'isdescending'),
          IsDescCol5  = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 5,  N'isdescending'),
          IsDescCol6  = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 6,  N'isdescending'),
          IsDescCol7  = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 7,  N'isdescending'),
          IsDescCol8  = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 8,  N'isdescending'),
          IsDescCol9  = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 9,  N'isdescending'),
          IsDescCol10 = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 10, N'isdescending'),
          IsDescCol11 = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 11, N'isdescending'),
          IsDescCol12 = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 12, N'isdescending'),
          IsDescCol13 = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 13, N'isdescending'),
          IsDescCol14 = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 14, N'isdescending'),
          IsDescCol15 = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 15, N'isdescending'),
          IsDescCol16 = INDEXKEY_PROPERTY(OBJECT_ID(@tablename), i.indid, 16, N'isdescending'),    
          IsCompCol1  = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 1),  N'IsComputed'),
          IsCompCol2  = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 2),  N'IsComputed'),
          IsCompCol3  = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 3),  N'IsComputed'),
          IsCompCol4  = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 4),  N'IsComputed'),
          IsCompCol5  = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 5),  N'IsComputed'),
          IsCompCol6  = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 6),  N'IsComputed'),
          IsCompCol7  = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 7),  N'IsComputed'),
          IsCompCol8  = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 8),  N'IsComputed'),
          IsCompCol9  = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 9),  N'IsComputed'),
          IsCompCol10 = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 10), N'IsComputed'),
          IsCompCol11 = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 11), N'IsComputed'),
          IsCompCol12 = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 12), N'IsComputed'),
          IsCompCol13 = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 13), N'IsComputed'),
          IsCompCol14 = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 14), N'IsComputed'),
          IsCompCol15 = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 15), N'IsComputed'),
          IsCompCol16 = COLUMNPROPERTY(OBJECT_ID(@tablename), INDEX_COL(@tablename, i.indid, 16), N'IsComputed'),    
          SegName          = s.groupname,
          IsFullTextKey    = INDEXPROPERTY(OBJECT_ID(@tablename), i.name, N'IsFulltextKey'),
          IsTable          = OBJECTPROPERTY(OBJECT_ID(@tablename), N'IsTable'),
          IsStatistics     = INDEXPROPERTY(OBJECT_ID(@tablename), i.name, N'IsStatistics'),
          IsAutoStatistics = INDEXPROPERTY(OBJECT_ID(@tablename), i.name, N'IsAutoStatistics'),
          IsHypothetical   = INDEXPROPERTY(OBJECT_ID(@tablename), i.name, N'IsHypothetical'),
          IsConstraint     = CASE WHEN c.constid IS NOT NULL THEN 1 ELSE 0 END    

本文转自over140 51CTO博客,原文链接:http://blog.51cto.com/over140/586712,如需转载请自行联系原作者
相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
20天前
|
存储 Oracle 关系型数据库
Oracle和MySQL有哪些区别?从基本特性、技术选型、字段类型、事务、语句等角度详细对比Oracle和MySQL
从基本特性、技术选型、字段类型、事务提交方式、SQL语句、分页方法等方面对比Oracle和MySQL的区别。
Oracle和MySQL有哪些区别?从基本特性、技术选型、字段类型、事务、语句等角度详细对比Oracle和MySQL
|
4天前
|
Oracle NoSQL 关系型数据库
主流数据库对比:MySQL、PostgreSQL、Oracle和Redis的优缺点分析
主流数据库对比:MySQL、PostgreSQL、Oracle和Redis的优缺点分析
15 2
|
2月前
|
SQL 关系型数据库 MySQL
SQL语句编写的练习(MySQL)
这篇文章提供了MySQL数据库中关于学生表、课程表、成绩表和教师表的建表语句、数据插入示例以及一系列SQL查询练习,包括查询、排序、聚合和连接查询等操作。
|
2月前
|
Oracle 关系型数据库 MySQL
Mysql和Oracle数据库死锁查看以及解决
【8月更文挑战第11天】本文介绍了解决MySQL与Oracle数据库死锁的方法。MySQL可通过`SHOW ENGINE INNODB STATUS`查看死锁详情,并自动回滚一个事务解除死锁;也可手动KILL事务。Oracle则通过查询V$LOCK与V$SESSION视图定位死锁,并用`ALTER SYSTEM KILL SESSION`命令终止相关会话。预防措施包括遵循ACID原则、优化索引及拆分大型事务。
|
3月前
|
SQL Oracle 关系型数据库
|
3月前
|
SQL Oracle 关系型数据库
MySQL、SQL Server和Oracle数据库安装部署教程
数据库的安装部署教程因不同的数据库管理系统(DBMS)而异,以下将以MySQL、SQL Server和Oracle为例,分别概述其安装部署的基本步骤。请注意,由于软件版本和操作系统的不同,具体步骤可能会有所变化。
165 3
|
3月前
|
SQL 存储 Oracle
TDengine 3.3.2.0 发布:新增 UDT 及 Oracle、SQL Server 数据接入
**TDengine 3.3.2.0 发布摘要** - 开源与企业版均强化性能,提升WebSocket、stmt模式写入与查询效率,解决死锁,增强列显示。 - taos-explorer支持geometry和varbinary类型。 - 企业版引入UDT,允许自定义数据转换。 - 新增Oracle和SQL Server数据接入。 - 数据同步优化,支持压缩,提升元数据同步速度,错误信息细化,支持表名修改。 - 扩展跨平台支持,包括麒麟、Euler、Anolis OS等。
97 0
|
4月前
|
SQL Oracle 关系型数据库
一些非常有用的Oracle SQL
一些非常有用的Oracle SQL
40 4
|
7天前
|
关系型数据库 MySQL 网络安全
5-10Can't connect to MySQL server on 'sh-cynosl-grp-fcs50xoa.sql.tencentcdb.com' (110)")
5-10Can't connect to MySQL server on 'sh-cynosl-grp-fcs50xoa.sql.tencentcdb.com' (110)")

热门文章

最新文章

推荐镜像

更多
下一篇
无影云桌面