原文链接: http://www.eygle.com/faq/Use.Nid.to.Change.Your.dbname.htm Nid是Oracle从9iR2开始提供的工具,可以用来更改数据库名称,...(默认值) ---------------------------------------------------- TARGET 用户名/口令 (无) DBNAME...C:/>nid target=sys/orasys dbname=eyglen DBNEWID: Release 9.2.0.1.0 - Production Copyright (c) 1995, 2002...修改 C:/>nid target=sys/orasys@vilen dbname=vilene DBNEWID: Release 9.2.0.1.0 - Production Copyright (c
修改dbname以及dbid通常在使用RMAN还原到异机之后需要更改dbname以及dbid的情形。对于这个修改我们可以借助于命令行下的nid工具来完成。同时也可以直接调用API来实现。...本文即是通过dbms_backup_restore方式来修改dbname及dbid,供大家参考。 ...有关使用nid方式修改dbname及dbid,请参考:使用nid命令修改 db name 及 dbid 1、修改dbid及dbname的步骤 a、一致性关闭数据库并启动数据库到read only...状态(需要调用dbms_backup_restore,因此要open数据库) b、调用脚本修改dbname或者dbid(根据提示输入) c、修改spfile或pfile中的db_name...--该脚本从网上整理而来 --该脚本可以修改dbname,以及dbid,或者两者同时修改 --该脚本在10g下测试ok,11g下有待测试 robin@SZDB:~/dba_scripts/custom
`t_table_info`; -- 查看表结构 desc dbname.`t_table_info`; -- 添加列 alter table dbname....`t_table_info` drop column new_col_v2; -- 复制表结构 create table dbname.`t_table_info_v2` like dbname....`t_table_info`; -- 复制表数据 insert into dbname.`t_table_info_v2` select * from dbname....`t_table_info`; -- 重命名表 rename table dbname.`t_table_info_v2` to dbname....`t_table_info_v3`; -- 删除表 -- drop table dbname.`t_table_info_v3`; -- 清空表 -- truncate table dbname.
`t_table_info_v2` like dbname.`t_table_info`; -- 2、表的修改(alter) -- 添加列 alter table dbname....`t_table_info_v2`; -- 4、表的查询(desc) desc dbname.`t_table_info`; show columns from dbname....`t_table_info`; -- 5、复制表数据 insert into dbname.`t_table_info_v2` select * from dbname....`t_table_info`; -- 6、重命名表 rename table dbname.`t_table_info_v2` to dbname....`t_table_info`; -- 查询今天的数据 select * from dbname.
//数据库连接用户名 $pass = 'root'; //对应的密码 $dsn = "$dbms:host=$host;dbname=$dbName"; $userlist = array(); try...//数据库连接用户名 $pass = 'root'; //对应的密码 $dsn = "$dbms:host=$host;dbname=$dbName"; try { $conn = new PDO...= new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); // set the PDO error mode...= new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); // 设置 PDO 错误模式为异常 $conn...//数据库连接用户名 $pass = 'root'; //对应的密码 $dsn = "$dbms:host=$host;dbname=$dbName"; try { $conn = new PDO
public class TransactionCache extends RevokingDB { @Autowired public TransactionCache(String dbName...TxCacheDB(String dbName) { System.out.println("TxCacheDB: " + dbName); } public void init()...{ System.out.println("TxCacheDB: init"); } } 这里可以偿试几种解决方案: 方案一 直接成员变量中 new TxCacheDB(dbName);...如果写死,你不能确定会传入dbName将会是什么,实际中这个dbName有很多个,没有办法写死 方案二 这个方法看着就可行,来验证一下。...TxCacheDB getTxCache(String dbName) { txCacheDB = new TxCacheDB(dbName); return txCacheDB;
#1.1、备份单个数据库dbname到目录/tmp下面,并指定名称为dbname(dbname可任意更改) mysqldump -h127.0.0.1 -uroot -ppassword dbname...dbname t_a_table t_b_table > /tmp/dbname.sql; #1.3、备份多个数据库a_dbname b_dbname,注:加上--databases参数,数据dbname...之间是空格 mysqldump -h127.0.0.1 -uroot -ppassword --databases a_dbname b_dbname > /tmp/dbname.sql; #1.4、...src_dbname_list=(dbname_a dbname_b) dst_dbname_list=(dbname_a dbname_b) # 1、根据当天时间创建目录, -p:如果不存在该目录则创建.../src_dbname/${time1}/${src_dbname_list[$i]}.sql.gz echo -e "\033[32m${time2} ${src_dbname_list[$
`dbname`....`dbname`....-t opt_log --print DELETE FROM `dbname`....,u=ptck dst_db:dbname dst_tbl:opt_log dst_dsn:h=172.16.2.218,p=......-t opt_log --print -execute DELETE FROM `dbname`.
scalikeJDBC是在trait DBs中的setup(dbname)来进行dbname数据库连接池的设定的: /** * DB configurator */ trait DBs { self...=> setup(Symbol(dbName)) } } def close(dbName: Symbol = ConnectionPool.DEFAULT_NAME): Unit = {...)进行了dbname设置操作包括Class.forName(driver),ConnectionPool.add(dbname...)。...=> setup(Symbol(dbName)) } } def close(dbName: Symbol = ConnectionPool.DEFAULT_NAME): Unit = {...=> setup(Symbol(dbName)) } } def close(dbName: Symbol = ConnectionPool.DEFAULT_NAME): Unit = {
上储存过程的代码: declare @DBname nvarchar(500) --数据库名 declare @ztname nvarchar(500) --账套名 declare @readonly...SQL语句 declare @count_s nvarchar(4000)--返回值 declare @n int set @n=1 select @sql='select ztname as a0,DBname...+''' as name,kc.ctypeid,kc.ccode,kc.cname,kc.pricepass,b.pass,b.roleid from ['+@DBname+'].dbo.K_Customer...kc left join ['+@DBname+'].dbo.K_Customerpass b on b.ctypeid=kc.ctypeid where (kc.ccode='''+@user+'...+'$'+@readonly+''' as name,kc.ctypeid,kc.ccode,kc.cname,kc.pricepass,b.pass,b.roleid from ['+@DBname+
工作中不可避免地碰到需要修改dbname以及dbid的情形,如将数据库恢复到同一台机器的情形是其中之一。...但dbname以及dbid是用于标识数据库的重要标志之一,尤其是dbid,具有唯一性,因此对其修改应慎重处理。本文描述了修改dbname以及dbid的步骤并给出示例。...b、修改dbname 修改之后,无需使用open resetlogs打开数据库。(注dbname不具有唯一性,global name则具有唯一性)。 ...=new_dbname [setname=yes] # / 表明连接到当前环境的sid,且使用操作系统认证 nid target=sys/password dbname...dbname=new_dbname [setname=yes] #使用连接串连接到远程主机并修改 f、修改Oracle 参数文件 pfile(使用先前从spfile备份的)中的参数db_name,
node1 | primary | * running | | default | 100 | 3 | host=192.168.1.1 user=repmgr dbname...node2 | standby | running | node1 | default | 100 | 3 | host=192.168.1.2 user=repmgr dbname...| host=192.168.1.1 user=repmgr dbname=repmgr connect_timeout=2 2 | node2 | standby | running...node1 | default | 100 | 3 | host=192.168.1.2 user=repmgr dbname=repmgr connect_timeout=...| default | 100 | 4 | host=192.168.1.2 user=repmgr dbname=repmgr connect_timeout=2 WARNING
dbname.sql.gz | mysql -u user -p pass -h localhost yourdb 或者先使用gunzip解压,再恢复数据 gunzip dbname.sql.gz...zcat dbname1.sql.gz | mysql -u user -p pass -h localhost yourdb zcat dbname2.sql.gz | mysql -u user -...dbname10.sql.gz | mysql -u user -p pass -h localhost yourdb 也可以跳跃恢复数据 zcat dbname2.sql.gz | mysql...zcat dbname5.sql.gz | mysql -u user -p pass -h localhost yourdb zcat dbname10.sql.gz | mysql -u user...zcat dbname15.sql.gz | mysql -u user -p pass -h localhost yourdb zcat dbname13.sql.gz | mysql -u user
private static String[] host;//主机地址 private static int[] port;//端口地址 private static String dbName...; } public static void setDbName(String dbName) { MongoConfig.dbName = dbName; }...* @param userName * @param pwd * 实例化dbName一个DB */ public MongoManager(String dbName..., String userName, String pwd) { if (dbName == null || "".equals(dbName)) { throw...new NumberFormatException("dbName is null"); } db = mongo.getDB(dbName); if(
returnColumnByName(col: String) = Some(col) } case class JDBCContext( dbName..._)) rawSql.fetchSize(ctx.fetchSize) implicit val session = NamedAutoSession(ctx.dbName...) val cpSettings = readConnectionPoolSettings(dbName) if (driver !...=> setup(Symbol(dbName)) } } def close(dbName: Symbol = ConnectionPool.DEFAULT_NAME): Unit = {...ConnectionPool.close(dbName) } def closeAll(): Unit = { ConnectionPool.closeAll } }
下面我们详细介绍一下mysqldump导出的各种实例: 1 导出一个数据库的结构 mysqldump -d dbname -uroot -p > dbname.sql 2 导出多个数据库的结构 mysqldump...-d -B dbname1 dbname2 -uroot -p > dbname.sql 3 导出一个数据库中数据(不包含结构) mysqldump -t dbname -uroot -p > dbname.sql...4 导出多个数据库中数据(不包含结构) mysqldump -t -B dbname1 dbname2 -uroot -p > dbname.sql 5 导出一个数据库的结构以及数据 mysqldump...dbname -uroot -p > dbname.sql 6 导出多个数据库的结构以及数据 mysqldump -B dbname1 dbname2 -uroot -p > dbname.sql 7...-p > dbname.sql 2 只导出事件 mysqldump -E -ndt dbname -u root -p > dbname.sql 3 不导出触发器(触发器是默认导出的–triggers
)} if ($p -ne $null) { $ObjPerms += @{DBName=$itm.DBName; Permission...($p -ne $null) { $ObjPerms += @{DBName=$itm.DBName; Permission=$p};}...=$itm.DBName; Permission=$p};} $p = $svr.Databases[$itm.DBName].ServiceBroker.Routes...=$itm.DBName; Permission=$p};} $p = $svr.Databases[$itm.DBName].ServiceBroker.Services...=$itm.DBName; Permission=$p};} $p = $svr.Databases[$itm.DBName].FullTextStopLists |
-----------------共用方法--------------------------------------------------- /** 获取DB实例 - 指定DB @param dbName...@return */ public MongoDatabase getDB(String dbName) { if (dbName !...equals(dbName)) { MongoDatabase database = mongoClient.getDatabase(dbName); return database; } return...(String dbName) { MongoIterable colls = getDB(dbName).listCollectionNames(); List _...) { getDB(dbName).drop(); } /** 查找对象 - 根据主键_id @param collection @param id @return */ public Document
大家好,又见面了,我是全栈君 Sqlserver2005日志文件太大,使其减小的方法: 运行下面的三行 dbName为数据库名: backup log dbNamewith NO_LOG backup...log dbNamewith TRUNCATE_ONLY DBCC SHRINKDATABASE(dbName) 日志文件减小到1MB 或者見:http://hovertree.com/menu/...EXEC sp_detach_db @dbname = “77169database” EXEC sp_attach_single_file_db @dbname = “77169database”,...a.分离 EXEC sp_detach_db @dbname = “77169database” b.删除日志文件 c.再附加 EXEC sp_attach_single_file_db @dbname...exec(“DBCC SHRINKDATABASE([“+@dbname+”])”) –4.设置自动收缩 exec(“EXEC sp_dboption “””+@dbname+”””,””autoshrink
MGO-streaming也是是通过一个Context对象来描述操作方式和内容细节的,MGOContext定义如下: case class MGOContext( dbName...= Nil ) { ctx => def setDbName(name: String): MGOContext = ctx.copy(dbName...= this.dbName, collName = this.collName, commandType = this.commandType, bsonParam...( dbName = proto.dbName, collName = proto.collName, actionType = MGO_UPDATE,...) => Some(new sdp.grpc.services.ProtoMGOContext( dbName = ctx.dbName, commandType
领取专属 10元无门槛券
手把手带您无忧上云