建立“共享”序列【CREATE SEQUENCE OF THE SHARED】

本文介绍了一种在不同数据库用户间共享序列的方法。通过创建同义词(synonym),可以在不修改现有程序代码的情况下,使得多个用户能够使用同一个序列,解决了原有方案无法适应的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

    在一次系统实施的时候碰到一个问题,学到一个建立“共享”序列的方法。
    在数据库中有三个用户,A用户下有一个序列,而B和C用户需要使用A的这个序列。但是程序当时已经写好(分别取各自用户下的序列)。照以前如果使用
    select a.seq_name.nextval from dual;的方法就不适应了。
    解决方法:
    通过建立同义词来解决:
    create synonym seq_name for a.seq_name;
    -----
    synonym is an alternative name for a table, view, sequence, procedure, stored function, package, materialized view, Java class schema object, user-defined object type, or another synonym.
    原来是没有很好的阅读手册关于synonym的定义。SYNONYM可以解决多种数据库对象的重命名。
    惭愧呀,还是要好好熟读手册。 -:)
操作系统代码实现:Number Project Name Content Summary State Type 一、Process Scheduling Algorithm Simulation 1、 Simulate the operation of the round-robin algorithm for process scheduling. 2、 Create at least 15 processes and output their scheduling situation under the scheduling algorithm mentioned above and output it to theterminal to check the execution of the algorithm. 3、 The output should include the arrival time of the processes, the end time, and the average execution time. Essential. General 二、Readers-Writer Problem Implmentation 1、 A data set is shared among several concurrent processes: Readers – only read the data set; they do not perform any updates. Writers – can both read and write. 2、 Problem – allow multiple readers (at most 8) to read at the same time. Only one single writer can access the shared data at the same time. Essential. General 三、Program for Least Recently used Algorithm 1、 Create a page access sequence (page number range 0-18) using a random function. The sequence length is 54 and assume that the number of main memory frames allocated to the thread is 6, that is, M = 6. 2、 Implement the LRU algorithm for page replacement on the above access sequence. 3、 Output the page replacement sequence and the page fault rate. Essential. General Requirements 1、 For each experiment project, submit a design report and code. The code should be implemented in C++. The requirements are as follows: a) The content of the design report should include the design ideas and implementation. b) The results of the design report should include testing and running results (screenshots of screen outputs). c) The conclusion of the design report should summarize the problems encountered, the solutions and experiences during the implementation process.
06-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值