Thursday, November 24, 2011

/3GB switch to increase the SGA size in windows

On 32 bit OS we can increase the SGA maximum up to 1700MB but by using /3GB switchs for complete memory addressed on windows server 2003 you can use maximum up to 3GB SGA for Oracle.

Additionally by using /PAE & /NoExecute=AlwaysOn switch you can use more than 3.2GB Physical RAM on 32bit windows server 2003 for all programs other than oracle.

Means 
In my test case i have 6 GB Physical RAM and 2Gb paging from OS. So if I use these switches I have maximum 3GB SGA and remaining 3GB+2GB for OS and other windows program.

NOTE
If I don't use these switches we have to face to possible errors

ORA-04030: out of process memory when trying to allocate 123404 bytes (QERHJ hash-joi,kllcqas:kllsltba)

OR

TNS-12518: TNS: listener could not hand off client connection
this error usually comes when your memory full reached or your listener comes in blocked state. you can check listener state by lsnrctl services command.

TEST CASE 1  with:  /3GB /PAE /NoExecute=AlwaysOn switchs in boot.ini


Changes made to Boot.ini
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise" /noexecute=AlwaysOn /3GB /PAE /fastdetect


MEMORY
Physical RAM     = 6GB
OS Paging Area = 2GB

SPFILE.ORA PARAMETERS
SGA_MAX_SIZE=1300M
SGA_TARGET=1300M
PGA_AGGREGATE_TARGET =194M
PROCESSES=500
SESSIONS=555
After Taking connection form sqlpls of HR user
SQL> select * from v$resource_limit where resource_name='processes';

RESOURCE_NAME                  CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_AL LIMIT_VALU
------------------------------ ------------------- --------------- ---------- ----------
processes                                      499             500        500        500

SQL> select * from v$resource_limit where resource_name='sessions';

RESOURCE_NAME                  CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_AL LIMIT_VALU
------------------------------ ------------------- --------------- ---------- ----------
sessions                                       503             504        555        555

SQL> select username , module ,count(username) from v$session group by username, module;

USERNAME                       MODULE                                           COUNT(USERNAME)
------------------------------ ------------------------------------------------ ---------------
SYSMAN                         OMS                                                       1
HR                                    SQL*Plus                                               474
DBSNMP                        emagent.exe                                          2
SYSMAN                         OEM.SystemPool                                  2
SYS                                  sqlplusw.exe                                           1
SYSMAN                         OEM.Loader                                           1

After Taking 503 session new session blocked by listener because of processes parameter limits reached.

So this is because of switchs I can able to make 500 connections 


HR 452 connections is from server side (in that case each sqlplus.exe took 14M aprox from memory which is also addressable) . So I can make more connection from different clients.
HR 22 connections is from client side


 
TEST CASE 2 with:  /NoExecute=OptIn switchs in boot.ini 


multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise" /noexecute=OptIn /fastdetect


MEMORY

Same as above


SPFILE.ORA PARAMETERS

Same as above


SQL> select * from v$resource_limit where resource_name='processes';



RESOURCE_NAME                  CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_AL LIMIT_VALU

------------------------------ ------------------- --------------- ---------- ----------

processes                                      266             269        500        500



SQL> select * from v$resource_limit where resource_name='sessions';



RESOURCE_NAME                  CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_AL LIMIT_VALU

------------------------------ ------------------- --------------- ---------- ----------

sessions                                       270             273        555        555



SQL> select username , module ,count(username) from v$session group by username, module;



USERNAME                       MODULE                                           COUNT(USERNAME)

------------------------------ ------------------------------------------------ ---------------

                                                                                                                         0

SYSMAN                         OMS                                                            1

HR                             SQL*Plus                                                         241

DBSNMP                         emagent.exe                                             2

SYS                            sqlplusw.exe                                                    1

SYSMAN                         OEM.SystemPool                                      2

SYSMAN                         OEM.Loader                                               1



After Taking total 270 session new session still open and processes parameter limits nopt reached.





HR 241 connections is from server side (in that case each sqlplus.exe took 14M aprox from memory also) . So I can make more connection from different clients.



HR 1 connections is from client side



After this I am facing the below error on connection.

As you can see currently 7.05 GB memory is using less than 900 MB from the 1st case. And we can make HR 271 connections and we make 474 connections of HR in 1st case
 

TEST CASE 3 with:  /NoExecute=OptIn /PAE switchs in boot.ini


multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise" /noexecute=OptIn /PAE /fastdetect


MEMORY

Same as above

SPFILE.ORA PARAMETERS

Same as above


Only 249 session can able to connect to database in which 243 is HR 



TEST CASE 4 with:  /NoExecute=AlwaysOn /PAE switchs in boot.ini


multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise" /noexecute=AlwaysOn /PAE /fastdetect


MEMORY

Same as above


SPFILE.ORA PARAMETERS

Same as above


Only 255 session can able to connect to database in which 225 is HR



SQL> select * from v$resource_limit where resource_name='sessions';



RESOURCE_NAME                  CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_AL LIMIT_VALU

------------------------------ ------------------- --------------- ---------- ----------

sessions                                       255             257        555        555



SQL> select * from v$resource_limit where resource_name='processes';



RESOURCE_NAME                  CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_AL LIMIT_VALU


------------------------------ ------------------- --------------- ---------- ----------

processes                                      251             253        500        500




Hope you all understand the game of this switches.

ORA-06512: at "SYS.DBMS_DEBUG_JDWP", line 68


From Sql developer facing below issue.
Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( '10.142.58.22', '52331' )
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_DEBUG_JDWP", line 68
ORA-06512: at line 1
This session requires DEBUG CONNECT SESSION and DEBUG ANY PROCEDURE user privileges.
Process exited.
Disconnecting from the database KASBDB_RAC.

Solution
SQL> grant debug connect session, debug any procedure to  <Username>

User and Role what priviliges have assign


What Role does user have in current running session
SQL> show user
USER is "VISION211"

SQL> select * from session_roles;
ROLE
------------------------------
CONNECT
RESOURCE

What Role does user have and with admin option or not
SQL> show user
USER is "VISION211"

SQL> select * from user_role_privs;
USERNAME                       GRANTED_ROLE                   ADM DEF OS_
------------------------------ ------------------------------           --- --- ---
VISION211                      CONNECT                                   NO  YES NO
VISION211                      RESOURCE                                  NO  YES NO

What System Privileges does ROLE have and with admin option or not
SQL> desc role_sys_privs
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ROLE                                      NOT NULL VARCHAR2(30)
 PRIVILEGE                                 NOT NULL VARCHAR2(40)
 ADMIN_OPTION                                       VARCHAR2(3)

SQL> select PRIVILEGE, ADMIN_OPTION from role_sys_privs where role='RESOURCE';

PRIVILEGE                                ADM
---------------------------------------- ---
CREATE SEQUENCE                       NO
CREATE TRIGGER                           NO
CREATE CLUSTER                           NO
CREATE PROCEDURE                     NO
CREATE TYPE                              NO
FORCE TRANSACTION               NO
CREATE VIEW                              NO
CREATE OPERATOR                    NO
CREATE TABLE                             NO
CREATE INDEXTYPE                    NO

Thursday, November 17, 2011

You Gotta Pay Your Dues If You Want To Sing the Blues


"I am the entertainer,
And I've had to pay my price.
The things I did not know at first,
I learned by doin' twice." 
                    - William Joel

A couple of weeks ago, I wrote at length about the 10000 Hour Rule, which can be stated as follow:

To master any non-trivial field requires 10000 hours of dedicated practice and study.

The previous post was about the rule and why I think it's a true thing. I also wanted to write a bit about how this rule applies to the creation of computer games, which, believe me, is an endeavor that takes many years to master.

How the Rule Applies To Professional, AAA Game Development

Big game companies are infamous for eating their young. They scoop up young people that don't know any better, make them work insane hours for crap pay, discard them when they burn out, and harvest a new crop of workers. There are few elder statesmen who stayed around long enough to get really good at what they do. Alas, most of the rank and file get driven off before they put in the years necessary to get really good.

So if you've ever wondered why games tend to be so derivative and make so many of the same mistakes again and again ...

How the Rule Applies To Indies

When an indie developer nobody cared about suddenly breaks out and releases a hit, kickass game, you know what I love to do? Find out how that sudden superstar spent the years learning to make a good game.

Every successful indie developer has a pile of relatively rough old games they cut their teeth on. Notch (Minecraft) does. Jonathan Blow (Braid) does. Petri Purho (Crayon Physics) does. I sure do. John Carmack and John Romero made a pile of games you never heard of before they created Wolfenstein 3-D and Doom.

It's necessary. You can't just make a good game from scratch. You have to spend years working at it, writing stuff that you probably won't be very proud of. I count myself very lucky that, when I was writing my early RPGs, there was pent up demand for them. Enough so that even my rough, subpar goods were able to generate a living.

One More Example That Amuses Me

I only just heard about an upcoming Indie RPG called Driftmoon, being developed by a small company called Instant Kingdom. Hey, why shouldn't they write an Indie RPG? Everyone else is.

I'd never heard of them, but I looked at the gameplay video and the screenshots and thought, "Hey, this looks really nice. I bet this isn't their first game."

Then I looked at their older games. Five of them, each one a little nicer than the one that came before. It's awesome to look at. You can almost see the learning.

(Oh, and you can see the couple who runs Instant Kingdom here. I don't want to sound crass, but these are two seriously attractive game developers. If I was running some Association For the Advancement of Indie Games or something, I would put those two on a poster in a cold second. The caption would be, "Indie Game Developers - WE'RE NOT MONSTERS!")

How the Rule Applies To You. (If You Want To Create Games.)

So if you're one of the many enterprising young folks who ask me about getting into this business, learn from the above. Write games. Lots of them. Don't worry about aiming too high. Don't do your ultra-mega-epic yet. A bunch of varied, small apps is a great way to learn, and you'll get a bunch of your failures out of the way early.

It's a lot of work, but don't despair. Hey, I built a career on a game that looked like this. If that can happen, than you, a person I suspect is at least as intelligent and driven as me, totally has a shot.

Sunday, November 13, 2011

ORA-23515: materialized views and/or their indices exist in the tablespace

SQL> drop tablespace TEST1 including contents cascade constraints;
*
ERROR at line 1:
ORA-23515: materialized views and/or their indices exist in the tablespace

Now you have to drop all materialized view in this tablespace to drop this tablespace.

SQL> drop materialized view  <MV_NAME>
 
Materialized view dropped.

Elapsed: 00:00:01.70
 
SQL> drop tablespace TEST1 including contents and datafiles;

Tablespace dropped.

Elapsed: 00:00:01.37
SQL>

Thursday, November 3, 2011

Geneforge Saga Now Available On Steam!


When Steam started to carry Avadon: The Black Fortress in August, it was a big thrill for us. The money, the prestige, the ability to feel like real developers. It's awesome. And it didn't stop there.

On Wednesday, Steam released another of our games. Well, five games. You can now go to Steam and, for twenty bucks (20% off the first week) get our entire Geneforge Saga.

The Geneforge Saga is a series of five huge fantasy RPGs, telling one epic tale of rebellion, war and devastation. I am immensely proud of these games. Sure, they are old and very low budget, and the earlier games have pretty rough interfaces. They're also genuinely innovative and cool, and I'm thrilled that a bunch more people can be exposed to them.

I wanted to write a little bit about them and what I think makes them unique.

1. The Setting

People often complain, with good reason, that role-playing games are too mired in fantasy. I have always lacked the courage to totally break out of the fantasy thing, but I've tried really hard to push it as far as it will go. For example, we wrote Nethergate, which was a fantasy game in an actual historical setting: ancient Britain under Roman occupation.

Geneforge was originally going to be science fiction, until I realized that it really would work better as fantasy. It is based in a world ruled by the Shapers, a secretive sect that used magic to create life. Intelligent plants, servant humanoids, living tools. The games are about what happens when the creatures they make to serve them decide to rebel.

The player is a Shaper, and the characters in your party will be loyal mutant monsters made by you. Older gamers play Geneforge for the story. Younger gamers play it because you get to have an army of fire-breathing dinosaurs.

It's a unique setting, and I think it's really cool. And, I don't deny it, I had several strong influences when I made it.

2. The Morality

The Geneforge games are very morally open-ended. I have long been annoyed with fantasy's over-reliance on characters who are all-good or all-evil. I wanted to write a game where you could play through the whole storyline looking for this guy who is evil, meet the guy, listen to his side of the story, realize he has a point, and join him. And I did. It's called Geneforge.

The Geneforge games are full of factions you can join. Some are sensible. Some are insane. Some are peaceful, and some are violent. Only a few of them are truly bad people, trying to do horrible things. I tried to be truly even-handed when making the factions. When writing them, I always had them make the case for their point of view as clearly and convincingly as possible. When I wrote a faction, I was really trying to convince the player to join it.

This is what I am most proud of about Geneforge: I have gotten many e-mails that said, "I loved the games, but I had one problem. I joined [some faction], but I thought you made it too obvious that [that faction] was the right faction and I was supposed to join it."  They were all convinced that I was secretly supporting their own pet faction. Hee!

3. The Open-Endedness

I wanted the Geneforge games to be as open-ended as possible. Play by yourself or with a group. Use magic or melee. Use combat or get by with stealth and diplomacy. Join the rebels or the Shapers. Even play as a pacifist and never kill anything outside of the tutorial. Writing the games to allow this much freedom was truly maddening, but the result was something unique. (And I had one very specific, awesome influence.)

Interestingly, this led to what I think are the games' greatest flaw. You see, to create paths through the world for different specialties, I made some routes that required serious combat skill and other that required lots of diplomacy or stealth or tool use skill. The problem was that, to make the choices meaningful, I had to make it so that not all characters could travel down all paths. I didn't want everyone to be able to do everything, and, for any given character, there will always be some zones they can't do.

Some players hate this. Hate, hate, hate it. To be told they can't defeat a place, it drives them nuts. Infuriates them.It's not the sort of design that appeals to all players, to say the least.

Old Games For New Gamers

Yep. They're old. They're rough. They're pretty ugly. But if you like Indie gaming for it's creativity and ability to take risks, they're worth a look. They're five huge games, an almost ridiculous amount of gameplay for sixteen bucks. And, if you just want a sample to see what's going on, there are five big demos on our web site. Hope you like them!