How to create user for oracle10g/11g asm instance

本文介绍了Oracle GoldenGate (OGG) 连接ASM实例的方法,包括不同版本间的差异。在10g版本中,使用SYS用户并通过配置密码文件实现连接;而在11g版本中,则可以直接在ASM实例中创建具有SYSASM/SYSDBA权限的用户。

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

      在常规的asm维护管理中,我们可以用具有sysasm和sysdba权限的sys用户登录asm实例,进行相关的维护管理工作,但是在ogg相关的项目工程中,ogg读取asm存放的日志文件,为了管理的安全规范和方便,需要给ogg建立专用的登陆asm实例访问asm日志的具备sysasm或者sysdba权限的账号:
     比如,ogg里的asm账号配置:
     GGSCI (OSS-FWKT-DB1) 28> edit param EXTIOM
"/arch_1/ogg/dirprm/extiom.prm" 24 lines, 675 characters 
extract extiom
setenv(NLS_LANG = AMERICAN_AMERICA.ZHS16GBK)
dynamicresolution
userid ogg,password ggspwd
TRANLOGOPTIONS ASMUSER ggadm@ASM,ASMPASSWORD ggadm--这里就是asm实例账号。
exttrail /arch_1/ogg/dirdat/pf
DBOPTIONS ALLOWUNUSEDCOLUMN
nocompressupdates
table IOM.WO_WORK_ORDER_DETAIL;
table IOM.OM_ORDER;
table IOM.OM_SERVICE_ORDER;
     然而在10g版本里,ogg访问asm实例是有限制的:

     SYS@ASM_instance

    Specifies the ASM instance for the connection string. The user must be SYS.

   此外10g版本里,没法在asm实例里创建用户。只能通过配置密码文件来实现密码的变更来用新密码登陆asm实例

Oracle ASM is managed by a set of processes called an Oracle ASM instance. In comparing an ASM instance to a database instance; one can see similar processes for an ASM instance, as for a database instance at the operating system level.

 

Similarly, ASM can be implemented in a cluster configuration with multiple instances accessing a single ASM storage system (compare with a RAC database in which multiple database instances access a single database).

 

An Oracle ASM instance can be accessed remotely through a database listener. Connections to an Oracle ASM instance may only be made as a user with the SYSDBA privilege. The default ASM user is SYS. A major difference with ASM, as compared to a database instance, is that users cannot be added to an ASM instance. However a different username with the SYSDBA privilege may be specified through the password file.

Using a password file

The use of a password file is mandatory to connect remotely to an instance using a SYSDBA privilege. The first step is to find out whether the ASM instance is configured to make use of a password file. Connect to the ASM instance (using SYS (or /) as SYSDBA) and run the following query:

         

select value from v$parameter where name = ?remote_login_passwordfile?;



There are three possible outcomes for this query:


 

NONE The instance will not make use of a password file if there is one. EXCLUSIVE: The password file is only used for this ASM instance. SHARED: The password file may be used by other ASM or database instances.

If there is no password file, then the ASM instance will behave as if the setting for remote_login_passwordfile is NONE. If remote_login_passwordfile is set to NONE, set it to EXCLUSIVE or SHARED using an alter system command or by editing the init+ASM.ora file (followed by a restart of the ASM instance).

 

Next make sure a password file was generated for the ASM instance, and if it wasn?t, generate one. More information on how to configure and generate a password file is in the Oracle Database documentation.


For GoldenGate to connect to the ASM instance with a username other than the SYS username and password a SHARED password file is required.
*************************************************************************************

Please check step by step

a) set environment variables ORACLE_HOME and ORACLE_SID

export ORACLE_SID = sid
export ORACLE_HOME = home

b)create database user : login to RDBMS in sqlplus and create new user

create user UserName identified by Password connect / as sysdba grant sysdba to UserName

c) rename original ASM password file

copy RDBMS password file and rename to ASM password file name mv .orig -- this is a backup asm password file cp

 

d) verify the connection to ASM on a separated machine with UserName in sqlplus
SQL> connect UserName/Password as sysdba

*************************************************************************************************************


          而到11g版本,在asm实例里可以直接创建管理asm的用户,并能够grant sysdba和sysasm权限:

 grid@OSS-FWKT-DB1:/home/db/grid$ sqlplus '/ as sysasm';

SQL*Plus: Release 11.2.0.4.0 Production on Tue Feb 3 20:30:52 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> grant sysasm to ggadm;
Grant succeeded.

SQL> 
SQL> create user gg identified by gg;

User created.

SQL> grant sysasm to    gg;

Grant succeeded.
SQL> grant sysdba  to    gg;

Grant succeeded.


SQL> drop user gg;

User dropped.
SQL> 

注意:

When capturing from an ASM instance via the ASMUSER option, the maximum amount of data read by Capture is 28,672 bytes. With a default read and write buffer size of 1,024,000 bytes DBLOGREADER provides the capability to capture large database transactions more efficiently.

 



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13750068/viewspace-1426564/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/13750068/viewspace-1426564/

资源下载链接为: https://pan.quark.cn/s/abbae039bf2a 在计算机科学领域,编译原理是研究如何将编程语言转化为机器可执行代码的理论基础。其中,三地址代码(Three-Address Code,TAC)作为一种中间表示形式,在编译器设计中经常被使用,尤其是在生成目标代码的阶段。本文将深入探讨三地址代码的概念、生成器的工作原理及其在编译过程中的作用。 三地址代码是一种简单的低级抽象语法树(AST)表示,每条指令涉及三个操作数,通常包括两个源操作数和一个目的操作数。这种格式简化了代码优化和目标代码生成的复杂性。例如,一个简单的算术表达式“x = y + z”在三地址代码中可能表示为: 在这个例子中,“t1”是一个临时变量,存储了“y + z”的结果,然后这个结果被赋值给“x”。 生成三地址代码的过程通常发生在编译器的中间阶段,即语法分析之后,语义分析之前。这个阶段称为“代码生成”或“中间代码生成”。编译器通过词法分析器处理源代码,将其转化为标记流;接着,语法分析器根据上下文无关文法将标记流解析成抽象语法树。三地址代码生成器就是在这个阶段介入,它遍历AST,为每个节点生成对应的三地址指令。 在Turbo C3.0这样的编译器环境下,开发者可以实现自己的三地址代码生成器。虽然Turbo C3.0是一款较老的编译器,但其C语言编译器设计原理依然适用于现代编译器开发。开发过程中,我们需要考虑如下关键点: 符号表管理:符号表记录了程序中所有标识符的类型、作用域和关联地址,对于生成三地址代码至关重要,因为它提供了关于操作数的类型信息。 数据类型转换:编译器必须处理不同数据类型的运算,确保它们在三地址代码中正确表示。例如,整型与浮点型之间的转换需要特别处理。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值