Showing posts with label Cloud Amazon. Show all posts
Showing posts with label Cloud Amazon. Show all posts

Friday, October 28, 2011

Oracle Database Cloud Backup to Amazon S3 using osbws

After registering with S3 check to ensure your S3 bucks are available.
I created 2 buckets 1 for the log and 1 for data.
oracle-data--1
oracle-log--1

Ensure your database server can access s3.amazonaws.com
>nslookup s3.amazonaws.com

Non-authoritative answer:
s3.amazonaws.com canonical name = s3-1.amazonaws.com.
Name: s3-1.amazonaws.com
Address: 72.21.203.145

Ensure you have java installed on your database server
java -version
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)

Download osbws_install.jar from otn.oracle.com

Create argFile , I called it awsrman
-AWSID -AWSKEY -otnUser -otnPass < yourOTNpassword> -walletDir /home/oracle/script/wallet -libDir /home/oracle/script -debug

java -jar osbws_install.jar -argFile ./awsrman

Here is the output from the jar install
Oracle Secure Backup Database Web-Service Install Tool, build 2011-02-04.0001
Debug: os.name = Linux
Debug: os.arch = amd64
Debug: os.version = 2.6.18-194.el5
Debug: file.separator = /
Debug: S3 ID:
Debug: S3 Key:
Debug: AWS Success, owner=sthenmoz, id=
AWS credentials are valid.
Debug: Platform = PLATFORM_LINUX64
S3 user already registered.
Registration ID:
S3 Logging Bucket: oracle-log--1
Validating log bucket location ...
Debug: Get location HTTP response: 200 - OK
Debug: log bucket location = []
Validating license file ...
Debug: Get license file HTTP response: 200 - OK
Create credential oracle.security.client.connect_string1
OSB web-services wallet created in directory /home/oracle/script/wallet.
OSB web-services initialization file /opt/oracle/product/10.2.0/db_1/dbs/osbwsTST10G.ora created.
Downloading OSB Web Services Software Library from file osbws_linux64.zip.
Debug: Temp zip file = /tmp/osbws_linux644610275856950839391.zip
Downloaded 16350454 bytes in 10 seconds. Transfer rate was 1635045 bytes/second.
Download complete.
Extracted file /home/oracle/script/libosbws11.so
Debug: Delete RC = true

Created a script to configure rman and placed in configure.rcv
configure CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/home/oracle/script/libosbws11.so ENV=(OSB_WS_PFILE=/opt/oracle/product/10.2.0/db_1
/dbs/osbwsTST10G.ora)';


rman target / @configure.rcv

Output
RMAN> configure CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/home/oracle/script/libosbws11.so ENV=(OSB_WS_PFILE=/opt/oracle/product/10.2.0/db_1/dbs/osbwsTST10G.ora)';
using target database control file instead of recovery catalog
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/home/oracle/script/libosbws11.so ENV=(OSB_WS_PFILE=/opt/oracle/product/10.2.0/db_1/dbs/osbwsTST10G.ora)';
new RMAN configuration parameters are successfully stored

show all;
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/home/oracle/script/libosbws11.so ENV=(OSB_WS_PFILE=/opt/oracle/product/10.2.0/db_1ee/dbs/osbwsTST10G.ora)';



RMAN> backup as compressed backupset database include current controlfile plus archivelog;

Tuesday, October 4, 2011

Nice additions to Amazon RDS with 11.2.0.2v3 version

Thank up Amazon RDS team for giving us DBA's a little more power with 11.2.0.2v3 version.

Execute privileges to a number of DBMS packages including DBMS_CRYPTO, DBMS_ALERT, DBMS_LOCK and DBMS_PIPE are now available.
Privileges to grant DBA, CONNECT and RESOURCE roles to other users are also available.
You can use the CTXAPP (Oracle Text) role and grant it to other users.
The system privileges “RESTRICTED SESSION” and “GRANT ANY OBJECT".

For the full announcement forum: https://forums.aws.amazon.com/ann.jspa?annID=1186

Amazon RDS Oracle Database and Alert and Listener Log

To see the oracle alert log and listener log data on Oracle RDS at Amazon RDS, we utilize sql.

For Alert Log:
select message_text from alertlog;

For listener log
select message_text from listenerlog;

Note: only last 10 MB of entries in these files are available since oracle is rotating them at 10mb interval so if you need history this might be a good candidate for nightly job.

More information can be found in AWS api rds-ug.pdf

Oracle Dynamic Session Kill for sessions in Amazon RDS

For those folks running Oracle Databases in Amazon RDS environment, we can kill sessions using the Amazon API: rdsadmin.rdsadmin_util.kill

select 'exec rdsadmin.rdsadmin_util.kill('|| sid ||',' || serial# || ');'
from v$session where username in ('&myUsername', '&myOtherUserName');

Here is the link to the amazon API doc. awsdocs.s3.amazonaws.com/RDS/latest/rds-ug.pdf