Issues between RMAN Client and Database

Some Issues between RMAN Client and Database:---------------------------------------------------•Most RMAN commands take a number of parameters and must end with a semicolon.The exception is some database related command , like STARTUP, SHUTDOWN and CONNECT.•You can write rman commands in a file and then you can run the file. In both ways from command line and within RMAN command prompt you can check.$rman TARGET / @filenameRMAN>@filenameAfter the command file contents have been executed, RMAN displays the following message:RMAN> **end-of-file**•With CHECKSYNTAX you can test some RMAN commands for syntactic correctness without executing them.In both ways from command line and within RMAN command prompt you can check.$rman CHECKSYNTAXRMAN>run your command.From Command Line,rman CHECKSYNTAX @filenameExample:-------------1)Make rmancmdtest file with following entry-bash-3.00$ cat rmancmdtestlist backup;show all;2)From RMAN command prompt checking the syntaxRMAN> @/export/home/oracle/rmancmdtestRMAN> list backup;The cmdfile has no syntax errorsRMAN> show all;The cmdfile has no syntax errorsRMAN> **end-of-file**3)Now from OS Command line-bash-3.00$ rman checksyntax @/export/home/oracle/rmancmdtestRecovery Manager: Release 10.2.0.1.0 - Production on Thu Apr 24 10:16:07 2008Copyright (c) 1982, 2005, Oracle. All rights reserved.RMAN> list backup;2> show all;3>The cmdfile has no syntax errors Access database with SQL command from RMAN:-----------------------------------------------------You can write sql commands with RMAN to access database. In the following section I have given an example.1)Here I used System/a but it actually connected to database with SYSDBA privilege automatically, OS Authentication is used.bash-3.00$ rman target system/aRecovery Manager: Release 10.2.0.1.0 - Production on Thu Apr 24 09:23:35 2008Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database: DATA1 (DBID=2547250380)2)After connecting I created a Table and Insert one row.RMAN> sql'create table test (a number)';using target database control file instead of recovery catalogsql statement: create table test (a number)RMAN> sql'insert into test values(100)';using target database control file instead of recovery catalogsql statement: insert into test values(100)3)Now connect with system and see the object. Because SYSDBA privilege conenction use SYS schema so in SYSTEM there is no object. Here system/a is nothing but a show. Any user or any password would work if current user is a member of OSDBA group.-bash-3.00$ sqlplus system/aSQL*Plus: Release 10.2.0.1.0 - Production on Thu Apr 24 09:23:10 2008Copyright (c) 1982, 2005, Oracle. All rights reserved.SQL> desc test;ERROR:ORA-04043: object test does not exist4)Now Check object in SYS schemaSQL> conn / as sysdbaConnected.SQL> desc test;Name Null? Type----------------------------------------- -------- ----------------------------A NUMBERSQL> select * from test;A----------100Caution: As to run any SQL command it is needed to connect to target database and to connect target database you must have SYSDBA privilege and SYSDBA privilege use SYS schema so it is not good practice to create object from RMAN client.Though you can create obejct in other schema from RMAN using,RMAN> sql'create table system.test(a number)';using target database control file instead of recovery catalogsql statement: create table system.test(a number)

Comments

Popular posts from this blog

How to make partitioning in Oracle more Quickly

Copy files between Unix and Windows with rcp

ORA-04062: timestamp of procedure has been changed