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 / @filename
RMAN>@filename
After 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 CHECKSYNTAX
RMAN>run your command.
From Command Line,
rman CHECKSYNTAX @filename
Example:
-------------
1)Make rmancmdtest file with following entry
-bash-3.00$ cat rmancmdtest
list backup;
show all;
2)From RMAN command prompt checking the syntax
RMAN> @/export/home/oracle/rmancmdtest
RMAN> list backup;
The cmdfile has no syntax errors
RMAN> show all;
The cmdfile has no syntax errors
RMAN> **end-of-file**
3)Now from OS Command line
-bash-3.00$ rman checksyntax @/export/home/oracle/rmancmdtest
Recovery Manager: Release 10.2.0.1.0 - Production on Thu Apr 24 10:16:07 2008
Copyright (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/a
Recovery Manager: Release 10.2.0.1.0 - Production on Thu Apr 24 09:23:35 2008
Copyright (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 catalog
sql statement: create table test (a number)
RMAN> sql'insert into test values(100)';
using target database control file instead of recovery catalog
sql 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/a
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Apr 24 09:23:10 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> desc test;
ERROR:
ORA-04043: object test does not exist
4)Now Check object in SYS schema
SQL> conn / as sysdba
Connected.
SQL> desc test;
Name Null? Type
----------------------------------------- -------- ----------------------------
A NUMBER
SQL> select * from test;
A
----------
100
Caution: 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 catalog
sql statement: create table system.test(a number)
Related Documents:
----------------------
DBA Authentication
Interaction with RMAN Client
No comments:
Post a Comment